summaryrefslogtreecommitdiff
path: root/libs/ardour/vst_plugin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r--libs/ardour/vst_plugin.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index 352b887e13..4c09ba3440 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -479,3 +479,33 @@ VSTPlugin::print_parameter (uint32_t param, char *buf, uint32_t len) const
memmove (buf, first_nonws, strlen (buf) - (first_nonws - buf) + 1);
}
+
+PluginPtr
+VSTPluginInfo::load (Session& session)
+{
+ try {
+ PluginPtr plugin;
+
+ if (Config->get_use_vst()) {
+ FSTHandle* handle;
+
+ handle = fst_load(path.c_str());
+
+ if ( (int)handle == -1) {
+ error << string_compose(_("VST: cannot load module from \"%1\""), path) << endmsg;
+ } else {
+ plugin.reset (new VSTPlugin (session.engine(), session, handle));
+ }
+ } else {
+ error << _("You asked ardour to not use any VST plugins") << endmsg;
+ return PluginPtr ((Plugin*) 0);
+ }
+
+ plugin->set_info(PluginInfoPtr(new VSTPluginInfo(*this)));
+ return plugin;
+ }
+
+ catch (failed_constructor &err) {
+ return PluginPtr ((Plugin*) 0);
+ }
+}