From c3d90f415c9881f2829876728dbb9f6c675cefac Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 10 Jul 2024 19:26:02 +0200 Subject: [PATCH] Fix fader/trim automation after locate First see 31c6f66d9b7 and 5cb6e1046b0. It worked previously due to `AutomationControl::get_value` evaluating automation, which was removed in 5cb6e1046b0 in favor of properly using latency compensated evaluation. However due to 31c6f66d9b7, fader and trim automation were never evaluated on locate, only during playback via `Amp::setup_gain_automation`. This fixes a case where gain is incorrect after a locate. The amp still has the gain from before the locate, and when starting playback ramps to the new gain. --- libs/ardour/amp.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index c0259d814e..6c4917537e 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -73,7 +73,7 @@ Amp::configure_io (ChanCount in, ChanCount out) } void -Amp::run (BufferSet& bufs, samplepos_t /*start_sample*/, samplepos_t /*end_sample*/, double /*speed*/, pframes_t nframes, bool) +Amp::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t /*end_sample*/, double /*speed*/, pframes_t nframes, bool) { if (!check_active()) { /* disregard potentially prepared gain-automation. */ @@ -129,6 +129,8 @@ Amp::run (BufferSet& bufs, samplepos_t /*start_sample*/, samplepos_t /*end_sampl } else { /* manual (scalar) gain */ + _gain_control->automation_run (start_sample, nframes); + gain_t const target_gain = _gain_control->get_value(); if (fabsf (_current_gain - target_gain) >= GAIN_COEFF_DELTA) { @@ -384,7 +386,7 @@ Amp::setup_gain_automation (samplepos_t start_sample, samplepos_t end_sample, sa _apply_gain_automation = _gain_control->get_masters_curve ( start_sample, end_sample, _gain_automation_buffer, nframes); - if (start_sample != _current_automation_sample && _session.bounce_processing ()) { + if (start_sample != _current_automation_sample) { _current_gain = _gain_automation_buffer[0]; } _current_automation_sample = end_sample;