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