logic rearrangement for visual state save

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3324 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-05-06 20:22:27 +00:00
parent 63b54649ba
commit 15d6871c02
3 changed files with 52 additions and 48 deletions

View file

@ -193,53 +193,53 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-1", _("Save View 1"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 0));
act = ActionManager::register_action (editor_actions, "save-visual-state-1", _("Save View 1"), bind (mem_fun (*this, &Editor::start_visual_state_op), 0));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-1", _("Goto View 1"), bind (mem_fun (*this, &Editor::start_visual_state_op), 0));
act = ActionManager::register_action (editor_actions, "goto-visual-state-1", _("Goto View 1"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 0));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-2", _("Save View 2"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 1));
act = ActionManager::register_action (editor_actions, "save-visual-state-2", _("Save View 2"), bind (mem_fun (*this, &Editor::start_visual_state_op), 1));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-2", _("Goto View 2"), bind (mem_fun (*this, &Editor::start_visual_state_op), 1));
act = ActionManager::register_action (editor_actions, "goto-visual-state-2", _("Goto View 2"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 1));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-3", _("Save View 3"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 2));
act = ActionManager::register_action (editor_actions, "save-visual-state-3", _("Save View 3"), bind (mem_fun (*this, &Editor::start_visual_state_op), 2));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-3", _("Goto View 3"), bind (mem_fun (*this, &Editor::start_visual_state_op), 2));
act = ActionManager::register_action (editor_actions, "goto-visual-state-3", _("Goto View 3"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 2));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-4", _("Save View 4"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 3));
act = ActionManager::register_action (editor_actions, "save-visual-state-4", _("Save View 4"), bind (mem_fun (*this, &Editor::start_visual_state_op), 3));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-4", _("Goto View 4"), bind (mem_fun (*this, &Editor::start_visual_state_op), 3));
act = ActionManager::register_action (editor_actions, "goto-visual-state-4", _("Goto View 4"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 3));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-5", _("Save View 5"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 4));
act = ActionManager::register_action (editor_actions, "save-visual-state-5", _("Save View 5"), bind (mem_fun (*this, &Editor::start_visual_state_op), 4));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-5", _("Goto View 5"), bind (mem_fun (*this, &Editor::start_visual_state_op), 4));
act = ActionManager::register_action (editor_actions, "goto-visual-state-5", _("Goto View 5"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 4));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-6", _("Save View 6"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 5));
act = ActionManager::register_action (editor_actions, "save-visual-state-6", _("Save View 6"), bind (mem_fun (*this, &Editor::start_visual_state_op), 5));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-6", _("Goto View 6"), bind (mem_fun (*this, &Editor::start_visual_state_op), 5));
act = ActionManager::register_action (editor_actions, "goto-visual-state-6", _("Goto View 6"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 5));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-7", _("Save View 7"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 6));
act = ActionManager::register_action (editor_actions, "save-visual-state-7", _("Save View 7"), bind (mem_fun (*this, &Editor::start_visual_state_op), 6));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-7", _("Goto View 7"), bind (mem_fun (*this, &Editor::start_visual_state_op), 6));
act = ActionManager::register_action (editor_actions, "goto-visual-state-7", _("Goto View 7"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 6));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-8", _("Save View 8"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 7));
act = ActionManager::register_action (editor_actions, "save-visual-state-8", _("Save View 8"), bind (mem_fun (*this, &Editor::start_visual_state_op), 7));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-8", _("Goto View 8"), bind (mem_fun (*this, &Editor::start_visual_state_op), 7));
act = ActionManager::register_action (editor_actions, "goto-visual-state-8", _("Goto View 8"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 7));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-9", _("Save View 9"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 8));
act = ActionManager::register_action (editor_actions, "save-visual-state-9", _("Save View 9"), bind (mem_fun (*this, &Editor::start_visual_state_op), 8));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-9", _("Goto View 9"), bind (mem_fun (*this, &Editor::start_visual_state_op), 8));
act = ActionManager::register_action (editor_actions, "goto-visual-state-9", _("Goto View 9"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 8));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-10", _("Save View 10"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 9));
act = ActionManager::register_action (editor_actions, "save-visual-state-10", _("Save View 10"), bind (mem_fun (*this, &Editor::start_visual_state_op), 9));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-10", _("Goto View 10"), bind (mem_fun (*this, &Editor::start_visual_state_op), 9));
act = ActionManager::register_action (editor_actions, "goto-visual-state-10", _("Goto View 10"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 9));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-11", _("Save View 11"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 10));
act = ActionManager::register_action (editor_actions, "save-visual-state-11", _("Save View 11"), bind (mem_fun (*this, &Editor::start_visual_state_op), 10));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-11", _("Goto View 11"), bind (mem_fun (*this, &Editor::start_visual_state_op), 10));
act = ActionManager::register_action (editor_actions, "goto-visual-state-11", _("Goto View 11"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 10));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "save-visual-state-12", _("Save View 12"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 11));
act = ActionManager::register_action (editor_actions, "save-visual-state-12", _("Save View 12"), bind (mem_fun (*this, &Editor::start_visual_state_op), 11));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto-visual-state-12", _("Goto View 12"), bind (mem_fun (*this, &Editor::start_visual_state_op), 11));
act = ActionManager::register_action (editor_actions, "goto-visual-state-12", _("Goto View 12"), bind (mem_fun (*this, &Editor::cancel_visual_state_op), 11));
ActionManager::session_sensitive_actions.push_back (act);

View file

@ -5942,7 +5942,9 @@ Editor::goto_visual_state (uint32_t n)
void
Editor::start_visual_state_op (uint32_t n)
{
cerr << "Start\n";
if (visual_state_op_connection.empty()) {
cerr << "\tqueue\n";
visual_state_op_connection = Glib::signal_timeout().connect (bind (mem_fun (*this, &Editor::end_visual_state_op), n), 1000);
}
}
@ -5950,7 +5952,9 @@ Editor::start_visual_state_op (uint32_t n)
void
Editor::cancel_visual_state_op (uint32_t n)
{
cerr << "Cancel\n";
if (!visual_state_op_connection.empty()) {
cerr << "\tgoto\n";
visual_state_op_connection.disconnect();
goto_visual_state (n);
}

View file

@ -179,31 +179,31 @@
(gtk_accel_path "<Actions>/Editor/select-range-between-cursors" "F6")
(gtk_accel_path "<Actions>/Common/ToggleMaximalEditor" "F11")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-1" "<%PRIMARY%>F1")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-2" "<%PRIMARY%>F2")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-3" "<%PRIMARY%>F3")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-4" "<%PRIMARY%>F4")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-5" "<%PRIMARY%>F5")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-6" "<%PRIMARY%>F6")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-7" "<%PRIMARY%>F7")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-8" "<%PRIMARY%>F8")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-9" "<%PRIMARY%>F9")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-10" "<%PRIMARY%>F10")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-11" "<%PRIMARY%>F11")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-12" "<%PRIMARY%>F12")
(gtk_accel_path "<Actions>/Editor/save-visual-state-1" "<%PRIMARY%>F1")
(gtk_accel_path "<Actions>/Editor/save-visual-state-2" "<%PRIMARY%>F2")
(gtk_accel_path "<Actions>/Editor/save-visual-state-3" "<%PRIMARY%>F3")
(gtk_accel_path "<Actions>/Editor/save-visual-state-4" "<%PRIMARY%>F4")
(gtk_accel_path "<Actions>/Editor/save-visual-state-5" "<%PRIMARY%>F5")
(gtk_accel_path "<Actions>/Editor/save-visual-state-6" "<%PRIMARY%>F6")
(gtk_accel_path "<Actions>/Editor/save-visual-state-7" "<%PRIMARY%>F7")
(gtk_accel_path "<Actions>/Editor/save-visual-state-8" "<%PRIMARY%>F8")
(gtk_accel_path "<Actions>/Editor/save-visual-state-9" "<%PRIMARY%>F9")
(gtk_accel_path "<Actions>/Editor/save-visual-state-10" "<%PRIMARY%>F10")
(gtk_accel_path "<Actions>/Editor/save-visual-state-11" "<%PRIMARY%>F11")
(gtk_accel_path "<Actions>/Editor/save-visual-state-12" "<%PRIMARY%>F12")
(gtk_accel_path "<Actions>/Editor/save-visual-state-1" "<release><%PRIMARY%>F1")
(gtk_accel_path "<Actions>/Editor/save-visual-state-2" "<release><%PRIMARY%>F2")
(gtk_accel_path "<Actions>/Editor/save-visual-state-3" "<release><%PRIMARY%>F3")
(gtk_accel_path "<Actions>/Editor/save-visual-state-4" "<release><%PRIMARY%>F4")
(gtk_accel_path "<Actions>/Editor/save-visual-state-5" "<release><%PRIMARY%>F5")
(gtk_accel_path "<Actions>/Editor/save-visual-state-6" "<release><%PRIMARY%>F6")
(gtk_accel_path "<Actions>/Editor/save-visual-state-7" "<release><%PRIMARY%>F7")
(gtk_accel_path "<Actions>/Editor/save-visual-state-8" "<release><%PRIMARY%>F8")
(gtk_accel_path "<Actions>/Editor/save-visual-state-9" "<release><%PRIMARY%>F9")
(gtk_accel_path "<Actions>/Editor/save-visual-state-10" "<release><%PRIMARY%>F10")
(gtk_accel_path "<Actions>/Editor/save-visual-state-11" "<release><%PRIMARY%>F11")
(gtk_accel_path "<Actions>/Editor/save-visual-state-12" "<release><%PRIMARY%>F12")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-1" "<release><%PRIMARY%>F1")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-2" "<release><%PRIMARY%>F2")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-3" "<release><%PRIMARY%>F3")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-4" "<release><%PRIMARY%>F4")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-5" "<release><%PRIMARY%>F5")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-6" "<release><%PRIMARY%>F6")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-7" "<release><%PRIMARY%>F7")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-8" "<release><%PRIMARY%>F8")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-9" "<release><%PRIMARY%>F9")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-10" "<release><%PRIMARY%>F10")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-11" "<release><%PRIMARY%>F11")
(gtk_accel_path "<Actions>/Editor/goto-visual-state-12" "<release><%PRIMARY%>F12")
;; numbers