aboutsummaryrefslogtreecommitdiffstats
path: root/src/lv2_evbuf.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-11-07 23:13:46 +0000
committerDavid Robillard <d@drobilla.net>2011-11-07 23:13:46 +0000
commit772bdee6ee56a2655a96429aec87589371ea263b (patch)
tree4e1e1ae63f7774330e30a04218dbc1433c904ca8 /src/lv2_evbuf.h
parentbb80e20cabfaa12c9307c9c708e7de38b6588f85 (diff)
downloadjalv-772bdee6ee56a2655a96429aec87589371ea263b.tar.gz
jalv-772bdee6ee56a2655a96429aec87589371ea263b.tar.bz2
jalv-772bdee6ee56a2655a96429aec87589371ea263b.zip
Implement atom buffer.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3606 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/lv2_evbuf.h')
-rw-r--r--src/lv2_evbuf.h35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/lv2_evbuf.h b/src/lv2_evbuf.h
index 94aa1e0..7af161d 100644
--- a/src/lv2_evbuf.h
+++ b/src/lv2_evbuf.h
@@ -31,12 +31,12 @@ typedef enum {
/**
An old ev:EventBuffer (LV2_Event_Buffer).
*/
- LV2_EVBUF_EVENT_BUFFER,
+ LV2_EVBUF_EVENT,
/**
A new atom:EventBuffer (LV2_Atom_Event_Buffer).
*/
- LV2_EVBUF_ATOM_EVENT_BUFFER
+ LV2_EVBUF_ATOM
} LV2_Evbuf_Type;
/**
@@ -56,7 +56,7 @@ typedef struct {
Allocate a new, empty event buffer.
*/
LV2_Evbuf*
-lv2_evbuf_new(uint32_t capacity);
+lv2_evbuf_new(uint32_t capacity, LV2_Evbuf_Type type);
/**
Free an event buffer allocated with lv2_evbuf_new.
@@ -73,6 +73,12 @@ void
lv2_evbuf_reset(LV2_Evbuf* evbuf);
/**
+ Return the total padded size of the events stored in the buffer.
+*/
+uint32_t
+lv2_evbuf_get_size(LV2_Evbuf* evbuf);
+
+/**
Return the number of events stored in the buffer.
*/
uint32_t
@@ -89,24 +95,23 @@ lv2_evbuf_get_buffer(LV2_Evbuf* evbuf);
Reset an iterator to point to the start of @a buf.
@return True if @a iter is valid, otherwise false (buffer is empty)
*/
-bool
-lv2_evbuf_begin(LV2_Evbuf_Iterator* iter,
- LV2_Evbuf* evbuf);
+LV2_Evbuf_Iterator
+lv2_evbuf_begin(LV2_Evbuf* evbuf);
/**
Check if @a iter is valid.
@return True if @a iter is valid, otherwise false (past end of buffer)
*/
bool
-lv2_evbuf_is_valid(LV2_Evbuf_Iterator* iter);
+lv2_evbuf_is_valid(LV2_Evbuf_Iterator iter);
/**
Advance @a iter forward one event.
@a iter must be valid.
@return True if @a iter is valid, otherwise false (reached end of buffer)
*/
-bool
-lv2_evbuf_increment(LV2_Evbuf_Iterator* iter);
+LV2_Evbuf_Iterator
+lv2_evbuf_next(LV2_Evbuf_Iterator iter);
/**
Dereference an event iterator (i.e. get the event currently pointed to).
@@ -117,12 +122,12 @@ lv2_evbuf_increment(LV2_Evbuf_Iterator* iter);
@return True on success.
*/
bool
-lv2_evbuf_get(LV2_Evbuf_Iterator* iter,
- uint32_t* frames,
- uint32_t* subframes,
- uint32_t* type,
- uint32_t* size,
- uint8_t** data);
+lv2_evbuf_get(LV2_Evbuf_Iterator iter,
+ uint32_t* frames,
+ uint32_t* subframes,
+ uint32_t* type,
+ uint32_t* size,
+ uint8_t** data);
/**
Write an event at @a iter.