Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
lv2_evbuf.h
1/*
2 * Copyright (C) 2021 Alexandros Theodotou <alex at zrythm dot org>
3 *
4 * This file is part of Zrythm
5 *
6 * Zrythm is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Zrythm is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * This file incorporates work covered by the following copyright and
20 * permission notice:
21 *
22 Copyright 2008-2014 David Robillard <http://drobilla.net>
23
24 Permission to use, copy, modify, and/or distribute this software for any
25 purpose with or without fee is hereby granted, provided that the above
26 copyright notice and this permission notice appear in all copies.
27
28 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
29 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
30 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
31 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
32 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
33 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
34 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
35*/
36
37#ifndef LV2_EVBUF_H
38#define LV2_EVBUF_H
39
40#include <stdbool.h>
41#include <stdint.h>
42
43#include <lv2/atom/atom.h>
44#include <lv2/urid/urid.h>
45
49typedef struct LV2_Evbuf_Impl LV2_Evbuf;
50
54typedef struct
55{
56 LV2_Evbuf * evbuf;
57 uint32_t offset;
59
64LV2_Evbuf *
65lv2_evbuf_new (
66 uint32_t capacity,
67 LV2_URID atom_Chunk,
68 LV2_URID atom_Sequence);
69
73NONNULL void
74lv2_evbuf_free (LV2_Evbuf * evbuf);
75
83NONNULL void
84lv2_evbuf_reset (LV2_Evbuf * evbuf, bool input);
85
89NONNULL uint32_t
90lv2_evbuf_get_size (LV2_Evbuf * evbuf);
91
96NONNULL LV2_Atom_Sequence *
97lv2_evbuf_get_buffer (LV2_Evbuf * evbuf);
98
102NONNULL LV2_Evbuf_Iterator
103lv2_evbuf_begin (LV2_Evbuf * evbuf);
104
108NONNULL LV2_Evbuf_Iterator
109lv2_evbuf_end (LV2_Evbuf * evbuf);
110
115NONNULL bool
116lv2_evbuf_is_valid (LV2_Evbuf_Iterator iter);
117
123NONNULL LV2_Evbuf_Iterator
124lv2_evbuf_next (LV2_Evbuf_Iterator iter);
125
134bool
135lv2_evbuf_get (
137 uint32_t * frames,
138 uint32_t * subframes,
139 uint32_t * type,
140 uint32_t * size,
141 uint8_t ** data);
142
150bool
151lv2_evbuf_write (
152 LV2_Evbuf_Iterator * iter,
153 uint32_t frames,
154 uint32_t subframes,
155 uint32_t type,
156 uint32_t size,
157 const uint8_t * data);
158
159#endif /* LV2_EVBUF_H */
An iterator over an LV2_Evbuf.
Definition lv2_evbuf.h:55