summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-05-08 06:35:08 +0200
committerRobin Gareus <robin@gareus.org>2020-05-08 06:35:08 +0200
commitcaf057f06dbe307e4a53580665b0f2166fe8a2c5 (patch)
tree53386e6f5c3bb437109b556e8702001708b545b6 /libs
parent3f6764f276b629898c4195fa6e4f1d900286c082 (diff)
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.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/internal_send.h2
-rw-r--r--libs/ardour/internal_send.cc35
-rw-r--r--libs/ardour/route.cc14
-rw-r--r--libs/ardour/session.cc4
4 files changed, 46 insertions, 9 deletions
diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h
index faa2053e92..86c801b59c 100644
--- a/libs/ardour/ardour/internal_send.h
+++ b/libs/ardour/ardour/internal_send.h
@@ -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
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc
index 6bc67a0059..f140ccb6e7 100644
--- a/libs/ardour/internal_send.cc
+++ b/libs/ardour/internal_send.cc
@@ -73,12 +73,41 @@ 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 ()
{
if (_role == Listen) {
@@ -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 ();
}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 42e262d169..bbdfc54828 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -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);
}
}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 1a84fe4f86..b138791a80 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -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);