comparison base/Selection.h @ 24:bb9291d84810

* Add ffwd/rewind * Abstract out MultiSelection
author Chris Cannam
date Wed, 08 Feb 2006 17:59:16 +0000
parents 73d85d19919f
children 935a2419a77c
comparison
equal deleted inserted replaced
23:6ace4286ba06 24:bb9291d84810
9 9
10 #ifndef _SELECTION_H_ 10 #ifndef _SELECTION_H_
11 #define _SELECTION_H_ 11 #define _SELECTION_H_
12 12
13 #include <cstddef> 13 #include <cstddef>
14 #include <set>
14 15
15 class Selection 16 class Selection
16 { 17 {
17 public: 18 public:
18 Selection(); 19 Selection();
32 protected: 33 protected:
33 size_t m_startFrame; 34 size_t m_startFrame;
34 size_t m_endFrame; 35 size_t m_endFrame;
35 }; 36 };
36 37
38 class MultiSelection
39 {
40 public:
41 MultiSelection();
42 virtual ~MultiSelection();
43
44 typedef std::set<Selection> SelectionList;
45
46 const SelectionList &getSelections() const;
47 void setSelection(const Selection &selection);
48 void addSelection(const Selection &selection);
49 void removeSelection(const Selection &selection);
50 void clearSelections();
51
52 /**
53 * Return the selection that contains a given frame.
54 * If defaultToFollowing is true, and if the frame is not in a
55 * selected area, return the next selection after the given frame.
56 * Return the empty selection if no appropriate selection is found.
57 */
58 Selection getContainingSelection(size_t frame, bool defaultToFollowing);
59
60 protected:
61 SelectionList m_selections;
62 };
63
64
37 #endif 65 #endif