From 3a648098201bcc6c988034189ec4831e28e20173 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 10 Aug 2015 18:14:08 -0400 Subject: [PATCH] convert Route::_solo_isolated from counter to a boolean. This correctly manages the semantics - the counting part is only intended to cover upstream/downstream effects, not "am i solo-isolated" (similar to self-soloed) --- libs/ardour/ardour/route.h | 2 +- libs/ardour/route.cc | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index ec6fa8ca8d..64e40e165d 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -546,7 +546,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou bool _self_solo; uint32_t _soloed_by_others_upstream; uint32_t _soloed_by_others_downstream; - uint32_t _solo_isolated; + bool _solo_isolated; uint32_t _solo_isolated_by_upstream; void mod_solo_isolated_by_upstream (bool, void*); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 34d92b7a7e..f27bed6a6a 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -96,7 +96,7 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type) , _self_solo (false) , _soloed_by_others_upstream (0) , _soloed_by_others_downstream (0) - , _solo_isolated (0) + , _solo_isolated (false) , _solo_isolated_by_upstream (0) , _denormal_protection (false) , _recordable (true) @@ -989,18 +989,16 @@ Route::set_solo_isolated (bool yn, void *src) bool changed = false; if (yn) { - if (_solo_isolated == 0) { + if (_solo_isolated == false) { _mute_master->set_solo_ignore (true); changed = true; } - _solo_isolated++; + _solo_isolated = true; } else { - if (_solo_isolated > 0) { - _solo_isolated--; - if (_solo_isolated == 0) { - _mute_master->set_solo_ignore (false); - changed = true; - } + if (_solo_isolated == true) { + _solo_isolated = false; + _mute_master->set_solo_ignore (false); + changed = true; } } @@ -1034,7 +1032,7 @@ Route::set_solo_isolated (bool yn, void *src) bool Route::solo_isolated () const { - return (_solo_isolated > 0) || (_solo_isolated_by_upstream > 0); + return (_solo_isolated == true) || (_solo_isolated_by_upstream > 0); } void -- 2.30.2