consolidate zoom-to-range and zoom-to-regions into: zoom-to-selection. ToDo: zoom...
[ardour.git] / gtk2_ardour / editor_ops.cc
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