X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fregion_selection.h;h=084345a76d4b16009b85bee2d6c9b6e6ee5232f8;hb=e11b3f90c2d02735a071d526d67cfd0de90cbac3;hp=7e1d3b0835fb621a7d8e33aa2bb274842d97bc62;hpb=fedf3d34f32264ac57c6a222b678dc90f2bb1a88;p=ardour.git diff --git a/gtk2_ardour/region_selection.h b/gtk2_ardour/region_selection.h index 7e1d3b0835..084345a76d 100644 --- a/gtk2_ardour/region_selection.h +++ b/gtk2_ardour/region_selection.h @@ -29,11 +29,11 @@ using std::set; class RegionView; -struct RegionComparator { - bool operator() (const RegionView* a, const RegionView* b) const; -}; +/** + * Class to represent list of selected regions. + */ -class RegionSelection : public set, public sigc::trackable +class RegionSelection : public std::list, public sigc::trackable { public: RegionSelection(); @@ -41,9 +41,12 @@ class RegionSelection : public set, 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(); @@ -51,24 +54,25 @@ class RegionSelection : public set, public sigc:: return _current_start; } - /* collides with list<>::end */ + /* "end" collides with list<>::end */ nframes_t end_frame () const { return _current_end; } - const list & by_layer() const { return _bylayer; } - void by_position (list&) const; + const std::list& by_layer() const { return _bylayer; } + void by_position (std::list&) const; + void by_track (std::list&) const; private: void remove_it (RegionView*); void add_to_layer (RegionView *); - nframes_t _current_start; - nframes_t _current_end; + nframes_t _current_start; ///< start position for the selection + nframes_t _current_end; ///< end position for the selection - list _bylayer; + list _bylayer; ///< list of regions sorted by layer }; #endif /* __ardour_gtk_region_selection_h__ */