From f6aaa1660bbce1782b8292d106c8adfb1ecbdc16 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 23 Jun 2014 00:48:47 +0200 Subject: [PATCH] en/disable internal send+returns with tracks en/disable. --- gtk2_ardour/processor_box.cc | 4 ++-- libs/ardour/ardour/internal_send.h | 4 +++- libs/ardour/internal_return.cc | 3 ++- libs/ardour/internal_send.cc | 19 +++++++++++++------ libs/ardour/route.cc | 6 +++--- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index aa8f285a43..56d2d371eb 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -2111,8 +2111,8 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr boost::shared_ptr sendpan(new Pannable (*_session)); XMLNode n (**niter); - InternalSend* s = new InternalSend (*_session, sendpan, _route->mute_master(), - boost::shared_ptr(), Delivery::Aux); + InternalSend* s = new InternalSend (*_session, sendpan, _route->mute_master(), + _route, boost::shared_ptr(), Delivery::Aux); IOProcessor::prepare_for_reset (n, s->name()); diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index a06bf39906..6feeb35c6d 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -28,7 +28,7 @@ namespace ARDOUR { class LIBARDOUR_API InternalSend : public Send { public: - InternalSend (Session&, boost::shared_ptr, boost::shared_ptr, boost::shared_ptr send_to, Delivery::Role role = Delivery::Aux, bool ignore_bitslot = false); + InternalSend (Session&, boost::shared_ptr, boost::shared_ptr, boost::shared_ptr send_from, boost::shared_ptr send_to, Delivery::Role role = Delivery::Aux, bool ignore_bitslot = false); virtual ~InternalSend (); std::string display_name() const; @@ -46,6 +46,7 @@ class LIBARDOUR_API InternalSend : public Send bool configure_io (ChanCount in, ChanCount out); int set_block_size (pframes_t); + boost::shared_ptr source_route() const { return _send_from; } boost::shared_ptr target_route() const { return _send_to; } const PBD::ID& target_id() const { return _send_to_id; } @@ -60,6 +61,7 @@ class LIBARDOUR_API InternalSend : public Send private: BufferSet mixbufs; + boost::shared_ptr _send_from; boost::shared_ptr _send_to; PBD::ID _send_to_id; PBD::ScopedConnection connect_c; diff --git a/libs/ardour/internal_return.cc b/libs/ardour/internal_return.cc index fc5963603b..1eae5d3171 100644 --- a/libs/ardour/internal_return.cc +++ b/libs/ardour/internal_return.cc @@ -20,6 +20,7 @@ #include "ardour/internal_return.h" #include "ardour/internal_send.h" +#include "ardour/route.h" using namespace std; using namespace ARDOUR; @@ -41,7 +42,7 @@ InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*e if (lm.locked ()) { for (list::iterator i = _sends.begin(); i != _sends.end(); ++i) { - if ((*i)->active ()) { + if ((*i)->active () && (!(*i)->source_route() || (*i)->source_route()->active())) { bufs.merge_from ((*i)->get_buffers(), nframes); } } diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 23d9221086..e5c7232f48 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -40,14 +40,21 @@ 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, bool ignore_bitslot) +InternalSend::InternalSend (Session& s, + boost::shared_ptr p, + boost::shared_ptr mm, + boost::shared_ptr sendfrom, + boost::shared_ptr sendto, + Delivery::Role role, + bool ignore_bitslot) : Send (s, p, mm, role, ignore_bitslot) + , _send_from (sendfrom) { - if (sendto) { - if (use_target (sendto)) { - throw failed_constructor(); - } - } + if (sendto) { + if (use_target (sendto)) { + throw failed_constructor(); + } + } init_gain (); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index b50492031f..6a23ca70d4 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2643,7 +2643,7 @@ Route::set_processor_state (const XMLNode& node) if (prop->value() == "intsend") { - processor.reset (new InternalSend (_session, _pannable, _mute_master, boost::shared_ptr(), Delivery::Aux, true)); + processor.reset (new InternalSend (_session, _pannable, _mute_master, boost::shared_ptr(this), boost::shared_ptr(), Delivery::Aux, true)); } else if (prop->value() == "ladspa" || prop->value() == "Ladspa" || prop->value() == "lv2" || @@ -2812,7 +2812,7 @@ Route::enable_monitor_send () /* make sure we have one */ if (!_monitor_send) { - _monitor_send.reset (new InternalSend (_session, _pannable, _mute_master, _session.monitor_out(), Delivery::Listen)); + _monitor_send.reset (new InternalSend (_session, _pannable, _mute_master, boost::shared_ptr(this), _session.monitor_out(), Delivery::Listen)); _monitor_send->set_display_to_user (false); } @@ -2850,7 +2850,7 @@ Route::add_aux_send (boost::shared_ptr route, boost::shared_ptrprocess_lock ()); boost::shared_ptr sendpan (new Pannable (_session)); - listener.reset (new InternalSend (_session, sendpan, _mute_master, route, Delivery::Aux)); + listener.reset (new InternalSend (_session, sendpan, _mute_master, boost::shared_ptr(this), route, Delivery::Aux)); } add_processor (listener, before);