LMMS
Loading...
Searching...
No Matches
_LV2_Worker_Interface Struct Reference

#include <worker.h>

Public Attributes

LV2_Worker_Status(* work )(LV2_Handle instance, LV2_Worker_Respond_Function respond, LV2_Worker_Respond_Handle handle, uint32_t size, const void *data)
LV2_Worker_Status(* work_response )(LV2_Handle instance, uint32_t size, const void *body)
LV2_Worker_Status(* end_run )(LV2_Handle instance)

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

Member Data Documentation

◆ end_run

LV2_Worker_Status(* _LV2_Worker_Interface::end_run) (LV2_Handle instance)

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.

◆ work

LV2_Worker_Status(* _LV2_Worker_Interface::work) (LV2_Handle instance, LV2_Worker_Respond_Function respond, LV2_Worker_Respond_Handle handle, uint32_t size, const void *data)

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.

Parameters
instanceThe LV2 instance this is a method on.
respondA function for sending a response to run().
handleMust be passed to respond if it is called.
sizeThe size of data.
dataData from run(), or NULL.

◆ work_response

LV2_Worker_Status(* _LV2_Worker_Interface::work_response) (LV2_Handle instance, uint32_t size, const void *body)

Handle a response from the worker. This is called by the host in the run() context when a response from the worker is ready.

Parameters
instanceThe LV2 instance this is a method on.
sizeThe size of body.
bodyMessage body, or NULL.

The documentation for this struct was generated from the following file: