13
0

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

This commit is contained in:
Paul Davis 2016-07-20 16:10:11 -04:00
parent 316562ee9e
commit 52d746c5fb
6 changed files with 10 additions and 27 deletions

View File

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

View File

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

View File

@ -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))
{
}

View File

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

View File

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

View File

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