diff options
author | Robin Gareus <robin@gareus.org> | 2016-01-15 13:44:17 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-01-15 13:44:17 +0100 |
commit | d14e3ccc249e64ab48bdc9cf6be428b57d1f0bdc (patch) | |
tree | 5e589904a1c58611a27a19a676ee9420ac8ec9be /libs/ardour/lv2_plugin.cc | |
parent | 440618b463ff88bd42847456b1470479ce25871d (diff) |
force LV2 plugin-state save for templates - #6709
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 14 |
1 files 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); |