HostCallback

Struct HostCallback 

Source
pub struct HostCallback { /* private fields */ }
Expand description

A reference to the host which allows the plugin to call back and access information.

§Panics

All methods in this struct will panic if the plugin has not yet been initialized. In practice, this can only occur if the plugin queries the host for information when Default::default() is called.

struct ExamplePlugin;

impl Default for ExamplePlugin {
    fn default() -> ExamplePlugin {
        // Will panic, don't do this. If needed, you can query
        // the host during initialization via Vst::new()
        let host: HostCallback = Default::default();
        let version = host.vst_version();

        // ...
    }
}

Implementations§

Source§

impl HostCallback

Source

pub fn vst_version(&self) -> i32

Get the VST API version supported by the host e.g. 2400 = VST 2.4.

Trait Implementations§

Source§

impl Default for HostCallback

HostCallback implements Default so that the plugin can implement Default and have a HostCallback field.

Source§

fn default() -> HostCallback

Returns the “default value” for a type. Read more
Source§

impl Host for HostCallback

Source§

fn automate(&mut self, index: i32, value: f32)

Automate a parameter; the value has been changed.
Source§

fn get_plugin_id(&self) -> i32

Get the plugin ID of the currently loading plugin. Read more
Source§

fn idle(&self)

An idle call. Read more
Source§

fn get_info(&self) -> (isize, String, String)

Get vendor and product information. Read more

Auto Trait Implementations§

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<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> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.