From 7244b03385ed656f839a0366b934b1f42f550452 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 15 Mar 2021 19:54:02 -0600 Subject: [PATCH] convert NoteCreateDrag::grid_aligned_beats() into a proxy for Editor::snap_to_bbt() --- gtk2_ardour/editor_drag.cc | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 2967441bd8..7dd651e531 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -6957,25 +6957,7 @@ NoteCreateDrag::~NoteCreateDrag () Temporal::Beats NoteCreateDrag::grid_aligned_beats (timepos_t const & pos, GdkEvent const * event) const { - Temporal::Beats beats; - - TempoMap::SharedPtr map (TempoMap::use()); - const int32_t divisions = _editor->get_grid_music_divisions (event->button.state); - - switch (divisions) { - case 0: /* no rounding */ - case 1: /* round to beat */ - beats = pos.beats (); - break; - case -1: /* round to bar */ - beats = map->quarters_at (map->metric_at (pos).meter().round_to_bar (map->bbt_at (pos))); - break; - default: /* round to some beat subdivision */ - beats = pos.beats().round_to_subdivision (divisions, Temporal::RoundNearest); - break; - } - - return beats; + return _editor->snap_to_bbt (pos, RoundNearest, SnapToGrid_Unscaled).beats (); } void