diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-01-31 03:27:25 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-01-31 03:27:25 +0000 |
commit | 98046ce92dfe16bdff36f19b90731269b82275f0 (patch) | |
tree | 89b2450702578264a427a3789494b0723d38922a | |
parent | 1de6e1a626a8aad8a3fee8ea4508645c3272896d (diff) |
remove editor mixer button, fix up editor mixer state save/restore
git-svn-id: svn://localhost/trunk/ardour2@306 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/ardour.bindings | 1 | ||||
-rw-r--r-- | gtk2_ardour/ardour.menus | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 34 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor_mixer.cc | 14 |
5 files changed, 38 insertions, 16 deletions
diff --git a/gtk2_ardour/ardour.bindings b/gtk2_ardour/ardour.bindings index a196c8392a..333561501b 100644 --- a/gtk2_ardour/ardour.bindings +++ b/gtk2_ardour/ardour.bindings @@ -11,6 +11,7 @@ (gtk_accel_path "<Actions>/Editor/crop" "c") (gtk_accel_path "<Actions>/Editor/duplicate-region" "d") (gtk_accel_path "<Actions>/Editor/set-edit-cursor" "e") +(gtk_accel_path "<Actions>/Editor/show-editor-mixer" "<shift>e") (gtk_accel_path "<Actions>/Editor/split-region" "s") (gtk_accel_path "<Actions>/Editor/set-region-sync-position" "v") (gtk_accel_path "<Actions>/Editor/mute-unmute-region" "m") diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus index 3ebf8c9e5f..134feaefe7 100644 --- a/gtk2_ardour/ardour.menus +++ b/gtk2_ardour/ardour.menus @@ -146,6 +146,8 @@ <menuitem action='ToggleWaveformVisibility'/> <menuitem action='ToggleWaveformsWhileRecording'/> <menuitem action='ToggleMeasureVisibility'/> + <separator/> + <menuitem action='show-editor-mixer'/> </menu> <menu name='JACK' action='JACK'> <menuitem action='JACKDisconnect'/> diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index d6b9f5b278..55b10bc77c 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -234,8 +234,6 @@ Editor::Editor (AudioEngine& eng) /* tool bar related */ - editor_mixer_button (_("editor\nmixer")), - selection_start_clock (X_("SelectionStartClock"), true), selection_end_clock (X_("SelectionEndClock"), true), edit_cursor_clock (X_("EditCursorClock"), true), @@ -1195,9 +1193,6 @@ Editor::connect_to_session (Session *t) session->foreach_edit_group(this, &Editor::add_edit_group); - editor_mixer_button.signal_toggled().connect (mem_fun(*this, &Editor::editor_mixer_button_toggled)); - editor_mixer_button.set_name (X_("EditorMixerButton")); - edit_cursor_clock.set_session (session); selection_start_clock.set_session (session); selection_end_clock.set_session (session); @@ -2185,8 +2180,18 @@ Editor::set_state (const XMLNode& node) set_mouse_mode (MouseObject, true); } - if ((prop = node.property ("editor-mixer-button"))) { - editor_mixer_button.set_active(prop->value() == "yes"); + if ((prop = node.property ("show-editor-mixer"))) { + + Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer")); + if (act) { + Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act); + bool yn = (prop->value() == X_("yes")); + + /* do it twice to force the change */ + + tact->set_active (!yn); + tact->set_active (yn); + } } return 0; @@ -2242,8 +2247,15 @@ Editor::get_state () node->add_property ("xfades-visible", _xfade_visibility ? "yes" : "no"); node->add_property ("region-list-sort-type", enum2str(region_list_sort_type)); node->add_property ("mouse-mode", enum2str(mouse_mode)); - node->add_property ("editor-mixer-button", editor_mixer_button.get_active() ? "yes" : "no"); + Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer")); + if (act) { + Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act); + node->add_property (X_("show-editor-mixer"), tact->get_active() ? "yes" : "no"); + } else { + cerr << "no show editor mixer action\n"; + } + return *node; } @@ -2672,14 +2684,8 @@ Editor::setup_toolbar () edit_clock_vbox->pack_start (edit_cursor_clock_label, false, false); edit_clock_vbox->pack_start (*edit_clock_hbox, false, false); - /* the editor/mixer button will be enabled at session connect */ - - editor_mixer_button.set_active(false); - editor_mixer_button.set_sensitive(false); - HBox* hbox = new HBox; - hbox->pack_start (editor_mixer_button, false, false); hbox->pack_start (*edit_clock_vbox, false, false); hbox->pack_start (zoom_indicator_vbox, false, false); hbox->pack_start (zoom_focus_box, false, false); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 544035f33e..26718e25d1 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -36,6 +36,9 @@ Editor::register_actions () /* add named actions for the editor */ + act = ActionManager::register_toggle_action (editor_actions, "show-editor-mixer", _("show editor mixer"), mem_fun (*this, &Editor::editor_mixer_button_toggled)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (editor_actions, "toggle-xfades-active", _("toggle xfades active"), mem_fun(*this, &Editor::toggle_xfades_active)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index ec1511f2a2..a61707f91b 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -26,13 +26,18 @@ #include "ardour_ui.h" #include "selection.h" #include "audio_time_axis.h" +#include "actions.h" #include "i18n.h" void Editor::editor_mixer_button_toggled () { - show_editor_mixer (editor_mixer_button.get_active()); + Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer")); + if (act) { + Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act); + show_editor_mixer (tact->get_active()); + } } void @@ -230,7 +235,12 @@ Editor::current_mixer_strip_hidden () } } } - global_hpacker.remove (*current_mixer_strip); + + Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer")); + if (act) { + Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act); + tact->set_active (false); + } } void |