allow hiding and showing the mixer list
authorBen Loftis <ben@harrisonconsoles.com>
Thu, 10 Dec 2015 23:21:02 +0000 (17:21 -0600)
committerBen Loftis <ben@harrisonconsoles.com>
Thu, 10 Dec 2015 23:21:02 +0000 (17:21 -0600)
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.cc
gtk2_ardour/mixer_ui.h

index 33460000da5d3c11b849d2111e96c648c8e33b8f..2197ed93f847a7e1f1ab58add018036ca4525768 100644 (file)
 
       <menuitem action='show-editor-mixer'/>
       <menuitem action='show-editor-list'/>
+      <menuitem action='ToggleMixerList'/>
       <menuitem action='ToggleMeasureVisibility'/>
       <menuitem action='ToggleSummary'/>
       <menuitem action='ToggleGroupTabs'/>
index fc46eb4292bfdab8d416cfc5232fffe1b2dd84e0..8583d73d48cc1c8fa4010ebfc381b62a038781b8 100644 (file)
@@ -202,6 +202,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        void new_midi_tracer_window ();
        void toggle_editing_space();
        void toggle_mixer_space();
+       void toggle_mixer_list();
        void toggle_keep_tearoffs();
 
        static PublicEditor* _instance;
index f41c06a9a130bbfec3da107ae975b2cb563ac7c7..8640d7a2f54ed7f152a77142f5abeff96816d725 100644 (file)
@@ -586,3 +586,14 @@ ARDOUR_UI::toggle_mixer_space()
                }
        }
 }
+
+void
+ARDOUR_UI::toggle_mixer_list()
+{
+       Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMixerList");
+
+       if (act) {
+               Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+                       mixer->show_mixer_list (tact->get_active());
+       }
+}
index e409c5b8fc9d87706753057de8716514af49e39d..2fc5a17c3386ec49905546b450bdf73682a73788 100644 (file)
@@ -215,6 +215,9 @@ ARDOUR_UI::install_actions ()
        act = ActionManager::register_toggle_action (common_actions, X_("KeepTearoffs"), _("Show Toolbars"), mem_fun (*this, &ARDOUR_UI::toggle_keep_tearoffs));
        ActionManager::session_sensitive_actions.push_back (act);
 
+       act = ActionManager::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);
+
 if (Profile->get_mixbus())
        ActionManager::register_action (common_actions, X_("show-ui-prefs"), _("Show more UI preferences"), sigc::mem_fun (*this, &ARDOUR_UI::show_ui_prefs));
 
index e58a61948db0ecdc02bbacb7a170e746884becca..0eb3f77cfeabd8b706a8f66c87cd7ca66165c018 100644 (file)
@@ -100,6 +100,7 @@ Mixer_UI::Mixer_UI ()
         , _route_deletion_in_progress (false)
        , _following_editor_selection (false)
        , _maximised (false)
+       , _show_mixer_list (true)
 {
        /* allow this window to become the key focus window */
        set_flags (CAN_FOCUS);
@@ -1429,6 +1430,24 @@ Mixer_UI::route_group_property_changed (RouteGroup* group, const PropertyChange&
        }
 }
 
+void
+Mixer_UI::show_mixer_list (bool yn)
+{
+       if (yn) {
+               list_vpacker.show ();
+               
+               //if user wants to show the pane, we should make sure that it is wide enough to be visible 
+               int width = list_hpane.get_position();
+               if (width < 40)
+                       list_hpane.set_position(40);
+       } else {
+               list_vpacker.hide ();
+       }
+       
+       _show_mixer_list = yn;
+}
+
+
 void
 Mixer_UI::route_group_name_edit (const std::string& path, const std::string& new_text)
 {
@@ -1639,6 +1658,17 @@ Mixer_UI::set_state (const XMLNode& node)
                }
        }
 
+       if ((prop = node.property ("show-mixer-list"))) {
+               bool yn = string_is_affirmative (prop->value());
+               Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleMixerList"));
+               assert (act);
+               Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+
+               /* do it twice to force the change */
+               tact->set_active (!yn);
+               tact->set_active (yn);
+       }
+
 
        return 0;
 }
@@ -1682,6 +1712,8 @@ Mixer_UI::get_state (void)
 
        node->add_property ("show-mixer", _visible ? "yes" : "no");
 
+       node->add_property ("show-mixer-list", _show_mixer_list ? "yes" : "no");
+
        node->add_property ("maximised", _maximised ? "yes" : "no");
 
        return *node;
index a9825463589d02f78e75198333bd616afb57d7c6..8352ce76a259be9351c60fcfdc003d8e984d5862 100644 (file)
@@ -75,6 +75,8 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
        XMLNode& get_state (void);
        int set_state (const XMLNode& );
 
+       void show_mixer_list (bool yn);
+       
        void show_window ();
        bool hide_window (GdkEventAny *ev);
        void show_strip (MixerStrip *);
@@ -293,6 +295,9 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
 
        /// true if we are in fullscreen mode
        bool _maximised;
+
+       // true if mixer list is visible
+       bool _show_mixer_list;
 };
 
 #endif /* __ardour_mixer_ui_h__ */