From 96cc1dbe80f0378ca010c1c5ac37913958193360 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 16 Sep 2015 18:32:28 -0400 Subject: Revert "add an Amp to Delivery, remove it from Send, make use of this in various ::run() methods" This reverts commit 601a34521c2ce1d0167ed2f3c66f2fa6eeeb6b8e. --- libs/ardour/internal_send.cc | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'libs/ardour/internal_send.cc') diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index fe57176ac7..e8e560c7c0 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -148,10 +148,10 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame } else { if (role() == Listen) { /* We're going to the monitor bus, so discard MIDI data */ - + uint32_t const bufs_audio = bufs.count().get (DataType::AUDIO); uint32_t const mixbufs_audio = mixbufs.count().get (DataType::AUDIO); - + /* monitor-section has same number of channels as master-bus (on creation). * * There is no clear answer what should happen when trying to PFL or AFL @@ -190,21 +190,26 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame gain_t tgain = target_gain (); - _amp->set_gain (tgain, this); + if (tgain != _current_gain) { + + /* target gain has changed */ + + _current_gain = Amp::apply_gain (mixbufs, _session.nominal_frame_rate(), nframes, _current_gain, tgain); + + } else if (tgain == GAIN_COEFF_ZERO) { - if (tgain == GAIN_COEFF_ZERO && _amp->gain() == GAIN_COEFF_ZERO) { /* we were quiet last time, and we're still supposed to be quiet. - */ + */ _meter->reset (); Amp::apply_simple_gain (mixbufs, nframes, GAIN_COEFF_ZERO); goto out; - } + } else if (tgain != GAIN_COEFF_UNITY) { - /* These two calls will either set up gain automation or mark - the amp as ready to use a simple scalar gain. - */ + /* target gain has not changed, but is not zero or unity */ + Amp::apply_simple_gain (mixbufs, nframes, tgain); + } _amp->set_gain_automation_buffer (_session.send_gain_automation_buffer ()); _amp->setup_gain_automation (start_frame, end_frame, nframes); @@ -395,4 +400,4 @@ InternalSend::cycle_start (pframes_t /*nframes*/) for (BufferSet::audio_iterator b = mixbufs.audio_begin(); b != mixbufs.audio_end(); ++b) { b->prepare (); } -} +} -- cgit v1.2.3