move 15 actions out of Editor/* namespace, and into Common/*
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 28 Jan 2017 17:02:28 +0000 (18:02 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 28 Jan 2017 17:02:28 +0000 (18:02 +0100)
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/editor_actions.cc
gtk2_ardour/public_editor.h

index 1cdbcb51c7218d12f1817e8cf865fc74fb1b4323..4a02ec68166c8102c84b2f9a7c2623a5ef88a405 100644 (file)
@@ -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.
index f2ca7ad328330699e071eeb70b72b1630219531f..f92327575b0078216ec764b131328938e3e01db3 100644 (file)
@@ -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));
index 64c35e2ecdef54d8c12367f433f2ece6c177b77e..01472b9dfc60b219f919be8aa6dcb92c0a739dd9 100644 (file)
@@ -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 */