Restore snap when switching to/from internal.
[ardour.git] / gtk2_ardour / monitor_section.cc
index 7f518b4bf6dfa511250190aac8d4ae1add42a0d6..1a18c4bc472cc2b2f5edfac134f3f93638deb5bb 100644 (file)
@@ -50,8 +50,6 @@ using namespace PBD;
 using namespace std;
 
 Glib::RefPtr<ActionGroup> MonitorSection::monitor_actions;
-Glib::RefPtr<Gdk::Pixbuf> MonitorSection::big_knob_pixbuf;
-Glib::RefPtr<Gdk::Pixbuf> MonitorSection::little_knob_pixbuf;
 
 MonitorSection::MonitorSection (Session* s)
        : AxisView (s)
@@ -855,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) {
@@ -871,45 +869,6 @@ MonitorSection::solo_use_pfl ()
        }
 }
 
-void
-MonitorSection::setup_knob_images ()
-{
-
-       try {
-               uint32_t c = ARDOUR_UI::config()->color_by_name ("monitor knob");
-               char buf[16];
-               snprintf (buf, 16, "#%x", (c >> 8));
-               MotionFeedback::set_lamp_color (buf);
-               big_knob_pixbuf = MotionFeedback::render_pixbuf (80);
-
-       }  catch (...) {
-
-               error << "No usable large knob image" << endmsg;
-               throw failed_constructor ();
-       }
-
-       if (!big_knob_pixbuf) {
-               error << "No usable large knob image" << endmsg;
-               throw failed_constructor ();
-       }
-
-       try {
-
-               little_knob_pixbuf = MotionFeedback::render_pixbuf (30);
-
-       }  catch (...) {
-
-               error << "No usable small knob image" << endmsg;
-               throw failed_constructor ();
-       }
-
-       if (!little_knob_pixbuf) {
-               error << "No usable small knob image" << endmsg;
-               throw failed_constructor ();
-       }
-
-}
-
 void
 MonitorSection::update_solo_model ()
 {
@@ -1109,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)
 {
@@ -1116,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 ())
        }
 }