summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-04-14 06:14:51 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:15 +1000
commit06f294fa1869998463210d55ab823119efd8d80b (patch)
tree08e0a1ee08d954dd60d8dd488eb8aaa5d20f1498 /gtk2_ardour/editor_tempodisplay.cc
parent932c7b07fd42fa383d772b6cb4543893ed9ea7f7 (diff)
Tempo ramps - prevent adding tempos before the first tempo.
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 4f12aadb0a..1ccd614638 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -225,13 +225,17 @@ Editor::mouse_add_new_tempo_event (framepos_t frame)
TempoMap& map(_session->tempo_map());
begin_reversible_command (_("add tempo mark"));
- XMLNode &before = map.get_state();
- /* add music-locked ramped (?) tempo using the bpm/note type at frame*/
- map.add_tempo (map.tempo_at (frame), map.pulse_at_frame (frame), TempoSection::Ramp);
+ const double pulse = map.pulse_at_frame (frame);
- XMLNode &after = map.get_state();
- _session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
- commit_reversible_command ();
+ if (pulse > 0.0) {
+ XMLNode &before = map.get_state();
+ /* add music-locked ramped (?) tempo using the bpm/note type at frame*/
+ map.add_tempo (map.tempo_at (frame), pulse, TempoSection::Ramp);
+
+ XMLNode &after = map.get_state();
+ _session->add_command(new MementoCommand<TempoMap>(map, &before, &after));
+ commit_reversible_command ();
+ }
//map.dump (cerr);
}