diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-09-19 10:42:09 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-09-19 10:42:09 +0000 |
commit | 21ea541267361b03c66a9cc330b7c862d7bc8e85 (patch) | |
tree | 24c23aca13597cfadea84b98c9f8a857f4894282 /gtk2_ardour/selection.cc | |
parent | 959907af01dd398fd45ee28413d37f5516ce6047 (diff) |
shift-click to extend marker selection; marker drag moves all selected markers
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3758 d708f5d6-7413-0410-9779-e7cbd77b26cf
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 a647cbcb6e..666f791ade 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -651,6 +651,12 @@ Selection::set (AutomationList *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(); @@ -826,3 +832,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); +} |