summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-12-15 02:21:25 +0000
committerCarl Hetherington <carl@carlh.net>2010-12-15 02:21:25 +0000
commit0e74620ad469eb9d2ab9cb2f57ff650b2c796a00 (patch)
tree2fccaff29bd42ed8ce43f085aca0249ddbfecca1 /libs
parent3a1af63fedc4792a3c98de446d031bfe27e9202d (diff)
Make VST preset files pre-preset rather than global. Clean up VST preset handling to use more of the bas class' code.
git-svn-id: svn://localhost/ardour2/branches/3.0@8279 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/vst_plugin.h1
-rw-r--r--libs/ardour/vst_plugin.cc15
2 files changed, 13 insertions, 3 deletions
diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h
index b6e2a02756..e9a2c4abdf 100644
--- a/libs/ardour/ardour/vst_plugin.h
+++ b/libs/ardour/ardour/vst_plugin.h
@@ -97,6 +97,7 @@ private:
gchar* get_chunk (bool);
int set_chunk (gchar const *, bool);
XMLTree * presets_tree () const;
+ std::string presets_file () const;
FSTHandle* handle;
FST* _fst;
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index e77fc483ed..625e4482b3 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -425,8 +425,9 @@ VSTPlugin::do_save_preset (string name)
sys::path f = ARDOUR::user_config_directory ();
f /= "presets";
- f /= "vst";
+ f /= presets_file ();
+ cout << "Write presets to " << f.to_string () << "\n";
t->write (f.to_string ());
delete t;
return uri;
@@ -449,8 +450,9 @@ VSTPlugin::do_remove_preset (string name)
sys::path f = ARDOUR::user_config_directory ();
f /= "presets";
- f /= "vst";
+ f /= presets_file ();
+ cout << "Write presets to " << f.to_string () << "\n";
t->write (f.to_string ());
delete t;
}
@@ -711,7 +713,7 @@ VSTPlugin::presets_tree () const
create_directory (p);
}
- p /= "vst";
+ p /= presets_file ();
if (!exists (p)) {
t->set_root (new XMLNode (X_("VSTPresets")));
@@ -734,7 +736,14 @@ VSTPlugin::first_user_preset_index () const
return _plugin->numPrograms;
}
+string
+VSTPlugin::presets_file () const
+{
+ return string_compose ("vst-%1", unique_id ());
+}
+
VSTPluginInfo::VSTPluginInfo()
{
type = ARDOUR::VST;
}
+