13
0

separate solo isolate into two components (self-solo-isolate and solo-isolated-by-upstream)

This commit is contained in:
Paul Davis 2015-07-13 15:26:59 -04:00
parent 782aa6aa47
commit 8a686632a0
2 changed files with 51 additions and 22 deletions

View File

@ -547,7 +547,10 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
uint32_t _soloed_by_others_upstream;
uint32_t _soloed_by_others_downstream;
uint32_t _solo_isolated;
uint32_t _solo_isolated_by_upstream;
void mod_solo_isolated_by_upstream (bool, void*);
bool _denormal_protection;
bool _recordable : 1;

View File

@ -97,6 +97,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
, _soloed_by_others_upstream (0)
, _soloed_by_others_downstream (0)
, _solo_isolated (0)
, _solo_isolated_by_upstream (0)
, _denormal_protection (false)
, _recordable (true)
, _silent (false)
@ -951,6 +952,28 @@ Route::set_mute_master_solo ()
_mute_master->set_soloed (self_soloed() || soloed_by_others_downstream() || soloed_by_others_upstream());
}
void
Route::mod_solo_isolated_by_upstream (bool yn, void* src)
{
bool old = solo_isolated ();
if (!yn) {
if (_solo_isolated_by_upstream >= 1) {
_solo_isolated_by_upstream--;
} else {
_solo_isolated_by_upstream = 0;
}
} else {
_solo_isolated_by_upstream++;
}
if (solo_isolated() != old) {
/* solo isolated status changed */
_mute_master->set_solo_ignore (yn);
solo_isolated_changed (src);
}
}
void
Route::set_solo_isolated (bool yn, void *src)
{
@ -963,25 +986,6 @@ Route::set_solo_isolated (bool yn, void *src)
return;
}
/* forward propagate solo-isolate status to everything fed by this route, but not those via sends only */
boost::shared_ptr<RouteList> routes = _session.get_routes ();
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
if ((*i).get() == this || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) {
continue;
}
bool sends_only;
bool does_feed = direct_feeds_according_to_graph (*i, &sends_only); // we will recurse anyway, so don't use ::feeds()
if (does_feed && !sends_only) {
(*i)->set_solo_isolated (yn, (*i)->route_group());
}
}
/* XXX should we back-propagate as well? (April 2010: myself and chris goddard think not) */
bool changed = false;
if (yn) {
@ -1000,15 +1004,37 @@ Route::set_solo_isolated (bool yn, void *src)
}
}
if (changed) {
solo_isolated_changed (src);
if (!changed) {
return;
}
/* forward propagate solo-isolate status to everything fed by this route, but not those via sends only */
boost::shared_ptr<RouteList> routes = _session.get_routes ();
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
if ((*i).get() == this || (*i)->is_master() || (*i)->is_monitor() || (*i)->is_auditioner()) {
continue;
}
bool sends_only;
bool does_feed = feeds (*i, &sends_only);
if (does_feed && !sends_only) {
(*i)->mod_solo_isolated_by_upstream (yn, src);
}
}
/* XXX should we back-propagate as well? (April 2010: myself and chris goddard think not) */
solo_isolated_changed (src);
}
bool
Route::solo_isolated () const
{
return _solo_isolated > 0;
return (_solo_isolated > 0) || (_solo_isolated_by_upstream > 0);
}
void