comparison base/Clipboard.cpp @ 1044:31f01931b781 cxx11

Move to using double rather than float for floating-point calculations (float only for storage); more build fixes
author Chris Cannam
date Mon, 09 Mar 2015 12:02:10 +0000
parents 048173126e71
children 7db29268cf4c
comparison
equal deleted inserted replaced
1043:fe39581d249b 1044:31f01931b781
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #include "Clipboard.h" 16 #include "Clipboard.h"
17 17
18 Clipboard::Point::Point(long frame, QString label) : 18 Clipboard::Point::Point(sv_frame_t frame, QString label) :
19 m_haveFrame(true), 19 m_haveFrame(true),
20 m_frame(frame), 20 m_frame(frame),
21 m_haveValue(false), 21 m_haveValue(false),
22 m_value(0), 22 m_value(0),
23 m_haveDuration(false), 23 m_haveDuration(false),
29 m_haveReferenceFrame(false), 29 m_haveReferenceFrame(false),
30 m_referenceFrame(frame) 30 m_referenceFrame(frame)
31 { 31 {
32 } 32 }
33 33
34 Clipboard::Point::Point(long frame, float value, QString label) : 34 Clipboard::Point::Point(sv_frame_t frame, float value, QString label) :
35 m_haveFrame(true), 35 m_haveFrame(true),
36 m_frame(frame), 36 m_frame(frame),
37 m_haveValue(true), 37 m_haveValue(true),
38 m_value(value), 38 m_value(value),
39 m_haveDuration(false), 39 m_haveDuration(false),
45 m_haveReferenceFrame(false), 45 m_haveReferenceFrame(false),
46 m_referenceFrame(frame) 46 m_referenceFrame(frame)
47 { 47 {
48 } 48 }
49 49
50 Clipboard::Point::Point(long frame, float value, int duration, QString label) : 50 Clipboard::Point::Point(sv_frame_t frame, float value, sv_frame_t duration, QString label) :
51 m_haveFrame(true), 51 m_haveFrame(true),
52 m_frame(frame), 52 m_frame(frame),
53 m_haveValue(true), 53 m_haveValue(true),
54 m_value(value), 54 m_value(value),
55 m_haveDuration(true), 55 m_haveDuration(true),
61 m_haveReferenceFrame(false), 61 m_haveReferenceFrame(false),
62 m_referenceFrame(frame) 62 m_referenceFrame(frame)
63 { 63 {
64 } 64 }
65 65
66 Clipboard::Point::Point(long frame, float value, int duration, float level, QString label) : 66 Clipboard::Point::Point(sv_frame_t frame, float value, sv_frame_t duration, float level, QString label) :
67 m_haveFrame(true), 67 m_haveFrame(true),
68 m_frame(frame), 68 m_frame(frame),
69 m_haveValue(true), 69 m_haveValue(true),
70 m_value(value), 70 m_value(value),
71 m_haveDuration(true), 71 m_haveDuration(true),
118 Clipboard::Point::haveFrame() const 118 Clipboard::Point::haveFrame() const
119 { 119 {
120 return m_haveFrame; 120 return m_haveFrame;
121 } 121 }
122 122
123 long 123 sv_frame_t
124 Clipboard::Point::getFrame() const 124 Clipboard::Point::getFrame() const
125 { 125 {
126 return m_frame; 126 return m_frame;
127 } 127 }
128 128
129 Clipboard::Point 129 Clipboard::Point
130 Clipboard::Point::withFrame(long frame) const 130 Clipboard::Point::withFrame(sv_frame_t frame) const
131 { 131 {
132 Point p(*this); 132 Point p(*this);
133 p.m_haveFrame = true; 133 p.m_haveFrame = true;
134 p.m_frame = frame; 134 p.m_frame = frame;
135 return p; 135 return p;
160 Clipboard::Point::haveDuration() const 160 Clipboard::Point::haveDuration() const
161 { 161 {
162 return m_haveDuration; 162 return m_haveDuration;
163 } 163 }
164 164
165 int 165 sv_frame_t
166 Clipboard::Point::getDuration() const 166 Clipboard::Point::getDuration() const
167 { 167 {
168 return m_duration; 168 return m_duration;
169 } 169 }
170 170
171 Clipboard::Point 171 Clipboard::Point
172 Clipboard::Point::withDuration(int duration) const 172 Clipboard::Point::withDuration(sv_frame_t duration) const
173 { 173 {
174 Point p(*this); 174 Point p(*this);
175 p.m_haveDuration = true; 175 p.m_haveDuration = true;
176 p.m_duration = duration; 176 p.m_duration = duration;
177 return p; 177 return p;
229 Clipboard::Point::referenceFrameDiffers() const 229 Clipboard::Point::referenceFrameDiffers() const
230 { 230 {
231 return m_haveReferenceFrame && (m_referenceFrame != m_frame); 231 return m_haveReferenceFrame && (m_referenceFrame != m_frame);
232 } 232 }
233 233
234 long 234 sv_frame_t
235 Clipboard::Point::getReferenceFrame() const 235 Clipboard::Point::getReferenceFrame() const
236 { 236 {
237 return m_referenceFrame; 237 return m_referenceFrame;
238 } 238 }
239 239
240 void 240 void
241 Clipboard::Point::setReferenceFrame(long f) 241 Clipboard::Point::setReferenceFrame(sv_frame_t f)
242 { 242 {
243 m_haveReferenceFrame = true; 243 m_haveReferenceFrame = true;
244 m_referenceFrame = f; 244 m_referenceFrame = f;
245 } 245 }
246 246