From 41cf86cb9f8a1256f0dd942c814333a352d260e0 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 17 May 2018 15:00:50 -0500 Subject: Playhead to Grid: handle case where PH is rolling, and we are prevented from skipping backwards sensibly. --- gtk2_ardour/editor_ops.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 7439ad353f..d730bb772a 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -7397,8 +7397,17 @@ Editor::playhead_backward_to_grid () if (pos.sample > 2) { pos.sample -= 2; snap_to_internal (pos, RoundDownAlways, SnapToGrid, false, true); - _session->request_locate (pos.sample); } + + //handle the case where we are rolling, and we're less than one-half second past the mark, we want to go to the prior mark... + //also see: jump_backward_to_mark + if (_session->transport_rolling()) { + if ((playhead_cursor->current_sample() - pos.sample) < _session->sample_rate()/2) { + snap_to_internal (pos, RoundDownAlways, SnapToGrid, false, true); + } + } + + _session->request_locate (pos.sample, _session->transport_rolling()); } /* keep PH visible in window */ -- cgit v1.2.3