summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-12-13 12:02:57 +1000
committerTim Mayberry <mojofunk@gmail.com>2016-12-13 13:02:04 +1000
commit0eff7d4a0cc6dfee97d521330e1fbec3d500b9fd (patch)
treeed44aead5577f4e159715a29f4adf37912cddb68
parent89623923bdc475381bfb8b0d318b7284920e05fc (diff)
Add option to Zoom to Selection on double click
Currently implemented for Region and Range selections. The new option is false/off by default to maintain existing behaviour. I'm not sure it should require another option, perhaps Zoom to Selection should be the default and accessing the region properties dialog can be via Modifier+double click, but further changes can be made on user feedback etc. Related: #7112
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_drag.cc13
-rw-r--r--gtk2_ardour/editor_mouse.cc10
-rw-r--r--gtk2_ardour/rc_option_editor.cc8
-rw-r--r--gtk2_ardour/ui_config_vars.h1
5 files changed, 29 insertions, 4 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 68c9814556..677c0927c9 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -1655,6 +1655,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void edit_meter_marker (MeterMarker&);
void edit_control_point (ArdourCanvas::Item*);
void edit_notes (MidiRegionView*);
+ void edit_region (RegionView*);
void edit_current_meter ();
void edit_current_tempo ();
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 00a3541c09..cad6e782a0 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -1382,8 +1382,7 @@ RegionMoveDrag::finished (GdkEvent* ev, bool movement_occurred)
if (was_double_click() && !_views.empty()) {
DraggingView dv = _views.front();
- dv.view->show_region_editor ();
-
+ _editor->edit_region (dv.view);
}
return;
@@ -2312,8 +2311,7 @@ RegionRippleDrag::finished (GdkEvent* event, bool movement_occurred)
if (was_double_click() && !_views.empty()) {
DraggingView dv = _views.front();
- dv.view->show_region_editor ();
-
+ _editor->edit_region (dv.view);
}
return;
@@ -5314,6 +5312,13 @@ SelectionDrag::finished (GdkEvent* event, bool movement_occurred)
/* just a click, no pointer movement.
*/
+ if (was_double_click()) {
+ if (UIConfiguration::instance().get_use_double_click_to_zoom_to_selection()) {
+ _editor->temporal_zoom_selection (ZoomAxis::Both);
+ return;
+ }
+ }
+
if (_operation == SelectionExtend) {
if (_time_selection_at_start) {
framepos_t pos = adjusted_current_frame (event, false);
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 6845017e40..dabdb1e90d 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -2143,6 +2143,16 @@ Editor::note_edit_done (int r, EditNoteDialog* d)
}
void
+Editor::edit_region (RegionView* rv)
+{
+ if (UIConfiguration::instance().get_use_double_click_to_zoom_to_selection()) {
+ temporal_zoom_selection (ZoomAxis::Both);
+ } else {
+ rv->show_region_editor ();
+ }
+}
+
+void
Editor::visible_order_range (int* low, int* high) const
{
*low = TimeAxisView::max_order ();
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 3569d939cc..440705e1a3 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -2546,6 +2546,14 @@ if (!Profile->get_mixbus()) {
add_option (_("Editor"),
new BoolOption (
+ "use-double-click-to-zoom-to-selection",
+ _("Use double mouse click to zoom to selection"),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_use_double_click_to_zoom_to_selection),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_use_double_click_to_zoom_to_selection)
+ ));
+
+ add_option (_("Editor"),
+ new BoolOption (
"update-editor-during-summary-drag",
_("Update editor window during drags of the summary"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_update_editor_during_summary_drag),
diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h
index 561bd9d72c..d540bcab61 100644
--- a/gtk2_ardour/ui_config_vars.h
+++ b/gtk2_ardour/ui_config_vars.h
@@ -50,6 +50,7 @@ UI_CONFIG_VARIABLE (bool, show_plugin_scan_window, "show-plugin-scan-window", fa
UI_CONFIG_VARIABLE (bool, show_zoom_tools, "show-zoom-tools", true)
UI_CONFIG_VARIABLE (bool, use_mouse_position_as_zoom_focus_on_scroll, "use-mouse-position-as-zoom-focus-on-scroll", true)
UI_CONFIG_VARIABLE (bool, use_time_rulers_to_zoom_with_vertical_drag, "use-time-rulers-to-zoom-with-vertical-drag", false)
+UI_CONFIG_VARIABLE (bool, use_double_click_to_zoom_to_selection, "use-double-click-to-zoom-to-selection", false)
UI_CONFIG_VARIABLE (bool, widget_prelight, "widget-prelight", true)
UI_CONFIG_VARIABLE (bool, use_tooltips, "use-tooltips", true)
UI_CONFIG_VARIABLE (std::string, mixer_strip_visibility, "mixer-element-visibility", "Input,PhaseInvert,RecMon,SoloIsoLock,Output,Comments")