diff options
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 40 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 21 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 11 |
3 files changed, 51 insertions, 21 deletions
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 1cdbcb51c7..4a02ec6816 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -283,6 +283,46 @@ ARDOUR_UI::install_actions () global_actions.register_action (common_actions, X_("detach-mixer"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), mixer)); global_actions.register_action (common_actions, X_("detach-preferences"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), rc_option_editor)); + /* these actions are all currently implemented by the Editor, but need + * to be accessible from anywhere as actions. + */ + + act = global_actions.register_action (common_actions, "alternate-jump-forward-to-mark", _("Jump to Next Mark"), sigc::mem_fun(editor, &PublicEditor::jump_forward_to_mark)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "alternate-jump-backward-to-mark", _("Jump to Previous Mark"), sigc::mem_fun(editor, &PublicEditor::jump_backward_to_mark)); + ActionManager::session_sensitive_actions.push_back (act); + + act = global_actions.register_action (common_actions, "set-session-start-from-playhead", _("Set Session Start from Playhead"), sigc::mem_fun(editor, &PublicEditor::set_session_start_from_playhead)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "set-session-end-from-playhead", _("Set Session End from Playhead"), sigc::mem_fun(editor, &PublicEditor::set_session_end_from_playhead)); + ActionManager::session_sensitive_actions.push_back (act); + + act = global_actions.register_action (common_actions, "toggle-location-at-playhead", _("Toggle Mark at Playhead"), sigc::mem_fun(editor, &PublicEditor::toggle_location_at_playhead_cursor)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(editor, &PublicEditor::add_location_from_playhead_cursor)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "alternate-add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(editor, &PublicEditor::add_location_from_playhead_cursor)); + ActionManager::session_sensitive_actions.push_back (act); + + act = global_actions.register_action (common_actions, "remove-location-from-playhead", _("Remove Mark at Playhead"), sigc::mem_fun(editor, &PublicEditor::remove_location_at_playhead_cursor)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "alternate-remove-location-from-playhead", _("Remove Mark at Playhead"), sigc::mem_fun(editor, &PublicEditor::remove_location_at_playhead_cursor)); + ActionManager::session_sensitive_actions.push_back (act); + + act = global_actions.register_action (common_actions, "nudge-next-forward", _("Nudge Next Later"), sigc::bind (sigc::mem_fun(editor, &PublicEditor::nudge_forward), true, false)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "nudge-next-backward", _("Nudge Next Earlier"), sigc::bind (sigc::mem_fun(editor, &PublicEditor::nudge_backward), true, false)); + ActionManager::session_sensitive_actions.push_back (act); + + act = global_actions.register_action (common_actions, "nudge-playhead-forward", _("Nudge Playhead Forward"), sigc::bind (sigc::mem_fun(editor, &PublicEditor::nudge_forward), false, true)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "nudge-playhead-backward", _("Nudge Playhead Backward"), sigc::bind (sigc::mem_fun(editor, &PublicEditor::nudge_backward), false, true)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "playhead-forward-to-grid", _("Playhead to Next Grid"), sigc::mem_fun(editor, &PublicEditor::playhead_forward_to_grid)); + ActionManager::session_sensitive_actions.push_back (act); + act = global_actions.register_action (common_actions, "playhead-backward-to-grid", _("Playhead to Previous Grid"), sigc::mem_fun(editor, &PublicEditor::playhead_backward_to_grid)); + ActionManager::session_sensitive_actions.push_back (act); + /* These "change" actions are not intended to be used inside menus, but are for the tab/window control buttons, which have somewhat odd semantics. diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index f2ca7ad328..f92327575b 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -249,27 +249,6 @@ Editor::register_actions () reg_sens (editor_actions, a.c_str(), n.c_str(), sigc::bind (sigc::mem_fun (*this, &Editor::goto_nth_marker), i - 1)); } - reg_sens (editor_actions, "alternate-jump-forward-to-mark", _("Jump to Next Mark"), sigc::mem_fun(*this, &Editor::jump_forward_to_mark)); - reg_sens (editor_actions, "alternate-jump-backward-to-mark", _("Jump to Previous Mark"), sigc::mem_fun(*this, &Editor::jump_backward_to_mark)); - - reg_sens (editor_actions, "set-session-start-from-playhead", _("Set Session Start from Playhead"), sigc::mem_fun(*this, &Editor::set_session_start_from_playhead)); - reg_sens (editor_actions, "set-session-end-from-playhead", _("Set Session End from Playhead"), sigc::mem_fun(*this, &Editor::set_session_end_from_playhead)); - - reg_sens (editor_actions, "toggle-location-at-playhead", _("Toggle Mark at Playhead"), sigc::mem_fun(*this, &Editor::toggle_location_at_playhead_cursor)); - reg_sens (editor_actions, "add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(*this, &Editor::add_location_from_playhead_cursor)); - reg_sens (editor_actions, "alternate-add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(*this, &Editor::add_location_from_playhead_cursor)); - - reg_sens (editor_actions, "remove-location-from-playhead", _("Remove Mark at Playhead"), sigc::mem_fun(*this, &Editor::remove_location_at_playhead_cursor)); - reg_sens (editor_actions, "alternate-remove-location-from-playhead", _("Remove Mark at Playhead"), sigc::mem_fun(*this, &Editor::remove_location_at_playhead_cursor)); - - reg_sens (editor_actions, "nudge-next-forward", _("Nudge Next Later"), sigc::bind (sigc::mem_fun(*this, &Editor::nudge_forward), true, false)); - reg_sens (editor_actions, "nudge-next-backward", _("Nudge Next Earlier"), sigc::bind (sigc::mem_fun(*this, &Editor::nudge_backward), true, false)); - - reg_sens (editor_actions, "nudge-playhead-forward", _("Nudge Playhead Forward"), sigc::bind (sigc::mem_fun(*this, &Editor::nudge_forward), false, true)); - reg_sens (editor_actions, "nudge-playhead-backward", _("Nudge Playhead Backward"), sigc::bind (sigc::mem_fun(*this, &Editor::nudge_backward), false, true)); - reg_sens (editor_actions, "playhead-forward-to-grid", _("Playhead to Next Grid"), sigc::mem_fun(*this, &Editor::playhead_forward_to_grid)); - reg_sens (editor_actions, "playhead-backward-to-grid", _("Playhead to Previous Grid"), sigc::mem_fun(*this, &Editor::playhead_backward_to_grid)); - reg_sens (editor_actions, "temporal-zoom-out", _("Zoom Out"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), true)); reg_sens (editor_actions, "temporal-zoom-in", _("Zoom In"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), false)); reg_sens (editor_actions, "zoom-to-session", _("Zoom to Session"), sigc::mem_fun(*this, &Editor::temporal_zoom_session)); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 64c35e2ecd..01472b9dfc 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -225,6 +225,17 @@ class PublicEditor : public Gtkmm2ext::Tabbable { virtual void jump_forward_to_mark () = 0; virtual void jump_backward_to_mark () = 0; + virtual void set_session_start_from_playhead () = 0; + virtual void set_session_end_from_playhead () = 0; + + virtual void toggle_location_at_playhead_cursor () = 0; + + virtual void nudge_forward (bool next, bool force_playhead) = 0; + virtual void nudge_backward (bool next, bool force_playhead) = 0; + + virtual void playhead_forward_to_grid () = 0; + virtual void playhead_backward_to_grid () = 0; + virtual Editing::MouseMode effective_mouse_mode () const = 0; /** Import existing media */ |