LV2  1.0.13
Data Fields
LV2_Event_Buffer Struct Reference

A buffer of LV2 events (header only). More...

Data Fields

uint8_t * data
 The contents of the event buffer.
 
uint16_t header_size
 The size of this event header in bytes (including everything).
 
uint16_t stamp_type
 The type of the time stamps for events in this buffer.
 
uint32_t event_count
 The number of events in this buffer.
 
uint32_t capacity
 The size of the data buffer in bytes.
 
uint32_t size
 The size of the initial portion of the data buffer containing data.
 

Detailed Description

A buffer of LV2 events (header only).

Like events (which this contains) an event buffer is a single chunk of POD: the entire buffer (including contents) can be copied with a single memcpy. The first contained event begins sizeof(LV2_EventBuffer) bytes after the start of this struct.

After this header, the buffer contains an event header (defined by struct LV2_Event), followed by that event's contents (padded to 64 bits), followed by another header, etc:

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ...

Field Documentation

uint8_t* LV2_Event_Buffer::data

The contents of the event buffer.

This may or may not reside in the same block of memory as this header, plugins must not assume either. The host guarantees this points to at least capacity bytes of allocated memory (though only size bytes of that are valid events).

uint16_t LV2_Event_Buffer::header_size

The size of this event header in bytes (including everything).

This is to allow for extending this header in the future without breaking binary compatibility. Whenever this header is copied, it MUST be done using this field (and NOT the sizeof this struct).

uint16_t LV2_Event_Buffer::stamp_type

The type of the time stamps for events in this buffer.

As a special exception, '0' always means audio frames and subframes (1/UINT32_MAX'th of a frame) in the sample rate passed to instantiate.

INPUTS: The host must set this field to the numeric ID of some URI defining the meaning of the frames/subframes fields of contained events (obtained by the LV2 URI Map uri_to_id function with the URI of this extension as the 'map' argument, see lv2_uri_map.h). The host must never pass a plugin a buffer which uses a stamp type the plugin does not 'understand'. The value of this field must never change, except when connect_port is called on the input port, at which time the host MUST have set the stamp_type field to the value that will be used for all subsequent run calls.

OUTPUTS: The plugin may set this to any value that has been returned from uri_to_id with the URI of this extension for a 'map' argument. When connected to a buffer with connect_port, output ports MUST set this field to the type of time stamp they will be writing. On any call to connect_port on an event input port, the plugin may change this field on any output port, it is the responsibility of the host to check if any of these values have changed and act accordingly.

uint32_t LV2_Event_Buffer::event_count

The number of events in this buffer.

INPUTS: The host must set this field to the number of events contained in the data buffer before calling run(). The plugin must not change this field.

OUTPUTS: The plugin must set this field to the number of events it has written to the buffer before returning from run(). Any initial value should be ignored by the plugin.

uint32_t LV2_Event_Buffer::capacity

The size of the data buffer in bytes.

This is set by the host and must not be changed by the plugin. The host is allowed to change this between run() calls.

uint32_t LV2_Event_Buffer::size

The size of the initial portion of the data buffer containing data.

INPUTS: The host must set this field to the number of bytes used by all events it has written to the buffer (including headers) before calling the plugin's run(). The plugin must not change this field.

OUTPUTS: The plugin must set this field to the number of bytes used by all events it has written to the buffer (including headers) before returning from run(). Any initial value should be ignored by the plugin.


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