X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Finternal_send.cc;h=bdfcf6d2496b26de55535a9eb51e0a39bedd94a1;hb=78310ad79206939c99a78f8d6d97c1fb919edf03;hp=8ec543030870a76c09a37892572e7ebe0af8519e;hpb=f4290fc09c9ba03dd2c3d4f8fc6754bab29fa724;p=ardour.git diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 8ec5430308..bdfcf6d249 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -32,9 +32,8 @@ using namespace PBD; using namespace ARDOUR; using namespace std; -InternalSend::InternalSend (Session& s, boost::shared_ptr mm, boost::shared_ptr sendto, Delivery::Role role) - : Send (s, mm, role) - , target (0) +InternalSend::InternalSend (Session& s, boost::shared_ptr p, boost::shared_ptr mm, boost::shared_ptr sendto, Delivery::Role role) + : Send (s, p, mm, role) { if (sendto) { if (use_target (sendto)) { @@ -46,18 +45,20 @@ InternalSend::InternalSend (Session& s, boost::shared_ptr mm, boost: InternalSend::~InternalSend () { if (_send_to) { - _send_to->release_return_buffer (); + _send_to->remove_send_from_internal_return (this); } } int InternalSend::use_target (boost::shared_ptr sendto) { + if (_send_to) { + _send_to->remove_send_from_internal_return (this); + } + _send_to = sendto; - if ((target = _send_to->get_return_buffer ()) == 0) { - return -1; - } + _send_to->add_send_to_internal_return (this); set_name (sendto->name()); _send_to_id = _send_to->id(); @@ -74,16 +75,15 @@ InternalSend::use_target (boost::shared_ptr sendto) void InternalSend::send_to_going_away () { - target = 0; target_connections.drop_connections (); _send_to.reset (); _send_to_id = "0"; } void -InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, nframes_t nframes, bool) +InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool) { - if ((!_active && !_pending_active) || !target || !_send_to) { + if ((!_active && !_pending_active) || !_send_to) { _meter->reset (); return; } @@ -138,23 +138,16 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame } } - /* deliver to target */ - - target->merge_from (mixbufs, nframes); + /* target will pick up our output when it is ready */ out: _active = _pending_active; } int -InternalSend::set_block_size (nframes_t nframes) +InternalSend::set_block_size (pframes_t nframes) { mixbufs.ensure_buffers (_configured_input, nframes); - - /* ensure that our target can cope with us merging this many frames to it */ - if (target) { - target->ensure_buffers (_configured_input, nframes); - } return 0; }