- if (!_editor->snap_musical()) {
- /* snap normally (this is not self-referential).*/
- pf = adjusted_current_frame (event);
-
- } else {
- /* but this is.
- we can't use the map for anything related to tempo,
- so we round bbt using meters, which have no dependency
- on pulse for this kind of thing.
- */
- TempoMap& map (_editor->session()->tempo_map());
- Timecode::BBT_Time when;
- bool use_snap;
-
- if (ArdourKeyboard::indicates_snap (event->button.state)) {
- if (_editor->snap_mode() == Editing::SnapOff) {
- use_snap = true;
- } else {
- use_snap = false;
- }
- } else {
- if (_editor->snap_mode() == Editing::SnapOff) {
- use_snap = false;
- } else {
- use_snap = true;
- }
- }
-
- pf = adjusted_current_frame (event);
- map.bbt_time (pf, when);
-
- if (use_snap && _editor->snap_type() == SnapToBar) {
- map.round_bbt (when, -1, (pf > _real_section->frame()) ? RoundUpMaybe : RoundDownMaybe);
-
- }
- const pair<double, framepos_t> future_pos = map.predict_tempo_position (_real_section, when);
- map.gui_move_tempo (_real_section, future_pos);
+ /* snap to beat is 1, snap to bar is -1 (sorry) */
+ int sub_num = _editor->get_grid_music_divisions (event->button.state);