From 06717e9f84d3aeee8f92cb93d0775e234f871a47 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 7 Aug 2022 17:59:16 +0200 Subject: [PATCH] Set TempoMap after sample-rate (map uses engine-rate) --- libs/ardour/session_state.cc | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 5a73e05b89..755252c409 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1660,21 +1660,6 @@ Session::set_state (const XMLNode& node, int version) goto out; } - /* need the tempo map setup ASAP */ - - if ((child = find_named_node (node, "TempoMap")) == 0) { - error << _("Session: XML state has no Tempo Map section") << endmsg; - goto out; - } else { - try { - TempoMap::WritableSharedPtr tmap = TempoMap::write_copy (); /* get writable copy of current tempo map */ - tmap->set_state (*child, version); /* reset its state */ - TempoMap::update (tmap); /* update the global tempo map manager */ - } catch (...) { - goto out; - } - } - node.get_property ("name", _name); if (node.get_property (X_("sample-rate"), _base_sample_rate)) { @@ -1708,6 +1693,22 @@ Session::set_state (const XMLNode& node, int version) } } + /* need the tempo map setup ASAP */ + + if ((child = find_named_node (node, "TempoMap")) == 0) { + error << _("Session: XML state has no Tempo Map section") << endmsg; + goto out; + } else { + try { + TempoMap::WritableSharedPtr tmap = TempoMap::write_copy (); /* get writable copy of current tempo map */ + tmap->set_state (*child, version); /* reset its state */ + TempoMap::update (tmap); /* update the global tempo map manager */ + } catch (...) { + goto out; + } + } + + created_with = "unknown"; if ((child = find_named_node (node, "ProgramVersion")) != 0) { child->get_property (X_("created-with"), created_with);