From 9766cc7d8b1d96817d2ec9b5a7ccef6f97f440f5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 13 Jul 2016 14:33:23 -0400 Subject: [PATCH] a better, deeper fix for "cancel all solo", as Session::cancel_all_solo() --- libs/ardour/ardour/session.h | 1 + libs/ardour/ardour/utils.h | 11 +++++++++++ libs/ardour/session.cc | 11 +++++++++++ 3 files changed, 23 insertions(+) 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 boost::shared_ptr route_list_to_control_list ( return cl; } +template boost::shared_ptr stripable_list_to_control_list (StripableList& sl, boost::shared_ptr (Stripable::*get_control)() const) { + boost::shared_ptr cl (new ControlList); + for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) { + boost::shared_ptr 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()); +}