diff options
author | nick_m <mainsbridge@gmail.com> | 2016-03-24 02:55:59 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:12 +1000 |
commit | 33e98186e44c479eeb2731ebc294c5925cb036c4 (patch) | |
tree | 2d72157d35cf4c4b33a6eb62a19733f4963dc1e9 /gtk2_ardour/editor_tempodisplay.cc | |
parent | 99efddb050f290c81eabc029cca07069b97fc0d1 (diff) |
Tempo ramps - small bug fixes/cleanup.
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r-- | gtk2_ardour/editor_tempodisplay.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index e1201579a6..02b7027442 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -372,12 +372,17 @@ Editor::edit_tempo_section (TempoSection* section) begin_reversible_command (_("replace tempo mark")); XMLNode &before = _session->tempo_map().get_state(); + if (tempo_dialog.get_lock_style() == MusicTime) { - _session->tempo_map().replace_tempo (*section, Tempo (bpm, nt), _session->tempo_map().pulse_at_beat (beat), tempo_dialog.get_tempo_type()); + section->set_position_lock_style (MusicTime); + framepos_t const f = _session->tempo_map().predict_tempo_frame (section, Tempo (bpm, nt), when); + double const p = _session->tempo_map().predict_tempo_pulse (section, Tempo (bpm, nt), f); + _session->tempo_map().replace_tempo (*section, Tempo (bpm, nt), p, tempo_dialog.get_tempo_type()); } else { framepos_t const f = _session->tempo_map().predict_tempo_frame (section, Tempo (bpm, nt), when); _session->tempo_map().replace_tempo (*section, Tempo (bpm, nt), f, tempo_dialog.get_tempo_type()); } + XMLNode &after = _session->tempo_map().get_state(); _session->add_command (new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after)); commit_reversible_command (); |