convert Route::_solo_isolated from counter to a boolean.
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 10 Aug 2015 22:14:08 +0000 (18:14 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 10 Aug 2015 22:14:08 +0000 (18:14 -0400)
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
libs/ardour/route.cc

index ec6fa8ca8df03a13adc0177d031ac27b0a671a6d..64e40e165d8ec1dcfa7eee5aede78367af7e2e46 100644 (file)
@@ -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*);
index 34d92b7a7e30605d5ae9def5288614c32bd615ee..f27bed6a6a96d46e1b0401dfb56dfbe07a076649 100644 (file)
@@ -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