Fix glitching on "events" (like loop markers) due to taking the processing offset...
[ardour.git] / gtk2_ardour / region_selection.h
index 2192442cb0cbdf5ac0eb53435f1af27c5fdd3716..6b5ae9c0fbf98a5a772d2d950623be66458d7c07 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,36 @@ class RegionSelection : public set<RegionView*, RegionComparator>, public sigc::
 
        RegionSelection& operator= (const RegionSelection&);
 
-       void add (RegionView*, bool dosort = true);
+       bool add (RegionView*);
        bool remove (RegionView*);
-       bool contains (RegionView*);
+       void sort_by_position_and_track ();
+
+       bool contains (RegionView*) const;
+       bool involves (const TimeAxisView&) const;
 
        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;
 };