Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lv2_rdf.hpp 22KB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. /*
  2. * Custom types to store LV2 information
  3. * Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
  4. *
  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.
  9. *
  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.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifndef LV2_RDF_HPP_INCLUDED
  18. #define LV2_RDF_HPP_INCLUDED
  19. #include "CarlaDefines.h"
  20. #ifdef CARLA_PROPER_CPP11_SUPPORT
  21. # include <cstdint>
  22. #else
  23. # include <stdint.h>
  24. #endif
  25. // Base Types
  26. typedef const char* LV2_URI;
  27. typedef uint32_t LV2_Property;
  28. // Port Midi Map Types
  29. #define LV2_PORT_MIDI_MAP_CC 1
  30. #define LV2_PORT_MIDI_MAP_NRPN 2
  31. #define LV2_IS_PORT_MIDI_MAP_CC(x) ((x) == LV2_PORT_MIDI_MAP_CC)
  32. #define LV2_IS_PORT_MIDI_MAP_NRPN(x) ((x) == LV2_PORT_MIDI_MAP_NRPN)
  33. // Port Point Hints
  34. #define LV2_PORT_POINT_DEFAULT 0x1
  35. #define LV2_PORT_POINT_MINIMUM 0x2
  36. #define LV2_PORT_POINT_MAXIMUM 0x4
  37. #define LV2_HAVE_DEFAULT_PORT_POINT(x) ((x) & LV2_PORT_POINT_DEFAULT)
  38. #define LV2_HAVE_MINIMUM_PORT_POINT(x) ((x) & LV2_PORT_POINT_MINIMUM)
  39. #define LV2_HAVE_MAXIMUM_PORT_POINT(x) ((x) & LV2_PORT_POINT_MAXIMUM)
  40. // Port Unit Hints
  41. #define LV2_PORT_UNIT_NAME 0x1
  42. #define LV2_PORT_UNIT_RENDER 0x2
  43. #define LV2_PORT_UNIT_SYMBOL 0x4
  44. #define LV2_PORT_UNIT_UNIT 0x8
  45. #define LV2_HAVE_PORT_UNIT_NAME(x) ((x) & LV2_PORT_UNIT_NAME)
  46. #define LV2_HAVE_PORT_UNIT_RENDER(x) ((x) & LV2_PORT_UNIT_RENDER)
  47. #define LV2_HAVE_PORT_UNIT_SYMBOL(x) ((x) & LV2_PORT_UNIT_SYMBOL)
  48. #define LV2_HAVE_PORT_UNIT_UNIT(x) ((x) & LV2_PORT_UNIT_UNIT)
  49. // Port Unit Unit
  50. #define LV2_PORT_UNIT_BAR 1
  51. #define LV2_PORT_UNIT_BEAT 2
  52. #define LV2_PORT_UNIT_BPM 3
  53. #define LV2_PORT_UNIT_CENT 4
  54. #define LV2_PORT_UNIT_CM 5
  55. #define LV2_PORT_UNIT_COEF 6
  56. #define LV2_PORT_UNIT_DB 7
  57. #define LV2_PORT_UNIT_DEGREE 8
  58. #define LV2_PORT_UNIT_FRAME 9
  59. #define LV2_PORT_UNIT_HZ 10
  60. #define LV2_PORT_UNIT_INCH 11
  61. #define LV2_PORT_UNIT_KHZ 12
  62. #define LV2_PORT_UNIT_KM 13
  63. #define LV2_PORT_UNIT_M 14
  64. #define LV2_PORT_UNIT_MHZ 15
  65. #define LV2_PORT_UNIT_MIDINOTE 16
  66. #define LV2_PORT_UNIT_MILE 17
  67. #define LV2_PORT_UNIT_MIN 18
  68. #define LV2_PORT_UNIT_MM 19
  69. #define LV2_PORT_UNIT_MS 20
  70. #define LV2_PORT_UNIT_OCT 21
  71. #define LV2_PORT_UNIT_PC 22
  72. #define LV2_PORT_UNIT_S 23
  73. #define LV2_PORT_UNIT_SEMITONE 24
  74. #define LV2_IS_PORT_UNIT_BAR(x) ((x) == LV2_PORT_UNIT_BAR)
  75. #define LV2_IS_PORT_UNIT_BEAT(x) ((x) == LV2_PORT_UNIT_BEAT)
  76. #define LV2_IS_PORT_UNIT_BPM(x) ((x) == LV2_PORT_UNIT_BPM)
  77. #define LV2_IS_PORT_UNIT_CENT(x) ((x) == LV2_PORT_UNIT_CENT)
  78. #define LV2_IS_PORT_UNIT_CM(x) ((x) == LV2_PORT_UNIT_CM)
  79. #define LV2_IS_PORT_UNIT_COEF(x) ((x) == LV2_PORT_UNIT_COEF)
  80. #define LV2_IS_PORT_UNIT_DB(x) ((x) == LV2_PORT_UNIT_DB)
  81. #define LV2_IS_PORT_UNIT_DEGREE(x) ((x) == LV2_PORT_UNIT_DEGREE)
  82. #define LV2_IS_PORT_UNIT_FRAME(x) ((x) == LV2_PORT_UNIT_FRAME)
  83. #define LV2_IS_PORT_UNIT_HZ(x) ((x) == LV2_PORT_UNIT_HZ)
  84. #define LV2_IS_PORT_UNIT_INCH(x) ((x) == LV2_PORT_UNIT_INCH)
  85. #define LV2_IS_PORT_UNIT_KHZ(x) ((x) == LV2_PORT_UNIT_KHZ)
  86. #define LV2_IS_PORT_UNIT_KM(x) ((x) == LV2_PORT_UNIT_KM)
  87. #define LV2_IS_PORT_UNIT_M(x) ((x) == LV2_PORT_UNIT_M)
  88. #define LV2_IS_PORT_UNIT_MHZ(x) ((x) == LV2_PORT_UNIT_MHZ)
  89. #define LV2_IS_PORT_UNIT_MIDINOTE(x) ((x) == LV2_PORT_UNIT_MIDINOTE)
  90. #define LV2_IS_PORT_UNIT_MILE(x) ((x) == LV2_PORT_UNIT_MILE)
  91. #define LV2_IS_PORT_UNIT_MIN(x) ((x) == LV2_PORT_UNIT_MIN)
  92. #define LV2_IS_PORT_UNIT_MM(x) ((x) == LV2_PORT_UNIT_MM)
  93. #define LV2_IS_PORT_UNIT_MS(x) ((x) == LV2_PORT_UNIT_MS)
  94. #define LV2_IS_PORT_UNIT_OCT(x) ((x) == LV2_PORT_UNIT_OCT)
  95. #define LV2_IS_PORT_UNIT_PC(x) ((x) == LV2_PORT_UNIT_PC)
  96. #define LV2_IS_PORT_UNIT_S(x) ((x) == LV2_PORT_UNIT_S)
  97. #define LV2_IS_PORT_UNIT_SEMITONE(x) ((x) == LV2_PORT_UNIT_SEMITONE)
  98. // Port Types
  99. #define LV2_PORT_INPUT 0x001
  100. #define LV2_PORT_OUTPUT 0x002
  101. #define LV2_PORT_CONTROL 0x004
  102. #define LV2_PORT_AUDIO 0x008
  103. #define LV2_PORT_CV 0x010
  104. #define LV2_PORT_ATOM 0x020
  105. #define LV2_PORT_ATOM_SEQUENCE (0x040 | LV2_PORT_ATOM)
  106. #define LV2_PORT_EVENT 0x080
  107. #define LV2_PORT_MIDI_LL 0x100
  108. // Port Data Types
  109. #define LV2_PORT_DATA_MIDI_EVENT 0x1000
  110. #define LV2_PORT_DATA_OSC_EVENT 0x2000
  111. #define LV2_PORT_DATA_PATCH_MESSAGE 0x4000
  112. #define LV2_PORT_DATA_TIME_POSITION 0x8000
  113. #define LV2_IS_PORT_INPUT(x) ((x) & LV2_PORT_INPUT)
  114. #define LV2_IS_PORT_OUTPUT(x) ((x) & LV2_PORT_OUTPUT)
  115. #define LV2_IS_PORT_CONTROL(x) ((x) & LV2_PORT_CONTROL)
  116. #define LV2_IS_PORT_AUDIO(x) ((x) & LV2_PORT_AUDIO)
  117. #define LV2_IS_PORT_CV(x) ((x) & LV2_PORT_CV)
  118. #define LV2_IS_PORT_ATOM_SEQUENCE(x) ((x) & LV2_PORT_ATOM_SEQUENCE)
  119. #define LV2_IS_PORT_EVENT(x) ((x) & LV2_PORT_EVENT)
  120. #define LV2_IS_PORT_MIDI_LL(x) ((x) & LV2_PORT_MIDI_LL)
  121. #define LV2_PORT_SUPPORTS_MIDI_EVENT(x) ((x) & LV2_PORT_DATA_MIDI_EVENT)
  122. #define LV2_PORT_SUPPORTS_OSC_EVENT(x) ((x) & LV2_PORT_DATA_OSC_EVENT)
  123. #define LV2_PORT_SUPPORTS_PATCH_MESSAGE(x) ((x) & LV2_PORT_DATA_PATCH_MESSAGE)
  124. #define LV2_PORT_SUPPORTS_TIME_POSITION(x) ((x) & LV2_PORT_DATA_TIME_POSITION)
  125. // Port Properties
  126. #define LV2_PORT_OPTIONAL 0x0001
  127. #define LV2_PORT_ENUMERATION 0x0002
  128. #define LV2_PORT_INTEGER 0x0004
  129. #define LV2_PORT_SAMPLE_RATE 0x0008
  130. #define LV2_PORT_TOGGLED 0x0010
  131. #define LV2_PORT_CAUSES_ARTIFACTS 0x0020
  132. #define LV2_PORT_CONTINUOUS_CV 0x0040
  133. #define LV2_PORT_DISCRETE_CV 0x0080
  134. #define LV2_PORT_EXPENSIVE 0x0100
  135. #define LV2_PORT_STRICT_BOUNDS 0x0200
  136. #define LV2_PORT_LOGARITHMIC 0x0400
  137. #define LV2_PORT_NOT_AUTOMATIC 0x0800
  138. #define LV2_PORT_NOT_ON_GUI 0x1000
  139. #define LV2_PORT_TRIGGER 0x2000
  140. #define LV2_IS_PORT_OPTIONAL(x) ((x) & LV2_PORT_OPTIONAL)
  141. #define LV2_IS_PORT_ENUMERATION(x) ((x) & LV2_PORT_ENUMERATION)
  142. #define LV2_IS_PORT_INTEGER(x) ((x) & LV2_PORT_INTEGER)
  143. #define LV2_IS_PORT_SAMPLE_RATE(x) ((x) & LV2_PORT_SAMPLE_RATE)
  144. #define LV2_IS_PORT_TOGGLED(x) ((x) & LV2_PORT_TOGGLED)
  145. #define LV2_IS_PORT_CAUSES_ARTIFACTS(x) ((x) & LV2_PORT_CAUSES_ARTIFACTS)
  146. #define LV2_IS_PORT_CONTINUOUS_CV(x) ((x) & LV2_PORT_CONTINUOUS_CV)
  147. #define LV2_IS_PORT_DISCRETE_CV(x) ((x) & LV2_PORT_DISCRETE_CV)
  148. #define LV2_IS_PORT_EXPENSIVE(x) ((x) & LV2_PORT_EXPENSIVE)
  149. #define LV2_IS_PORT_STRICT_BOUNDS(x) ((x) & LV2_PORT_STRICT_BOUNDS)
  150. #define LV2_IS_PORT_LOGARITHMIC(x) ((x) & LV2_PORT_LOGARITHMIC)
  151. #define LV2_IS_PORT_NOT_AUTOMATIC(x) ((x) & LV2_PORT_NOT_AUTOMATIC)
  152. #define LV2_IS_PORT_NOT_ON_GUI(x) ((x) & LV2_PORT_NOT_ON_GUI)
  153. #define LV2_IS_PORT_TRIGGER(x) ((x) & LV2_PORT_TRIGGER)
  154. // Port Designation
  155. #define LV2_PORT_DESIGNATION_CONTROL 1
  156. #define LV2_PORT_DESIGNATION_FREEWHEELING 2
  157. #define LV2_PORT_DESIGNATION_LATENCY 3
  158. #define LV2_PORT_DESIGNATION_SAMPLE_RATE 4
  159. #define LV2_PORT_DESIGNATION_TIME_BAR 5
  160. #define LV2_PORT_DESIGNATION_TIME_BAR_BEAT 6
  161. #define LV2_PORT_DESIGNATION_TIME_BEAT 7
  162. #define LV2_PORT_DESIGNATION_TIME_BEAT_UNIT 8
  163. #define LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR 9
  164. #define LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE 10
  165. #define LV2_PORT_DESIGNATION_TIME_FRAME 11
  166. #define LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND 12
  167. #define LV2_PORT_DESIGNATION_TIME_SPEED 13
  168. #define LV2_IS_PORT_DESIGNATION_CONTROL(x) ((x) == LV2_PORT_DESIGNATION_CONTROL)
  169. #define LV2_IS_PORT_DESIGNATION_FREEWHEELING(x) ((x) == LV2_PORT_DESIGNATION_FREEWHEELING)
  170. #define LV2_IS_PORT_DESIGNATION_LATENCY(x) ((x) == LV2_PORT_DESIGNATION_LATENCY)
  171. #define LV2_IS_PORT_DESIGNATION_SAMPLE_RATE(x) ((x) == LV2_PORT_DESIGNATION_SAMPLE_RATE)
  172. #define LV2_IS_PORT_DESIGNATION_TIME_BAR(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR)
  173. #define LV2_IS_PORT_DESIGNATION_TIME_BAR_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR_BEAT)
  174. #define LV2_IS_PORT_DESIGNATION_TIME_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEAT)
  175. #define LV2_IS_PORT_DESIGNATION_TIME_BEAT_UNIT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEAT_UNIT)
  176. #define LV2_IS_PORT_DESIGNATION_TIME_BEATS_PER_BAR(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR)
  177. #define LV2_IS_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE)
  178. #define LV2_IS_PORT_DESIGNATION_TIME_FRAME(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAME)
  179. #define LV2_IS_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND)
  180. #define LV2_IS_PORT_DESIGNATION_TIME_SPEED(x) ((x) == LV2_PORT_DESIGNATION_TIME_SPEED)
  181. #define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) >= LV2_PORT_DESIGNATION_TIME_BAR && (x) <= LV2_PORT_DESIGNATION_TIME_SPEED)
  182. // Feature Types
  183. #define LV2_FEATURE_OPTIONAL 1
  184. #define LV2_FEATURE_REQUIRED 2
  185. #define LV2_IS_FEATURE_OPTIONAL(x) ((x) == LV2_FEATURE_OPTIONAL)
  186. #define LV2_IS_FEATURE_REQUIRED(x) ((x) == LV2_FEATURE_REQUIRED)
  187. // UI Types
  188. #define LV2_UI_GTK2 1
  189. #define LV2_UI_GTK3 2
  190. #define LV2_UI_QT4 3
  191. #define LV2_UI_QT5 4
  192. #define LV2_UI_NTK 5
  193. #define LV2_UI_COCOA 6
  194. #define LV2_UI_WINDOWS 7
  195. #define LV2_UI_X11 8
  196. #define LV2_UI_EXTERNAL 9
  197. #define LV2_UI_OLD_EXTERNAL 10
  198. #define LV2_IS_UI_GTK2(x) ((x) == LV2_UI_GTK2)
  199. #define LV2_IS_UI_GTK3(x) ((x) == LV2_UI_GTK3)
  200. #define LV2_IS_UI_QT4(x) ((x) == LV2_UI_QT4)
  201. #define LV2_IS_UI_QT5(x) ((x) == LV2_UI_QT5)
  202. #define LV2_IS_UI_NTK(x) ((x) == LV2_UI_NTK)
  203. #define LV2_IS_UI_COCOA(x) ((x) == LV2_UI_COCOA)
  204. #define LV2_IS_UI_WINDOWS(x) ((x) == LV2_UI_WINDOWS)
  205. #define LV2_IS_UI_X11(x) ((x) == LV2_UI_X11)
  206. #define LV2_IS_UI_EXTERNAL(x) ((x) == LV2_UI_EXTERNAL)
  207. #define LV2_IS_UI_OLD_EXTERNAL(x) ((x) == LV2_UI_OLD_EXTERNAL)
  208. // Plugin Types
  209. #define LV2_PLUGIN_DELAY 0x000001
  210. #define LV2_PLUGIN_REVERB 0x000002
  211. #define LV2_PLUGIN_SIMULATOR 0x000004
  212. #define LV2_PLUGIN_DISTORTION 0x000008
  213. #define LV2_PLUGIN_WAVESHAPER 0x000010
  214. #define LV2_PLUGIN_DYNAMICS 0x000020
  215. #define LV2_PLUGIN_AMPLIFIER 0x000040
  216. #define LV2_PLUGIN_COMPRESSOR 0x000080
  217. #define LV2_PLUGIN_ENVELOPE 0x000100
  218. #define LV2_PLUGIN_EXPANDER 0x000200
  219. #define LV2_PLUGIN_GATE 0x000400
  220. #define LV2_PLUGIN_LIMITER 0x000800
  221. #define LV2_PLUGIN_EQ 0x001000
  222. #define LV2_PLUGIN_MULTI_EQ 0x002000
  223. #define LV2_PLUGIN_PARA_EQ 0x004000
  224. #define LV2_PLUGIN_FILTER 0x008000
  225. #define LV2_PLUGIN_ALLPASS 0x010000
  226. #define LV2_PLUGIN_BANDPASS 0x020000
  227. #define LV2_PLUGIN_COMB 0x040000
  228. #define LV2_PLUGIN_HIGHPASS 0x080000
  229. #define LV2_PLUGIN_LOWPASS 0x100000
  230. #define LV2_PLUGIN_GENERATOR 0x000001
  231. #define LV2_PLUGIN_CONSTANT 0x000002
  232. #define LV2_PLUGIN_INSTRUMENT 0x000004
  233. #define LV2_PLUGIN_OSCILLATOR 0x000008
  234. #define LV2_PLUGIN_MODULATOR 0x000010
  235. #define LV2_PLUGIN_CHORUS 0x000020
  236. #define LV2_PLUGIN_FLANGER 0x000040
  237. #define LV2_PLUGIN_PHASER 0x000080
  238. #define LV2_PLUGIN_SPATIAL 0x000100
  239. #define LV2_PLUGIN_SPECTRAL 0x000200
  240. #define LV2_PLUGIN_PITCH 0x000400
  241. #define LV2_PLUGIN_UTILITY 0x000800
  242. #define LV2_PLUGIN_ANALYSER 0x001000
  243. #define LV2_PLUGIN_CONVERTER 0x002000
  244. #define LV2_PLUGIN_FUNCTION 0x008000
  245. #define LV2_PLUGIN_MIXER 0x010000
  246. #define LV2_GROUP_DELAY (LV2_PLUGIN_DELAY|LV2_PLUGIN_REVERB)
  247. #define LV2_GROUP_DISTORTION (LV2_PLUGIN_DISTORTION|LV2_PLUGIN_WAVESHAPER)
  248. #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)
  249. #define LV2_GROUP_EQ (LV2_PLUGIN_EQ|LV2_PLUGIN_MULTI_EQ|LV2_PLUGIN_PARA_EQ)
  250. #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)
  251. #define LV2_GROUP_GENERATOR (LV2_PLUGIN_GENERATOR|LV2_PLUGIN_CONSTANT|LV2_PLUGIN_INSTRUMENT|LV2_PLUGIN_OSCILLATOR)
  252. #define LV2_GROUP_MODULATOR (LV2_PLUGIN_MODULATOR|LV2_PLUGIN_CHORUS|LV2_PLUGIN_FLANGER|LV2_PLUGIN_PHASER)
  253. #define LV2_GROUP_REVERB (LV2_PLUGIN_REVERB)
  254. #define LV2_GROUP_SIMULATOR (LV2_PLUGIN_SIMULATOR|LV2_PLUGIN_REVERB)
  255. #define LV2_GROUP_SPATIAL (LV2_PLUGIN_SPATIAL)
  256. #define LV2_GROUP_SPECTRAL (LV2_PLUGIN_SPECTRAL|LV2_PLUGIN_PITCH)
  257. #define LV2_GROUP_UTILITY (LV2_PLUGIN_UTILITY|LV2_PLUGIN_ANALYSER|LV2_PLUGIN_CONVERTER|LV2_PLUGIN_FUNCTION|LV2_PLUGIN_MIXER)
  258. #define LV2_IS_DELAY(x, y) (((x) & LV2_GROUP_DELAY) || ((y) & LV2_GROUP_DELAY))
  259. #define LV2_IS_DISTORTION(x, y) (((x) & LV2_GROUP_DISTORTION) || ((y) & LV2_GROUP_DISTORTION))
  260. #define LV2_IS_DYNAMICS(x, y) (((x) & LV2_GROUP_DYNAMICS) || ((y) & LV2_GROUP_DYNAMICS))
  261. #define LV2_IS_EQ(x, y) (((x) & LV2_GROUP_EQ) || ((y) & LV2_GROUP_EQ))
  262. #define LV2_IS_FILTER(x, y) (((x) & LV2_GROUP_FILTER) || ((y) & LV2_GROUP_FILTER))
  263. #define LV2_IS_GENERATOR(x, y) (((x) & LV2_GROUP_GENERATOR) || ((y) & LV2_GROUP_GENERATOR))
  264. #define LV2_IS_MODULATOR(x, y) (((x) & LV2_GROUP_MODULATOR) || ((y) & LV2_GROUP_MODULATOR))
  265. #define LV2_IS_REVERB(x, y) (((x) & LV2_GROUP_REVERB) || ((y) & LV2_GROUP_REVERB))
  266. #define LV2_IS_SIMULATOR(x, y) (((x) & LV2_GROUP_SIMULATOR) || ((y) & LV2_GROUP_SIMULATOR))
  267. #define LV2_IS_SPATIAL(x, y) (((x) & LV2_GROUP_SPATIAL) || ((y) & LV2_GROUP_SPATIAL))
  268. #define LV2_IS_SPECTRAL(x, y) (((x) & LV2_GROUP_SPECTRAL) || ((y) & LV2_GROUP_SPECTRAL))
  269. #define LV2_IS_UTILITY(x, y) (((x) & LV2_GROUP_UTILITY) || ((y) & LV2_GROUP_UTILITY))
  270. // Port Midi Map
  271. struct LV2_RDF_PortMidiMap {
  272. LV2_Property Type;
  273. uint32_t Number;
  274. LV2_RDF_PortMidiMap() noexcept
  275. : Type(0),
  276. Number(0) {}
  277. };
  278. // Port Points
  279. struct LV2_RDF_PortPoints {
  280. LV2_Property Hints;
  281. float Default;
  282. float Minimum;
  283. float Maximum;
  284. LV2_RDF_PortPoints() noexcept
  285. : Hints(0x0),
  286. Default(0.0f),
  287. Minimum(0.0f),
  288. Maximum(1.0f) {}
  289. };
  290. // Port Unit
  291. struct LV2_RDF_PortUnit {
  292. LV2_Property Hints;
  293. const char* Name;
  294. const char* Render;
  295. const char* Symbol;
  296. LV2_Property Unit;
  297. LV2_RDF_PortUnit() noexcept
  298. : Hints(0x0),
  299. Name(nullptr),
  300. Render(nullptr),
  301. Symbol(nullptr),
  302. Unit(0) {}
  303. ~LV2_RDF_PortUnit()
  304. {
  305. if (Name != nullptr)
  306. {
  307. delete[] Name;
  308. Name = nullptr;
  309. }
  310. if (Render != nullptr)
  311. {
  312. delete[] Render;
  313. Render = nullptr;
  314. }
  315. if (Symbol != nullptr)
  316. {
  317. delete[] Symbol;
  318. Symbol = nullptr;
  319. }
  320. }
  321. CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_PortUnit)
  322. };
  323. // Port Scale Point
  324. struct LV2_RDF_PortScalePoint {
  325. const char* Label;
  326. float Value;
  327. LV2_RDF_PortScalePoint() noexcept
  328. : Label(nullptr),
  329. Value(0.0f) {}
  330. ~LV2_RDF_PortScalePoint()
  331. {
  332. if (Label != nullptr)
  333. {
  334. delete[] Label;
  335. Label = nullptr;
  336. }
  337. }
  338. CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_PortScalePoint)
  339. };
  340. // Port
  341. struct LV2_RDF_Port {
  342. LV2_Property Types;
  343. LV2_Property Properties;
  344. LV2_Property Designation;
  345. const char* Name;
  346. const char* Symbol;
  347. LV2_RDF_PortMidiMap MidiMap;
  348. LV2_RDF_PortPoints Points;
  349. LV2_RDF_PortUnit Unit;
  350. uint32_t ScalePointCount;
  351. LV2_RDF_PortScalePoint* ScalePoints;
  352. LV2_RDF_Port() noexcept
  353. : Types(0x0),
  354. Properties(0x0),
  355. Designation(0),
  356. Name(nullptr),
  357. Symbol(nullptr),
  358. ScalePointCount(0),
  359. ScalePoints(nullptr) {}
  360. ~LV2_RDF_Port()
  361. {
  362. if (Name != nullptr)
  363. {
  364. delete[] Name;
  365. Name = nullptr;
  366. }
  367. if (Symbol != nullptr)
  368. {
  369. delete[] Symbol;
  370. Symbol = nullptr;
  371. }
  372. if (ScalePoints != nullptr)
  373. {
  374. delete[] ScalePoints;
  375. ScalePoints = nullptr;
  376. }
  377. }
  378. CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Port)
  379. };
  380. // Preset
  381. struct LV2_RDF_Preset {
  382. LV2_URI URI;
  383. const char* Label;
  384. LV2_RDF_Preset() noexcept
  385. : URI(nullptr),
  386. Label(nullptr) {}
  387. ~LV2_RDF_Preset()
  388. {
  389. if (URI != nullptr)
  390. {
  391. delete[] URI;
  392. URI = nullptr;
  393. }
  394. if (Label != nullptr)
  395. {
  396. delete[] Label;
  397. Label = nullptr;
  398. }
  399. }
  400. CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Preset)
  401. };
  402. // Feature
  403. struct LV2_RDF_Feature {
  404. LV2_Property Type;
  405. LV2_URI URI;
  406. LV2_RDF_Feature() noexcept
  407. : Type(0),
  408. URI(nullptr) {}
  409. ~LV2_RDF_Feature()
  410. {
  411. if (URI != nullptr)
  412. {
  413. delete[] URI;
  414. URI = nullptr;
  415. }
  416. }
  417. CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Feature)
  418. };
  419. // UI
  420. struct LV2_RDF_UI {
  421. LV2_Property Type;
  422. LV2_URI URI;
  423. const char* Binary;
  424. const char* Bundle;
  425. uint32_t FeatureCount;
  426. LV2_RDF_Feature* Features;
  427. uint32_t ExtensionCount;
  428. LV2_URI* Extensions;
  429. LV2_RDF_UI() noexcept
  430. : Type(0),
  431. URI(nullptr),
  432. Binary(nullptr),
  433. Bundle(nullptr),
  434. FeatureCount(0),
  435. Features(nullptr),
  436. ExtensionCount(0),
  437. Extensions(nullptr) {}
  438. ~LV2_RDF_UI()
  439. {
  440. if (URI != nullptr)
  441. {
  442. delete[] URI;
  443. URI = nullptr;
  444. }
  445. if (Binary != nullptr)
  446. {
  447. delete[] Binary;
  448. Binary = nullptr;
  449. }
  450. if (Bundle != nullptr)
  451. {
  452. delete[] Bundle;
  453. Bundle = nullptr;
  454. }
  455. if (Features != nullptr)
  456. {
  457. delete[] Features;
  458. Features = nullptr;
  459. }
  460. if (Extensions != nullptr)
  461. {
  462. delete[] Extensions;
  463. Extensions = nullptr;
  464. }
  465. }
  466. CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_UI)
  467. };
  468. // Plugin Descriptor
  469. struct LV2_RDF_Descriptor {
  470. LV2_Property Type[2];
  471. LV2_URI URI;
  472. const char* Name;
  473. const char* Author;
  474. const char* License;
  475. const char* Binary;
  476. const char* Bundle;
  477. unsigned long UniqueID;
  478. uint32_t PortCount;
  479. LV2_RDF_Port* Ports;
  480. uint32_t PresetCount;
  481. LV2_RDF_Preset* Presets;
  482. uint32_t FeatureCount;
  483. LV2_RDF_Feature* Features;
  484. uint32_t ExtensionCount;
  485. LV2_URI* Extensions;
  486. uint32_t UICount;
  487. LV2_RDF_UI* UIs;
  488. LV2_RDF_Descriptor() noexcept
  489. : URI(nullptr),
  490. Name(nullptr),
  491. Author(nullptr),
  492. License(nullptr),
  493. Binary(nullptr),
  494. Bundle(nullptr),
  495. UniqueID(0),
  496. PortCount(0),
  497. Ports(nullptr),
  498. PresetCount(0),
  499. Presets(nullptr),
  500. FeatureCount(0),
  501. Features(nullptr),
  502. ExtensionCount(0),
  503. Extensions(nullptr),
  504. UICount(0),
  505. UIs(nullptr)
  506. {
  507. Type[0] = Type[1] = 0x0;
  508. }
  509. ~LV2_RDF_Descriptor()
  510. {
  511. if (URI != nullptr)
  512. {
  513. delete[] URI;
  514. URI = nullptr;
  515. }
  516. if (Name != nullptr)
  517. {
  518. delete[] Name;
  519. Name = nullptr;
  520. }
  521. if (Author != nullptr)
  522. {
  523. delete[] Author;
  524. Author = nullptr;
  525. }
  526. if (License != nullptr)
  527. {
  528. delete[] License;
  529. License = nullptr;
  530. }
  531. if (Binary != nullptr)
  532. {
  533. delete[] Binary;
  534. Binary = nullptr;
  535. }
  536. if (Bundle != nullptr)
  537. {
  538. delete[] Bundle;
  539. Bundle = nullptr;
  540. }
  541. if (Ports != nullptr)
  542. {
  543. delete[] Ports;
  544. Ports = nullptr;
  545. }
  546. if (Presets != nullptr)
  547. {
  548. delete[] Presets;
  549. Presets = nullptr;
  550. }
  551. if (Features != nullptr)
  552. {
  553. delete[] Features;
  554. Features = nullptr;
  555. }
  556. if (Extensions != nullptr)
  557. {
  558. delete[] Extensions;
  559. Extensions = nullptr;
  560. }
  561. if (UIs != nullptr)
  562. {
  563. delete[] UIs;
  564. UIs = nullptr;
  565. }
  566. }
  567. CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Descriptor)
  568. };
  569. #endif // LV2_RDF_HPP_INCLUDED