diff options
author | Robin Gareus <robin@gareus.org> | 2016-06-08 15:34:30 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-06-08 15:39:04 +0200 |
commit | a223b96725c68a4e41c9f2f5675756c274730889 (patch) | |
tree | a4b65182c127c21bb4faa250a3101b00faecb6dd /libs | |
parent | fce6ac0ef6cbf410715a02b59d9d41d3290710a0 (diff) |
fix mute automation for busses & consolidate code.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/mute_control.h | 2 | ||||
-rw-r--r-- | libs/ardour/audio_track.cc | 10 | ||||
-rw-r--r-- | libs/ardour/midi_track.cc | 10 | ||||
-rw-r--r-- | libs/ardour/mute_control.cc | 17 | ||||
-rw-r--r-- | libs/ardour/route.cc | 2 |
5 files changed, 21 insertions, 20 deletions
diff --git a/libs/ardour/ardour/mute_control.h b/libs/ardour/ardour/mute_control.h index 36d5e112cc..909f0cbf02 100644 --- a/libs/ardour/ardour/mute_control.h +++ b/libs/ardour/ardour/mute_control.h @@ -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); diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 1b544bfb57..742eb9c778 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -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); diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 6402d9057c..97ddb43f6f 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -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); diff --git a/libs/ardour/mute_control.cc b/libs/ardour/mute_control.cc index 0870732c58..7e9815f326 100644 --- a/libs/ardour/mute_control.cc +++ b/libs/ardour/mute_control.cc @@ -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 + } +} diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 60db5a1ffe..1600c3c9e8 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -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 ()); |