summaryrefslogtreecommitdiff
path: root/gtk2_ardour/region_selection.h
diff options
context:
space:
mode:
authorTaybin Rutkin <taybin@taybin.com>2005-09-25 18:42:24 +0000
committerTaybin Rutkin <taybin@taybin.com>2005-09-25 18:42:24 +0000
commit209d967b1bb80a9735d690d8f4f0455ecb9970ca (patch)
tree9d76ddcd7c1ac9d91bb2b1a33d31b66ce4ded5de /gtk2_ardour/region_selection.h
parente4b9aed743fc765219ac775905a221c017c88fba (diff)
Initial import of gtk2_ardour.
git-svn-id: svn://localhost/trunk/ardour2@24 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/region_selection.h')
-rw-r--r--gtk2_ardour/region_selection.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/gtk2_ardour/region_selection.h b/gtk2_ardour/region_selection.h
new file mode 100644
index 0000000000..73fabeb0b2
--- /dev/null
+++ b/gtk2_ardour/region_selection.h
@@ -0,0 +1,56 @@
+#ifndef __ardour_gtk_region_selection_h__
+#define __ardour_gtk_region_selection_h__
+
+#include <set>
+#include <list>
+#include <sigc++/signal_system.h>
+#include <ardour/types.h>
+
+using std::list;
+using std::set;
+
+class AudioRegionView;
+
+struct AudioRegionComparator {
+ bool operator() (const AudioRegionView* a, const AudioRegionView* b) const;
+};
+
+class AudioRegionSelection : public set<AudioRegionView*, AudioRegionComparator>, public SigC::Object
+{
+ public:
+ AudioRegionSelection();
+ AudioRegionSelection (const AudioRegionSelection&);
+
+ AudioRegionSelection& operator= (const AudioRegionSelection&);
+
+ void add (AudioRegionView*, bool dosort = true);
+ bool remove (AudioRegionView*);
+ bool contains (AudioRegionView*);
+
+ void clear_all();
+
+ jack_nframes_t start () const {
+ return _current_start;
+ }
+
+ /* collides with list<>::end */
+
+ jack_nframes_t end_frame () const {
+ return _current_end;
+ }
+
+ const list<AudioRegionView *> & by_layer() const { return _bylayer; }
+ void by_position (list<AudioRegionView*>&) const;
+
+ private:
+ void remove_it (AudioRegionView*);
+
+ void add_to_layer (AudioRegionView *);
+
+ jack_nframes_t _current_start;
+ jack_nframes_t _current_end;
+
+ list<AudioRegionView *> _bylayer;
+};
+
+#endif /* __ardour_gtk_region_selection_h__ */