diff options
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r-- | gtk2_ardour/selection.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 2f9601fcec..3f6c282d3a 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -609,6 +609,12 @@ Selection::set (boost::shared_ptr<Evoral::ControlList> ac) } bool +Selection::selected (Marker* m) +{ + return find (markers.begin(), markers.end(), m) != markers.end(); +} + +bool Selection::selected (TimeAxisView* tv) { return find (tracks.begin(), tracks.end(), tv) != tracks.end(); @@ -801,3 +807,31 @@ Selection::add (Marker* m) MarkersChanged(); } } + +void +Selection::add (const list<Marker*>& m) +{ + markers.insert (markers.end(), m.begin(), m.end()); + MarkersChanged (); +} + +void +MarkerSelection::range (nframes64_t& s, nframes64_t& e) +{ + s = max_frames; + e = 0; + + for (MarkerSelection::iterator i = begin(); i != end(); ++i) { + + if ((*i)->position() < s) { + s = (*i)->position(); + } + + if ((*i)->position() > e) { + e = (*i)->position(); + } + } + + s = std::min (s, e); + e = std::max (s, e); +} |