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
30 typedef const char* LV2_URI
;
31 typedef uint32_t LV2_Property
;
32 #define LV2UI_INVALID_PORT_INDEX ((uint32_t)-1)
35 #define LV2_PARAMETER_FLAG_INPUT 0x1
36 #define LV2_PARAMETER_FLAG_OUTPUT 0x2
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)
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)
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)
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)
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
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)
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)
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)
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)
235 #define LV2_UI_NONE 0
236 #define LV2_UI_GTK2 1
237 #define LV2_UI_GTK3 2
240 #define LV2_UI_COCOA 5
241 #define LV2_UI_WINDOWS 6
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)
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)
326 struct LV2_RDF_PortMidiMap
{
330 LV2_RDF_PortMidiMap() noexcept
336 struct LV2_RDF_PortPoints
{
342 LV2_RDF_PortPoints() noexcept
350 struct LV2_RDF_PortUnit
{
357 LV2_RDF_PortUnit() noexcept
364 ~LV2_RDF_PortUnit() noexcept
371 if (Render
!= nullptr)
376 if (Symbol
!= nullptr)
383 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortUnit
)
387 struct LV2_RDF_PortScalePoint
{
391 LV2_RDF_PortScalePoint() noexcept
395 ~LV2_RDF_PortScalePoint() noexcept
397 if (Label
!= nullptr)
404 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortScalePoint
)
408 struct LV2_RDF_Port
{
410 LV2_Property Properties
;
411 LV2_Property Designation
;
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
439 ScalePoints(nullptr) {}
441 ~LV2_RDF_Port() noexcept
448 if (Symbol
!= nullptr)
453 if (Comment
!= nullptr)
458 if (GroupURI
!= nullptr)
463 if (ScalePoints
!= nullptr)
465 delete[] ScalePoints
;
466 ScalePoints
= nullptr;
470 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Port
)
474 struct LV2_RDF_PortGroup
{
475 LV2_URI URI
; // shared value, do not deallocate
479 LV2_RDF_PortGroup() noexcept
484 ~LV2_RDF_PortGroup() noexcept
491 if (Symbol
!= nullptr)
498 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortGroup
)
502 struct LV2_RDF_Parameter
{
508 const char* GroupURI
;
510 LV2_RDF_PortMidiMap MidiMap
;
511 LV2_RDF_PortPoints Points
;
512 LV2_RDF_PortUnit Unit
;
514 LV2_RDF_Parameter() noexcept
525 ~LV2_RDF_Parameter() noexcept
532 if (Label
!= nullptr)
537 if (Comment
!= nullptr)
542 if (GroupURI
!= nullptr)
549 void copyAndReplace(LV2_RDF_Parameter
& other
) noexcept
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
;
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
)
577 struct LV2_RDF_Preset
{
581 LV2_RDF_Preset() noexcept
585 ~LV2_RDF_Preset() noexcept
592 if (Label
!= nullptr)
599 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Preset
)
603 struct LV2_RDF_Feature
{
607 LV2_RDF_Feature() noexcept
611 ~LV2_RDF_Feature() noexcept
620 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Feature
)
624 struct LV2_RDF_UI_PortNotification
{
627 LV2_Property Protocol
;
629 LV2_RDF_UI_PortNotification() noexcept
631 Index(LV2UI_INVALID_PORT_INDEX
),
634 ~LV2_RDF_UI_PortNotification() noexcept
636 if (Symbol
!= nullptr)
643 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_UI_PortNotification
)
653 uint32_t FeatureCount
;
654 LV2_RDF_Feature
* Features
;
656 uint32_t ExtensionCount
;
659 uint32_t PortNotificationCount
;
660 LV2_RDF_UI_PortNotification
* PortNotifications
;
662 LV2_RDF_UI() noexcept
671 PortNotificationCount(0),
672 PortNotifications(nullptr) {}
674 ~LV2_RDF_UI() noexcept
681 if (Binary
!= nullptr)
686 if (Bundle
!= nullptr)
691 if (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;
707 Extensions
= nullptr;
709 if (PortNotifications
!= nullptr)
711 delete[] PortNotifications
;
712 PortNotifications
= nullptr;
716 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_UI
)
720 struct LV2_RDF_Descriptor
{
721 LV2_Property Type
[2];
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
;
751 LV2_RDF_Descriptor() noexcept
774 Type
[0] = Type
[1] = 0x0;
777 ~LV2_RDF_Descriptor() noexcept
789 if (Author
!= nullptr)
794 if (License
!= nullptr)
799 if (Binary
!= nullptr)
804 if (Bundle
!= nullptr)
809 if (Ports
!= nullptr)
814 if (PortGroups
!= nullptr)
817 PortGroups
= nullptr;
819 if (Parameters
!= nullptr)
822 Parameters
= nullptr;
824 if (Presets
!= nullptr)
829 if (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;
845 Extensions
= nullptr;
854 CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Descriptor
)
857 #endif // LV2_RDF_HPP_INCLUDED