From 67e19c177f473807cd6510751bcf4a48574e6088 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 8 Aug 2015 08:36:29 -0400 Subject: radically change Keyboard/Binding API design to disconnect Gtk::Action lookup from binding definition We need this because we need binding information/objects before all Actions have been defined. --- gtk2_ardour/monitor_section.cc | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'gtk2_ardour/monitor_section.cc') diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index 49a5c754df..0bc5b98bc7 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -852,25 +852,24 @@ MonitorSection::register_actions () string action_descr; Glib::RefPtr act; - monitor_actions = myactions.create_action_group (X_("Monitor")); - myactions.install_action_group (monitor_actions); + monitor_actions = Actions.create_action_group (X_("Monitor")); - myactions.register_toggle_action (monitor_actions, "monitor-mono", _("Switch monitor to mono"), + Actions.register_toggle_action (monitor_actions, "monitor-mono", _("Switch monitor to mono"), sigc::mem_fun (*this, &MonitorSection::mono)); - myactions.register_toggle_action (monitor_actions, "monitor-cut-all", _("Cut monitor"), + Actions.register_toggle_action (monitor_actions, "monitor-cut-all", _("Cut monitor"), sigc::mem_fun (*this, &MonitorSection::cut_all)); - myactions.register_toggle_action (monitor_actions, "monitor-dim-all", _("Dim monitor"), + Actions.register_toggle_action (monitor_actions, "monitor-dim-all", _("Dim monitor"), sigc::mem_fun (*this, &MonitorSection::dim_all)); - act = myactions.register_toggle_action (monitor_actions, "toggle-exclusive-solo", _("Toggle exclusive solo mode"), + act = Actions.register_toggle_action (monitor_actions, "toggle-exclusive-solo", _("Toggle exclusive solo mode"), sigc::mem_fun (*this, &MonitorSection::toggle_exclusive_solo)); Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act); tact->set_active (Config->get_exclusive_solo()); - act = myactions.register_toggle_action (monitor_actions, "toggle-mute-overrides-solo", _("Toggle mute overrides solo mode"), + act = Actions.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::cast_dynamic(act); @@ -880,38 +879,36 @@ MonitorSection::register_actions () action_name = string_compose (X_("monitor-cut-%1"), chn); action_descr = string_compose (_("Cut monitor channel %1"), chn); - myactions.register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(), + Actions.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); - myactions.register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(), + Actions.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); - myactions.register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(), + Actions.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); - myactions.register_toggle_action (monitor_actions, action_name.c_str(), action_descr.c_str(), + Actions.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 solo_actions = myactions.create_action_group (X_("Solo")); + Glib::RefPtr solo_actions = Actions.create_action_group (X_("Solo")); RadioAction::Group solo_group; - myactions.register_radio_action (solo_actions, solo_group, "solo-use-in-place", _("In-place solo"), + Actions.register_radio_action (solo_actions, solo_group, "solo-use-in-place", _("In-place solo"), sigc::mem_fun (*this, &MonitorSection::solo_use_in_place)); - myactions.register_radio_action (solo_actions, solo_group, "solo-use-afl", _("After Fade Listen (AFL) solo"), + Actions.register_radio_action (solo_actions, solo_group, "solo-use-afl", _("After Fade Listen (AFL) solo"), sigc::mem_fun (*this, &MonitorSection::solo_use_afl)); - myactions.register_radio_action (solo_actions, solo_group, "solo-use-pfl", _("Pre Fade Listen (PFL) solo"), + Actions.register_radio_action (solo_actions, solo_group, "solo-use-pfl", _("Pre Fade Listen (PFL) solo"), sigc::mem_fun (*this, &MonitorSection::solo_use_pfl)); - - myactions.install_action_group (solo_actions); } void -- cgit v1.2.3