consolidate zoom-to-range and zoom-to-regions into: zoom-to-selection. ToDo: zoom...
authorBen Loftis <ben@harrisonconsoles.com>
Mon, 22 Dec 2014 17:59:05 +0000 (11:59 -0600)
committerBen Loftis <ben@harrisonconsoles.com>
Mon, 22 Dec 2014 23:42:43 +0000 (17:42 -0600)
gtk2_ardour/ardour.menus.in
gtk2_ardour/editor.h
gtk2_ardour/editor_actions.cc
gtk2_ardour/editor_ops.cc
gtk2_ardour/mnemonic-us.bindings.in

index d4b65025c69c49472d3083d3e7c413b26c73a102..53eeb745d517467a310f0b9efa44bf7248883c7a 100644 (file)
         <menuitem action='temporal-zoom-in'/>
         <menuitem action='temporal-zoom-out'/>
         <menuitem action='zoom-to-session'/>
-        <menuitem action='zoom-to-region'/>
-        <menuitem action='zoom-to-region-both-axes'/>
-        <menuitem action='zoom-to-range'/>
-        <menuitem action='zoom-to-range-both-axes'/>
+        <menuitem action='zoom-to-selection'/>
+        <menuitem action='zoom-to-selection-both-axes'/>
         <menuitem action='toggle-zoom'/>
         <menuitem action='expand-tracks'/>
         <menuitem action='shrink-tracks'/>
index b511bd0ddef9695f40eca9f3f691e90334f650b4..ba2060748b2399724c9347645f81a31fe5f1e073 100644 (file)
@@ -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);
index a62dcee8a617744b0dc8d2deebbe2c74a97aeb1f..4807bdf72e6c90909456988306889b69c075e344 100644 (file)
@@ -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));
index d9575cb6f9fa2b72e4baa208f0378e14549cdf23..64a7d1a059842f85998cc2a4ccab78e14aaa5348 100644 (file)
@@ -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
index 68b6b04e2b5710fc35d1215d84fd4f7b33a0d4f9..8660b2c99eee752365252db99ba1be567177b0f0 100644 (file)
@@ -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