LMMS
Loading...
Searching...
No Matches
atom.h
Go to the documentation of this file.
1/*
2 Copyright 2008-2016 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
25
26#ifndef LV2_ATOM_H
27#define LV2_ATOM_H
28
29#include <stdint.h>
30#include <stddef.h>
31
32#define LV2_ATOM_URI "http://lv2plug.in/ns/ext/atom"
33#define LV2_ATOM_PREFIX LV2_ATOM_URI "#"
34
35#define LV2_ATOM__Atom LV2_ATOM_PREFIX "Atom"
36#define LV2_ATOM__AtomPort LV2_ATOM_PREFIX "AtomPort"
37#define LV2_ATOM__Blank LV2_ATOM_PREFIX "Blank"
38#define LV2_ATOM__Bool LV2_ATOM_PREFIX "Bool"
39#define LV2_ATOM__Chunk LV2_ATOM_PREFIX "Chunk"
40#define LV2_ATOM__Double LV2_ATOM_PREFIX "Double"
41#define LV2_ATOM__Event LV2_ATOM_PREFIX "Event"
42#define LV2_ATOM__Float LV2_ATOM_PREFIX "Float"
43#define LV2_ATOM__Int LV2_ATOM_PREFIX "Int"
44#define LV2_ATOM__Literal LV2_ATOM_PREFIX "Literal"
45#define LV2_ATOM__Long LV2_ATOM_PREFIX "Long"
46#define LV2_ATOM__Number LV2_ATOM_PREFIX "Number"
47#define LV2_ATOM__Object LV2_ATOM_PREFIX "Object"
48#define LV2_ATOM__Path LV2_ATOM_PREFIX "Path"
49#define LV2_ATOM__Property LV2_ATOM_PREFIX "Property"
50#define LV2_ATOM__Resource LV2_ATOM_PREFIX "Resource"
51#define LV2_ATOM__Sequence LV2_ATOM_PREFIX "Sequence"
52#define LV2_ATOM__Sound LV2_ATOM_PREFIX "Sound"
53#define LV2_ATOM__String LV2_ATOM_PREFIX "String"
54#define LV2_ATOM__Tuple LV2_ATOM_PREFIX "Tuple"
55#define LV2_ATOM__URI LV2_ATOM_PREFIX "URI"
56#define LV2_ATOM__URID LV2_ATOM_PREFIX "URID"
57#define LV2_ATOM__Vector LV2_ATOM_PREFIX "Vector"
58#define LV2_ATOM__atomTransfer LV2_ATOM_PREFIX "atomTransfer"
59#define LV2_ATOM__beatTime LV2_ATOM_PREFIX "beatTime"
60#define LV2_ATOM__bufferType LV2_ATOM_PREFIX "bufferType"
61#define LV2_ATOM__childType LV2_ATOM_PREFIX "childType"
62#define LV2_ATOM__eventTransfer LV2_ATOM_PREFIX "eventTransfer"
63#define LV2_ATOM__frameTime LV2_ATOM_PREFIX "frameTime"
64#define LV2_ATOM__supports LV2_ATOM_PREFIX "supports"
65#define LV2_ATOM__timeUnit LV2_ATOM_PREFIX "timeUnit"
66
67#define LV2_ATOM_REFERENCE_TYPE 0
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
76 ((sizeof(double) <= sizeof(uint64_t)) * 2) - 1];
78
85#define LV2_ATOM_CONTENTS(type, atom) \
86 ((uint8_t*)(atom) + sizeof(type))
87
91#define LV2_ATOM_CONTENTS_CONST(type, atom) \
92 ((const uint8_t*)(atom) + sizeof(type))
93
98#define LV2_ATOM_BODY(atom) LV2_ATOM_CONTENTS(LV2_Atom, atom)
99
103#define LV2_ATOM_BODY_CONST(atom) LV2_ATOM_CONTENTS_CONST(LV2_Atom, atom)
104
106typedef struct {
109} LV2_Atom;
110
116
118typedef struct {
120 int64_t body;
122
124typedef struct {
126 float body;
128
130typedef struct {
132 double body;
134
137
143
145typedef struct {
147 /* Contents (a null-terminated UTF-8 string) follow here. */
149
151typedef struct {
154 /* Contents (a null-terminated UTF-8 string) follow here. */
156
162
164typedef struct {
166 /* Contents (a series of complete atoms) follow here. */
168
170typedef struct {
173 /* Contents (a series of packed atom bodies) follow here. */
175
181
183typedef struct {
187 /* Value atom body follows here. */
189
195
197typedef struct {
200 /* Contents (a series of property bodies) follow here. */
202
208
210typedef struct {
212 union {
213 int64_t frames;
214 double beats;
215 } time;
217 /* Body atom contents follow here. */
219
236typedef struct {
239 /* Contents (a series of events) follow here. */
241
247
251
252#ifdef __cplusplus
253} /* extern "C" */
254#endif
255
256#endif /* LV2_ATOM_H */
LV2_Atom_Int LV2_Atom_Bool
Definition atom.h:136
char lv2_atom_assert_double_fits_in_64_bits[((sizeof(double)<=sizeof(uint64_t)) *2) - 1]
Definition lv2_atom.h:71
int int32_t
Definition mid.cpp:97
unsigned int uint32_t
Definition mid.cpp:100
Definition atom.h:130
double body
Definition atom.h:132
LV2_Atom atom
Definition atom.h:131
Definition atom.h:210
int64_t frames
Definition atom.h:213
LV2_Atom body
Definition atom.h:216
double beats
Definition atom.h:214
Definition atom.h:124
float body
Definition atom.h:126
LV2_Atom atom
Definition atom.h:125
Definition atom.h:112
int32_t body
Definition atom.h:114
LV2_Atom atom
Definition atom.h:113
Definition atom.h:151
uint32_t datatype
Definition atom.h:152
uint32_t lang
Definition atom.h:153
Definition atom.h:158
LV2_Atom atom
Definition atom.h:159
LV2_Atom_Literal_Body body
Definition atom.h:160
Definition atom.h:118
LV2_Atom atom
Definition atom.h:119
int64_t body
Definition atom.h:120
Definition atom.h:197
uint32_t id
Definition atom.h:198
uint32_t otype
Definition atom.h:199
Definition atom.h:204
LV2_Atom atom
Definition atom.h:205
LV2_Atom_Object_Body body
Definition atom.h:206
Definition atom.h:183
LV2_Atom value
Definition atom.h:186
uint32_t key
Definition atom.h:184
uint32_t context
Definition atom.h:185
Definition atom.h:191
LV2_Atom atom
Definition atom.h:192
LV2_Atom_Property_Body body
Definition atom.h:193
Definition atom.h:236
uint32_t pad
Definition atom.h:238
uint32_t unit
Definition atom.h:237
Definition atom.h:243
LV2_Atom atom
Definition atom.h:244
LV2_Atom_Sequence_Body body
Definition atom.h:245
Definition atom.h:145
LV2_Atom atom
Definition atom.h:146
Definition atom.h:164
LV2_Atom atom
Definition atom.h:165
Definition atom.h:139
uint32_t body
Definition atom.h:141
LV2_Atom atom
Definition atom.h:140
Definition atom.h:170
uint32_t child_type
Definition atom.h:172
uint32_t child_size
Definition atom.h:171
Definition atom.h:177
LV2_Atom atom
Definition atom.h:178
LV2_Atom_Vector_Body body
Definition atom.h:179
Definition atom.h:106
uint32_t size
Definition atom.h:107
uint32_t type
Definition atom.h:108