Struct rsynth::backend::vst_backend::vst::plugin::HostCallback [−]
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>
&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
pub fn clone(&self) -> HostCallback
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for HostCallback
impl Default for HostCallback
HostCallback
implements Default
so that the plugin can implement Default
and have a
HostCallback
field.
pub fn default() -> HostCallback
impl Host for HostCallback
pub fn automate(&self, index: i32, value: f32)
pub fn get_plugin_id(&self) -> i32
pub fn idle(&self)
pub fn get_info(&self) -> (isize, String, String)
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]
fn output_initialized(&self) -> bool
[src]
fn stop(&mut self)
[src]
impl Send for HostCallback
impl Sync for HostCallback
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<S, T> Duplex<S> for T where
T: FromSample<S> + ToSample<S>,
T: FromSample<S> + ToSample<S>,
impl<T> From<T> for T
[src]
impl<S> FromSample<S> for S
pub fn from_sample_(s: S) -> S
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> ToSample<U> for T where
U: FromSample<T>,
U: FromSample<T>,
pub fn to_sample_(self) -> U
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,