diff options
author | Robin Gareus <robin@gareus.org> | 2017-01-20 00:33:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-01-20 00:50:14 +0100 |
commit | b084036c87b57c61eb80a6a4d345b8bf9b0c4857 (patch) | |
tree | 9115aa1460f23d55267e0b2dde0800bb576f4774 /libs/ardour/luaproc.cc | |
parent | 761747760921b5c6b3f4899ca1c40e9aa27bc4a0 (diff) |
Fix oddities when replacing VST-presets.
VST used the count of available of presets as URI:
- add 2 presets (1,2)
- remove first, add another one -> two presets with same URI (2,2)
PluginInfo::get_presets() simply lists all (name only) in a vector.
Plugin::find_presets() uses the URI in a map (unique by URI).
..various ensuing bugs: eg. Plugin::remove_preset() looked up by name,
but didn't check for NULL.
Diffstat (limited to 'libs/ardour/luaproc.cc')
-rw-r--r-- | libs/ardour/luaproc.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index 436f60bfc4..4bc2c00c8b 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -1141,6 +1141,9 @@ LuaProc::do_save_preset (std::string name) { return ""; } + // prevent dups -- just in case + t->root()->remove_nodes_and_delete (X_("label"), name); + std::string uri (preset_name_to_uri (name)); XMLNode* p = new XMLNode (X_("Preset")); |