pub struct PluginLoader<T>
where 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§

source§

impl<T> PluginLoader<T>
where T: Host,

source

pub fn load( path: &Path, host: Arc<Mutex<T>> ) -> Result<PluginLoader<T>, PluginLoadError>

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
source

pub fn instance(&mut self) -> Result<PluginInstance, PluginLoadError>

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§

§

impl<T> RefUnwindSafe for PluginLoader<T>

§

impl<T> Send for PluginLoader<T>
where T: Send,

§

impl<T> Sync for PluginLoader<T>
where T: Send,

§

impl<T> Unpin for PluginLoader<T>

§

impl<T> UnwindSafe for PluginLoader<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<S> FromSample<S> for S

source§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

source§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,