From 1224fc07007a99a138678a800497c841f4f04e1b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 13 Dec 2012 16:20:37 +0000 Subject: [PATCH] add cycle-zoom-focus and bind to "1" by default git-svn-id: svn://localhost/ardour2/branches/3.0@13658 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour.menus.in | 1 + gtk2_ardour/editor.cc | 25 +++++++++++++++++++++++++ gtk2_ardour/editor.h | 1 + gtk2_ardour/editor_actions.cc | 3 +++ gtk2_ardour/mnemonic-us.bindings.in | 3 ++- 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index 7bfac45594..4d018ae815 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -371,6 +371,7 @@ + diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 7cf10ad493..3e356e1795 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -3578,6 +3578,31 @@ Editor::set_zoom_focus (ZoomFocus f) } } +void +Editor::cycle_zoom_focus () +{ + switch (zoom_focus) { + case ZoomFocusLeft: + set_zoom_focus (ZoomFocusRight); + break; + case ZoomFocusRight: + set_zoom_focus (ZoomFocusCenter); + break; + case ZoomFocusCenter: + set_zoom_focus (ZoomFocusPlayhead); + break; + case ZoomFocusPlayhead: + set_zoom_focus (ZoomFocusMouse); + break; + case ZoomFocusMouse: + set_zoom_focus (ZoomFocusEdit); + break; + case ZoomFocusEdit: + set_zoom_focus (ZoomFocusLeft); + break; + } +} + void Editor::ensure_float (Window& win) { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index a239f4e3be..0221a82286 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -322,6 +322,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_zoom_focus (Editing::ZoomFocus); Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; } double get_current_zoom () const { return frames_per_unit; } + void cycle_zoom_focus (); void temporal_zoom_step (bool coarser); void tav_zoom_step (bool coarser); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 0222dd6b3b..6fc16c85c5 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -401,6 +401,9 @@ Editor::register_actions () radio_reg_sens (zoom_actions, zoom_group, "zoom-focus-mouse", _("Zoom Focus Mouse"), sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusMouse)); radio_reg_sens (zoom_actions, zoom_group, "zoom-focus-edit", _("Zoom Focus Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::zoom_focus_chosen), Editing::ZoomFocusEdit)); + ActionManager::register_action (editor_actions, X_("cycle-zoom-focus"), _("Next Zoom Focus"), sigc::mem_fun (*this, &Editor::cycle_zoom_focus)); + + Glib::RefPtr mouse_mode_actions = ActionGroup::create (X_("MouseMode")); RadioAction::Group mouse_mode_group; diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in index 7ef94f726b..76de8d8c2e 100644 --- a/gtk2_ardour/mnemonic-us.bindings.in +++ b/gtk2_ardour/mnemonic-us.bindings.in @@ -32,7 +32,7 @@ $ARDOUR Shortcuts \linebreak Mnemonic US-Keypad %wvis Window Visibility %eep Editing with Edit Point -Most edit functions operate on a single "Edit Point". The edit point can be any of: playhead (default), the mouse or an active marker. The choice of Edit Point is by default linked to the Zoom Focus. +Most edit functions operate on a single "Edit Point". The edit point can be any of: playhead (default), the mouse or an active marker. The choice of Edit Point (by default) also sets the Zoom Focus. %aep Aligning with the Edit Point Align operations move regions so that their start/end/sync point is at the edit point. "Relative" operations @@ -332,6 +332,7 @@ This mode provides many different operations on both regions and control points, ;; numbers +@eep|Editor/cycle-zoom-focus|1|cycle to next zoom focus @eep|Editor/cycle-snap-mode|2|cycle to next grid snap mode @eep|Editor/prev-snap-choice|3|use next grid unit @eep|Editor/prev-snap-choice-music-only|<@PRIMARY@>3|use previous grid unit