- Timecode::BBT_Time bbt;
- map.bbt_time (frame, bbt);
-
- /* add new tempo section to map, ensuring we don't refer to existing tempos for snap */
-
- if (_real_section->position_lock_style() == MusicTime) {
- if (use_snap && _editor->snap_type() == SnapToBar) {
- map.round_bbt (bbt, -1, (frame > _real_section->frame()) ? RoundUpMaybe : RoundDownMaybe);
- } else if (use_snap) {
- map.round_bbt (bbt, _editor->get_grid_beat_divisions (0), RoundNearest);
- }
- double const pulse = map.predict_tempo_pulse (_real_section, map.frame_time (bbt));
- _real_section = map.add_tempo (_marker->tempo(), pulse, _real_section->type());
- } else {
- if (use_snap && _editor->snap_type() == SnapToBar) {
- map.round_bbt (bbt, -1, (frame > _real_section->frame()) ? RoundUpMaybe : RoundDownMaybe);
- } else if (use_snap) {
- map.round_bbt (bbt, _editor->get_grid_beat_divisions (0), RoundNearest);
- }
- if (use_snap) {
- frame = map.predict_tempo_frame (_real_section, bbt);
- }
- _real_section = map.add_tempo (_marker->tempo(), frame, _real_section->type());