[][src]Struct 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.

This example panics
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[src]

pub fn vst_version(&self) -> i32[src]

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

pub fn raw_callback(&self) -> Option<HostCallbackProc>[src]

Get the callback for calling host-specific extensions

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

Get the effect pointer for calling host-specific extensions

Trait Implementations

impl Clone for HostCallback[src]

impl Copy for HostCallback[src]

impl Default for HostCallback[src]

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

impl Host for HostCallback[src]

fn process_events(&self, events: &Events)[src]

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.

fn get_time_info(&self, mask: i32) -> Option<TimeInfo>[src]

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.

fn get_block_size(&self) -> isize[src]

Get block size.

fn update_display(&self)[src]

Refresh UI after the plugin's parameters changed.

impl Send for HostCallback[src]

impl Sync for HostCallback[src]

Auto Trait Implementations

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<T> From<T> for T[src]

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