fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / mute_control.cc
index a3f46ffa066d72775cfd7013e408c3a82219c76f..5b38547366778081b9a479abf216780f1d869fca 100644 (file)
@@ -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;
@@ -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
+       }
+}