summaryrefslogtreecommitdiff
path: root/libs/ardour/internal_send.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-09-15 16:34:53 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-09-15 16:35:37 -0400
commit601a34521c2ce1d0167ed2f3c66f2fa6eeeb6b8e (patch)
tree43afbe2f75c190654c8c57d37e99653ab101c000 /libs/ardour/internal_send.cc
parentfdcc209354d830d8edce0e53a367fd2d6faef75d (diff)
add an Amp to Delivery, remove it from Send, make use of this in various ::run() methods
Delivery::_amp now will handle monitor-related delicks assuming the Session::config.get_use_monitor_fades() is true.
Diffstat (limited to 'libs/ardour/internal_send.cc')
-rw-r--r--libs/ardour/internal_send.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc
index e8e560c7c0..fe57176ac7 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,27 +190,22 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame
gain_t tgain = target_gain ();
- 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) {
+ _amp->set_gain (tgain, this);
+ 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) {
-
- /* target gain has not changed, but is not zero or unity */
- Amp::apply_simple_gain (mixbufs, nframes, tgain);
}
+ /* These two calls will either set up gain automation or mark
+ the amp as ready to use a simple scalar gain.
+ */
+
_amp->set_gain_automation_buffer (_session.send_gain_automation_buffer ());
_amp->setup_gain_automation (start_frame, end_frame, nframes);
_amp->run (mixbufs, start_frame, end_frame, nframes, true);
@@ -400,4 +395,4 @@ InternalSend::cycle_start (pframes_t /*nframes*/)
for (BufferSet::audio_iterator b = mixbufs.audio_begin(); b != mixbufs.audio_end(); ++b) {
b->prepare ();
}
-}
+}