summaryrefslogtreecommitdiff
path: root/libs/ardour/internal_send.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-09-16 18:32:28 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-09-16 18:38:44 -0400
commit96cc1dbe80f0378ca010c1c5ac37913958193360 (patch)
treefc89043007be602c33bf8752bc5461dc73d23349 /libs/ardour/internal_send.cc
parent202b9cc82a6d602ec842b60d609ebdcfe6bac16d (diff)
Revert "add an Amp to Delivery, remove it from Send, make use of this in various ::run() methods"
This reverts commit 601a34521c2ce1d0167ed2f3c66f2fa6eeeb6b8e.
Diffstat (limited to 'libs/ardour/internal_send.cc')
-rw-r--r--libs/ardour/internal_send.cc25
1 files changed, 15 insertions, 10 deletions
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 ();
}
-}
+}