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
This commit is contained in:
Robin Gareus 2016-10-14 15:06:49 +02:00
parent 88dedfcbdb
commit c21a0760a4
2 changed files with 21 additions and 1 deletions

View File

@ -54,6 +54,9 @@ class LIBARDOUR_API InternalSend : public Send
return mixbufs;
}
bool allow_feedback () const { return _allow_feedback;}
void set_allow_feedback (bool yn);
void set_can_pan (bool yn);
uint32_t pan_outs () const;
@ -63,6 +66,7 @@ class LIBARDOUR_API InternalSend : public Send
BufferSet mixbufs;
boost::shared_ptr<Route> _send_from;
boost::shared_ptr<Route> _send_to;
bool _allow_feedback;
PBD::ID _send_to_id;
PBD::ScopedConnection connect_c;
PBD::ScopedConnection source_connection;

View File

@ -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<Route> 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;
}