comparison base/Selection.h @ 1057:5c5d4863b428 tonioni

Merge from cxx11 branch
author Chris Cannam
date Mon, 23 Mar 2015 11:26:28 +0000
parents cc27f35aa75c
children 6e9615bde1f9
comparison
equal deleted inserted replaced
1056:c4898e57eea5 1057:5c5d4863b428
18 18
19 #include <cstddef> 19 #include <cstddef>
20 #include <set> 20 #include <set>
21 21
22 #include "XmlExportable.h" 22 #include "XmlExportable.h"
23 #include "BaseTypes.h"
23 24
24 /** 25 /**
25 * A selection object simply represents a range in time, via start and 26 * A selection object simply represents a range in time, via start and
26 * end frame. 27 * end frame.
27 * 28 *
38 */ 39 */
39 class Selection 40 class Selection
40 { 41 {
41 public: 42 public:
42 Selection(); 43 Selection();
43 Selection(int startFrame, int endFrame); 44 Selection(sv_frame_t startFrame, sv_frame_t endFrame);
44 Selection(const Selection &); 45 Selection(const Selection &);
45 Selection &operator=(const Selection &); 46 Selection &operator=(const Selection &);
46 virtual ~Selection(); 47 virtual ~Selection();
47 48
48 bool isEmpty() const; 49 bool isEmpty() const;
49 int getStartFrame() const; 50 sv_frame_t getStartFrame() const;
50 int getEndFrame() const; 51 sv_frame_t getEndFrame() const;
51 bool contains(int frame) const; 52 bool contains(sv_frame_t frame) const;
52 53
53 bool operator<(const Selection &) const; 54 bool operator<(const Selection &) const;
54 bool operator==(const Selection &) const; 55 bool operator==(const Selection &) const;
55 56
56 protected: 57 protected:
57 int m_startFrame; 58 sv_frame_t m_startFrame;
58 int m_endFrame; 59 sv_frame_t m_endFrame;
59 }; 60 };
60 61
61 class MultiSelection : public XmlExportable 62 class MultiSelection : public XmlExportable
62 { 63 {
63 public: 64 public:
70 void setSelection(const Selection &selection); 71 void setSelection(const Selection &selection);
71 void addSelection(const Selection &selection); 72 void addSelection(const Selection &selection);
72 void removeSelection(const Selection &selection); 73 void removeSelection(const Selection &selection);
73 void clearSelections(); 74 void clearSelections();
74 75
75 void getExtents(int &startFrame, int &endFrame) const; 76 void getExtents(sv_frame_t &startFrame, sv_frame_t &endFrame) const;
76 77
77 /** 78 /**
78 * Return the selection that contains a given frame. 79 * Return the selection that contains a given frame.
79 * If defaultToFollowing is true, and if the frame is not in a 80 * If defaultToFollowing is true, and if the frame is not in a
80 * selected area, return the next selection after the given frame. 81 * selected area, return the next selection after the given frame.
81 * Return the empty selection if no appropriate selection is found. 82 * Return the empty selection if no appropriate selection is found.
82 */ 83 */
83 Selection getContainingSelection(int frame, bool defaultToFollowing) const; 84 Selection getContainingSelection(sv_frame_t frame, bool defaultToFollowing) const;
84 85
85 virtual void toXml(QTextStream &stream, QString indent = "", 86 virtual void toXml(QTextStream &stream, QString indent = "",
86 QString extraAttributes = "") const; 87 QString extraAttributes = "") const;
87 88
88 protected: 89 protected: