Ardour  9.0-pre0-582-g084a23a80d
lv2_evbuf.h
Go to the documentation of this file.
1 /*
2  Copyright 2008-2020 David Robillard <d@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 #pragma once
18 
19 #include <stdint.h>
20 
21 namespace ARDOUR {
22 
26 struct LV2_Evbuf;
27 
31 typedef struct {
32  LV2_Evbuf* evbuf;
33  uint32_t offset;
35 
40 LV2_Evbuf*
41 lv2_evbuf_new(uint32_t capacity,
42  uint32_t atom_Chunk,
43  uint32_t atom_Sequence);
44 
48 void
49 lv2_evbuf_free(LV2_Evbuf* evbuf);
50 
58 void
59 lv2_evbuf_reset(LV2_Evbuf* evbuf, bool input);
60 
64 uint32_t
65 lv2_evbuf_get_size(LV2_Evbuf* evbuf);
66 
70 uint32_t
71 lv2_evbuf_get_capacity(LV2_Evbuf* evbuf);
72 
77 void*
78 lv2_evbuf_get_buffer(LV2_Evbuf* evbuf);
79 
84 lv2_evbuf_begin(LV2_Evbuf* evbuf);
85 
90 lv2_evbuf_end(LV2_Evbuf* evbuf);
91 
96 bool
98 
106 
115 bool
117  uint32_t* samples,
118  uint32_t* subframes,
119  uint32_t* type,
120  uint32_t* size,
121  uint8_t** data);
122 
130 bool
132  uint32_t samples,
133  uint32_t subframes,
134  uint32_t type,
135  uint32_t size,
136  const uint8_t* data);
137 
138 }
void * lv2_evbuf_get_buffer(LV2_Evbuf *evbuf)
uint32_t lv2_evbuf_get_capacity(LV2_Evbuf *evbuf)
bool lv2_evbuf_is_valid(LV2_Evbuf_Iterator iter)
void lv2_evbuf_free(LV2_Evbuf *evbuf)
void lv2_evbuf_reset(LV2_Evbuf *evbuf, bool input)
LV2_Evbuf_Iterator lv2_evbuf_end(LV2_Evbuf *evbuf)
LV2_Evbuf_Iterator lv2_evbuf_begin(LV2_Evbuf *evbuf)
uint32_t lv2_evbuf_get_size(LV2_Evbuf *evbuf)
bool lv2_evbuf_get(LV2_Evbuf_Iterator iter, uint32_t *samples, uint32_t *subframes, uint32_t *type, uint32_t *size, uint8_t **data)
bool lv2_evbuf_write(LV2_Evbuf_Iterator *iter, uint32_t samples, uint32_t subframes, uint32_t type, uint32_t size, const uint8_t *data)
LV2_Evbuf * lv2_evbuf_new(uint32_t capacity, uint32_t atom_Chunk, uint32_t atom_Sequence)
LV2_Evbuf_Iterator lv2_evbuf_next(LV2_Evbuf_Iterator iter)