summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2014-12-22 11:59:05 -0600
committerBen Loftis <ben@harrisonconsoles.com>2014-12-22 17:42:43 -0600
commit1211278a2b368a4acc0e26ae5f064544b4b1ffec (patch)
tree3c5c03feaeef24257948b08e5d1134fc2fed78eb /gtk2_ardour
parentc404ef985682a9f3e2c70aa84bf953ab6adecf71 (diff)
consolidate zoom-to-range and zoom-to-regions into: zoom-to-selection. ToDo: zoom to selection of midi notes, control points, tracks(?)
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour.menus.in6
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_actions.cc6
-rw-r--r--gtk2_ardour/editor_ops.cc16
-rw-r--r--gtk2_ardour/mnemonic-us.bindings.in5
5 files changed, 14 insertions, 20 deletions
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 @@
<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'/>
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