fix mute automation for busses & consolidate code.
authorRobin Gareus <robin@gareus.org>
Wed, 8 Jun 2016 13:34:30 +0000 (15:34 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 8 Jun 2016 13:39:04 +0000 (15:39 +0200)
libs/ardour/ardour/mute_control.h
libs/ardour/audio_track.cc
libs/ardour/midi_track.cc
libs/ardour/mute_control.cc
libs/ardour/route.cc

index 36d5e112ccdf8fbd1e216fdbfe081cbbf9f47c0e..909f0cbf02ab7d394dbffbe9f6a424d3ca1fbc09 100644 (file)
@@ -67,6 +67,8 @@ class LIBARDOUR_API MuteControl : public SlavableAutomationControl
        void set_mute_points (MuteMaster::MutePoint);
        MuteMaster::MutePoint mute_points () const;
 
+       void automation_run (framepos_t start, pframes_t nframes);
+
   protected:
        void master_changed (bool, PBD::Controllable::GroupControlDisposition, boost::shared_ptr<AutomationControl>);
        void actually_set_value (double, PBD::Controllable::GroupControlDisposition group_override);
index 1b544bfb57f0a9dd19d046816d0158423ec65f17..742eb9c7788a8a6b3259bc9fe76432fa176ac78a 100644 (file)
@@ -375,16 +375,6 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
                return dret;
        }
 
-       if (_mute_control->list() && _mute_control->automation_playback()) {
-               bool        valid = false;
-               const float mute  = _mute_control->list()->rt_safe_eval(transport_frame, valid);
-               if (mute >= 0.5 && !muted()) {
-                       _mute_control->set_value_unchecked(1.0);  // mute
-               } else if (mute < 0.5 && muted()) {
-                       _mute_control->set_value_unchecked(0.0);  // unmute
-               }
-       }
-
        _silent = false;
        _amp->apply_gain_automation(false);
 
index 6402d9057c437e02cfd6712371cb26e49e391457..97ddb43f6f257d490f8853d80a0a8d52d82de0fd 100644 (file)
@@ -396,16 +396,6 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
                return dret;
        }
 
-       if (_mute_control->list() && _mute_control->automation_playback()) {
-               bool        valid = false;
-               const float mute  = _mute_control->list()->rt_safe_eval(transport_frame, valid);
-               if (mute >= 0.5 && !muted()) {
-                       _mute_control->set_value_unchecked(1.0);  // mute
-               } else if (mute < 0.5 && muted()) {
-                       _mute_control->set_value_unchecked(0.0);  // unmute
-               }
-       }
-
        BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
 
        fill_buffers_with_input (bufs, _input, nframes);
index 0870732c5845f9d253fe931b96897f240bb3fcb8..7e9815f32663aadb3211cf3cd104a4eb6f7239e6 100644 (file)
@@ -175,3 +175,20 @@ 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
+       }
+}
index 60db5a1ffefa10a55f74a8dde2aaf185b1bc2844..1600c3c9e88b7f7d2b88ded6469e6dd577ea633e 100644 (file)
@@ -317,6 +317,8 @@ Route::process_output_buffers (BufferSet& bufs,
                return;
        }
 
+       _mute_control->automation_run (start_frame, nframes);
+
        /* figure out if we're going to use gain automation */
        if (gain_automation_ok) {
                _amp->set_gain_automation_buffer (_session.gain_automation_buffer ());