From 52d746c5fb39263a42dd33de12e101c3fbeafaa9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 20 Jul 2016 16:10:11 -0400 Subject: [PATCH] MuteMaster should (a) use a Muteable's own ::muted_by_others_soloing() (b) not try to use its own _solo_ignore to track Muteable::can_solo() or solo isolate state --- libs/ardour/ardour/mute_master.h | 6 +++--- libs/ardour/mute_master.cc | 9 +++------ libs/ardour/muteable.cc | 2 +- libs/ardour/route.cc | 14 +------------- libs/ardour/session.cc | 2 ++ libs/ardour/solo_isolate_control.cc | 4 ---- 6 files changed, 10 insertions(+), 27 deletions(-) diff --git a/libs/ardour/ardour/mute_master.h b/libs/ardour/ardour/mute_master.h index 6f5999efb4..f73ce09565 100644 --- a/libs/ardour/ardour/mute_master.h +++ b/libs/ardour/ardour/mute_master.h @@ -33,6 +33,7 @@ namespace ARDOUR { class Session; +class Muteable; class LIBARDOUR_API MuteMaster : public SessionHandleRef, public PBD::Stateful { @@ -47,7 +48,7 @@ class LIBARDOUR_API MuteMaster : public SessionHandleRef, public PBD::Stateful static const MutePoint AllPoints; - MuteMaster (Session& s, const std::string& name); + MuteMaster (Session& s, Muteable&, const std::string& name); ~MuteMaster() {} bool muted_by_self () const { return _muted_by_self && (_mute_point != MutePoint (0)); } @@ -69,7 +70,6 @@ class LIBARDOUR_API MuteMaster : public SessionHandleRef, public PBD::Stateful void set_soloed_by_self (bool yn) { _soloed_by_self = yn; } void set_soloed_by_others (bool yn) { _soloed_by_others = yn; } - void set_solo_ignore (bool yn) { _solo_ignore = yn; } void set_muted_by_masters (bool); @@ -80,11 +80,11 @@ class LIBARDOUR_API MuteMaster : public SessionHandleRef, public PBD::Stateful static const std::string xml_node_name; private: + Muteable* _muteable; MutePoint _mute_point; bool _muted_by_self; bool _soloed_by_self; bool _soloed_by_others; - bool _solo_ignore; bool _muted_by_masters; }; diff --git a/libs/ardour/mute_master.cc b/libs/ardour/mute_master.cc index 29a2fe9143..ed77942f6c 100644 --- a/libs/ardour/mute_master.cc +++ b/libs/ardour/mute_master.cc @@ -36,13 +36,13 @@ const string MuteMaster::xml_node_name (X_("MuteMaster")); const MuteMaster::MutePoint MuteMaster::AllPoints = MuteMaster::MutePoint( PreFader|PostFader|Listen|Main); -MuteMaster::MuteMaster (Session& s, const std::string&) +MuteMaster::MuteMaster (Session& s, Muteable& m, const std::string&) : SessionHandleRef (s) + , _muteable (&m) , _mute_point (MutePoint (0)) , _muted_by_self (false) , _soloed_by_self (false) , _soloed_by_others (false) - , _solo_ignore (false) , _muted_by_masters (0) { @@ -166,10 +166,7 @@ MuteMaster::get_state() bool MuteMaster::muted_by_others_soloing_at (MutePoint mp) const { - /* note: this is currently called with the assumption that the owner is - not soloed. it does not test for this condition. - */ - return (!_solo_ignore && _session.soloing()) && (_mute_point & mp); + return _muteable->muted_by_others_soloing() && (_mute_point & mp); } void diff --git a/libs/ardour/muteable.cc b/libs/ardour/muteable.cc index 9d434888bf..c94b55a683 100644 --- a/libs/ardour/muteable.cc +++ b/libs/ardour/muteable.cc @@ -22,6 +22,6 @@ using namespace ARDOUR; Muteable::Muteable (Session& s, std::string const & name) - : _mute_master (new MuteMaster (s, name)) + : _mute_master (new MuteMaster (s, *this, name)) { } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index d072d81c88..36d1791f9f 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -229,10 +229,6 @@ Route::init () _monitor_control->activate (); } - if (is_master() || is_monitor() || is_auditioner()) { - _mute_master->set_solo_ignore (true); - } - /* now that we have _meter, its safe to connect to this */ { @@ -2352,10 +2348,6 @@ Route::set_state (const XMLNode& node, int version) _strict_io = string_is_affirmative (prop->value()); } - if (!can_solo()) { - _mute_master->set_solo_ignore (true); - } - if (is_monitor()) { /* monitor bus does not get a panner, but if (re)created via XML, it will already have one by the time we @@ -2502,10 +2494,6 @@ Route::set_state_2X (const XMLNode& node, int version) Stripable::set_state (node, version); - if (is_master() || is_monitor() || is_auditioner()) { - _mute_master->set_solo_ignore (true); - } - if ((prop = node.property (X_("denormal-protection"))) != 0) { set_denormal_protection (string_is_affirmative (prop->value())); } @@ -5262,7 +5250,7 @@ Route::muted_by_others_soloing () const return false; } - return _session.soloing() && !_solo_control->soloed() && !_solo_isolate_control->solo_isolated(); + return _session.soloing() && !_solo_control->soloed() && !_solo_isolate_control->solo_isolated(); } void diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 4449897898..63cd20a0c0 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3903,6 +3903,8 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD if ((*i)->solo_isolate_control()->solo_isolated() || !(*i)->can_solo()) { /* route does not get solo propagated to it */ + DEBUG_TRACE (DEBUG::Solo, string_compose ("%1 excluded from solo because iso = %2 can_solo = %3\n", (*i)->name(), (*i)->solo_isolate_control()->solo_isolated(), + (*i)->can_solo())); continue; } diff --git a/libs/ardour/solo_isolate_control.cc b/libs/ardour/solo_isolate_control.cc index e4d551168b..3be57dc23d 100644 --- a/libs/ardour/solo_isolate_control.cc +++ b/libs/ardour/solo_isolate_control.cc @@ -84,8 +84,6 @@ SoloIsolateControl::mod_solo_isolated_by_upstream (int32_t delta) } if (solo_isolated() != old) { - /* solo isolated status changed */ - _muteable.mute_master()->set_solo_ignore (solo_isolated()); Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ } } @@ -118,14 +116,12 @@ SoloIsolateControl::set_solo_isolated (bool yn, Controllable::GroupControlDispos if (yn) { if (_solo_isolated == false) { - _muteable.mute_master()->set_solo_ignore (true); changed = true; } _solo_isolated = true; } else { if (_solo_isolated == true) { _solo_isolated = false; - _muteable.mute_master()->set_solo_ignore (false); changed = true; } } -- 2.30.2