summaryrefslogtreecommitdiff
path: root/libs/ardour/lv2_plugin.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-07-15 15:49:47 -0400
committerDavid Robillard <d@drobilla.net>2014-07-15 15:49:47 -0400
commit9869e2704a71cccf80e99c330d1b5ecb9e8e99f7 (patch)
tree472d27d67b74b47b20387e61794d862e74ea5d12 /libs/ardour/lv2_plugin.cc
parente3cf23b8a099f6afc0b3295ab8f8bf2d603a6302 (diff)
Support saving LV2 presets multiple times (fix #0005949).
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r--libs/ardour/lv2_plugin.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index 1bdb2f20d6..36f9032865 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -407,7 +407,7 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate)
throw failed_constructor();
}
-#ifdef HAVE_NEW_LILV
+#ifdef HAVE_LILV_0_16_0
// Load default state
LilvState* state = lilv_state_new_from_world(
_world.world, _uri_map.urid_map(), lilv_plugin_get_uri(_impl->plugin));
@@ -1077,6 +1077,10 @@ LV2Plugin::do_save_preset(string name)
std::string uri = Glib::filename_to_uri(Glib::build_filename(bundle, file_name));
LilvNode *node_bundle = lilv_new_uri(_world.world, Glib::filename_to_uri(Glib::build_filename(bundle, "/")).c_str());
LilvNode *node_preset = lilv_new_uri(_world.world, uri.c_str());
+#ifdef HAVE_LILV_0_19_2
+ lilv_world_unload_resource(_world.world, node_preset);
+ lilv_world_unload_bundle(_world.world, node_bundle);
+#endif
lilv_world_load_bundle(_world.world, node_bundle);
lilv_world_load_resource(_world.world, node_preset);
lilv_node_free(node_bundle);