diff options
author | David Robillard <d@drobilla.net> | 2014-11-29 01:25:27 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-29 01:25:27 -0500 |
commit | ed1bbefd193be8a21eb4436442ee7acf49c858a2 (patch) | |
tree | c2dbd24ca7b8b9485c125cb93a23d99ff05a9534 /libs | |
parent | f190e630ab2b3d2ff1f7c8640a7d4a072ea3437e (diff) |
Somewhat working gain automation.
This probably isn't correct in several ways, but it works more than it did, so
I figure it's push worthy.
Still not working:
* Saving mute automation list
* Dragged control points are not snapped to model restrictions
(boolean, in this case, but general problem)
* Line goes funny if you record mute automation
(as opposed to drawing it which works)
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/audio_track.cc | 10 | ||||
-rw-r--r-- | libs/ardour/route.cc | 15 |
2 files changed, 22 insertions, 3 deletions
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 13d5c43dda..c458668e18 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -350,6 +350,16 @@ 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(1.0); // mute + } else if (mute < 0.5 && muted()) { + _mute_control->set_value(0.0); // unmute + } + } + _silent = false; _amp->apply_gain_automation(false); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index d67c1bbd86..f35da57b92 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -3392,6 +3392,7 @@ Route::SoloControllable::SoloControllable (std::string name, boost::shared_ptr<R , _route (r) { boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(SoloAutomation))); + gl->set_interpolation(Evoral::ControlList::Discrete); set_list (gl); } @@ -3440,6 +3441,7 @@ Route::MuteControllable::MuteControllable (std::string name, boost::shared_ptr<R , _route (r) { boost::shared_ptr<AutomationList> gl(new AutomationList(Evoral::Parameter(MuteAutomation))); + gl->set_interpolation(Evoral::ControlList::Discrete); set_list (gl); } @@ -3448,15 +3450,22 @@ Route::MuteControllable::set_value (double val) { bool bval = ((val >= 0.5f) ? true: false); - boost::shared_ptr<RouteList> rl (new RouteList); + // boost::shared_ptr<RouteList> rl (new RouteList); boost::shared_ptr<Route> r = _route.lock (); if (!r) { return; } - rl->push_back (r); - _session.set_mute (rl, bval); + /* I don't know why this apparently "should" be done via the RT event + system, but doing so causes a ton of annoying errors... */ + // rl->push_back (r); + // _session.set_mute (rl, bval); + + /* ... but this seems to work. */ + r->set_mute (bval, this); + + AutomationControl::set_value(bval); } double |