From 722a159ac1e284aa97f5dec148fff4b87be237bc Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 21 Dec 2021 09:47:34 -0700 Subject: [PATCH] Session constructor should create a new tempo map This may be the wrong place to do this. It might be more appropriate in ::set_state(0 so that we either use existing XML state or a default tempo map --- libs/ardour/session.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 0688cbf695..b752068651 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -337,6 +337,15 @@ Session::Session (AudioEngine &eng, g_atomic_int_set (&_seek_counter, 0); g_atomic_int_set (&_butler_seek_counter, 0); + /* create a new "default" tempo map. This maybe reset/overwritten by + * the session if it already exists during ::set_state() + */ + + TempoMap::SharedPtr tmcopy (TempoMap::write_copy()); + /* this discards the copy that was made, and installs the new default tempo map */ + tmcopy = new TempoMap(); + TempoMap::update (new_tempo_map); + created_with = string_compose ("%1 %2", PROGRAM_NAME, revision); pthread_mutex_init (&_rt_emit_mutex, 0);