diff options
author | Robin Gareus <robin@gareus.org> | 2020-05-08 07:15:31 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-05-08 14:59:44 +0200 |
commit | 21f2c01fcdd92db6edaeeaf69b88ba70983cfb1c (patch) | |
tree | 86fc2d5265637560618e265da175680023e2f7b5 /libs | |
parent | caf057f06dbe307e4a53580665b0f2166fe8a2c5 (diff) |
Fix aux-send solo propagation
* Do not allow new send to change implicit solo (no propagation)
* Propagate changes to due aux-send removal upstream
to tracks or busses connected to the source route.
* Forward solo-isolate
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/internal_send.h | 2 | ||||
-rw-r--r-- | libs/ardour/internal_send.cc | 66 |
2 files changed, 47 insertions, 21 deletions
diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 86c801b59c..c952b1378f 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -84,7 +84,7 @@ private: int use_target (boost::shared_ptr<Route>, bool update_name = true); void target_io_changed (); - void propagate_solo (bool); + void propagate_solo (); }; } // namespace ARDOUR diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index f140ccb6e7..d93e61e1ac 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -34,6 +34,7 @@ #include "ardour/panner_shell.h" #include "ardour/route.h" #include "ardour/session.h" +#include "ardour/solo_isolate_control.h" #include "pbd/i18n.h" @@ -73,36 +74,63 @@ InternalSend::InternalSend (Session& s, InternalSend::~InternalSend () { - propagate_solo (false); + propagate_solo (); if (_send_to) { _send_to->remove_send_from_internal_return (this); } } void -InternalSend::propagate_solo (bool enable) +InternalSend::propagate_solo () { 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); + /* cache state before modification */ + bool from_soloed = _send_from->soloed(); + bool to_soloed = _send_to->soloed(); + bool from_soloed_downstream = _send_from->solo_control()->soloed_by_others_downstream(); + bool to_soloed_upstream = _send_to->solo_control()->soloed_by_others_upstream(); + bool to_isolated_upstream = _send_to->solo_isolate_control()->solo_isolated_by_upstream(); + + if (from_soloed && (to_soloed_upstream | to_isolated_upstream)) { + if (to_soloed_upstream) { + _send_to->solo_control()->mod_solo_by_others_upstream (-1); } - if (to_soloed) { - _send_from->solo_control()->mod_solo_by_others_downstream (1); + if (to_isolated_upstream) { + _send_to->solo_isolate_control()->mod_solo_isolated_by_upstream (-1); } - } else { - if (from_soloed && _send_to->solo_control()->soloed_by_others_upstream()) - { - _send_to->solo_control()->mod_solo_by_others_upstream (-1); + /* propagate further downstream alike Route::input_change_handler() */ + boost::shared_ptr<RouteList> routes = _session.get_routes (); + for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { + if ((*i) == _send_to || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) { + continue; + } + bool sends_only; + bool does_feed = _send_to->feeds (*i, &sends_only); + if (does_feed && to_soloed_upstream) { + (*i)->solo_control()->mod_solo_by_others_upstream (-1); + } + if (does_feed && to_isolated_upstream) { + (*i)->solo_isolate_control()->mod_solo_isolated_by_upstream (-1); + } } - if (to_soloed && _send_from->solo_control()->soloed_by_others_downstream()) - { - _send_from->solo_control()->mod_solo_by_others_downstream (-1); + } + if (to_soloed && from_soloed_downstream) { + _send_from->solo_control()->mod_solo_by_others_downstream (-1); + + /* propagate further upstream alike Route::output_change_handler() */ + boost::shared_ptr<RouteList> routes = _session.get_routes (); + for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { + if (*i == _send_from || !(*i)->can_solo()) { + continue; + } + bool sends_only; + bool does_feed = (*i)->feeds (_send_from, &sends_only); + if (does_feed) { + (*i)->solo_control()->mod_solo_by_others_downstream (-1); + } } } } @@ -123,7 +151,7 @@ int InternalSend::use_target (boost::shared_ptr<Route> sendto, bool update_name) { if (_send_to) { - propagate_solo (false); + propagate_solo (); _send_to->remove_send_from_internal_return (this); } @@ -131,8 +159,6 @@ 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 ()); @@ -170,7 +196,7 @@ 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); + propagate_solo (); _send_from.reset (); } |