X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Finternal_send.cc;h=1746b00847e49a739f19293de18269fa3fb4ed62;hb=47ba20143e06445a9977f4757d816439ea8042d0;hp=60de2087f3701a58ec3685789ccc0a01a8d121cb;hpb=22b07e0233a29d9633ffa825a79503befaf2e16e;p=ardour.git diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 60de2087f3..1746b00847 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -30,7 +30,7 @@ #include "ardour/session.h" #include "ardour/audioengine.h" -#include "i18n.h" +#include "pbd/i18n.h" namespace ARDOUR { class MuteMaster; class Pannable; } @@ -74,10 +74,10 @@ InternalSend::init_gain () { if (_role == Listen) { /* send to monitor bus is always at unity */ - _amp->set_gain (GAIN_COEFF_UNITY, this); + _gain_control->set_value (GAIN_COEFF_UNITY, PBD::Controllable::NoGroup); } else { /* aux sends start at -inf dB */ - _amp->set_gain (GAIN_COEFF_ZERO, this); + _gain_control->set_value (GAIN_COEFF_ZERO, PBD::Controllable::NoGroup); } } @@ -133,7 +133,7 @@ InternalSend::send_to_going_away () } void -InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool) +InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, double speed, pframes_t nframes, bool) { if ((!_active && !_pending_active) || !_send_to) { _meter->reset (); @@ -144,7 +144,30 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame // in-place, which a send must never do. if (_panshell && !_panshell->bypassed() && role() != Listen) { - _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes); + if (mixbufs.count ().n_audio () > 0) { + _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes); + } + + /* non-audio data will not have been copied by the panner, do it now + * if there are more buffers available than send buffers, ignore them, + * if there are less, copy the last as IO::copy_to_output does. */ + + for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { + if (*t != DataType::AUDIO) { + BufferSet::iterator o = mixbufs.begin(*t); + BufferSet::iterator i = bufs.begin(*t); + + while (i != bufs.end(*t) && o != mixbufs.end(*t)) { + o->read_from (*i, nframes); + ++i; + ++o; + } + while (o != mixbufs.end(*t)) { + o->silence(nframes, 0); + ++o; + } + } + } } else { if (role() == Listen) { /* We're going to the monitor bus, so discard MIDI data */ @@ -213,9 +236,9 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame _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); + _amp->run (mixbufs, start_frame, end_frame, speed, nframes, true); - _delayline->run (mixbufs, start_frame, end_frame, nframes, true); + _delayline->run (mixbufs, start_frame, end_frame, speed, nframes, true); /* consider metering */ @@ -223,7 +246,7 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame if (_amp->gain_control()->get_value() == GAIN_COEFF_ZERO) { _meter->reset(); } else { - _meter->run (mixbufs, start_frame, end_frame, nframes, true); + _meter->run (mixbufs, start_frame, end_frame, speed, nframes, true); } } @@ -274,7 +297,7 @@ InternalSend::get_state() int InternalSend::set_state (const XMLNode& node, int version) { - const XMLProperty* prop; + XMLProperty const * prop; init_gain ();