diff options
author | David Robillard <d@drobilla.net> | 2022-05-27 13:37:07 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-05-27 13:40:33 -0400 |
commit | d22bd43dd053b060dfce40285cd968602efbce78 (patch) | |
tree | 968e688788a4da06c97cbb1bf276eaf8a1760ac6 /src/lv2_evbuf.h | |
parent | ea783414b68512c15b9523cde2bfb4f93e433d56 (diff) | |
download | jalv-d22bd43dd053b060dfce40285cd968602efbce78.tar.gz jalv-d22bd43dd053b060dfce40285cd968602efbce78.tar.bz2 jalv-d22bd43dd053b060dfce40285cd968602efbce78.zip |
Use consistent comment styles
Diffstat (limited to 'src/lv2_evbuf.h')
-rw-r--r-- | src/lv2_evbuf.h | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/src/lv2_evbuf.h b/src/lv2_evbuf.h index 40acbe5..31f3f08 100644 --- a/src/lv2_evbuf.h +++ b/src/lv2_evbuf.h @@ -1,5 +1,5 @@ /* - Copyright 2008-2014 David Robillard <d@drobilla.net> + Copyright 2008-2022 David Robillard <d@drobilla.net> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -25,14 +25,10 @@ extern "C" { # include <stdbool.h> #endif -/** - An abstract/opaque LV2 event buffer. -*/ +/// An abstract/opaque LV2 event buffer typedef struct LV2_Evbuf_Impl LV2_Evbuf; -/** - An iterator over an LV2_Evbuf. -*/ +/// An iterator over an LV2_Evbuf typedef struct { LV2_Evbuf* evbuf; uint32_t offset; @@ -40,54 +36,50 @@ typedef struct { /** Allocate a new, empty event buffer. + URIDs for atom:Chunk and atom:Sequence must be passed for LV2_EVBUF_ATOM. */ LV2_Evbuf* lv2_evbuf_new(uint32_t capacity, uint32_t atom_Chunk, uint32_t atom_Sequence); -/** - Free an event buffer allocated with lv2_evbuf_new. -*/ +/// Free an event buffer allocated with lv2_evbuf_new void lv2_evbuf_free(LV2_Evbuf* evbuf); /** Clear and initialize an existing event buffer. + The contents of buf are ignored entirely and overwritten, except capacity - which is unmodified. - If input is false and this is an atom buffer, the buffer will be prepared - for writing by the plugin. This MUST be called before every run cycle. + which is unmodified. If input is false and this is an atom buffer, the + buffer will be prepared for writing by the plugin. This MUST be called + before every run cycle. */ void lv2_evbuf_reset(LV2_Evbuf* evbuf, bool input); -/** - Return the total padded size of the events stored in the buffer. -*/ +/// Return the total padded size of the events stored in the buffer uint32_t lv2_evbuf_get_size(LV2_Evbuf* evbuf); /** Return the actual buffer implementation. + The format of the buffer returned depends on the buffer type. */ void* lv2_evbuf_get_buffer(LV2_Evbuf* evbuf); -/** - Return an iterator to the start of `evbuf`. -*/ +/// Return an iterator to the start of `evbuf` LV2_Evbuf_Iterator lv2_evbuf_begin(LV2_Evbuf* evbuf); -/** - Return an iterator to the end of `evbuf`. -*/ +/// Return an iterator to the end of `evbuf` LV2_Evbuf_Iterator lv2_evbuf_end(LV2_Evbuf* evbuf); /** Check if `iter` is valid. + @return True if `iter` is valid, otherwise false (past end of buffer) */ bool @@ -95,7 +87,9 @@ lv2_evbuf_is_valid(LV2_Evbuf_Iterator iter); /** Advance `iter` forward one event. + `iter` must be valid. + @return True if `iter` is valid, otherwise false (reached end of buffer) */ LV2_Evbuf_Iterator @@ -103,6 +97,7 @@ lv2_evbuf_next(LV2_Evbuf_Iterator iter); /** Dereference an event iterator (i.e. get the event currently pointed to). + `iter` must be valid. `type` Set to the type of the event. `size` Set to the size of the event. @@ -119,9 +114,11 @@ lv2_evbuf_get(LV2_Evbuf_Iterator iter, /** 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). + @return True if event was written, otherwise false (buffer is full). */ bool @@ -136,4 +133,4 @@ lv2_evbuf_write(LV2_Evbuf_Iterator* iter, } #endif -#endif /* LV2_EVBUF_H */ +#endif // LV2_EVBUF_H |