Fix VST preset deletion.
authorCarl Hetherington <carl@carlh.net>
Tue, 7 Dec 2010 20:12:47 +0000 (20:12 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 7 Dec 2010 20:12:47 +0000 (20:12 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8216 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/vst_plugin.cc

index edcb6654357ed5ebf1204ce2e5432cec528e5097..26b3ce78f60fbc55816c3ec678df1e3d20b6201d 100644 (file)
@@ -440,11 +440,19 @@ VSTPlugin::do_remove_preset (string name)
 {
        if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
 
-               /* XXX: TODO */
-               
-               error << _("no support for presets using chunks at this time")
-                     << endmsg;
-               return;
+               XMLTree* t = presets_tree ();
+               if (t == 0) {
+                       return;
+               }
+
+               t->root()->remove_nodes_and_delete (X_("label"), name);
+
+               sys::path f = ARDOUR::user_config_directory ();
+               f /= "presets";
+               f /= "vst";
+
+               t->write (f.to_string ());
+               delete t;
        }
 }