From bf7d4f895edfb051a6fee02c2e59835cf6eb2196 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 4 Mar 2024 20:25:41 +0100 Subject: [PATCH] Fix jump to next/prev bar Previously this only located to the prev/next bar if the playhead was not already on a bar boundary --- gtk2_ardour/editor.cc | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 072b785986..c91f261535 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -3045,22 +3045,7 @@ Editor::_snap_to_bbt (timepos_t const & presnap, Temporal::RoundMode direction, */ if (grid_type == GridTypeBar) { - TempoMetric m (tmap->metric_at (presnap)); - BBT_Argument bbt (m.bbt_at (presnap)); - switch (direction) { - case RoundDownAlways: - bbt = BBT_Argument (bbt.reference(), bbt.round_down_to_bar ()); - break; - case RoundUpAlways: - bbt = BBT_Argument (bbt.reference(), bbt.round_up_to_bar ()); - break; - case RoundNearest: - bbt = BBT_Argument (bbt.reference(), m.round_to_bar (bbt)); - break; - default: - break; - } - return timepos_t (tmap->quarters_at (bbt)); + return timepos_t (tmap->quarters_at (presnap).round_to_subdivision (get_grid_beat_divisions(_grid_type), direction)); } if (gpref != SnapToGrid_Unscaled) { // use the visual grid lines which are limited by the zoom scale that the user selected