add sampo's synthesize_sources perl script to tools; add scroll-playhead-{forward...
[ardour.git] / gtk2_ardour / region_selection.h
index 2192442cb0cbdf5ac0eb53435f1af27c5fdd3716..5c05a813f9464127ad7ee5560a21fb4cb2c867d2 100644 (file)
@@ -29,11 +29,7 @@ using std::set;
 
 class RegionView;
 
-struct RegionComparator {
-    bool operator() (const RegionView* a, const RegionView* b) const;
-};
-
-class RegionSelection : public set<RegionView*, RegionComparator>, public sigc::trackable
+class RegionSelection : public std::list<RegionView*>, public sigc::trackable
 {
   public:
        RegionSelection();
@@ -41,32 +37,34 @@ class RegionSelection : public set<RegionView*, RegionComparator>, public sigc::
 
        RegionSelection& operator= (const RegionSelection&);
 
-       void add (RegionView*, bool dosort = true);
+       void add (RegionView*);
        bool remove (RegionView*);
        bool contains (RegionView*);
+       void sort_by_position_and_track ();
 
        void clear_all();
        
-       jack_nframes_t start () const {
+       nframes_t start () const {
                return _current_start;
        }
 
-       /* collides with list<>::end */
+       /* "end" collides with list<>::end */
 
-       jack_nframes_t end_frame () const { 
+       nframes_t end_frame () const { 
                return _current_end;
        }
 
-       const list<RegionView *> & by_layer() const { return _bylayer; }
-       void  by_position (list<RegionView*>&) const;
+       const std::list<RegionView *>& by_layer() const { return _bylayer; }
+       void  by_position (std::list<RegionView*>&) const;
+       void  by_track (std::list<RegionView*>&) const;
        
   private:
        void remove_it (RegionView*);
 
        void add_to_layer (RegionView *);
        
-       jack_nframes_t _current_start;
-       jack_nframes_t _current_end;
+       nframes_t _current_start;
+       nframes_t _current_end;
 
        list<RegionView *> _bylayer;
 };