X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fmute_control.cc;h=5b38547366778081b9a479abf216780f1d869fca;hb=d92686afb4105b84b014372b6feb0ccc454a5171;hp=d44189e36b9223b4ef8f757f669959bb1be12b69;hpb=69250b64ea00671ab05d852833006e483a53cd8b;p=ardour.git diff --git a/libs/ardour/mute_control.cc b/libs/ardour/mute_control.cc index d44189e36b..5b38547366 100644 --- a/libs/ardour/mute_control.cc +++ b/libs/ardour/mute_control.cc @@ -22,7 +22,7 @@ #include "ardour/session.h" #include "ardour/mute_control.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace std; @@ -120,7 +120,7 @@ double MuteControl::get_value () const { if (slaved ()) { - return get_masters_value (); + return muted_by_self() || get_masters_value (); } if (_list && boost::dynamic_pointer_cast(_list)->automation_playback()) { @@ -128,7 +128,7 @@ MuteControl::get_value () const return AutomationControl::get_value(); } - return muted() ? 1.0 : 0.0; + return muted(); } void @@ -170,3 +170,25 @@ MuteControl::muted_by_masters () const return get_masters_value (); } +bool +MuteControl::muted_by_others_soloing () const +{ + return _muteable.muted_by_others_soloing (); +} + +void +MuteControl::automation_run (framepos_t start, pframes_t) +{ + if (!list() || !automation_playback()) { + return; + } + + bool valid = false; + const float mute = list()->rt_safe_eval (start, valid); + + if (mute >= 0.5 && !muted()) { + set_value_unchecked (1.0); // mute + } else if (mute < 0.5 && muted ()) { + set_value_unchecked (0.0); // unmute + } +}