Unify gain and draw tools.
[ardour.git] / gtk2_ardour / monitor_section.cc
index d92b9e96a334a243f313ca033a2a60d48560855b..1a18c4bc472cc2b2f5edfac134f3f93638deb5bb 100644 (file)
@@ -853,9 +853,9 @@ void
 MonitorSection::solo_use_pfl ()
 {
        /* this is driven by a toggle on a radio group, and so is invoked twice,
-                once for the item that became inactive and once for the one that became
-                active.
-                */
+          once for the item that became inactive and once for the one that became
+          active.
+       */
 
        Glib::RefPtr<Action> act = ActionManager::get_action (X_("Solo"), X_("solo-use-pfl"));
        if (act) {
@@ -1068,6 +1068,14 @@ MonitorSection::cancel_audition (GdkEventButton*)
        return true;
 }
 
+#define SYNCHRONIZE_TOGGLE_ACTION(action, value) \
+       if (action) { \
+               Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action); \
+               if (tact && tact->get_active() != value) { \
+                       tact->set_active(value); \
+               } \
+       }
+
 void
 MonitorSection::parameter_changed (std::string name)
 {
@@ -1075,6 +1083,14 @@ MonitorSection::parameter_changed (std::string name)
                update_solo_model ();
        } else if (name == "listen-position") {
                update_solo_model ();
+       } else if (name == "solo-mute-override") {
+               SYNCHRONIZE_TOGGLE_ACTION(
+                               ActionManager::get_action (X_("Monitor"), "toggle-mute-overrides-solo"),
+                               Config->get_solo_mute_override ())
+       } else if (name == "exclusive-solo") {
+               SYNCHRONIZE_TOGGLE_ACTION(
+                               ActionManager::get_action (X_("Monitor"), "toggle-exclusive-solo"),
+                               Config->get_exclusive_solo ())
        }
 }