From 2674057ad68542c843db445475e5fcf2559f9f03 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 30 Dec 2020 22:28:02 -0700 Subject: [PATCH] prototype for new general code structure when editing TempoMap --- gtk2_ardour/editor_tempodisplay.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 6a5e8602de..e6be305562 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -415,21 +415,22 @@ Editor::mouse_add_new_tempo_event (timepos_t pos) return; } - TempoMap::SharedPtr map (TempoMap::use()); + if (pos.beats() > Beats()) { - begin_reversible_command (_("add tempo mark")); + begin_reversible_command (_("add tempo mark")); - const Beats qn = map->quarters_at (pos); + TempoMap::SharedPtr map (TempoMap::write_copy()); - if (qn > Beats()) { XMLNode &before = map->get_state(); + /* add music-locked ramped (?) tempo using the bpm/note type at sample*/ - map->set_tempo (map->tempo_at (pos), timepos_t (qn)); - + map->set_tempo (map->tempo_at (pos), pos); XMLNode &after = map->get_state(); _session->add_command (new MementoCommand (new Temporal::TempoMap::MementoBinder(), &before, &after)); commit_reversible_command (); + + TempoMap::update (map); } //map.dump (cerr);