13
0

Fix creation of plugin presets.

git-svn-id: svn://localhost/ardour2/branches/3.0@5836 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-10-21 00:21:02 +00:00
parent bc56eb8bd7
commit e1980eb495
2 changed files with 9 additions and 9 deletions

View File

@ -136,7 +136,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual bool parameter_is_input(uint32_t) const = 0;
virtual bool parameter_is_output(uint32_t) const = 0;
virtual bool save_preset (std::string uri) = 0;
virtual bool save_preset (std::string) = 0;
virtual bool load_preset (const std::string uri);
struct PresetRecord {
@ -191,7 +191,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual void set_parameter (uint32_t which, float val) = 0;
bool save_preset (std::string uri, std::string domain /* vst, ladspa etc. */);
bool save_preset (std::string, std::string /* vst, ladspa etc. */);
ARDOUR::AudioEngine& _engine;
ARDOUR::Session& _session;

View File

@ -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)) {