Experiment: propagate solo-state with internal-sends

So far internal-sends were explicitly special-cased, and implicit
solo-state only was only forwarded for direct up/down-stream
connections.  ...and nobody can remember why :)

This restriction is removed, so far mainly with commenting-out
code, as experiment.

Internal sends are not only more convenient, but also required
in cases where direct connections result in ambiguous latency.
This commit is contained in:
Robin Gareus 2020-05-08 06:35:08 +02:00
parent 3f6764f276
commit caf057f06d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 46 additions and 9 deletions

View File

@ -83,6 +83,8 @@ private:
void init_gain ();
int use_target (boost::shared_ptr<Route>, bool update_name = true);
void target_io_changed ();
void propagate_solo (bool);
};
} // namespace ARDOUR

View File

@ -73,11 +73,40 @@ InternalSend::InternalSend (Session& s,
InternalSend::~InternalSend ()
{
propagate_solo (false);
if (_send_to) {
_send_to->remove_send_from_internal_return (this);
}
}
void
InternalSend::propagate_solo (bool enable)
{
if (!_send_to || !_send_from) {
return;
}
bool from_soloed = _send_from->soloed();
bool to_soloed = _send_to->soloed();
if (enable) {
if (from_soloed) {
_send_to->solo_control()->mod_solo_by_others_upstream (1);
}
if (to_soloed) {
_send_from->solo_control()->mod_solo_by_others_downstream (1);
}
} else {
if (from_soloed && _send_to->solo_control()->soloed_by_others_upstream())
{
_send_to->solo_control()->mod_solo_by_others_upstream (-1);
}
if (to_soloed && _send_from->solo_control()->soloed_by_others_downstream())
{
_send_from->solo_control()->mod_solo_by_others_downstream (-1);
}
}
}
void
InternalSend::init_gain ()
{
@ -94,6 +123,7 @@ int
InternalSend::use_target (boost::shared_ptr<Route> sendto, bool update_name)
{
if (_send_to) {
propagate_solo (false);
_send_to->remove_send_from_internal_return (this);
}
@ -101,6 +131,8 @@ InternalSend::use_target (boost::shared_ptr<Route> sendto, bool update_name)
_send_to->add_send_to_internal_return (this);
propagate_solo (true);
mixbufs.ensure_buffers (_send_to->internal_return ()->input_streams (), _session.get_block_size ());
mixbufs.set_count (_send_to->internal_return ()->input_streams ());
@ -136,6 +168,9 @@ InternalSend::target_io_changed ()
void
InternalSend::send_from_going_away ()
{
/* notify route while source-route is still available,
* signal emission in the d'tor is too late */
propagate_solo (false);
_send_from.reset ();
}

View File

@ -747,7 +747,7 @@ Route::push_solo_isolate_upstream (int32_t delta)
bool sends_only;
bool does_feed = feeds (*i, &sends_only);
if (does_feed && !sends_only) {
if (does_feed /*&& !sends_only*/) {
(*i)->solo_isolate_control()->mod_solo_isolated_by_upstream (delta);
}
}
@ -759,7 +759,7 @@ Route::push_solo_upstream (int delta)
DEBUG_TRACE (DEBUG::Solo, string_compose("\t ... INVERT push from %1\n", _name));
for (FedBy::iterator i = _fed_by.begin(); i != _fed_by.end(); ++i) {
if (i->sends_only) {
continue;
/* continue; */
}
boost::shared_ptr<Route> sr (i->r.lock());
if (sr) {
@ -3654,7 +3654,7 @@ Route::input_change_handler (IOChange change, void * /*src*/)
}
bool sends_only;
bool does_feed = (*i)->direct_feeds_according_to_reality (boost::dynamic_pointer_cast<Route> (shared_from_this()), &sends_only);
if (does_feed && !sends_only) {
if (does_feed /*&& !sends_only*/) {
if ((*i)->soloed()) {
++sbou;
}
@ -3699,11 +3699,11 @@ Route::input_change_handler (IOChange change, void * /*src*/)
}
bool sends_only;
bool does_feed = feeds (*i, &sends_only);
if (delta <= 0 && does_feed && !sends_only) {
if (delta <= 0 && does_feed /*&& !sends_only*/) {
(*i)->solo_control()->mod_solo_by_others_upstream (delta);
}
if (idelta < 0 && does_feed && !sends_only) {
if (idelta < 0 && does_feed /*&& !sends_only*/) {
(*i)->solo_isolate_control()->mod_solo_isolated_by_upstream (-1);
}
}
@ -3752,7 +3752,7 @@ Route::output_change_handler (IOChange change, void * /*src*/)
}
bool sends_only;
bool does_feed = direct_feeds_according_to_reality (*i, &sends_only);
if (does_feed && !sends_only) {
if (does_feed /*&& !sends_only*/) {
if ((*i)->soloed()) {
++sbod;
break;
@ -3774,7 +3774,7 @@ Route::output_change_handler (IOChange change, void * /*src*/)
}
bool sends_only;
bool does_feed = (*i)->feeds (shared_this, &sends_only);
if (delta != 0 && does_feed && !sends_only) {
if (delta != 0 && does_feed /*&& !sends_only*/) {
(*i)->solo_control()->mod_solo_by_others_downstream (delta);
}
}

View File

@ -3702,7 +3702,7 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD
if ((*i)->feeds (route, &via_sends_only)) {
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tthere is a feed from %1\n", (*i)->name()));
if (!via_sends_only) {
if (true /*!via_sends_only*/) {
if (!route->soloed_by_others_upstream()) {
(*i)->solo_control()->mod_solo_by_others_downstream (delta);
} else {
@ -3730,7 +3730,7 @@ Session::route_solo_changed (bool self_solo_changed, Controllable::GroupControlD
via_sends_only,
route->soloed_by_others_downstream(),
route->soloed_by_others_upstream()));
if (!via_sends_only) {
if (true /*!via_sends_only*/) {
//NB. Triggers Invert Push, which handles soloed by downstream
DEBUG_TRACE (DEBUG::Solo, string_compose ("\tmod %1 by %2\n", (*i)->name(), delta));
(*i)->solo_control()->mod_solo_by_others_upstream (delta);