diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h index f78f3e687c..a72b625288 100644 --- a/libs/ardour/ardour/vst_plugin.h +++ b/libs/ardour/ardour/vst_plugin.h @@ -81,6 +81,7 @@ class VSTPlugin : public ARDOUR::Plugin bool load_preset (const std::string& preset_label); bool save_preset (std::string name); + void remove_preset (std::string name); bool has_editor () const; diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index ee7c165fb3..d01a70239a 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -182,7 +182,7 @@ VSTPlugin::get_state() for (int32_t n = 0; n < _plugin->numParams; ++n) { char index[64]; char val[32]; - snprintf (index, sizeof (index), "param_%ld", n); + snprintf (index, sizeof (index), "param_%d", n); snprintf (val, sizeof (val), "%.12g", _plugin->getParameter (_plugin, n)); parameters->add_property (index, val); } @@ -349,6 +349,17 @@ VSTPlugin::save_preset (string name) return Plugin::save_preset (name, "vst"); } +void +VSTPlugin::remove_preset (string name) +{ + if (_plugin->flags & 32 /* effFlagsProgramsChunks */) { + error << _("no support for presets using chunks at this time") + << endmsg; + return; + } + Plugin::remove_preset (name, "vst"); +} + string VSTPlugin::describe_parameter (Evoral::Parameter param) {