Struct rsynth::backend::vst_backend::vst::plugin::HostCallback[]

pub struct HostCallback { /* fields omitted */ }

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

impl HostCallback

pub fn vst_version(&self) -> i32

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

pub fn raw_callback(
    &self
) -> Option<fn(*mut AEffect, i32, i32, isize, *mut c_void, f32) -> isize>

Get the callback for calling host-specific extensions

pub fn raw_effect(&self) -> *mut AEffect

Get the effect pointer for calling host-specific extensions

Trait Implementations

impl Clone for HostCallback

impl Copy for HostCallback

impl Default for HostCallback

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

impl Host for HostCallback

pub fn process_events(&self, events: &Events)

Send events to the host.

This should only be called within process or process_f64. Calling process_events anywhere else is undefined behaviour and may crash some hosts.

pub fn get_time_info(&self, mask: i32) -> Option<TimeInfo>

Request time information from Host.

The mask parameter is composed of the same flags which will be found in the flags field of TimeInfo when returned. That is, if you want the host’s tempo, the parameter passed to get_time_info() should have the TEMPO_VALID flag set. This request and delivery system is important, as a request like this may cause significant calculations at the application’s end, which may take a lot of our precious time. This obviously means you should only set those flags that are required to get the information you need.

Also please be aware that requesting information does not necessarily mean that that information is provided in return. Check the flags field in the TimeInfo structure to see if your request was actually met.

pub fn get_block_size(&self) -> isize

Get block size.

pub fn update_display(&self)

Refresh UI after the plugin’s parameters changed.

impl HostInterface for HostCallback[src]

impl Send for HostCallback

impl Sync for HostCallback

Auto Trait Implementations

impl RefUnwindSafe for HostCallback

impl Unpin for HostCallback

impl UnwindSafe for HostCallback

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<S> FromSample<S> for S

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.