Slightly hacky fix for AFL/PFL button misbehaviour
[ardour.git] / gtk2_ardour / monitor_section.cc
index 0926794175befd7b0322c64ae5ed28f70dc50a99..7de31e7d41da20f74839694f58531efea7e8b98d 100644 (file)
@@ -43,11 +43,9 @@ MonitorSection::MonitorSection (Session* s)
         , solo_in_place_button (_("SiP"), ArdourButton::led_default_elements)
         , afl_button (_("AFL"), ArdourButton::led_default_elements)
        , pfl_button (_("PFL"), ArdourButton::led_default_elements)
-       , cut_all_button (ArdourButton::led_default_elements)
-       , dim_all_button (ArdourButton::led_default_elements)
-       , mono_button (ArdourButton::led_default_elements)
        , exclusive_solo_button (ArdourButton::led_default_elements)
        , solo_mute_override_button (ArdourButton::led_default_elements)
+       , _inhibit_solo_model_update (false)
 {
         Glib::RefPtr<Action> act;
 
@@ -268,7 +266,7 @@ MonitorSection::MonitorSection (Session* s)
         Label* l1 = manage (new Label (X_("out")));
        l1->set_name (X_("MonitorSectionLabel"));
         channel_table_header.attach (*l1, 0, 1, 0, 1, EXPAND|FILL);
-        l1 = manage (new Label (X_("cut")));
+        l1 = manage (new Label (X_("mute")));
        l1->set_name (X_("MonitorSectionLabel"));
         channel_table_header.attach (*l1, 1, 2, 0, 1, EXPAND|FILL);
         l1 = manage (new Label (X_("dim")));
@@ -404,10 +402,6 @@ MonitorSection::set_session (Session* s)
 }
 
 MonitorSection::ChannelButtonSet::ChannelButtonSet ()
-       : cut (ArdourButton::just_led_default_elements)
-       , dim (ArdourButton::just_led_default_elements)
-       , solo (ArdourButton::just_led_default_elements)
-       , invert (ArdourButton::just_led_default_elements)
 {
        cut.set_diameter (3);
        dim.set_diameter (3);
@@ -735,7 +729,16 @@ MonitorSection::solo_use_in_place ()
         if (act) {
                 Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic (act);
                 if (ract) {
+                       if (!ract->get_active ()) {
+                               /* We are turning SiP off, which means that AFL or PFL will be turned on
+                                  shortly; don't update the solo model in the mean time, as if the currently
+                                  configured listen position is not the one that is about to be turned on,
+                                  things will go wrong.
+                               */
+                               _inhibit_solo_model_update = true;
+                       }
                         Config->set_solo_control_is_listen_control (!ract->get_active());
+                       _inhibit_solo_model_update = false;
                 }
         }
 }
@@ -822,6 +825,10 @@ MonitorSection::setup_knob_images ()
 void
 MonitorSection::update_solo_model ()
 {
+       if (_inhibit_solo_model_update) {
+               return;
+       }
+       
         const char* action_name = 0;
         Glib::RefPtr<Action> act;