summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/ardour/ardour/session.h1
-rw-r--r--libs/ardour/ardour/utils.h11
-rw-r--r--libs/ardour/session.cc11
3 files changed, 23 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 696e97ca9d..c6f32bbe07 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -791,6 +791,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
bool soloing() const { return _non_soloed_outs_muted; }
bool listening() const { return _listen_cnt > 0; }
bool solo_isolated() const { return _solo_isolated_cnt > 0; }
+ void cancel_all_solo ();
static const SessionEvent::RTeventCallback rt_cleanup;
diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h
index 4edf9fb446..cc6e5044ce 100644
--- a/libs/ardour/ardour/utils.h
+++ b/libs/ardour/ardour/utils.h
@@ -187,6 +187,17 @@ template<typename T> boost::shared_ptr<ControlList> route_list_to_control_list (
return cl;
}
+template<typename T> boost::shared_ptr<ControlList> stripable_list_to_control_list (StripableList& sl, boost::shared_ptr<T> (Stripable::*get_control)() const) {
+ boost::shared_ptr<ControlList> cl (new ControlList);
+ for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) {
+ boost::shared_ptr<AutomationControl> ac = ((*s).get()->*get_control)();
+ if (ac) {
+ cl->push_back (ac);
+ }
+ }
+ return cl;
+}
+
#if __APPLE__
LIBARDOUR_API std::string CFStringRefToStdString(CFStringRef stringRef);
#endif // __APPLE__
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 9e9b530ce3..67f43dc470 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -7041,3 +7041,14 @@ Session::auto_connect_thread_run ()
}
pthread_mutex_unlock (&_auto_connect_mutex);
}
+
+void
+Session::cancel_all_solo ()
+{
+ StripableList sl;
+
+ get_stripables (sl);
+
+ set_controls (stripable_list_to_control_list (sl, &Stripable::solo_control), 0.0, Controllable::NoGroup);
+ clear_all_solo_state (routes.reader());
+}