Version | 1.18.9 |
---|
Helper functions for the LV2 Event extension http://lv2plug.in/ns/ext/event.
These functions are provided for convenience only, use of them is not required for supporting lv2ev (i.e. the events extension is defined by the raw buffer format described in lv2_event.h and NOT by this API).
Note that these functions are all static inline which basically means: do not take the address of these functions.
Data Structures | |
struct | LV2_Event_Iterator |
Functions | |
static uint16_t | lv2_event_pad_size (uint16_t size) |
static void | lv2_event_buffer_reset (LV2_Event_Buffer *buf, uint16_t stamp_type, uint8_t *data) |
static LV2_Event_Buffer * | lv2_event_buffer_new (uint32_t capacity, uint16_t stamp_type) |
static bool | lv2_event_begin (LV2_Event_Iterator *iter, LV2_Event_Buffer *buf) |
static bool | lv2_event_is_valid (LV2_Event_Iterator *iter) |
static bool | lv2_event_increment (LV2_Event_Iterator *iter) |
static LV2_Event * | lv2_event_get (LV2_Event_Iterator *iter, uint8_t **data) |
static bool | lv2_event_write (LV2_Event_Iterator *iter, uint32_t frames, uint32_t subframes, uint16_t type, uint16_t size, const uint8_t *data) |
static uint8_t * | lv2_event_reserve (LV2_Event_Iterator *iter, uint32_t frames, uint32_t subframes, uint16_t type, uint16_t size) |
static bool | lv2_event_write_event (LV2_Event_Iterator *iter, const LV2_Event *ev, const uint8_t *data) |
struct LV2_Event_Iterator |
An iterator over an LV2_Event_Buffer.
Multiple simultaneous read iterators over a single buffer is fine, but changing the buffer invalidates all iterators.
Data Fields | ||
---|---|---|
LV2_Event_Buffer * | buf | |
uint32_t | offset |
|
inlinestatic |
Pad a size to 64 bits (for event sizes)
|
inlinestatic |
Initialize (empty, reset..) an existing event buffer.
The contents of buf are ignored entirely and overwritten, except capacity which is unmodified.
|
inlinestatic |
Allocate a new, empty event buffer.
|
inlinestatic |
Reset an iterator to point to the start of buf
.
iter
is valid, otherwise false (buffer is empty)
|
inlinestatic |
Check if iter
is valid.
iter
is valid, otherwise false (past end of buffer)
|
inlinestatic |
Advance iter
forward one event.
iter
must be valid.
iter
is valid, otherwise false (reached end of buffer)
|
inlinestatic |
Dereference an event iterator (get the event currently pointed at).
iter
must be valid. data
if non-NULL, will be set to point to the contents of the event returned.
iter
is currently pointing at, or NULL if the end of the buffer is reached (in which case data
is also set to NULL).
|
inlinestatic |
Write an event at iter
.
The event (if any) pointed to by iter
will be overwritten, and iter
incremented to point to the following event (i.e. several calls to this function can be done in sequence without twiddling iter in-between).
|
inlinestatic |
Reserve space for an event in the buffer and return a pointer to the memory where the caller can write the event data, or NULL if there is not enough room in the buffer.
|
inlinestatic |
Write an event at iter
.
The event (if any) pointed to by iter
will be overwritten, and iter
incremented to point to the following event (i.e. several calls to this function can be done in sequence without twiddling iter in-between).