-/** determines if @pos is the closest frame to an exact musical division when using SnapMagnetic.
- * (SnapMagnetic may snap to an exact division or no division at all).
- * this is a hotfix for musical region position/trim. we should really
- * deliver musical divisors when snapping magnetically to avoid this.
-*/
-int32_t
-RegionDrag::current_music_divisor (framepos_t pos, int32_t button_state)
-{
- int32_t divisions = _editor->get_grid_music_divisions (button_state);
-
- if (_editor->snap_mode() == Editing::SnapMagnetic && !ArdourKeyboard::indicates_snap (button_state)) {
- TempoMap& tmap (_editor->session()->tempo_map());
- const framepos_t exact_qn_pos = tmap.frame_at_quarter_note (tmap.exact_qn_at_frame (pos, divisions));
-
- if (pos != exact_qn_pos) {
- /* magnetic has not snapped */
- divisions = 0;
- }
- }
-
- return divisions;
-}
-