allow hiding and showing the mixer list

This commit is contained in:
Ben Loftis 2015-12-10 17:21:02 -06:00
parent 1c49ccbc7b
commit 3b3261ef55
6 changed files with 53 additions and 0 deletions

View File

@ -504,6 +504,7 @@
<menuitem action='show-editor-mixer'/>
<menuitem action='show-editor-list'/>
<menuitem action='ToggleMixerList'/>
<menuitem action='ToggleMeasureVisibility'/>
<menuitem action='ToggleSummary'/>
<menuitem action='ToggleGroupTabs'/>

View 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;

View 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());
}
}

View 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));

View 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;

View 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__ */