diff options
author | Robin Gareus <robin@gareus.org> | 2016-11-14 01:40:57 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-11-14 01:40:57 +0100 |
commit | 37137d5b3c9503a0ee5f4a67b8be67304e84d77d (patch) | |
tree | 75ca3950895e2149cb71474ba58658341940cf3e /libs/ardour/lv2_plugin.cc | |
parent | da480d55405a1adc3f60fd33830dd6cebe1a83a5 (diff) |
fix LV2 state versioning with session-templates
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 8343d3c0e5..a163b879c7 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1318,6 +1318,8 @@ LV2Plugin::add_state(XMLNode* root) const if (_has_state_interface) { // Provisionally increment state version and create directory const std::string new_dir = state_dir(++_state_version); + // and keep track of it (for templates & archive) + unsigned int saved_state = _state_version;; g_mkdir_with_parents(new_dir.c_str(), 0744); LilvState* state = lilv_state_new_from_instance( @@ -1363,9 +1365,10 @@ LV2Plugin::add_state(XMLNode* root) const lilv_state_free(state); PBD::remove_directory(new_dir); --_state_version; + saved_state = _state_version; } - root->add_property("state-dir", string_compose("state%1", _state_version)); + root->add_property("state-dir", string_compose("state%1", saved_state)); } } |