Set TempoMap after sample-rate (map uses engine-rate)

This commit is contained in:
Robin Gareus 2022-08-07 17:59:16 +02:00
parent b6921d1b14
commit 06717e9f84
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 16 additions and 15 deletions

View File

@ -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);