a better, deeper fix for "cancel all solo", as Session::cancel_all_solo()

This commit is contained in:
Paul Davis 2016-07-13 14:33:23 -04:00
parent eab3c57b83
commit 9766cc7d8b
3 changed files with 23 additions and 0 deletions

View File

@ -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;

View File

@ -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__

View File

@ -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());
}