Playhead to Grid: handle case where PH is rolling, and we are prevented from skipping...
authorBen Loftis <ben@harrisonconsoles.com>
Thu, 17 May 2018 20:00:50 +0000 (15:00 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Thu, 17 May 2018 20:01:09 +0000 (15:01 -0500)
gtk2_ardour/editor_ops.cc

index 7439ad353f57ec324616dea5ae9b21b2564bca83..d730bb772aeebe5e34df786e49046435e548811a 100644 (file)
@@ -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 */