diff options
author | Taybin Rutkin <taybin@taybin.com> | 2006-08-03 17:17:38 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2006-08-03 17:17:38 +0000 |
commit | 5fdfe49406db9de3431b099cd89a2233f43a6163 (patch) | |
tree | 6992819edab3e8bb1a355e9aa735255bb13a5d2f /libs/ardour/vst_plugin.cc | |
parent | e46924420fb60823b96cbe297c588a32fa5cce88 (diff) |
Most PluginManager refactoring is out of the way. Time to begin on AudioUnit support for real.
git-svn-id: svn://localhost/ardour2/trunk@752 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/vst_plugin.cc')
-rw-r--r-- | libs/ardour/vst_plugin.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index 352b887e13..a551a15d28 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -479,3 +479,31 @@ 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; + + if ((handle = fst_load (info->path.c_str())) == 0) { + error << string_compose(_("VST: cannot load module from \"%1\""), info->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); + } +} |