comparison base/Clipboard.h @ 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 6a94bb528e9d
children ad5f892c0c4d
comparison
equal deleted inserted replaced
1043:fe39581d249b 1044:31f01931b781
17 #define _CLIPBOARD_H_ 17 #define _CLIPBOARD_H_
18 18
19 #include <QString> 19 #include <QString>
20 #include <vector> 20 #include <vector>
21 21
22 #include "BaseTypes.h"
23
22 class Clipboard 24 class Clipboard
23 { 25 {
24 public: 26 public:
25 class Point 27 class Point
26 { 28 {
27 public: 29 public:
28 Point(long frame, QString label); 30 Point(sv_frame_t frame, QString label);
29 Point(long frame, float value, QString label); 31 Point(sv_frame_t frame, float value, QString label);
30 Point(long frame, float value, int duration, QString label); 32 Point(sv_frame_t frame, float value, sv_frame_t duration, QString label);
31 Point(long frame, float value, int duration, float level, QString label); 33 Point(sv_frame_t frame, float value, sv_frame_t duration, float level, QString label);
32 Point(const Point &point); 34 Point(const Point &point);
33 Point &operator=(const Point &point); 35 Point &operator=(const Point &point);
34 36
35 bool haveFrame() const; 37 bool haveFrame() const;
36 long getFrame() const; 38 sv_frame_t getFrame() const;
37 Point withFrame(long frame) const; 39 Point withFrame(sv_frame_t frame) const;
38 40
39 bool haveValue() const; 41 bool haveValue() const;
40 float getValue() const; 42 float getValue() const;
41 Point withValue(float value) const; 43 Point withValue(float value) const;
42 44
43 bool haveDuration() const; 45 bool haveDuration() const;
44 int getDuration() const; 46 sv_frame_t getDuration() const;
45 Point withDuration(int duration) const; 47 Point withDuration(sv_frame_t duration) const;
46 48
47 bool haveLabel() const; 49 bool haveLabel() const;
48 QString getLabel() const; 50 QString getLabel() const;
49 Point withLabel(QString label) const; 51 Point withLabel(QString label) const;
50 52
53 Point withLevel(float level) const; 55 Point withLevel(float level) const;
54 56
55 bool haveReferenceFrame() const; 57 bool haveReferenceFrame() const;
56 bool referenceFrameDiffers() const; // from point frame 58 bool referenceFrameDiffers() const; // from point frame
57 59
58 long getReferenceFrame() const; 60 sv_frame_t getReferenceFrame() const;
59 void setReferenceFrame(long); 61 void setReferenceFrame(sv_frame_t);
60 62
61 private: 63 private:
62 bool m_haveFrame; 64 bool m_haveFrame;
63 long m_frame; 65 sv_frame_t m_frame;
64 bool m_haveValue; 66 bool m_haveValue;
65 float m_value; 67 float m_value;
66 bool m_haveDuration; 68 bool m_haveDuration;
67 int m_duration; 69 sv_frame_t m_duration;
68 bool m_haveLabel; 70 bool m_haveLabel;
69 QString m_label; 71 QString m_label;
70 bool m_haveLevel; 72 bool m_haveLevel;
71 float m_level; 73 float m_level;
72 bool m_haveReferenceFrame; 74 bool m_haveReferenceFrame;
73 long m_referenceFrame; 75 sv_frame_t m_referenceFrame;
74 }; 76 };
75 77
76 Clipboard(); 78 Clipboard();
77 ~Clipboard(); 79 ~Clipboard();
78 80