ardour
lv2_evbuf.h
Go to the documentation of this file.
1 /*
2  Copyright 2008-2012 David Robillard <http://drobilla.net>
3 
4  Permission to use, copy, modify, and/or distribute this software for any
5  purpose with or without fee is hereby granted, provided that the above
6  copyright notice and this permission notice appear in all copies.
7 
8  THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16 
17 #ifndef LV2_EVBUF_H
18 #define LV2_EVBUF_H
19 
20 #include <stdint.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #else
25 #include <stdbool.h>
26 #endif
27 
31 typedef enum {
36 
42 
46 typedef struct LV2_Evbuf_Impl LV2_Evbuf;
47 
51 typedef struct {
53  uint32_t offset;
55 
60 LV2_Evbuf*
61 lv2_evbuf_new(uint32_t capacity,
62  LV2_Evbuf_Type type,
63  uint32_t atom_Chunk,
64  uint32_t atom_Sequence);
65 
69 void
71 
76 void
78 
86 void
87 lv2_evbuf_reset(LV2_Evbuf* evbuf, bool input);
88 
92 uint32_t
94 
98 uint32_t
100 
105 void*
107 
112 lv2_evbuf_begin(LV2_Evbuf* evbuf);
113 
118 lv2_evbuf_end(LV2_Evbuf* evbuf);
119 
124 bool
126 
134 
143 bool
145  uint32_t* frames,
146  uint32_t* subframes,
147  uint32_t* type,
148  uint32_t* size,
149  uint8_t** data);
150 
158 bool
160  uint32_t frames,
161  uint32_t subframes,
162  uint32_t type,
163  uint32_t size,
164  const uint8_t* data);
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* LV2_EVBUF_H */
LV2_Evbuf_Iterator lv2_evbuf_end(LV2_Evbuf *evbuf)
Definition: lv2_evbuf.c:144
LV2_Evbuf_Iterator lv2_evbuf_begin(LV2_Evbuf *evbuf)
Definition: lv2_evbuf.c:137
bool lv2_evbuf_is_valid(LV2_Evbuf_Iterator iter)
Definition: lv2_evbuf.c:152
LV2_Evbuf_Iterator lv2_evbuf_next(LV2_Evbuf_Iterator iter)
Definition: lv2_evbuf.c:158
LV2_Evbuf * evbuf
Definition: lv2_evbuf.h:52
LV2_Evbuf * lv2_evbuf_new(uint32_t capacity, LV2_Evbuf_Type type, uint32_t atom_Chunk, uint32_t atom_Sequence)
Definition: lv2_evbuf.c:44
LV2_Evbuf_Type
Definition: lv2_evbuf.h:31
uint32_t lv2_evbuf_get_capacity(LV2_Evbuf *evbuf)
Definition: lv2_evbuf.c:119
void lv2_evbuf_reset(LV2_Evbuf *evbuf, bool input)
Definition: lv2_evbuf.c:82
uint32_t offset
Definition: lv2_evbuf.h:53
void lv2_evbuf_free(LV2_Evbuf *evbuf)
Definition: lv2_evbuf.c:61
bool lv2_evbuf_get(LV2_Evbuf_Iterator iter, uint32_t *frames, uint32_t *subframes, uint32_t *type, uint32_t *size, uint8_t **data)
Definition: lv2_evbuf.c:185
uint32_t lv2_evbuf_get_size(LV2_Evbuf *evbuf)
Definition: lv2_evbuf.c:103
bool lv2_evbuf_write(LV2_Evbuf_Iterator *iter, uint32_t frames, uint32_t subframes, uint32_t type, uint32_t size, const uint8_t *data)
Definition: lv2_evbuf.c:230
void lv2_evbuf_set_type(LV2_Evbuf *evbuf, LV2_Evbuf_Type type)
Definition: lv2_evbuf.c:67
void * lv2_evbuf_get_buffer(LV2_Evbuf *evbuf)
Definition: lv2_evbuf.c:125