summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-09-07 00:18:35 +1000
committernick_m <mainsbridge@gmail.com>2016-09-07 00:18:35 +1000
commit3f4d49fd2f6fca3237668897e91212ea93b05b07 (patch)
tree081fe108242fb8f8311721385efda6a7cbad915b /libs/ardour/session_state.cc
parentd6e0e75f3ce48ba864f315e3bfcfe39275ee90bc (diff)
Load midi region length and start correctly in sessions modified by v5.0 -> 5.3-41
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 41d6d51979..48048ba764 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -1000,6 +1000,20 @@ Session::load_state (string snapshot_name)
return -1;
}
}
+ } else {
+ XMLNode* child;
+ if ((child = find_named_node (root, "ProgramVersion")) != 0) {
+ if ((prop = child->property ("modified-with")) != 0) {
+ std::string modified_with = prop->value ();
+
+ const double modified_with_version = atof (modified_with.substr ( modified_with.find(" ", 0) + 1, string::npos).c_str());
+ const int modified_with_revision = atoi (modified_with.substr (modified_with.find("-", 0) + 1, string::npos).c_str());
+
+ if (modified_with_version <= 5.3 && !(modified_with_version == 5.3 && modified_with_revision >= 42)) {
+ _midi_regions_use_bbt_beats = true;
+ }
+ }
+ }
}
save_snapshot_name (snapshot_name);