fix double quote in fr.po
[ardour.git] / gtk2_ardour / monitor_section.cc
index d1047271ddb5c92753f5e2d9ad65b5029ee5046f..2fcc5812b7d049494d30275283a10b7acd252059 100644 (file)
@@ -1,19 +1,19 @@
 /*
-    Copyright (C) 2012 Paul Davis
+  Copyright (C) 2012 Paul Davis
 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
 
@@ -26,7 +26,6 @@
 #include "gtkmm2ext/bindable_button.h"
 #include "gtkmm2ext/tearoff.h"
 #include "gtkmm2ext/actions.h"
-#include "gtkmm2ext/motionfeedback.h"
 #include "gtkmm2ext/utils.h"
 
 #include <gtkmm/menu.h>
 #include "ardour/monitor_processor.h"
 #include "ardour/port.h"
 #include "ardour/route.h"
+#include "ardour/solo_isolate_control.h"
 #include "ardour/user_bundle.h"
 #include "ardour/plugin_manager.h"
 
+#include "ardour_ui.h"
 #include "gui_thread.h"
 #include "monitor_section.h"
 #include "public_editor.h"
 #include "timers.h"
 #include "tooltips.h"
-#include "volume_controller.h"
 #include "ui_config.h"
 #include "utils.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace ARDOUR_UI_UTILS;
@@ -63,11 +63,11 @@ Glib::RefPtr<ActionGroup> MonitorSection::monitor_actions;
 #define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
 
 MonitorSection::MonitorSection (Session* s)
-       : AxisView (s)
+       : SessionHandlePtr (s)
        , RouteUI (s)
        , _tearoff (0)
        , channel_table_viewport (*channel_table_scroller.get_hadjustment()
-       , *channel_table_scroller.get_vadjustment ())
+                                 , *channel_table_scroller.get_vadjustment ())
        , gain_control (0)
        , dim_control (0)
        , solo_boost_control (0)
@@ -85,6 +85,8 @@ MonitorSection::MonitorSection (Session* s)
        , toggle_processorbox_button (ArdourButton::default_elements)
        , _inhibit_solo_model_update (false)
        , _ui_initialized (false)
+       , myactions (X_("monitor section"))
+       , bindings (0)
 {
 
        using namespace Menu_Helpers;
@@ -92,11 +94,11 @@ MonitorSection::MonitorSection (Session* s)
        Glib::RefPtr<Action> act;
 
        if (!monitor_actions) {
-
-               /* do some static stuff */
-
                register_actions ();
-
+               load_bindings ();
+               if (bindings) {
+                       set_data ("ardour-bindings", bindings);
+               }
        }
 
        _plugin_selector = new PluginSelector (PluginManager::instance());
@@ -166,7 +168,7 @@ MonitorSection::MonitorSection (Session* s)
 
        /* Solo option buttons */
        exclusive_solo_button.set_text (_("Excl. Solo"));
-       exclusive_solo_button.set_name (X_("monitor solo exclusive"));
+       exclusive_solo_button.set_name (X_("monitor section solo option"));
        set_tooltip (&exclusive_solo_button, _("Exclusive solo means that only 1 solo is active at a time"));
 
        act = ActionManager::get_action (X_("Monitor"), X_("toggle-exclusive-solo"));
@@ -175,7 +177,7 @@ MonitorSection::MonitorSection (Session* s)
        }
 
        solo_mute_override_button.set_text (_("Solo ยป Mute"));
-       solo_mute_override_button.set_name (X_("monitor solo override"));
+       solo_mute_override_button.set_name (X_("monitor section solo option"));
        set_tooltip (&solo_mute_override_button, _("If enabled, solo will override mute\n(a soloed & muted track or bus will be audible)"));
 
        act = ActionManager::get_action (X_("Monitor"), X_("toggle-mute-overrides-solo"));
@@ -185,12 +187,11 @@ MonitorSection::MonitorSection (Session* s)
 
        /* Processor Box hide/shos */
        toggle_processorbox_button.set_text (_("Processors"));
-       toggle_processorbox_button.set_name (X_("monitor processors toggle"));
-       set_tooltip (&toggle_processorbox_button, _("Allow to add monitor effect processors"));
+       toggle_processorbox_button.set_name (X_("monitor section processors toggle"));
+       set_tooltip (&toggle_processorbox_button, _("Allow one to add monitor effect processors"));
 
-       proctoggle = ToggleAction::create ();
+       proctoggle = ActionManager::get_action (X_("Monitor"), X_("toggle-monitor-processor-box"));
        toggle_processorbox_button.set_related_action (proctoggle);
-       proctoggle->signal_toggled().connect (sigc::mem_fun(*this, &MonitorSection::repack_processor_box), false);
 
        /* Knobs */
        Label* solo_boost_label;
@@ -200,12 +201,11 @@ MonitorSection::MonitorSection (Session* s)
        /* Solo Boost Knob */
 
        solo_boost_control = new ArdourKnob ();
-       solo_boost_control->set_name("monitor knob");
+       solo_boost_control->set_name("monitor section knob");
        solo_boost_control->set_size_request (PX_SCALE(36), PX_SCALE(36));
        set_tooltip (*solo_boost_control, _("Gain increase for soloed signals (0dB is normal)"));
 
        solo_boost_display = new ArdourDisplay ();
-       solo_boost_display->set_name("monitor section cut");
        solo_boost_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
        solo_boost_display->add_controllable_preset(_("0 dB"), 0.0);
        solo_boost_display->add_controllable_preset(_("3 dB"), 3.0);
@@ -217,12 +217,12 @@ MonitorSection::MonitorSection (Session* s)
        /* Solo (SiP) cut */
 
        solo_cut_control = new ArdourKnob ();
-       solo_cut_control->set_name ("monitor knob");
+       solo_cut_control->set_name ("monitor section knob");
        solo_cut_control->set_size_request (PX_SCALE(36), PX_SCALE(36));
        set_tooltip (*solo_cut_control, _("Gain reduction non-soloed signals\nA value above -inf dB causes \"solo-in-front\""));
 
        solo_cut_display = new ArdourDisplay ();
-       solo_cut_display->set_name("monitor section cut");
+       solo_cut_display->set_name("monitor section dropdown"); // XXX
        solo_cut_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
        solo_cut_display->add_controllable_preset(_("0 dB"), 0.0);
        solo_cut_display->add_controllable_preset(_("-6 dB"), -6.0);
@@ -235,12 +235,11 @@ MonitorSection::MonitorSection (Session* s)
        /* Dim */
 
        dim_control = new ArdourKnob (ArdourKnob::default_elements, ArdourKnob::Detent);
-       dim_control->set_name ("monitor knob");
+       dim_control->set_name ("monitor section knob");
        dim_control->set_size_request (PX_SCALE(36), PX_SCALE(36));
        set_tooltip (*dim_control, _("Gain reduction to use when dimming monitor outputs"));
 
        dim_display = new ArdourDisplay ();
-       dim_display->set_name("monitor section cut");
        dim_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
        dim_display->add_controllable_preset(_("0 dB"), 0.0);
        dim_display->add_controllable_preset(_("-3 dB"), -3.0);
@@ -252,8 +251,7 @@ MonitorSection::MonitorSection (Session* s)
 
        // mute button
        cut_all_button.set_text (_("Mute"));
-       cut_all_button.set_name ("monitor section cut");
-       cut_all_button.set_name (X_("monitor section cut"));
+       cut_all_button.set_name ("mute button");
        cut_all_button.set_size_request (-1, PX_SCALE(30));
        cut_all_button.show ();
 
@@ -283,11 +281,10 @@ MonitorSection::MonitorSection (Session* s)
        /* Gain */
 
        gain_control = new ArdourKnob (ArdourKnob::default_elements, ArdourKnob::Detent);
-       gain_control->set_name("monitor knob");
+       gain_control->set_name("monitor section knob");
        gain_control->set_size_request (PX_SCALE(60), PX_SCALE(60));
 
        gain_display = new ArdourDisplay ();
-       gain_display->set_name("monitor section cut");
        gain_display->set_size_request (PX_SCALE(68), PX_SCALE(20));
        gain_display->add_controllable_preset(_("0 dB"), 0.0);
        gain_display->add_controllable_preset(_("-3 dB"), -3.0);
@@ -301,7 +298,7 @@ MonitorSection::MonitorSection (Session* s)
 
        output_button = new ArdourButton ();
        output_button->set_text (_("Output"));
-       output_button->set_name (X_("monitor section cut"));
+       output_button->set_name (X_("monitor section cut")); // XXX
        output_button->set_text_ellipsize (Pango::ELLIPSIZE_MIDDLE);
        output_button->set_layout_ellipsize_width (PX_SCALE(128) * PANGO_SCALE);
 
@@ -398,7 +395,7 @@ MonitorSection::MonitorSection (Session* s)
        mono_dim_box->pack_start (mono_button, true, true);
        mono_dim_box->pack_end (dim_all_button, true, true);
 
-       // master gain 
+       // master gain
        Label* spin_label = manage (new Label (_("Monitor")));
        VBox* spin_packer = manage (new VBox);
        spin_packer->set_spacing (PX_SCALE(2));
@@ -415,7 +412,7 @@ MonitorSection::MonitorSection (Session* s)
        lower_packer->pack_start (*mono_dim_box,        false, false, PX_SCALE(2));
        lower_packer->pack_start (cut_all_button,       false, false, PX_SCALE(2));
 
-               // output port select
+       // output port select
        VBox* out_packer = manage (new VBox);
        out_packer->set_spacing (PX_SCALE(2));
        out_packer->pack_start (*output_label, false, false);
@@ -437,6 +434,8 @@ MonitorSection::MonitorSection (Session* s)
        hpacker.set_spacing (0);
        hpacker.pack_start (vpacker, true, true);
 
+       add (hpacker);
+
        gain_control->show_all ();
        gain_display->show_all ();
        dim_control->show_all ();
@@ -465,7 +464,11 @@ MonitorSection::MonitorSection (Session* s)
        output_button->signal_button_press_event().connect (sigc::mem_fun(*this, &MonitorSection::output_press), false);
        output_button->signal_button_release_event().connect (sigc::mem_fun(*this, &MonitorSection::output_release), false);
 
-       _tearoff = new TearOff (hpacker);
+       signal_enter_notify_event().connect (sigc::mem_fun (*this, &MonitorSection::enter_handler));
+       signal_leave_notify_event().connect (sigc::mem_fun (*this, &MonitorSection::leave_handler));
+       set_flags (CAN_FOCUS);
+
+       _tearoff = new TearOff (*this);
 
        if (!UIConfiguration::instance().get_floating_monitor_section()) {
                /* if torn off, make this a normal window
@@ -474,10 +477,10 @@ MonitorSection::MonitorSection (Session* s)
                _tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL);
        }
        _tearoff->tearoff_window().set_title (X_("Monitor"));
-       _tearoff->tearoff_window().signal_key_press_event().connect (sigc::ptr_fun (forward_key_press), false);
+       _tearoff->tearoff_window().signal_key_press_event().connect (sigc::bind (sigc::ptr_fun (relay_key_press), (Gtk::Window*) &_tearoff->tearoff_window()), false);
 
        update_output_display ();
-       repack_processor_box ();
+       update_processor_box ();
        _ui_initialized = true;
 
        /* catch changes that affect us */
@@ -496,33 +499,60 @@ MonitorSection::~MonitorSection ()
        _channel_buttons.clear ();
        _output_changed_connection.disconnect ();
 
-       delete insert_box;
-       delete output_button;
-       delete gain_control;
-       delete gain_display;
-       delete dim_control;
-       delete dim_display;
-       delete solo_boost_control;
-       delete solo_boost_display;
-       delete solo_cut_control;
-       delete solo_cut_display;
-       delete _tearoff;
-       delete _output_selector;
-       _output_selector = 0;
+       delete insert_box; insert_box = 0;
+       delete output_button; output_button = 0;
+       delete gain_control; gain_control = 0;
+       delete gain_display; gain_display = 0;
+       delete dim_control; dim_control = 0;
+       delete dim_display; dim_display = 0;
+       delete solo_boost_control; solo_boost_control = 0;
+       delete solo_boost_display; solo_boost_display = 0;
+       delete solo_cut_control; solo_cut_control = 0;
+       delete solo_cut_display; solo_cut_display = 0;
+       delete _tearoff; _tearoff = 0;
+       delete _output_selector; _output_selector = 0;
 }
 
+bool
+MonitorSection::enter_handler (GdkEventCrossing* ev)
+{
+       grab_focus ();
+       return false;
+}
+
+bool
+MonitorSection::leave_handler (GdkEventCrossing* ev)
+{
+       switch (ev->detail) {
+       case GDK_NOTIFY_INFERIOR:
+               return false;
+       default:
+               break;
+       }
+
+       /* cancel focus if we're not torn off. With X11 WM's that do
+        * focus-follows-mouse, focus will be taken from us anyway.
+        */
+
+       Widget* top = get_toplevel();
+
+       if (top->is_toplevel() && top != &_tearoff->tearoff_window()) {
+               Window* win = dynamic_cast<Window*> (top);
+               gtk_window_set_focus (win->gobj(), 0);
+       }
+
+       return false;
+}
 
 void
-MonitorSection::repack_processor_box ()
+MonitorSection::update_processor_box ()
 {
-       bool show_processor_box = proctoggle->get_active ();
+       bool show_processor_box = Glib::RefPtr<ToggleAction>::cast_dynamic (proctoggle)->get_active ();
 
-       if (count_processors () > 0) {
-               proctoggle->set_active (true);
-               proctoggle->set_sensitive (false);
-               show_processor_box = true;
+       if (count_processors () > 0 && !show_processor_box) {
+               toggle_processorbox_button.set_name (X_("monitor section processors present"));
        } else {
-               proctoggle->set_sensitive (true);
+               toggle_processorbox_button.set_name (X_("monitor section processors toggle"));
        }
 
        if (insert_box->is_visible() == show_processor_box) {
@@ -547,7 +577,7 @@ MonitorSection::repack_processor_box ()
 void
 MonitorSection::set_session (Session* s)
 {
-       AxisView::set_session (s);
+       RouteUI::set_session (s);
        _plugin_selector->set_session (_session);
 
        if (_session) {
@@ -564,7 +594,7 @@ MonitorSection::set_session (Session* s)
                        insert_box->set_route (_route);
                        _route->processors_changed.connect (*this, invalidator (*this), boost::bind (&MonitorSection::processors_changed, this, _1), gui_context());
                        if (_ui_initialized) {
-                               repack_processor_box ();  // too early
+                               update_processor_box ();
                        }
                } else {
                        /* session with no monitor section */
@@ -628,10 +658,10 @@ MonitorSection::set_session (Session* s)
 
 MonitorSection::ChannelButtonSet::ChannelButtonSet ()
 {
-       cut.set_name (X_("monitor section cut"));
+       cut.set_name (X_("mute button"));
        dim.set_name (X_("monitor section dim"));
-       solo.set_name (X_("monitor section solo"));
-       invert.set_name (X_("monitor section invert"));
+       solo.set_name (X_("solo button"));
+       invert.set_name (X_("invert button"));
 
        cut.unset_flags (Gtk::CAN_FOCUS);
        dim.unset_flags (Gtk::CAN_FOCUS);
@@ -685,25 +715,25 @@ MonitorSection::populate_buttons ()
                channel_table.attach (cbs->solo, 3, 4, i+row_offset, i+row_offset+1, EXPAND|FILL);
                channel_table.attach (cbs->invert, 4, 5, i+row_offset, i+row_offset+1, EXPAND|FILL);
 
-               snprintf (buf, sizeof (buf), "monitor-cut-%u", i+1);
+               snprintf (buf, sizeof (buf), "monitor-cut-%u", i);
                act = ActionManager::get_action (X_("Monitor"), buf);
                if (act) {
                        cbs->cut.set_related_action (act);
                }
 
-               snprintf (buf, sizeof (buf), "monitor-dim-%u", i+1);
+               snprintf (buf, sizeof (buf), "monitor-dim-%u", i);
                act = ActionManager::get_action (X_("Monitor"), buf);
                if (act) {
                        cbs->dim.set_related_action (act);
                }
 
-               snprintf (buf, sizeof (buf), "monitor-solo-%u", i+1);
+               snprintf (buf, sizeof (buf), "monitor-solo-%u", i);
                act = ActionManager::get_action (X_("Monitor"), buf);
                if (act) {
                        cbs->solo.set_related_action (act);
                }
 
-               snprintf (buf, sizeof (buf), "monitor-invert-%u", i+1);
+               snprintf (buf, sizeof (buf), "monitor-invert-%u", i);
                act = ActionManager::get_action (X_("Monitor"), buf);
                if (act) {
                        cbs->invert.set_related_action (act);
@@ -795,8 +825,6 @@ MonitorSection::cut_channel (uint32_t chn)
        char buf[64];
        snprintf (buf, sizeof (buf), "monitor-cut-%u", chn);
 
-       --chn; // 0-based in backend
-
        Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), buf);
        if (act) {
                Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
@@ -814,8 +842,6 @@ MonitorSection::dim_channel (uint32_t chn)
        char buf[64];
        snprintf (buf, sizeof (buf), "monitor-dim-%u", chn);
 
-       --chn; // 0-based in backend
-
        Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), buf);
        if (act) {
                Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
@@ -834,8 +860,6 @@ MonitorSection::solo_channel (uint32_t chn)
        char buf[64];
        snprintf (buf, sizeof (buf), "monitor-solo-%u", chn);
 
-       --chn; // 0-based in backend
-
        Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), buf);
        if (act) {
                Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
@@ -854,8 +878,6 @@ MonitorSection::invert_channel (uint32_t chn)
        char buf[64];
        snprintf (buf, sizeof (buf), "monitor-invert-%u", chn);
 
-       --chn; // 0-based in backend
-
        Glib::RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), buf);
        if (act) {
                Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
@@ -870,69 +892,120 @@ MonitorSection::register_actions ()
        string action_descr;
        Glib::RefPtr<Action> act;
 
-       monitor_actions = ActionGroup::create (X_("Monitor"));
-       ActionManager::add_action_group (monitor_actions);
+       monitor_actions = myactions.create_action_group (X_("Monitor"));
 
-       ActionManager::register_toggle_action (monitor_actions, "monitor-mono", "", _("Switch monitor to mono"),
+       myactions.register_toggle_action (monitor_actions, "monitor-mono", _("Switch monitor to mono"),
                        sigc::mem_fun (*this, &MonitorSection::mono));
 
-       ActionManager::register_toggle_action (monitor_actions, "monitor-cut-all", "", _("Cut monitor"),
+       myactions.register_toggle_action (monitor_actions, "monitor-cut-all", _("Cut monitor"),
                        sigc::mem_fun (*this, &MonitorSection::cut_all));
 
-       ActionManager::register_toggle_action (monitor_actions, "monitor-dim-all", "", _("Dim monitor"),
+       myactions.register_toggle_action (monitor_actions, "monitor-dim-all", _("Dim monitor"),
                        sigc::mem_fun (*this, &MonitorSection::dim_all));
 
-       act = ActionManager::register_toggle_action (monitor_actions, "toggle-exclusive-solo", "", _("Toggle exclusive solo mode"),
+       act = myactions.register_toggle_action (monitor_actions, "toggle-exclusive-solo", _("Toggle exclusive solo mode"),
                        sigc::mem_fun (*this, &MonitorSection::toggle_exclusive_solo));
 
        Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
        tact->set_active (Config->get_exclusive_solo());
 
-       act = ActionManager::register_toggle_action (monitor_actions, "toggle-mute-overrides-solo", "", _("Toggle mute overrides solo mode"),
+       act = myactions.register_toggle_action (monitor_actions, "toggle-mute-overrides-solo", _("Toggle mute overrides solo mode"),
                        sigc::mem_fun (*this, &MonitorSection::toggle_mute_overrides_solo));
 
        tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
        tact->set_active (Config->get_solo_mute_override());
 
-
-       /* note the 1-based counting (for naming - backend uses 0-based) */
-
-       for (uint32_t chn = 1; chn <= 16; ++chn) {
+       for (uint32_t chn = 0; chn < 16; ++chn) {
 
                action_name = string_compose (X_("monitor-cut-%1"), chn);
                action_descr = string_compose (_("Cut monitor channel %1"), chn);
-               ActionManager::register_toggle_action (monitor_actions, action_name.c_str(), "", action_descr.c_str(),
+               myactions.register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(),
                                sigc::bind (sigc::mem_fun (*this, &MonitorSection::cut_channel), chn));
 
                action_name = string_compose (X_("monitor-dim-%1"), chn);
                action_descr = string_compose (_("Dim monitor channel %1"), chn);
-               ActionManager::register_toggle_action (monitor_actions, action_name.c_str(), "", action_descr.c_str(),
+               myactions.register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(),
                                sigc::bind (sigc::mem_fun (*this, &MonitorSection::dim_channel), chn));
 
                action_name = string_compose (X_("monitor-solo-%1"), chn);
                action_descr = string_compose (_("Solo monitor channel %1"), chn);
-               ActionManager::register_toggle_action (monitor_actions, action_name.c_str(), "", action_descr.c_str(),
+               myactions.register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(),
                                sigc::bind (sigc::mem_fun (*this, &MonitorSection::solo_channel), chn));
 
                action_name = string_compose (X_("monitor-invert-%1"), chn);
                action_descr = string_compose (_("Invert monitor channel %1"), chn);
-               ActionManager::register_toggle_action (monitor_actions, action_name.c_str(), "", action_descr.c_str(),
+               myactions.register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(),
                                sigc::bind (sigc::mem_fun (*this, &MonitorSection::invert_channel), chn));
 
        }
 
 
-       Glib::RefPtr<ActionGroup> solo_actions = ActionGroup::create (X_("Solo"));
+       Glib::RefPtr<ActionGroup> solo_actions = myactions.create_action_group (X_("Solo"));
        RadioAction::Group solo_group;
 
-       ActionManager::register_radio_action (solo_actions, solo_group, "solo-use-in-place", "", _("In-place solo"),
+       myactions.register_radio_action (solo_actions, solo_group, "solo-use-in-place", _("In-place solo"),
                        sigc::mem_fun (*this, &MonitorSection::solo_use_in_place));
-       ActionManager::register_radio_action (solo_actions, solo_group, "solo-use-afl", "", _("After Fade Listen (AFL) solo"),
+       myactions.register_radio_action (solo_actions, solo_group, "solo-use-afl", _("After Fade Listen (AFL) solo"),
                        sigc::mem_fun (*this, &MonitorSection::solo_use_afl));
-       ActionManager::register_radio_action (solo_actions, solo_group, "solo-use-pfl", "", _("Pre Fade Listen (PFL) solo"),
+       myactions.register_radio_action (solo_actions, solo_group, "solo-use-pfl", _("Pre Fade Listen (PFL) solo"),
                        sigc::mem_fun (*this, &MonitorSection::solo_use_pfl));
 
-       ActionManager::add_action_group (solo_actions);
+       myactions.register_toggle_action (monitor_actions, "toggle-monitor-processor-box", _("Toggle Monitor Section Processor Box"),
+                       sigc::mem_fun(*this, &MonitorSection::update_processor_box));
+}
+
+void
+MonitorSection::connect_actions ()
+{
+       Glib::RefPtr<Action> act;
+       Glib::RefPtr<ToggleAction> tact;
+
+#define MON_TOG(NAME, FUNC) \
+       act = ActionManager::get_action (X_("Monitor"), NAME); \
+       tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act); \
+       assert (tact); \
+       tact->signal_toggled().connect (sigc::mem_fun (*this, &MonitorSection::FUNC)); \
+
+       MON_TOG("monitor-mono", mono);
+       MON_TOG("monitor-cut-all", cut_all);
+       MON_TOG("monitor-dim-all", dim_all);
+
+       MON_TOG("toggle-exclusive-solo", toggle_exclusive_solo);
+       tact->set_active (Config->get_exclusive_solo());
+
+       MON_TOG("toggle-mute-overrides-solo", toggle_mute_overrides_solo);
+       tact->set_active (Config->get_solo_mute_override());
+#undef MON_TOG
+
+#define MON_BIND(NAME, FUNC, ARG) \
+       act = ActionManager::get_action (X_("Monitor"), NAME); \
+       tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act); \
+       assert (tact); \
+       tact->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &MonitorSection::FUNC), ARG));
+
+       for (uint32_t chn = 0; chn < 16; ++chn) {
+               std::string action_name = string_compose (X_("monitor-cut-%1"), chn);
+               MON_BIND(action_name.c_str(), cut_channel, chn);
+               action_name = string_compose (X_("monitor-dim-%1"), chn);
+               MON_BIND(action_name.c_str(), dim_channel, chn);
+               action_name = string_compose (X_("monitor-solo-%1"), chn);
+               MON_BIND(action_name.c_str(), solo_channel, chn);
+               action_name = string_compose (X_("monitor-invert-%1"), chn);
+               MON_BIND(action_name.c_str(), invert_channel, chn);
+       }
+#undef MON_BIND
+
+#define SOLO_RADIO(NAME, FUNC) \
+       act = ActionManager::get_action (X_("Solo"), NAME); \
+       ract = Glib::RefPtr<RadioAction>::cast_dynamic (act); \
+       assert (ract); \
+       ract->signal_toggled().connect (sigc::mem_fun (*this, &MonitorSection::FUNC)); \
+
+       Glib::RefPtr<RadioAction> ract;
+       SOLO_RADIO ("solo-use-in-place", solo_use_in_place);
+       SOLO_RADIO ("solo-use-afl", solo_use_afl);
+       SOLO_RADIO ("solo-use-pfl", solo_use_pfl);
+#undef SOLO_RADIO
 }
 
 void
@@ -1174,7 +1247,7 @@ MonitorSection::cancel_isolate (GdkEventButton*)
 {
        if (_session) {
                boost::shared_ptr<RouteList> rl (_session->get_routes ());
-               _session->set_solo_isolated (rl, false, Session::rt_cleanup, true);
+               _session->set_controls (route_list_to_control_list (rl, &Stripable::solo_isolate_control), 0.0, Controllable::NoGroup);
        }
 
        return true;
@@ -1594,6 +1667,12 @@ MonitorSection::port_connected_or_disconnected (boost::weak_ptr<Port> wa, boost:
        }
 }
 
+void
+MonitorSection::load_bindings ()
+{
+       bindings = Bindings::get_bindings (X_("Monitor Section"), myactions);
+}
+
 void
 MonitorSection::help_count_processors (boost::weak_ptr<Processor> p, uint32_t* cnt) const
 {
@@ -1620,5 +1699,6 @@ MonitorSection::count_processors ()
 void
 MonitorSection::processors_changed (ARDOUR::RouteProcessorChange)
 {
-       repack_processor_box ();
+       update_processor_box ();
 }
+