#[repr(C)]pub struct LV2_Worker_Interface {
pub work: Option<unsafe extern "C" fn(instance: LV2_Handle, respond: LV2_Worker_Respond_Function, handle: LV2_Worker_Respond_Handle, size: u32, data: *const c_void) -> LV2_Worker_Status>,
pub work_response: Option<unsafe extern "C" fn(instance: LV2_Handle, size: u32, body: *const c_void) -> LV2_Worker_Status>,
pub end_run: Option<unsafe extern "C" fn(instance: LV2_Handle) -> LV2_Worker_Status>,
}Expand description
Plugin Worker Interface.
This is the interface provided by the plugin to implement a worker method. The plugin’s extension_data() method should return an LV2_Worker_Interface when called with LV2_WORKER__interface as its argument.
Fields§
§work: Option<unsafe extern "C" fn(instance: LV2_Handle, respond: LV2_Worker_Respond_Function, handle: LV2_Worker_Respond_Handle, size: u32, data: *const c_void) -> LV2_Worker_Status>The worker method. This is called by the host in a non-realtime context as requested, possibly with an arbitrary message to handle.
A response can be sent to run() using respond. The plugin MUST NOT
make any assumptions about which thread calls this method, except that
there are no real-time requirements and only one call may be executed at
a time. That is, the host MAY call this method from any non-real-time
thread, but MUST NOT make concurrent calls to this method from several
threads.
@param instance The LV2 instance this is a method on.
@param respond A function for sending a response to run().
@param handle Must be passed to respond if it is called.
@param size The size of data.
@param data Data from run(), or NULL.
work_response: Option<unsafe extern "C" fn(instance: LV2_Handle, size: u32, body: *const c_void) -> LV2_Worker_Status>Handle a response from the worker. This is called by the host in the run() context when a response from the worker is ready.
@param instance The LV2 instance this is a method on.
@param size The size of body.
@param body Message body, or NULL.
end_run: Option<unsafe extern "C" fn(instance: LV2_Handle) -> LV2_Worker_Status>Called when all responses for this cycle have been delivered.
Since work_response() may be called after run() finished, this provides a hook for code that must run after the cycle is completed.
This field may be NULL if the plugin has no use for it. Otherwise, the host MUST call it after every run(), regardless of whether or not any responses were sent that cycle.
Trait Implementations§
Source§impl Clone for LV2_Worker_Interface
impl Clone for LV2_Worker_Interface
Source§fn clone(&self) -> LV2_Worker_Interface
fn clone(&self) -> LV2_Worker_Interface
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more