Struct vst::plugin::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 HostCallback
was constructed using
Default::default()
rather than being set to the value passed to Plugin::new
.
Implementations§
source§impl HostCallback
impl HostCallback
sourcepub fn vst_version(&self) -> i32
pub fn vst_version(&self) -> i32
Get the VST API version supported by the host e.g. 2400 = VST 2.4
.
sourcepub fn raw_callback(&self) -> Option<HostCallbackProc>
pub fn raw_callback(&self) -> Option<HostCallbackProc>
Get the callback for calling host-specific extensions
sourcepub fn raw_effect(&self) -> *mut AEffect
pub fn raw_effect(&self) -> *mut AEffect
Get the effect pointer for calling host-specific extensions
Trait Implementations§
source§impl Clone for HostCallback
impl Clone for HostCallback
source§fn clone(&self) -> HostCallback
fn clone(&self) -> HostCallback
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for HostCallback
impl Default for HostCallback
HostCallback
implements Default
so that the plugin can implement Default
and have a
HostCallback
field.
source§fn default() -> HostCallback
fn default() -> HostCallback
source§impl Host for HostCallback
impl Host for HostCallback
source§fn automate(&self, index: i32, value: f32)
fn automate(&self, index: i32, value: f32)
Signal the host that the value for the parameter has changed.
Make sure to also call begin_edit
and end_edit
when a parameter
has been touched. This is important for the host to determine
if a user interaction is happening and the automation should be recorded.
source§fn begin_edit(&self, index: i32)
fn begin_edit(&self, index: i32)
Signal the host the start of a parameter change a gesture (mouse down on knob dragging).
source§fn end_edit(&self, index: i32)
fn end_edit(&self, index: i32)
Signal the host the end of a parameter change gesture (mouse up after knob dragging).
source§fn process_events(&self, events: &Events)
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.
source§fn get_time_info(&self, mask: i32) -> Option<TimeInfo>
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.
source§fn get_block_size(&self) -> isize
fn get_block_size(&self) -> isize
Get block size.
source§fn update_display(&self)
fn update_display(&self)
Refresh UI after the plugin’s parameters changed.