Struct vst::host::PluginLoader

source ·
pub struct PluginLoader<T: Host> { /* private fields */ }
Expand description

Wrapper for an externally loaded VST plugin.

The only functionality this struct provides is loading plugins, which can be done via the load method.

Implementations§

Load a plugin at the given path with the given host.

Because of the possibility of multi-threading problems that can occur when using plugins, the host must be passed in via an Arc<Mutex<T>> object. This makes sure that even if the plugins are multi-threaded no data race issues can occur.

Upon success, this method returns a PluginLoader object which you can use to call instance to create a new instance of the plugin.

Example
// ...
let host = Arc::new(Mutex::new(MyHost::new()));

let mut plugin = PluginLoader::load(path, host.clone()).unwrap();

let instance = plugin.instance().unwrap();
// ...
Linux/Windows
  • This should be a path to the library, typically ending in .so/.dll.
  • Possible full path: /home/overdrivenpotato/.vst/u-he/Zebra2.64.so
  • Possible full path: C:\Program Files (x86)\VSTPlugins\iZotope Ozone 5.dll
OS X
  • This should point to the mach-o file within the .vst bundle.
  • Plugin: /Library/Audio/Plug-Ins/VST/iZotope Ozone 5.vst
  • Possible full path: /Library/Audio/Plug-Ins/VST/iZotope Ozone 5.vst/Contents/MacOS/PluginHooksVST

Try to create an instance of this VST plugin.

If the instance is successfully created, a PluginInstance is returned. This struct implements the Plugin trait.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.