LV2_Descriptor.connect_port

Connect a port on a plugin instance to a memory location.

Plugin writers should be aware that the host may elect to use the same buffer for more than one port and even use the same buffer for both input and output (see lv2:inPlaceBroken in lv2.ttl).

If the plugin has the feature lv2:hardRTCapable then there are various things that the plugin MUST NOT do within the connect_port() function; see lv2core.ttl for details.

connect_port() MUST be called at least once for each port before run() is called, unless that port is lv2:connectionOptional. The plugin must pay careful attention to the block size passed to run() since the block allocated may only just be large enough to contain the data, and is not guaranteed to remain constant between run() calls.

connect_port() may be called more than once for a plugin instance to allow the host to change the buffers that the plugin is reading or writing. These calls may be made before or after activate() or deactivate() calls.

@param instance Plugin instance containing the port.

@param port Index of the port to connect. The host MUST NOT try to connect a port index that is not defined in the plugin's RDF data. If it does, the plugin's behaviour is undefined (a crash is likely).

@param data_location Pointer to data of the type defined by the port type in the plugin's RDF data (e.g. an array of float for an lv2:AudioPort). This pointer must be stored by the plugin instance and used to read/write data when run() is called. Data present at the time of the connect_port() call MUST NOT be considered meaningful.

struct LV2_Descriptor
extern (C) nothrow @nogc
void function(LV2_Handle instance, uint32_t port, void* data_location) connect_port;

Meta