From: Ben Loftis Date: Mon, 22 Dec 2014 17:59:05 +0000 (-0600) Subject: consolidate zoom-to-range and zoom-to-regions into: zoom-to-selection. ToDo: zoom... X-Git-Tag: 4.0-rc1~892 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=1211278a2b368a4acc0e26ae5f064544b4b1ffec;p=ardour.git consolidate zoom-to-range and zoom-to-regions into: zoom-to-selection. ToDo: zoom to selection of midi notes, control points, tracks(?) --- diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index d4b65025c6..53eeb745d5 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -363,10 +363,8 @@ - - - - + + diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index b511bd0dde..ba2060748b 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1249,7 +1249,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void calc_extra_zoom_edges(framepos_t &start, framepos_t &end); void temporal_zoom_selection (bool both_axes = false); void temporal_zoom_region (bool both_axes); - void zoom_to_region (bool both_axes); void temporal_zoom_session (); void temporal_zoom (framecnt_t samples_per_pixel); void temporal_zoom_by_frame (framepos_t start, framepos_t end); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index a62dcee8a6..4807bdf72e 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -261,10 +261,8 @@ Editor::register_actions () 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)); - reg_sens (editor_actions, "zoom-to-region", _("Zoom to Region"), sigc::bind (sigc::mem_fun(*this, &Editor::zoom_to_region), false)); - reg_sens (editor_actions, "zoom-to-region-both-axes", _("Zoom to Region (Width and Height)"), sigc::bind (sigc::mem_fun(*this, &Editor::zoom_to_region), true)); - reg_sens (editor_actions, "zoom-to-range", _("Zoom to Range"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_selection), false)); - reg_sens (editor_actions, "zoom-to-range-both-axes", _("Zoom to Range (Width and Height)"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_selection), true)); + reg_sens (editor_actions, "zoom-to-selection", _("Zoom to Selection"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_selection), false)); + reg_sens (editor_actions, "zoom-to-selection-both-axes", _("Zoom to Selection (Width and Height)"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_selection), true)); reg_sens (editor_actions, "toggle-zoom", _("Toggle Zoom State"), sigc::mem_fun(*this, &Editor::swap_visual_state)); reg_sens (editor_actions, "expand-tracks", _("Expand Track Height"), sigc::bind (sigc::mem_fun (*this, &Editor::tav_zoom_step), false)); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index d9575cb6f9..64a7d1a059 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1760,17 +1760,20 @@ Editor::temporal_zoom_region (bool both_axes) redo_visual_stack.push_back (current_visual_state (both_axes)); } -void -Editor::zoom_to_region (bool both_axes) -{ - temporal_zoom_region (both_axes); -} void Editor::temporal_zoom_selection (bool both_axes) { if (!selection) return; + //ToDo: if notes are selected, zoom to that + + //ToDo: if control points are selected, zoom to that + + //if region(s) are selected, zoom to that + if ( !selection->regions.empty() ) + temporal_zoom_region (both_axes); + //if a range is selected, zoom to that if (!selection->time.empty()) { @@ -1784,11 +1787,8 @@ Editor::temporal_zoom_selection (bool both_axes) if (both_axes) fit_selected_tracks(); - } else { - temporal_zoom_region (both_axes); } - } void diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in index 68b6b04e2b..8660b2c99e 100644 --- a/gtk2_ardour/mnemonic-us.bindings.in +++ b/gtk2_ardour/mnemonic-us.bindings.in @@ -206,11 +206,10 @@ This mode provides many different operations on both regions and control points, ;; BOTTOM ROW -@mmode|Editor/zoom-to-range|z|zoom to selection +@mmode|Editor/zoom-to-selection|z|zoom to selection +@vis|Editor/zoom-to-selection-both-axes|<@PRIMARY@><@SECONDARY@>z|zoom to selection, x and y @edit|Editor/undo|<@PRIMARY@>z|undo @edit|Editor/alternate-alternate-redo|<@PRIMARY@><@TERTIARY@>z|redo -@vis|Editor/zoom-to-region|<@PRIMARY@><@SECONDARY@>z|zoom (x) to selected region(s) -@vis|Editor/zoom-to-region-both-axes|<@SECONDARY@>z|zoom (x+y) to selected region @vis|Editor/toggle-zoom|<@TERTIARY@>z|toggle last 2 zoom states @edit|Editor/editor-cut|<@PRIMARY@>x|cut ;@-group|Editor/crop|c|some text