summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-01-29 23:20:37 +0100
committerRobin Gareus <robin@gareus.org>2020-01-29 23:20:37 +0100
commit51d2bb36ceec7386370f1999952b04bec291f312 (patch)
treeda598a912e3f3a7eeb8d59dd57b1443d9cd9066e /libs/ardour/route.cc
parent015d4d364267155316eed01345f49421ba29b91d (diff)
Save/Use state-version with route templates
Currently using Ardour-5 route templates (state version "3002") with Ardour6 fails. As opposed to session-templates, Route templates were not versioned. This ensures future compatibility (and may allow to interpret unversioned templates as "3002")
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 0b67528ac9..0b684f560c 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -2494,6 +2494,7 @@ Route::state (bool save_template)
std::string modified_with = string_compose ("%1 %2", PROGRAM_NAME, revision);
child->set_property("modified-with", modified_with);
+ node->set_property("version", CURRENT_SESSION_FILE_VERSION);
}
node->set_property (X_("id"), id ());
@@ -2589,6 +2590,9 @@ Route::state (bool save_template)
int
Route::set_state (const XMLNode& node, int version)
{
+ /* when loading a template, use the version of the Route (if available) */
+ node.get_property (X_("version"), version);
+
if (version < 3000) {
return set_state_2X (node, version);
}