summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-01-15 13:44:17 +0100
committerRobin Gareus <robin@gareus.org>2016-01-15 13:44:17 +0100
commitd14e3ccc249e64ab48bdc9cf6be428b57d1f0bdc (patch)
tree5e589904a1c58611a27a19a676ee9420ac8ec9be /libs/ardour
parent440618b463ff88bd42847456b1470479ce25871d (diff)
force LV2 plugin-state save for templates - #6709
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/lv2_plugin.cc14
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);