summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-03-29 07:19:11 +1100
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:13 +1000
commitb39db7ebeb7ab931a5528d273e65efca3d866441 (patch)
tree5afce29ae7404c4ec2e30a03909371e925841b3a /gtk2_ardour
parent29700068d711285de235012fc7e0c5a813062e8c (diff)
Tempo ramps - a saner way to snap music-locked tempos.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 4ca5462d67..5cecd952a0 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3317,7 +3317,6 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
}
framepos_t pf;
- double beat = 0.0;
Tempo const tp = _marker->tempo();
if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) {
@@ -3351,12 +3350,15 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move)
_editor->session()->tempo_map().bbt_time (pf, when);
if (_real_section->position_lock_style() == MusicTime) {
+
+ const double pulse = _editor->session()->tempo_map().predict_tempo_pulse (_real_section, Tempo (_real_section->beats_per_minute(), _real_section->note_type()), pf);
+ when = _editor->session()->tempo_map().pulse_to_bbt (pulse);
if (use_snap && _editor->snap_type() == SnapToBar) {
_editor->session()->tempo_map().round_bbt (when, -1);
} else if (use_snap) {
_editor->session()->tempo_map().round_bbt (when, _editor->get_grid_beat_divisions (0));
}
- beat = _editor->session()->tempo_map().bbt_to_beats (when);
+ const double beat = _editor->session()->tempo_map().bbt_to_beats (when);
_editor->session()->tempo_map().gui_move_tempo_beat (_real_section, tp, beat);
} else {
if (use_snap && _editor->snap_type() == SnapToBar) {