summaryrefslogtreecommitdiff
path: root/libs/ardour/plugin.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-10-21 00:21:02 +0000
committerCarl Hetherington <carl@carlh.net>2009-10-21 00:21:02 +0000
commite1980eb495c9682794be28cad8bd15b37806d8c3 (patch)
tree3c83e2e9f0825627dbcc0dbe46a9b26a30766cbf /libs/ardour/plugin.cc
parentbc56eb8bd73c7b456b646ba0cc627d449baa37f2 (diff)
Fix creation of plugin presets.
git-svn-id: svn://localhost/ardour2/branches/3.0@5836 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/plugin.cc')
-rw-r--r--libs/ardour/plugin.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc
index 6778a3af19..4971c57deb 100644
--- a/libs/ardour/plugin.cc
+++ b/libs/ardour/plugin.cc
@@ -161,7 +161,7 @@ Plugin::load_preset(const string preset_uri)
}
bool
-Plugin::save_preset (string uri, string domain)
+Plugin::save_preset (string name, string domain)
{
lrdf_portvalue portvalues[parameter_count()];
lrdf_defaults defaults;
@@ -197,12 +197,12 @@ Plugin::save_preset (string uri, string domain)
string source(string_compose("file:%1/.%2/rdf/ardour-presets.n3", envvar, domain));
- map<string,PresetRecord>::const_iterator pr = presets.find(uri);
- if (pr == presets.end()) {
- warning << _("Could not find preset ") << uri << endmsg;
- return false;
- }
- free(lrdf_add_preset(source.c_str(), pr->second.label.c_str(), id, &defaults));
+ char* uri = lrdf_add_preset (source.c_str(), name.c_str(), id, &defaults);
+
+ /* XXX: why is the uri apparently kept as the key in the `presets' map and also in the PresetRecord? */
+
+ presets.insert (make_pair (uri, PresetRecord (uri, name)));
+ free (uri);
string path = string_compose("%1/.%2", envvar, domain);
if (g_mkdir_with_parents (path.c_str(), 0775)) {