separate solo isolate into two components (self-solo-isolate and solo-isolated-by...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 13 Jul 2015 19:26:59 +0000 (15:26 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 16 Jul 2015 14:11:04 +0000 (10:11 -0400)
libs/ardour/ardour/route.h
libs/ardour/route.cc

index cce1e152a2976fc488eabd5e13c7796afc3e65fb..ec6fa8ca8df03a13adc0177d031ac27b0a671a6d 100644 (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;
index 432473657c913ca8db5e58c4f0742f80fc36617f..34d92b7a7e30605d5ae9def5288614c32bd615ee 100644 (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