diff options
author | nick_m <mainsbridge@gmail.com> | 2016-03-29 02:23:29 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:12 +1000 |
commit | daa07ce6e0303b27fb396be26007c18267ffb867 (patch) | |
tree | 6319f02b22f33d45c5e0987cbebcf47f8217d28c /gtk2_ardour/editor_drag.cc | |
parent | 59df9880a4639aea00d88f2ceb2b04d424b574a6 (diff) |
Tempo ramps - tempos now musically snap to their future.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 15246fb8fe..3305bfd040 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3316,7 +3316,20 @@ TempoMarkerDrag::motion (GdkEvent* event, bool first_move) _marker->hide(); } - framepos_t const pf = adjusted_current_frame (event); + framepos_t pf; + if (!_editor->snap_musical()) { + pf = adjusted_current_frame (event); + } else { + pf = adjusted_current_frame (event); + Timecode::BBT_Time when; + _editor->session()->tempo_map().bbt_time (pf, when); + if (_editor->snap_type() == SnapToBar) { + _editor->session()->tempo_map().round_bbt (when, -1); + } else { + _editor->session()->tempo_map().round_bbt (when, _editor->get_grid_beat_divisions (0)); + } + pf = _editor->session()->tempo_map().predict_tempo_frame (_real_section, Tempo (_real_section->beats_per_minute(), _real_section->note_type()), when); + } Tempo const tp = _marker->tempo(); if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::constraint_modifier ())) { |