diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-02-09 20:37:53 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2016-11-11 14:13:53 +1000 |
commit | 9485748e17d0f122ed42ba353c08312d58dc188e (patch) | |
tree | fb72899bab84e1932102edfd984db8d7900196c5 /gtk2_ardour/editor_ops.cc | |
parent | 4499066f39f735bfe530a8b0d40c211023020b91 (diff) |
Change Editor temporal zoom methods to be able to use different scale for the zoom
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 3d7adc5584..e074755a5f 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1710,25 +1710,43 @@ Editor::tav_zoom_smooth (bool coarser, bool force_all) } void -Editor::temporal_zoom_step_mouse_focus (bool coarser) +Editor::temporal_zoom_step_mouse_focus_scale (bool zoom_out, double scale) { Editing::ZoomFocus temp_focus = zoom_focus; zoom_focus = Editing::ZoomFocusMouse; - temporal_zoom_step (coarser); + temporal_zoom_step_scale (zoom_out, scale); zoom_focus = temp_focus; } void -Editor::temporal_zoom_step (bool coarser) +Editor::temporal_zoom_step_mouse_focus (bool zoom_out) { - ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_step, coarser) + temporal_zoom_step_mouse_focus_scale (zoom_out, 2.0); +} + +void +Editor::temporal_zoom_step (bool zoom_out) +{ + temporal_zoom_step_scale (zoom_out, 2.0); +} + +void +Editor::temporal_zoom_step_scale (bool zoom_out, double scale) +{ + ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_step, zoom_out, scale) framecnt_t nspp = samples_per_pixel; - if (coarser) { - nspp *= 2; + if (zoom_out) { + nspp *= scale; + if (nspp == samples_per_pixel) { + nspp *= 2.0; + } } else { - nspp /= 2; + nspp /= scale; + if (nspp == samples_per_pixel) { + nspp /= 2.0; + } } temporal_zoom (nspp); |