X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Finternal_send.cc;h=23d9221086f8455ad3b56439e6e9e4257f7e35e0;hb=70308f51747b5beeff99dec9f10490080f00b0c2;hp=029a46ce53136cc93e91d19b4c0a3c28fc1f998c;hpb=bfd50cdeb0416b106a7813177148dffb1af6db8e;p=ardour.git diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 029a46ce53..23d9221086 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -40,8 +40,8 @@ using namespace std; PBD::Signal1 InternalSend::CycleStart; -InternalSend::InternalSend (Session& s, boost::shared_ptr p, boost::shared_ptr mm, boost::shared_ptr sendto, Delivery::Role role) - : Send (s, p, mm, role) +InternalSend::InternalSend (Session& s, boost::shared_ptr p, boost::shared_ptr mm, boost::shared_ptr sendto, Delivery::Role role, bool ignore_bitslot) + : Send (s, p, mm, role, ignore_bitslot) { if (sendto) { if (use_target (sendto)) { @@ -95,11 +95,21 @@ InternalSend::use_target (boost::shared_ptr sendto) target_connections.drop_connections (); _send_to->DropReferences.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_going_away, this)); - _send_to->PropertyChanged.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_property_changed, this, _1));; + _send_to->PropertyChanged.connect_same_thread (target_connections, boost::bind (&InternalSend::send_to_property_changed, this, _1)); + _send_to->io_changed.connect_same_thread (target_connections, boost::bind (&InternalSend::target_io_changed, this)); return 0; } +void +InternalSend::target_io_changed () +{ + assert (_send_to); + mixbufs.ensure_buffers (_send_to->internal_return()->input_streams(), _session.get_block_size()); + mixbufs.set_count (_send_to->internal_return()->input_streams()); + reset_panner(); +} + void InternalSend::send_to_going_away () { @@ -119,7 +129,7 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame // we have to copy the input, because we may alter the buffers with the amp // in-place, which a send must never do. - if (_panshell && !_panshell->bypassed()) { + if (_panshell && !_panshell->bypassed() && role() != Listen) { _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes); } else { if (role() == Listen) { @@ -128,7 +138,19 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame uint32_t const bufs_audio = bufs.count().get (DataType::AUDIO); uint32_t const mixbufs_audio = mixbufs.count().get (DataType::AUDIO); - assert (mixbufs.available().get (DataType::AUDIO) >= bufs_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 + * a track that has more channels (bufs_audio from source-track is + * larger than mixbufs). + * + * There are two options: + * 1: discard additional channels (current) + * OR + * 2: require the monitor-section to have at least as many channels + * as the largest count of any route + */ + //assert (mixbufs.available().get (DataType::AUDIO) >= bufs_audio); /* Copy bufs into mixbufs, going round bufs more than once if necessary to ensure that every mixbuf gets some data. @@ -180,6 +202,8 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame _amp->setup_gain_automation (start_frame, end_frame, nframes); _amp->run (mixbufs, start_frame, end_frame, nframes, true); + _delayline->run (mixbufs, start_frame, end_frame, nframes, true); + /* consider metering */ if (_metering) { @@ -310,7 +334,7 @@ bool InternalSend::configure_io (ChanCount in, ChanCount out) { bool ret = Send::configure_io (in, out); - set_block_size (_session.engine().frames_per_cycle()); + set_block_size (_session.engine().samples_per_cycle()); return ret; }