From c21a0760a48ebd1d014d7ca66366477715cbb4a5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 14 Oct 2016 15:06:49 +0200 Subject: allow feedback (loops) from internal sends This facilitates custom "Echo" chains: Bus 1 [FX] [aux-send to Bus 2] -> master Bus 2 [FX] -> Bus 2 --- libs/ardour/internal_send.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'libs/ardour/internal_send.cc') diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 1746b00847..241506bdea 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -49,6 +49,7 @@ InternalSend::InternalSend (Session& s, bool ignore_bitslot) : Send (s, p, mm, role, ignore_bitslot) , _send_from (sendfrom) + , _allow_feedback (false) { if (sendto) { if (use_target (sendto)) { @@ -266,10 +267,20 @@ InternalSend::set_block_size (pframes_t nframes) return 0; } +void +InternalSend::set_allow_feedback (bool yn) +{ + _allow_feedback = yn; + _send_from->processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */ +} + bool InternalSend::feeds (boost::shared_ptr other) const { - return _send_to == other; + if (_role == Listen || !_allow_feedback) { + return _send_to == other; + } + return false; } XMLNode& @@ -284,6 +295,7 @@ InternalSend::state (bool full) if (_send_to) { node.add_property ("target", _send_to->id().to_s()); } + node.add_property ("allow-feedback", _allow_feedback); return node; } @@ -319,6 +331,10 @@ InternalSend::set_state (const XMLNode& node, int version) } } + if ((prop = node.property (X_("allow-feedback"))) != 0) { + _allow_feedback = string_is_affirmative (prop->value()); + } + return 0; } -- cgit v1.2.3