From 6af51b52ffd66612b06b14bda8d7a51b7a9efe22 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 10 Mar 2017 17:50:44 +0100 Subject: [PATCH] Use dedicated "show editor/mixer" actions --- gtk2_ardour/ardour.keys.in | 2 +- gtk2_ardour/ardour_ui_ed.cc | 7 +++---- gtk2_ardour/mixer.bindings | 1 + gtk2_ardour/mixer_ui.cc | 8 ++++++++ gtk2_ardour/mixer_ui.h | 5 +++-- libs/surfaces/faderport/gui.cc | 2 +- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/gtk2_ardour/ardour.keys.in b/gtk2_ardour/ardour.keys.in index 6d55ac6f86..7456ea2339 100644 --- a/gtk2_ardour/ardour.keys.in +++ b/gtk2_ardour/ardour.keys.in @@ -226,7 +226,7 @@ This mode provides many different operations on both regions and control points, @sess|Main/AddTrackBus|<@PRIMARY@><@TERTIARY@>n|add track(s) or bus(ses) @sess|Main/New|<@PRIMARY@>n|open a new session @wvis|Window/toggle-midi-connection-manager|<@SECONDARY@><@TERTIARY@>m|toggle global midi patchbay -@wvis|Common/toggle-editor-and-mixer|<@SECONDARY@>m|toggle editor & mixer +@wvis|Window/show-mixer|<@SECONDARY@>m|show mixer window ;; arrow keys, navigation etc. diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 43db733608..18a8036217 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -259,8 +259,6 @@ ARDOUR_UI::install_actions () global_actions.register_action (common_actions, X_("Quit"), _("Quit"), (hide_return (sigc::mem_fun(*this, &ARDOUR_UI::finish)))); global_actions.register_action (common_actions, X_("Hide"), _("Hide"), sigc::mem_fun (*this, &ARDOUR_UI::hide_application)); - global_actions.register_action (common_actions, X_("show-editor"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), editor)); - global_actions.register_action (common_actions, X_("show-mixer"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), mixer)); global_actions.register_action (common_actions, X_("show-preferences"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), rc_option_editor)); global_actions.register_action (common_actions, X_("menu-show-preferences"), _("Preferences"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), rc_option_editor)); @@ -276,6 +274,9 @@ ARDOUR_UI::install_actions () global_actions.register_action (common_actions, X_("detach-mixer"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), mixer)); global_actions.register_action (common_actions, X_("detach-preferences"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), rc_option_editor)); + Glib::RefPtr window_actions = ARDOUR_UI::instance()->global_actions.create_action_group (X_("Window")); + global_actions.register_action (window_actions, X_("show-mixer"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), mixer)); + /* these actions are all currently implemented by the Editor, but need * to be accessible from anywhere as actions. */ @@ -356,8 +357,6 @@ ARDOUR_UI::install_actions () global_actions.register_action (common_actions, X_("previous-tab"), _("Previous Tab"), sigc::mem_fun (*this, &ARDOUR_UI::step_up_through_tabs)); global_actions.register_action (common_actions, X_("next-tab"), _("Next Tab"), sigc::mem_fun (*this, &ARDOUR_UI::step_down_through_tabs)); - global_actions.register_action (common_actions, X_("toggle-editor-and-mixer"), _("Toggle Editor & Mixer"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editor_and_mixer)); - /* windows visibility actions */ global_actions.register_toggle_action (common_actions, X_("ToggleMaximalEditor"), _("Maximise Editor Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editing_space)); diff --git a/gtk2_ardour/mixer.bindings b/gtk2_ardour/mixer.bindings index 1a8a3138d8..6056cdcd64 100644 --- a/gtk2_ardour/mixer.bindings +++ b/gtk2_ardour/mixer.bindings @@ -17,5 +17,6 @@ + diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index e3f8111ca6..6c7a72ca14 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -2905,11 +2905,19 @@ Mixer_UI::showing_spill_for (boost::shared_ptr s) const return s == spilled_strip.lock(); } +void +Mixer_UI::show_editor_window () const +{ + PublicEditor::instance().make_visible (); +} + void Mixer_UI::register_actions () { Glib::RefPtr group = myactions.create_action_group (X_("Mixer")); + myactions.register_action (group, "show-editor", _("Show Editor"), sigc::mem_fun (*this, &Mixer_UI::show_editor_window)); + myactions.register_action (group, "solo", _("Toggle Solo on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::solo_action)); myactions.register_action (group, "mute", _("Toggle Mute on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::mute_action)); myactions.register_action (group, "recenable", _("Toggle Rec-enable on Mixer-Selected Tracks/Busses"), sigc::mem_fun (*this, &Mixer_UI::rec_enable_action)); diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index a96ce69734..be557ec018 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -111,8 +111,6 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p void select_strip (MixerStrip&, bool add=false); void select_none (); - bool window_not_visible () const; - void do_vca_assign (boost::shared_ptr); void do_vca_unassign (boost::shared_ptr); void show_spill (boost::shared_ptr); @@ -121,6 +119,9 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p sigc::signal1 > show_spill_change; RouteProcessorSelection& selection() { return _selection; } + + void show_editor_window () const; + void register_actions (); void load_bindings (); diff --git a/libs/surfaces/faderport/gui.cc b/libs/surfaces/faderport/gui.cc index db93d4cd8e..e24af3601f 100644 --- a/libs/surfaces/faderport/gui.cc +++ b/libs/surfaces/faderport/gui.cc @@ -519,7 +519,7 @@ FPGUI::build_mix_action_combo (Gtk::ComboBox& cb, FaderPort::ButtonState bs) { vector > actions; - actions.push_back (make_pair (string (_("Show Mixer Window")), string (X_("Editor/toggle-editor-to-mixer")))); + actions.push_back (make_pair (string (_("Show Mixer Window")), string (X_("Window/show-mixer")))); actions.push_back (make_pair (string (_("Show/Hide Mixer list")), string (X_("Common/ToggleMixerList")))); actions.push_back (make_pair (string("Toggle Meterbridge"), string(X_("Common/toggle-meterbridge")))); actions.push_back (make_pair (string (_("Show/Hide Editor mixer strip")), string (X_("Editor/show-editor-mixer"))));