factor out Route::muted_by_others from existing code
authorBen Loftis <ben@harrisonconsoles.com>
Fri, 29 May 2015 20:17:46 +0000 (15:17 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Fri, 29 May 2015 20:21:20 +0000 (15:21 -0500)
gtk2_ardour/route_ui.cc
libs/ardour/ardour/route.h
libs/ardour/route.cc

index 300379363f7f5e02c3f9cccdf7a5ff6f9125702a..854f6e04cfdb33607b797b48f0cd8d1f74a2465f 100644 (file)
@@ -1201,8 +1201,7 @@ RouteUI::mute_active_state (Session* s, boost::shared_ptr<Route> r)
                if (r->muted ()) {
                        /* full mute */
                        return Gtkmm2ext::ExplicitActive;
-               } else if (!r->is_master() && s->soloing() && !r->soloed() && !r->solo_isolated()) {
-                       /* master is NEVER muted by others */
+               } else if (r->muted_by_others()) {
                        return Gtkmm2ext::ImplicitActive;
                } else {
                        /* no mute at all */
index fbce3fd3f38cbc9b247cfb7bd06c4d8a1767c557..823721902043f5c492909eb8595ff82d8567bbec 100644 (file)
@@ -151,6 +151,8 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
        bool muted () const;
        void set_mute (bool yn, void* src);
        
+       bool muted_by_others() const;
+
        /* controls use set_solo() to modify this route's solo state
         */
 
index a793ae5b2ad5f3f957ef4cdf9b29b77120d978f5..be7174f240b5f690a656deb9b13a2e87dc3dcd94 100644 (file)
@@ -1033,6 +1033,17 @@ Route::muted () const
        return _mute_master->muted_by_self();
 }
 
+bool
+Route::muted_by_others () const
+{
+       //master is never muted by others
+       if (is_master())
+               return false;
+               
+       //now check to see if something is soloed (and I am not)
+       return (_session.soloing() && !self_soloed() && !solo_isolated());
+}
+
 #if 0
 static void
 dump_processors(const string& name, const list<boost::shared_ptr<Processor> >& procs)