From a5d90c3d9d3cbace6dada563a7a2b0e3458bbef1 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Tue, 8 May 2018 08:42:57 -0500 Subject: [PATCH] Arrow keys (playhead_x_to_grid()) should move the view along with it. This is more consistent with jog-wheel operation, which has proven to work nicely. --- gtk2_ardour/editor_ops.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 7ac2e08390..36a67d0a01 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -7357,6 +7357,11 @@ Editor::playhead_forward_to_grid () snap_to_internal (pos, RoundUpAlways, SnapToGrid, false, true); _session->request_locate (pos.sample); } + + /* keep PH visible in window */ + if (pos.sample > (_leftmost_sample + current_page_samples() *0.9)) { + reset_x_origin (pos.sample - (current_page_samples()*0.9)); + } } @@ -7374,6 +7379,11 @@ Editor::playhead_backward_to_grid () snap_to_internal (pos, RoundDownAlways, SnapToGrid, false, true); _session->request_locate (pos.sample); } + + /* keep PH visible in window */ + if (pos.sample < (_leftmost_sample + current_page_samples() *0.1)) { + reset_x_origin (pos.sample - (current_page_samples()*0.1)); + } } void