From d14e3ccc249e64ab48bdc9cf6be428b57d1f0bdc Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 15 Jan 2016 13:44:17 +0100 Subject: [PATCH] force LV2 plugin-state save for templates - #6709 --- libs/ardour/lv2_plugin.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index c39e40c7d5..ef247109bd 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1062,7 +1062,9 @@ LV2Plugin::add_state(XMLNode* root) const 0, NULL); - if (!_impl->state || !lilv_state_equals(state, _impl->state)) { + if (!_plugin_state_dir.empty() + || !_impl->state + || !lilv_state_equals(state, _impl->state)) { lilv_state_save(_world.world, _uri_map.urid_map(), _uri_map.urid_unmap(), @@ -1071,8 +1073,14 @@ LV2Plugin::add_state(XMLNode* root) const new_dir.c_str(), "state.ttl"); - lilv_state_free(_impl->state); - _impl->state = state; + if (_plugin_state_dir.empty()) { + // normal session save + lilv_state_free(_impl->state); + _impl->state = state; + } else { + // template save (dedicated state-dir) + lilv_state_free(state); + } } else { // State is identical, decrement version and nuke directory lilv_state_free(state);