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.

580 lines
21KB

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