13
0

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
This commit is contained in:
Paul Davis 2012-12-13 16:20:37 +00:00
parent 459a943bb0
commit 1224fc0700
5 changed files with 32 additions and 1 deletions

View File

@ -371,6 +371,7 @@
<menuitem action='zoom-focus-playhead'/>
<menuitem action='zoom-focus-mouse'/>
<menuitem action='zoom-focus-edit'/>
<menuitem action='cycle-zoom-focus'/>
</menu>
<menu name='SnapMode' action='SnapMode'>
<menuitem action='snap-off'/>

View File

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

View File

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

View File

@ -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<ActionGroup> mouse_mode_actions = ActionGroup::create (X_("MouseMode"));
RadioAction::Group mouse_mode_group;

View File

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