remove editor mixer button, fix up editor mixer state save/restore

git-svn-id: svn://localhost/trunk/ardour2@306 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-01-31 03:27:25 +00:00
parent 1de6e1a626
commit 98046ce92d
5 changed files with 38 additions and 16 deletions

View file

@ -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")

View file

@ -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'/>

View file

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

View file

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

View file

@ -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