From 5b9822ab98074c29b7eba219c81265dde678429b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 16 Jul 2017 18:59:35 +0200 Subject: Fix merging boolean automation + mute disconnect. --- libs/ardour/mute_control.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'libs/ardour/mute_control.cc') diff --git a/libs/ardour/mute_control.cc b/libs/ardour/mute_control.cc index 71bcf3517c..89d18746f7 100644 --- a/libs/ardour/mute_control.cc +++ b/libs/ardour/mute_control.cc @@ -123,7 +123,7 @@ double MuteControl::get_value () const { if (slaved ()) { - return muted_by_self() || get_masters_value (); + return muted_by_self() || muted_by_masters (); } if (_list && boost::dynamic_pointer_cast(_list)->automation_playback()) { @@ -158,7 +158,7 @@ MuteControl::muted () const Control, or the Muteable that we sort-of proxy for. Since this method is called by ::get_value(), use the latter to avoid recursion. */ - return _muteable.mute_master()->muted_by_self() || get_masters_value (); + return _muteable.mute_master()->muted_by_self() || muted_by_masters (); } bool @@ -170,7 +170,7 @@ MuteControl::muted_by_self () const bool MuteControl::muted_by_masters () const { - return get_masters_value (); + return _muteable.mute_master()->muted_by_masters (); } bool @@ -184,11 +184,6 @@ MuteControl::automation_run (framepos_t start, pframes_t len) { boolean_automation_run (start, len); - if (muted_by_masters ()) { - // already muted, no need to check further - return; - } - bool valid = false; bool mute = false; @@ -200,6 +195,17 @@ MuteControl::automation_run (framepos_t start, pframes_t len) return; } + if (muted_by_masters ()) { + /* already muted, no need to check further, + * except we need to up update implicit/explict mute + */ + if (muted_by_self () != mute) { + set_value_unchecked (mute ? 1. : 0.); + Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ + } + return; + } + if (mute && !muted()) { set_value_unchecked (1.0); // mute Changed (false, Controllable::NoGroup); /* EMIT SIGNAL */ -- cgit v1.2.3