Add initial bits for Qt6 support
[carla.git] / source / includes / lv2_rdf.hpp
blobac2eb73153e989dbcee0fc8d4a009f5411dec5ee
1 /*
2 * Custom types to store LV2 information
3 * Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #ifndef LV2_RDF_HPP_INCLUDED
19 #define LV2_RDF_HPP_INCLUDED
21 #include "CarlaDefines.h"
23 #ifdef CARLA_PROPER_CPP11_SUPPORT
24 # include <cstdint>
25 #else
26 # include <stdint.h>
27 #endif
29 // Base Types
30 typedef const char* LV2_URI;
31 typedef uint32_t LV2_Property;
32 #define LV2UI_INVALID_PORT_INDEX ((uint32_t)-1)
34 // Parameter FLAGS
35 #define LV2_PARAMETER_FLAG_INPUT 0x1
36 #define LV2_PARAMETER_FLAG_OUTPUT 0x2
38 // Parameter Types
39 #define LV2_PARAMETER_TYPE_BOOL 1
40 #define LV2_PARAMETER_TYPE_INT 2
41 #define LV2_PARAMETER_TYPE_LONG 3
42 #define LV2_PARAMETER_TYPE_FLOAT 4
43 #define LV2_PARAMETER_TYPE_DOUBLE 5
44 #define LV2_PARAMETER_TYPE_PATH 6
45 #define LV2_PARAMETER_TYPE_STRING 7
47 // Port Midi Map Types
48 #define LV2_PORT_MIDI_MAP_CC 1
49 #define LV2_PORT_MIDI_MAP_NRPN 2
51 #define LV2_IS_PORT_MIDI_MAP_CC(x) ((x) == LV2_PORT_MIDI_MAP_CC)
52 #define LV2_IS_PORT_MIDI_MAP_NRPN(x) ((x) == LV2_PORT_MIDI_MAP_NRPN)
54 // Port Point Hints
55 #define LV2_PORT_POINT_DEFAULT 0x1
56 #define LV2_PORT_POINT_MINIMUM 0x2
57 #define LV2_PORT_POINT_MAXIMUM 0x4
59 #define LV2_HAVE_DEFAULT_PORT_POINT(x) ((x) & LV2_PORT_POINT_DEFAULT)
60 #define LV2_HAVE_MINIMUM_PORT_POINT(x) ((x) & LV2_PORT_POINT_MINIMUM)
61 #define LV2_HAVE_MAXIMUM_PORT_POINT(x) ((x) & LV2_PORT_POINT_MAXIMUM)
63 // Port Unit Hints
64 #define LV2_PORT_UNIT_NAME 0x1
65 #define LV2_PORT_UNIT_RENDER 0x2
66 #define LV2_PORT_UNIT_SYMBOL 0x4
67 #define LV2_PORT_UNIT_UNIT 0x8
69 #define LV2_HAVE_PORT_UNIT_NAME(x) ((x) & LV2_PORT_UNIT_NAME)
70 #define LV2_HAVE_PORT_UNIT_RENDER(x) ((x) & LV2_PORT_UNIT_RENDER)
71 #define LV2_HAVE_PORT_UNIT_SYMBOL(x) ((x) & LV2_PORT_UNIT_SYMBOL)
72 #define LV2_HAVE_PORT_UNIT_UNIT(x) ((x) & LV2_PORT_UNIT_UNIT)
74 // Port Unit Unit
75 #define LV2_PORT_UNIT_BAR 1
76 #define LV2_PORT_UNIT_BEAT 2
77 #define LV2_PORT_UNIT_BPM 3
78 #define LV2_PORT_UNIT_CENT 4
79 #define LV2_PORT_UNIT_CM 5
80 #define LV2_PORT_UNIT_COEF 6
81 #define LV2_PORT_UNIT_DB 7
82 #define LV2_PORT_UNIT_DEGREE 8
83 #define LV2_PORT_UNIT_FRAME 9
84 #define LV2_PORT_UNIT_HZ 10
85 #define LV2_PORT_UNIT_INCH 11
86 #define LV2_PORT_UNIT_KHZ 12
87 #define LV2_PORT_UNIT_KM 13
88 #define LV2_PORT_UNIT_M 14
89 #define LV2_PORT_UNIT_MHZ 15
90 #define LV2_PORT_UNIT_MIDINOTE 16
91 #define LV2_PORT_UNIT_MILE 17
92 #define LV2_PORT_UNIT_MIN 18
93 #define LV2_PORT_UNIT_MM 19
94 #define LV2_PORT_UNIT_MS 20
95 #define LV2_PORT_UNIT_OCT 21
96 #define LV2_PORT_UNIT_PC 22
97 #define LV2_PORT_UNIT_S 23
98 #define LV2_PORT_UNIT_SEMITONE 24
99 #define LV2_PORT_UNIT_VOLTS 25
101 #define LV2_IS_PORT_UNIT_BAR(x) ((x) == LV2_PORT_UNIT_BAR)
102 #define LV2_IS_PORT_UNIT_BEAT(x) ((x) == LV2_PORT_UNIT_BEAT)
103 #define LV2_IS_PORT_UNIT_BPM(x) ((x) == LV2_PORT_UNIT_BPM)
104 #define LV2_IS_PORT_UNIT_CENT(x) ((x) == LV2_PORT_UNIT_CENT)
105 #define LV2_IS_PORT_UNIT_CM(x) ((x) == LV2_PORT_UNIT_CM)
106 #define LV2_IS_PORT_UNIT_COEF(x) ((x) == LV2_PORT_UNIT_COEF)
107 #define LV2_IS_PORT_UNIT_DB(x) ((x) == LV2_PORT_UNIT_DB)
108 #define LV2_IS_PORT_UNIT_DEGREE(x) ((x) == LV2_PORT_UNIT_DEGREE)
109 #define LV2_IS_PORT_UNIT_FRAME(x) ((x) == LV2_PORT_UNIT_FRAME)
110 #define LV2_IS_PORT_UNIT_HZ(x) ((x) == LV2_PORT_UNIT_HZ)
111 #define LV2_IS_PORT_UNIT_INCH(x) ((x) == LV2_PORT_UNIT_INCH)
112 #define LV2_IS_PORT_UNIT_KHZ(x) ((x) == LV2_PORT_UNIT_KHZ)
113 #define LV2_IS_PORT_UNIT_KM(x) ((x) == LV2_PORT_UNIT_KM)
114 #define LV2_IS_PORT_UNIT_M(x) ((x) == LV2_PORT_UNIT_M)
115 #define LV2_IS_PORT_UNIT_MHZ(x) ((x) == LV2_PORT_UNIT_MHZ)
116 #define LV2_IS_PORT_UNIT_MIDINOTE(x) ((x) == LV2_PORT_UNIT_MIDINOTE)
117 #define LV2_IS_PORT_UNIT_MILE(x) ((x) == LV2_PORT_UNIT_MILE)
118 #define LV2_IS_PORT_UNIT_MIN(x) ((x) == LV2_PORT_UNIT_MIN)
119 #define LV2_IS_PORT_UNIT_MM(x) ((x) == LV2_PORT_UNIT_MM)
120 #define LV2_IS_PORT_UNIT_MS(x) ((x) == LV2_PORT_UNIT_MS)
121 #define LV2_IS_PORT_UNIT_OCT(x) ((x) == LV2_PORT_UNIT_OCT)
122 #define LV2_IS_PORT_UNIT_PC(x) ((x) == LV2_PORT_UNIT_PC)
123 #define LV2_IS_PORT_UNIT_S(x) ((x) == LV2_PORT_UNIT_S)
124 #define LV2_IS_PORT_UNIT_SEMITONE(x) ((x) == LV2_PORT_UNIT_SEMITONE)
125 #define LV2_IS_PORT_UNIT_VOLTS(x) ((x) == LV2_PORT_UNIT_VOLTS)
127 // Port Types
128 #define LV2_PORT_INPUT 0x001
129 #define LV2_PORT_OUTPUT 0x002
130 #define LV2_PORT_CONTROL 0x004
131 #define LV2_PORT_AUDIO 0x008
132 #define LV2_PORT_CV 0x010
133 #define LV2_PORT_ATOM 0x020
134 #define LV2_PORT_ATOM_SEQUENCE (0x040 | LV2_PORT_ATOM)
135 #define LV2_PORT_EVENT 0x080
136 #define LV2_PORT_MIDI_LL 0x100
138 // Port Data Types
139 #define LV2_PORT_DATA_MIDI_EVENT 0x1000
140 #define LV2_PORT_DATA_OSC_EVENT 0x2000
141 #define LV2_PORT_DATA_PATCH_MESSAGE 0x4000
142 #define LV2_PORT_DATA_TIME_POSITION 0x8000
144 #define LV2_IS_PORT_INPUT(x) ((x) & LV2_PORT_INPUT)
145 #define LV2_IS_PORT_OUTPUT(x) ((x) & LV2_PORT_OUTPUT)
146 #define LV2_IS_PORT_CONTROL(x) ((x) & LV2_PORT_CONTROL)
147 #define LV2_IS_PORT_AUDIO(x) ((x) & LV2_PORT_AUDIO)
148 #define LV2_IS_PORT_CV(x) ((x) & LV2_PORT_CV)
149 #define LV2_IS_PORT_ATOM_SEQUENCE(x) ((x) & LV2_PORT_ATOM_SEQUENCE)
150 #define LV2_IS_PORT_EVENT(x) ((x) & LV2_PORT_EVENT)
151 #define LV2_IS_PORT_MIDI_LL(x) ((x) & LV2_PORT_MIDI_LL)
153 #define LV2_PORT_SUPPORTS_MIDI_EVENT(x) ((x) & LV2_PORT_DATA_MIDI_EVENT)
154 #define LV2_PORT_SUPPORTS_OSC_EVENT(x) ((x) & LV2_PORT_DATA_OSC_EVENT)
155 #define LV2_PORT_SUPPORTS_PATCH_MESSAGE(x) ((x) & LV2_PORT_DATA_PATCH_MESSAGE)
156 #define LV2_PORT_SUPPORTS_TIME_POSITION(x) ((x) & LV2_PORT_DATA_TIME_POSITION)
158 // Port Properties
159 #define LV2_PORT_OPTIONAL 0x0001
160 #define LV2_PORT_ENUMERATION 0x0002
161 #define LV2_PORT_INTEGER 0x0004
162 #define LV2_PORT_SAMPLE_RATE 0x0008
163 #define LV2_PORT_TOGGLED 0x0010
164 #define LV2_PORT_CAUSES_ARTIFACTS 0x0020
165 #define LV2_PORT_CONTINUOUS_CV 0x0040
166 #define LV2_PORT_DISCRETE_CV 0x0080
167 #define LV2_PORT_EXPENSIVE 0x0100
168 #define LV2_PORT_STRICT_BOUNDS 0x0200
169 #define LV2_PORT_LOGARITHMIC 0x0400
170 #define LV2_PORT_NOT_AUTOMATIC 0x0800
171 #define LV2_PORT_NOT_ON_GUI 0x1000
172 #define LV2_PORT_TRIGGER 0x2000
173 #define LV2_PORT_NON_AUTOMATABLE 0x4000
174 #define LV2_PORT_SIDECHAIN 0x8000
176 #define LV2_IS_PORT_OPTIONAL(x) ((x) & LV2_PORT_OPTIONAL)
177 #define LV2_IS_PORT_ENUMERATION(x) ((x) & LV2_PORT_ENUMERATION)
178 #define LV2_IS_PORT_INTEGER(x) ((x) & LV2_PORT_INTEGER)
179 #define LV2_IS_PORT_SAMPLE_RATE(x) ((x) & LV2_PORT_SAMPLE_RATE)
180 #define LV2_IS_PORT_TOGGLED(x) ((x) & LV2_PORT_TOGGLED)
181 #define LV2_IS_PORT_CAUSES_ARTIFACTS(x) ((x) & LV2_PORT_CAUSES_ARTIFACTS)
182 #define LV2_IS_PORT_CONTINUOUS_CV(x) ((x) & LV2_PORT_CONTINUOUS_CV)
183 #define LV2_IS_PORT_DISCRETE_CV(x) ((x) & LV2_PORT_DISCRETE_CV)
184 #define LV2_IS_PORT_EXPENSIVE(x) ((x) & LV2_PORT_EXPENSIVE)
185 #define LV2_IS_PORT_STRICT_BOUNDS(x) ((x) & LV2_PORT_STRICT_BOUNDS)
186 #define LV2_IS_PORT_LOGARITHMIC(x) ((x) & LV2_PORT_LOGARITHMIC)
187 #define LV2_IS_PORT_NOT_AUTOMATIC(x) ((x) & LV2_PORT_NOT_AUTOMATIC)
188 #define LV2_IS_PORT_NOT_ON_GUI(x) ((x) & LV2_PORT_NOT_ON_GUI)
189 #define LV2_IS_PORT_TRIGGER(x) ((x) & LV2_PORT_TRIGGER)
190 #define LV2_IS_PORT_NON_AUTOMATABLE(x) ((x) & LV2_PORT_NON_AUTOMATABLE)
191 #define LV2_IS_PORT_SIDECHAIN(x) ((x) & LV2_PORT_SIDECHAIN)
193 // Port Designation
194 #define LV2_PORT_DESIGNATION_CONTROL 1
195 #define LV2_PORT_DESIGNATION_ENABLED 2
196 #define LV2_PORT_DESIGNATION_FREEWHEELING 3
197 #define LV2_PORT_DESIGNATION_LATENCY 4
198 #define LV2_PORT_DESIGNATION_SAMPLE_RATE 5
199 #define LV2_PORT_DESIGNATION_TIME_BAR 6
200 #define LV2_PORT_DESIGNATION_TIME_BAR_BEAT 7
201 #define LV2_PORT_DESIGNATION_TIME_BEAT 8
202 #define LV2_PORT_DESIGNATION_TIME_BEAT_UNIT 9
203 #define LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR 10
204 #define LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE 11
205 #define LV2_PORT_DESIGNATION_TIME_FRAME 12
206 #define LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND 13
207 #define LV2_PORT_DESIGNATION_TIME_SPEED 14
208 #define LV2_PORT_DESIGNATION_TIME_TICKS_PER_BEAT 15
210 #define LV2_IS_PORT_DESIGNATION_CONTROL(x) ((x) == LV2_PORT_DESIGNATION_CONTROL)
211 #define LV2_IS_PORT_DESIGNATION_ENABLED(x) ((x) == LV2_PORT_DESIGNATION_ENABLED)
212 #define LV2_IS_PORT_DESIGNATION_FREEWHEELING(x) ((x) == LV2_PORT_DESIGNATION_FREEWHEELING)
213 #define LV2_IS_PORT_DESIGNATION_LATENCY(x) ((x) == LV2_PORT_DESIGNATION_LATENCY)
214 #define LV2_IS_PORT_DESIGNATION_SAMPLE_RATE(x) ((x) == LV2_PORT_DESIGNATION_SAMPLE_RATE)
215 #define LV2_IS_PORT_DESIGNATION_TIME_BAR(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR)
216 #define LV2_IS_PORT_DESIGNATION_TIME_BAR_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR_BEAT)
217 #define LV2_IS_PORT_DESIGNATION_TIME_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEAT)
218 #define LV2_IS_PORT_DESIGNATION_TIME_BEAT_UNIT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEAT_UNIT)
219 #define LV2_IS_PORT_DESIGNATION_TIME_BEATS_PER_BAR(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR)
220 #define LV2_IS_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE)
221 #define LV2_IS_PORT_DESIGNATION_TIME_FRAME(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAME)
222 #define LV2_IS_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND)
223 #define LV2_IS_PORT_DESIGNATION_TIME_SPEED(x) ((x) == LV2_PORT_DESIGNATION_TIME_SPEED)
224 #define LV2_IS_PORT_DESIGNATION_TIME_TICKS_PER_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_TICKS_PER_BEAT)
225 #define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) >= LV2_PORT_DESIGNATION_TIME_BAR && (x) <= LV2_PORT_DESIGNATION_TIME_TICKS_PER_BEAT)
227 // UI Port Protocol
228 #define LV2_UI_PORT_PROTOCOL_FLOAT 1
229 #define LV2_UI_PORT_PROTOCOL_PEAK 2
231 #define LV2_IS_UI_PORT_PROTOCOL_FLOAT(x) ((x) == LV2_UI_PORT_PROTOCOL_FLOAT)
232 #define LV2_IS_UI_PORT_PROTOCOL_PEAK(x) ((x) == LV2_UI_PORT_PROTOCOL_PEAK)
234 // UI Types
235 #define LV2_UI_NONE 0
236 #define LV2_UI_GTK2 1
237 #define LV2_UI_GTK3 2
238 #define LV2_UI_QT4 3
239 #define LV2_UI_QT5 4
240 #define LV2_UI_COCOA 5
241 #define LV2_UI_WINDOWS 6
242 #define LV2_UI_X11 7
243 #define LV2_UI_EXTERNAL 8
244 #define LV2_UI_OLD_EXTERNAL 9
245 #define LV2_UI_MOD 10
247 #define LV2_IS_UI_GTK2(x) ((x) == LV2_UI_GTK2)
248 #define LV2_IS_UI_GTK3(x) ((x) == LV2_UI_GTK3)
249 #define LV2_IS_UI_QT4(x) ((x) == LV2_UI_QT4)
250 #define LV2_IS_UI_QT5(x) ((x) == LV2_UI_QT5)
251 #define LV2_IS_UI_COCOA(x) ((x) == LV2_UI_COCOA)
252 #define LV2_IS_UI_WINDOWS(x) ((x) == LV2_UI_WINDOWS)
253 #define LV2_IS_UI_X11(x) ((x) == LV2_UI_X11)
254 #define LV2_IS_UI_EXTERNAL(x) ((x) == LV2_UI_EXTERNAL)
255 #define LV2_IS_UI_OLD_EXTERNAL(x) ((x) == LV2_UI_OLD_EXTERNAL)
256 #define LV2_IS_UI_MOD(x) ((x) == LV2_UI_MOD)
258 // Plugin Types
259 #define LV2_PLUGIN_DELAY 0x000001
260 #define LV2_PLUGIN_REVERB 0x000002
261 #define LV2_PLUGIN_SIMULATOR 0x000004
262 #define LV2_PLUGIN_DISTORTION 0x000008
263 #define LV2_PLUGIN_WAVESHAPER 0x000010
264 #define LV2_PLUGIN_DYNAMICS 0x000020
265 #define LV2_PLUGIN_AMPLIFIER 0x000040
266 #define LV2_PLUGIN_COMPRESSOR 0x000080
267 #define LV2_PLUGIN_ENVELOPE 0x000100
268 #define LV2_PLUGIN_EXPANDER 0x000200
269 #define LV2_PLUGIN_GATE 0x000400
270 #define LV2_PLUGIN_LIMITER 0x000800
271 #define LV2_PLUGIN_EQ 0x001000
272 #define LV2_PLUGIN_MULTI_EQ 0x002000
273 #define LV2_PLUGIN_PARA_EQ 0x004000
274 #define LV2_PLUGIN_FILTER 0x008000
275 #define LV2_PLUGIN_ALLPASS 0x010000
276 #define LV2_PLUGIN_BANDPASS 0x020000
277 #define LV2_PLUGIN_COMB 0x040000
278 #define LV2_PLUGIN_HIGHPASS 0x080000
279 #define LV2_PLUGIN_LOWPASS 0x100000
281 #define LV2_PLUGIN_GENERATOR 0x000001
282 #define LV2_PLUGIN_CONSTANT 0x000002
283 #define LV2_PLUGIN_INSTRUMENT 0x000004
284 #define LV2_PLUGIN_OSCILLATOR 0x000008
285 #define LV2_PLUGIN_MODULATOR 0x000010
286 #define LV2_PLUGIN_CHORUS 0x000020
287 #define LV2_PLUGIN_FLANGER 0x000040
288 #define LV2_PLUGIN_PHASER 0x000080
289 #define LV2_PLUGIN_SPATIAL 0x000100
290 #define LV2_PLUGIN_SPECTRAL 0x000200
291 #define LV2_PLUGIN_PITCH 0x000400
292 #define LV2_PLUGIN_UTILITY 0x000800
293 #define LV2_PLUGIN_ANALYSER 0x001000
294 #define LV2_PLUGIN_CONVERTER 0x002000
295 #define LV2_PLUGIN_FUNCTION 0x008000
296 #define LV2_PLUGIN_MIXER 0x010000
298 #define LV2_GROUP_DELAY (LV2_PLUGIN_DELAY|LV2_PLUGIN_REVERB)
299 #define LV2_GROUP_DISTORTION (LV2_PLUGIN_DISTORTION|LV2_PLUGIN_WAVESHAPER)
300 #define LV2_GROUP_DYNAMICS (LV2_PLUGIN_DYNAMICS|LV2_PLUGIN_AMPLIFIER|LV2_PLUGIN_COMPRESSOR|LV2_PLUGIN_ENVELOPE|LV2_PLUGIN_EXPANDER|LV2_PLUGIN_GATE|LV2_PLUGIN_LIMITER)
301 #define LV2_GROUP_EQ (LV2_PLUGIN_EQ|LV2_PLUGIN_MULTI_EQ|LV2_PLUGIN_PARA_EQ)
302 #define LV2_GROUP_FILTER (LV2_PLUGIN_FILTER|LV2_PLUGIN_ALLPASS|LV2_PLUGIN_BANDPASS|LV2_PLUGIN_COMB|LV2_GROUP_EQ|LV2_PLUGIN_HIGHPASS|LV2_PLUGIN_LOWPASS)
303 #define LV2_GROUP_GENERATOR (LV2_PLUGIN_GENERATOR|LV2_PLUGIN_CONSTANT|LV2_PLUGIN_INSTRUMENT|LV2_PLUGIN_OSCILLATOR)
304 #define LV2_GROUP_MODULATOR (LV2_PLUGIN_MODULATOR|LV2_PLUGIN_CHORUS|LV2_PLUGIN_FLANGER|LV2_PLUGIN_PHASER)
305 #define LV2_GROUP_REVERB (LV2_PLUGIN_REVERB)
306 #define LV2_GROUP_SIMULATOR (LV2_PLUGIN_SIMULATOR|LV2_PLUGIN_REVERB)
307 #define LV2_GROUP_SPATIAL (LV2_PLUGIN_SPATIAL)
308 #define LV2_GROUP_SPECTRAL (LV2_PLUGIN_SPECTRAL|LV2_PLUGIN_PITCH)
309 #define LV2_GROUP_UTILITY (LV2_PLUGIN_UTILITY|LV2_PLUGIN_ANALYSER|LV2_PLUGIN_CONVERTER|LV2_PLUGIN_FUNCTION|LV2_PLUGIN_MIXER)
311 #define LV2_IS_DELAY(x, y) ((x) & LV2_GROUP_DELAY)
312 #define LV2_IS_DISTORTION(x, y) ((x) & LV2_GROUP_DISTORTION)
313 #define LV2_IS_DYNAMICS(x, y) ((x) & LV2_GROUP_DYNAMICS)
314 #define LV2_IS_EQ(x, y) ((x) & LV2_GROUP_EQ)
315 #define LV2_IS_FILTER(x, y) ((x) & LV2_GROUP_FILTER)
316 #define LV2_IS_GENERATOR(x, y) ((y) & LV2_GROUP_GENERATOR)
317 #define LV2_IS_INSTRUMENT(x, y) ((y) & LV2_PLUGIN_INSTRUMENT)
318 #define LV2_IS_MODULATOR(x, y) ((y) & LV2_GROUP_MODULATOR)
319 #define LV2_IS_REVERB(x, y) ((x) & LV2_GROUP_REVERB)
320 #define LV2_IS_SIMULATOR(x, y) ((x) & LV2_GROUP_SIMULATOR)
321 #define LV2_IS_SPATIAL(x, y) ((y) & LV2_GROUP_SPATIAL)
322 #define LV2_IS_SPECTRAL(x, y) ((y) & LV2_GROUP_SPECTRAL)
323 #define LV2_IS_UTILITY(x, y) ((y) & LV2_GROUP_UTILITY)
325 // Port Midi Map
326 struct LV2_RDF_PortMidiMap {
327 LV2_Property Type;
328 uint32_t Number;
330 LV2_RDF_PortMidiMap() noexcept
331 : Type(0),
332 Number(0) {}
335 // Port Points
336 struct LV2_RDF_PortPoints {
337 LV2_Property Hints;
338 float Default;
339 float Minimum;
340 float Maximum;
342 LV2_RDF_PortPoints() noexcept
343 : Hints(0x0),
344 Default(0.0f),
345 Minimum(0.0f),
346 Maximum(1.0f) {}
349 // Port Unit
350 struct LV2_RDF_PortUnit {
351 LV2_Property Hints;
352 const char* Name;
353 const char* Render;
354 const char* Symbol;
355 LV2_Property Unit;
357 LV2_RDF_PortUnit() noexcept
358 : Hints(0x0),
359 Name(nullptr),
360 Render(nullptr),
361 Symbol(nullptr),
362 Unit(0) {}
364 ~LV2_RDF_PortUnit() noexcept
366 if (Name != nullptr)
368 delete[] Name;
369 Name = nullptr;
371 if (Render != nullptr)
373 delete[] Render;
374 Render = nullptr;
376 if (Symbol != nullptr)
378 delete[] Symbol;
379 Symbol = nullptr;
383 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortUnit)
386 // Port Scale Point
387 struct LV2_RDF_PortScalePoint {
388 const char* Label;
389 float Value;
391 LV2_RDF_PortScalePoint() noexcept
392 : Label(nullptr),
393 Value(0.0f) {}
395 ~LV2_RDF_PortScalePoint() noexcept
397 if (Label != nullptr)
399 delete[] Label;
400 Label = nullptr;
404 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortScalePoint)
407 // Port
408 struct LV2_RDF_Port {
409 LV2_Property Types;
410 LV2_Property Properties;
411 LV2_Property Designation;
412 const char* Name;
413 const char* Symbol;
414 const char* Comment;
415 const char* GroupURI;
417 LV2_RDF_PortMidiMap MidiMap;
418 LV2_RDF_PortPoints Points;
419 LV2_RDF_PortUnit Unit;
421 uint32_t MinimumSize;
423 uint32_t ScalePointCount;
424 LV2_RDF_PortScalePoint* ScalePoints;
426 LV2_RDF_Port() noexcept
427 : Types(0x0),
428 Properties(0x0),
429 Designation(0),
430 Name(nullptr),
431 Symbol(nullptr),
432 Comment(nullptr),
433 GroupURI(nullptr),
434 MidiMap(),
435 Points(),
436 Unit(),
437 MinimumSize(0),
438 ScalePointCount(0),
439 ScalePoints(nullptr) {}
441 ~LV2_RDF_Port() noexcept
443 if (Name != nullptr)
445 delete[] Name;
446 Name = nullptr;
448 if (Symbol != nullptr)
450 delete[] Symbol;
451 Symbol = nullptr;
453 if (Comment != nullptr)
455 delete[] Comment;
456 Comment = nullptr;
458 if (GroupURI != nullptr)
460 delete[] GroupURI;
461 GroupURI = nullptr;
463 if (ScalePoints != nullptr)
465 delete[] ScalePoints;
466 ScalePoints = nullptr;
470 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Port)
473 // Port
474 struct LV2_RDF_PortGroup {
475 LV2_URI URI; // shared value, do not deallocate
476 const char* Name;
477 const char* Symbol;
479 LV2_RDF_PortGroup() noexcept
480 : URI(nullptr),
481 Name(nullptr),
482 Symbol(nullptr) {}
484 ~LV2_RDF_PortGroup() noexcept
486 if (Name != nullptr)
488 delete[] Name;
489 Name = nullptr;
491 if (Symbol != nullptr)
493 delete[] Symbol;
494 Symbol = nullptr;
498 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortGroup)
501 // Parameter
502 struct LV2_RDF_Parameter {
503 LV2_URI URI;
504 LV2_Property Type;
505 LV2_Property Flags;
506 const char* Label;
507 const char* Comment;
508 const char* GroupURI;
510 LV2_RDF_PortMidiMap MidiMap;
511 LV2_RDF_PortPoints Points;
512 LV2_RDF_PortUnit Unit;
514 LV2_RDF_Parameter() noexcept
515 : URI(nullptr),
516 Type(0),
517 Flags(0x0),
518 Label(nullptr),
519 Comment(nullptr),
520 GroupURI(nullptr),
521 MidiMap(),
522 Points(),
523 Unit() {}
525 ~LV2_RDF_Parameter() noexcept
527 if (URI != nullptr)
529 delete[] URI;
530 URI = nullptr;
532 if (Label != nullptr)
534 delete[] Label;
535 Label = nullptr;
537 if (Comment != nullptr)
539 delete[] Comment;
540 Comment = nullptr;
542 if (GroupURI != nullptr)
544 delete[] GroupURI;
545 GroupURI = nullptr;
549 void copyAndReplace(LV2_RDF_Parameter& other) noexcept
551 URI = other.URI;
552 Type = other.Type;
553 Flags = other.Flags;
554 Label = other.Label;
555 Comment = other.Comment;
556 GroupURI = other.GroupURI;
557 MidiMap = other.MidiMap;
558 Points = other.Points;
559 Unit.Hints = other.Unit.Hints;
560 Unit.Name = other.Unit.Name;
561 Unit.Render = other.Unit.Render;
562 Unit.Symbol = other.Unit.Symbol;
563 Unit.Unit = other.Unit.Unit;
564 other.URI = nullptr;
565 other.Label = nullptr;
566 other.Comment = nullptr;
567 other.GroupURI = nullptr;
568 other.Unit.Name = nullptr;
569 other.Unit.Render = nullptr;
570 other.Unit.Symbol = nullptr;
573 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Parameter)
576 // Preset
577 struct LV2_RDF_Preset {
578 LV2_URI URI;
579 const char* Label;
581 LV2_RDF_Preset() noexcept
582 : URI(nullptr),
583 Label(nullptr) {}
585 ~LV2_RDF_Preset() noexcept
587 if (URI != nullptr)
589 delete[] URI;
590 URI = nullptr;
592 if (Label != nullptr)
594 delete[] Label;
595 Label = nullptr;
599 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Preset)
602 // Feature
603 struct LV2_RDF_Feature {
604 bool Required;
605 LV2_URI URI;
607 LV2_RDF_Feature() noexcept
608 : Required(false),
609 URI(nullptr) {}
611 ~LV2_RDF_Feature() noexcept
613 if (URI != nullptr)
615 delete[] URI;
616 URI = nullptr;
620 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Feature)
623 // Port Notification
624 struct LV2_RDF_UI_PortNotification {
625 const char* Symbol;
626 uint32_t Index;
627 LV2_Property Protocol;
629 LV2_RDF_UI_PortNotification() noexcept
630 : Symbol(nullptr),
631 Index(LV2UI_INVALID_PORT_INDEX),
632 Protocol(0) {}
634 ~LV2_RDF_UI_PortNotification() noexcept
636 if (Symbol != nullptr)
638 delete[] Symbol;
639 Symbol = nullptr;
643 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_UI_PortNotification)
646 // UI
647 struct LV2_RDF_UI {
648 LV2_Property Type;
649 LV2_URI URI;
650 const char* Binary;
651 const char* Bundle;
653 uint32_t FeatureCount;
654 LV2_RDF_Feature* Features;
656 uint32_t ExtensionCount;
657 LV2_URI* Extensions;
659 uint32_t PortNotificationCount;
660 LV2_RDF_UI_PortNotification* PortNotifications;
662 LV2_RDF_UI() noexcept
663 : Type(0),
664 URI(nullptr),
665 Binary(nullptr),
666 Bundle(nullptr),
667 FeatureCount(0),
668 Features(nullptr),
669 ExtensionCount(0),
670 Extensions(nullptr),
671 PortNotificationCount(0),
672 PortNotifications(nullptr) {}
674 ~LV2_RDF_UI() noexcept
676 if (URI != nullptr)
678 delete[] URI;
679 URI = nullptr;
681 if (Binary != nullptr)
683 delete[] Binary;
684 Binary = nullptr;
686 if (Bundle != nullptr)
688 delete[] Bundle;
689 Bundle = nullptr;
691 if (Features != nullptr)
693 delete[] Features;
694 Features = nullptr;
696 if (Extensions != nullptr)
698 for (uint32_t i=0; i<ExtensionCount; ++i)
700 if (Extensions[i] != nullptr)
702 delete[] Extensions[i];
703 Extensions[i] = nullptr;
706 delete[] Extensions;
707 Extensions = nullptr;
709 if (PortNotifications != nullptr)
711 delete[] PortNotifications;
712 PortNotifications = nullptr;
716 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_UI)
719 // Plugin Descriptor
720 struct LV2_RDF_Descriptor {
721 LV2_Property Type[2];
722 LV2_URI URI;
723 const char* Name;
724 const char* Author;
725 const char* License;
726 const char* Binary;
727 const char* Bundle;
728 ulong UniqueID;
730 uint32_t PortCount;
731 LV2_RDF_Port* Ports;
733 uint32_t PortGroupCount;
734 LV2_RDF_PortGroup* PortGroups;
736 uint32_t ParameterCount;
737 LV2_RDF_Parameter* Parameters;
739 uint32_t PresetCount;
740 LV2_RDF_Preset* Presets;
742 uint32_t FeatureCount;
743 LV2_RDF_Feature* Features;
745 uint32_t ExtensionCount;
746 LV2_URI* Extensions;
748 uint32_t UICount;
749 LV2_RDF_UI* UIs;
751 LV2_RDF_Descriptor() noexcept
752 : URI(nullptr),
753 Name(nullptr),
754 Author(nullptr),
755 License(nullptr),
756 Binary(nullptr),
757 Bundle(nullptr),
758 UniqueID(0),
759 PortCount(0),
760 Ports(nullptr),
761 PortGroupCount(0),
762 PortGroups(nullptr),
763 ParameterCount(0),
764 Parameters(nullptr),
765 PresetCount(0),
766 Presets(nullptr),
767 FeatureCount(0),
768 Features(nullptr),
769 ExtensionCount(0),
770 Extensions(nullptr),
771 UICount(0),
772 UIs(nullptr)
774 Type[0] = Type[1] = 0x0;
777 ~LV2_RDF_Descriptor() noexcept
779 if (URI != nullptr)
781 delete[] URI;
782 URI = nullptr;
784 if (Name != nullptr)
786 delete[] Name;
787 Name = nullptr;
789 if (Author != nullptr)
791 delete[] Author;
792 Author = nullptr;
794 if (License != nullptr)
796 delete[] License;
797 License = nullptr;
799 if (Binary != nullptr)
801 delete[] Binary;
802 Binary = nullptr;
804 if (Bundle != nullptr)
806 delete[] Bundle;
807 Bundle = nullptr;
809 if (Ports != nullptr)
811 delete[] Ports;
812 Ports = nullptr;
814 if (PortGroups != nullptr)
816 delete[] PortGroups;
817 PortGroups = nullptr;
819 if (Parameters != nullptr)
821 delete[] Parameters;
822 Parameters = nullptr;
824 if (Presets != nullptr)
826 delete[] Presets;
827 Presets = nullptr;
829 if (Features != nullptr)
831 delete[] Features;
832 Features = nullptr;
834 if (Extensions != nullptr)
836 for (uint32_t i=0; i<ExtensionCount; ++i)
838 if (Extensions[i] != nullptr)
840 delete[] Extensions[i];
841 Extensions[i] = nullptr;
844 delete[] Extensions;
845 Extensions = nullptr;
847 if (UIs != nullptr)
849 delete[] UIs;
850 UIs = nullptr;
854 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Descriptor)
857 #endif // LV2_RDF_HPP_INCLUDED