Add method to show/hide VCA (and Mixbus) Mixer pane
authorRobin Gareus <robin@gareus.org>
Wed, 8 Aug 2018 20:42:12 +0000 (22:42 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 8 Aug 2018 20:42:12 +0000 (22:42 +0200)
gtk2_ardour/ardour.menus.in
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/mixer_ui.h

index 14d0de4e1cc98f1f87ee3c29d047131207873f8b..f952a410a71dbfd71e952e9d8751a90d5ecad5cb 100644 (file)
       <menuitem action='show-editor-list'/>
       <menuitem action='ToggleMixerList'/>
       <menuitem action='ToggleMonitorSection'/>
+#ifdef MIXBUS
+      <menuitem action='ToggleMixbusPane'/>
+#endif
+      <menuitem action='ToggleVCAPane'/>
       <menuitem action='ToggleSummary'/>
       <menuitem action='ToggleGroupTabs'/>
       <menuitem action='show-marker-lines'/>
index 3962dc2945fd8b4c06b5f39304480a546d5b98a5..0cf7c58815a3691706a019c7fd1ed1a974296e5a 100644 (file)
@@ -230,6 +230,11 @@ public:
        void toggle_monitor_section_visibility ();
        void toggle_keep_tearoffs();
 
+       void toggle_vca_pane();
+#ifdef MIXBUS
+       void toggle_mixbus_pane();
+#endif
+
        void reset_focus (Gtk::Widget*);
 
        static PublicEditor* _instance;
index aabfbfd0beced7d0384cf282cf6c6125cacc1cd0..931e7a5a504470f429f7ad1c58647d94cf747ecd 100644 (file)
@@ -977,3 +977,27 @@ ARDOUR_UI::toggle_monitor_section_visibility ()
                        mixer->show_monitor_section (tact->get_active());
        }
 }
+
+void
+ARDOUR_UI::toggle_vca_pane ()
+{
+       Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleVCAPane");
+
+       if (act) {
+               Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+               mixer->showhide_vcas (tact->get_active());
+       }
+}
+
+#ifdef MIXBUS
+void
+ARDOUR_UI::toggle_mixbus_pane ()
+{
+       Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMixbusPane");
+
+       if (act) {
+               Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+               mixer->showhide_mixbusses (tact->get_active());
+       }
+}
+#endif
index 4ee384f467c0883687e4eb037ad0822273169b14..b5c0a9d5637d152392efbb784384afaf0e302dba 100644 (file)
@@ -372,6 +372,16 @@ ARDOUR_UI::install_actions ()
        act = global_actions.register_toggle_action (common_actions, X_("ToggleMixerList"), _("Toggle Mixer List"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_list));
        ActionManager::session_sensitive_actions.push_back (act);
 
+       act = global_actions.register_toggle_action (common_actions, X_("ToggleVCAPane"), _("Toggle VCA Pane"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_vca_pane));
+       ActionManager::session_sensitive_actions.push_back (act);
+       Glib::RefPtr<ToggleAction>::cast_dynamic(act)->set_active (true);
+
+#ifdef MIXBUS
+       act = global_actions.register_toggle_action (common_actions, X_("ToggleMixbusPane"), _("Toggle Mixbus Pane"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixbus_pane));
+       ActionManager::session_sensitive_actions.push_back (act);
+       Glib::RefPtr<ToggleAction>::cast_dynamic(act)->set_active (true);
+#endif
+
        act = global_actions.register_toggle_action (common_actions, X_("ToggleMonitorSection"), _("Toggle Monitor Section Visibility"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_monitor_section_visibility));
        act->set_sensitive (false);
 
index cfe1f1b29462b8bc82cf7a606426c7c7bf4b7ca7..0ef17eee38c30a51c4b337c2d0216de2680fec57 100644 (file)
@@ -133,6 +133,15 @@ public:
        void load_bindings ();
        Gtkmm2ext::Bindings*  bindings;
 
+       void showhide_vcas (bool on) {
+               if (on) { vca_vpacker.show(); } else { vca_vpacker.hide(); }
+       }
+#ifdef MIXBUS
+       void showhide_mixbusses (bool on) {
+               if (on) { mb_vpacker.show(); } else { mb_vpacker.hide(); }
+       }
+#endif
+
 protected:
        void set_axis_targets_for_operation ();
        ARDOUR::AutomationControlSet selected_gaincontrols ();