summaryrefslogtreecommitdiff
path: root/gtk2_ardour/selection.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-09-19 14:38:46 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-09-19 14:38:46 +0000
commit6f8cd634501efd70711b148b4ac0e0ce2aa5cc95 (patch)
tree07df4b771792ec9a0b8ba7c8c01db0234f1efe22 /gtk2_ardour/selection.cc
parent60f588f21d6ad62335d72e8dc682abf8859107ea (diff)
chris goddard's region list patch; port 2.X marker drag/move changes to 3.0; compilation fixes-post-evoral
git-svn-id: svn://localhost/ardour2/branches/3.0@3760 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r--gtk2_ardour/selection.cc34
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);
+}