Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
lv2_evbuf.h
1/*
2 * SPDX-FileCopyrightText: © 2021 Alexandros Theodotou <alex@zrythm.org>
3 *
4 * SPDX-License-Identifier: LicenseRef-ZrythmLicense
5 *
6 * This file incorporates work covered by the following copyright and
7 * permission notice:
8 *
9 Copyright 2008-2014 David Robillard <http://drobilla.net>
10
11 Permission to use, copy, modify, and/or distribute this software for any
12 purpose with or without fee is hereby granted, provided that the above
13 copyright notice and this permission notice appear in all copies.
14
15 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22*/
23
24#ifndef LV2_EVBUF_H
25#define LV2_EVBUF_H
26
27#include <stdbool.h>
28#include <stdint.h>
29
30#include <lv2/atom/atom.h>
31#include <lv2/urid/urid.h>
32
36typedef struct LV2_Evbuf_Impl LV2_Evbuf;
37
41typedef struct
42{
43 LV2_Evbuf * evbuf;
44 uint32_t offset;
46
51LV2_Evbuf *
52lv2_evbuf_new (uint32_t capacity, LV2_URID atom_Chunk, LV2_URID atom_Sequence);
53
57NONNULL void
58lv2_evbuf_free (LV2_Evbuf * evbuf);
59
67NONNULL void
68lv2_evbuf_reset (LV2_Evbuf * evbuf, bool input);
69
73NONNULL uint32_t
74lv2_evbuf_get_size (LV2_Evbuf * evbuf);
75
80NONNULL LV2_Atom_Sequence *
81lv2_evbuf_get_buffer (LV2_Evbuf * evbuf);
82
87lv2_evbuf_begin (LV2_Evbuf * evbuf);
88
93lv2_evbuf_end (LV2_Evbuf * evbuf);
94
99NONNULL bool
100lv2_evbuf_is_valid (LV2_Evbuf_Iterator iter);
101
107NONNULL LV2_Evbuf_Iterator
108lv2_evbuf_next (LV2_Evbuf_Iterator iter);
109
118bool
119lv2_evbuf_get (
121 uint32_t * frames,
122 uint32_t * subframes,
123 uint32_t * type,
124 uint32_t * size,
125 uint8_t ** data);
126
134bool
135lv2_evbuf_write (
136 LV2_Evbuf_Iterator * iter,
137 uint32_t frames,
138 uint32_t subframes,
139 uint32_t type,
140 uint32_t size,
141 const uint8_t * data);
142
143#endif /* LV2_EVBUF_H */
An iterator over an LV2_Evbuf.
Definition lv2_evbuf.h:42