summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-07-04 12:44:42 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-07-04 12:45:53 -0400
commit57ee61772b6c44e7731619c5c74e45bb860ac4aa (patch)
treebd517f71f0709195b0ad4b8f3179a661cc060a12 /libs/ardour/session.cc
parent5c32fc3babdd3ed7d715b6aeb24a72f3a0f550a0 (diff)
add session-scope selection ops for Stripables
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc52
1 files changed, 52 insertions, 0 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 2218ef5810..94051b0f9d 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -7004,3 +7004,55 @@ Session::auto_connect_thread_run ()
}
pthread_mutex_unlock (&_auto_connect_mutex);
}
+
+void
+Session::clear_stripable_selection ()
+{
+ StripableList sl;
+ get_stripables (sl);
+
+ for (StripableList::iterator si = sl.begin(); si != sl.end(); ++si) {
+ (*si)->presentation_info().set_selected (false);
+ }
+
+}
+
+void
+Session::toggle_stripable_selection (boost::shared_ptr<Stripable> s)
+{
+ s->presentation_info().set_selected (!s->presentation_info().selected());
+}
+
+void
+Session::add_stripable_selection (boost::shared_ptr<Stripable> s)
+{
+ if (!s->presentation_info().selected ()) {
+ s->presentation_info().set_selected (true);
+ }
+}
+
+void
+Session::set_stripable_selection (boost::shared_ptr<Stripable> s)
+{
+ StripableList sl;
+ bool change = false;
+
+ get_stripables (sl);
+
+ for (StripableList::iterator si = sl.begin(); si != sl.end(); ++si) {
+ if ((*si)->presentation_info().selected()) {
+ change = true;
+ }
+
+ (*si)->presentation_info().set_selected (false);
+ }
+
+ if (!s->presentation_info().selected()) {
+ change = true;
+ s->presentation_info().set_selected (true);
+ }
+
+ if (change) {
+ // PresentationInfo::SelectionChange (); /* EMIT SIGNAL */
+ }
+}