From 027e2646165b956eb0444488df4166c46b3a1375 Mon Sep 17 00:00:00 2001 From: GZharun Date: Fri, 23 Jan 2015 19:00:26 +0200 Subject: [PATCH] [Summary] Bound waveform zoom In/Out to View->Zoom->Waveform Zoom In/Out menu items --- gtk2_ardour/editor.h | 1 + gtk2_ardour/editor_actions.cc | 4 ++-- gtk2_ardour/editor_ops.cc | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index db3b07271f..a2be9bf0ab 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -295,6 +295,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD framecnt_t get_current_zoom () const { return samples_per_pixel; } void cycle_zoom_focus (); void temporal_zoom_step (bool coarser); + void waveform_zoom_step (bool coarser); void ensure_time_axis_view_is_visible (TimeAxisView const & tav, bool at_top); void tav_zoom_step (bool coarser); void tav_zoom_smooth (bool coarser, bool force_all); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 4054587cfa..22de7861da 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -266,8 +266,8 @@ Editor::register_actions () reg_sens (editor_actions, "temporal-zoom-out", _("Zoom Out Horizontal"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), true)); reg_sens (editor_actions, "temporal-zoom-in", _("Zoom In Horizontal"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), false)); - reg_sens (editor_actions, "waveform-zoom-in", _("Waveform Zoom In"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), true)); - reg_sens (editor_actions, "waveform-zoom-out", _("Waveform Zoom Out"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), false)); + reg_sens (editor_actions, "waveform-zoom-in", _("Waveform Zoom In"), sigc::bind (sigc::mem_fun(*this, &Editor::waveform_zoom_step), true)); + reg_sens (editor_actions, "waveform-zoom-out", _("Waveform Zoom Out"), sigc::bind (sigc::mem_fun(*this, &Editor::waveform_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)); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index bc9e0ddb51..f627d818f3 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6587,6 +6587,15 @@ Editor::waveform_zoom_changed() } } +void +Editor::waveform_zoom_step(bool coarser) +{ + ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_step, coarser) + + int zoom_step = coarser ? 1 : -1; + _waves_zoom_adjustment.set_value(_waves_zoom_adjustment.get_value() + zoom_step); +} + void Editor::toggle_tracks_active () {