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.

581 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_ATOM_URID (0x080 | LV2_PORT_ATOM)
  116. #define LV2_PORT_EVENT 0x100
  117. #define LV2_PORT_MIDI_LL 0x200
  118. // Port Data Types
  119. #define LV2_PORT_DATA_MIDI_EVENT 0x1000
  120. #define LV2_PORT_DATA_OBJECT 0x2000
  121. #define LV2_PORT_DATA_PATCH_MESSAGE 0x4000
  122. #define LV2_PORT_DATA_TIME 0x8000
  123. #define LV2_IS_PORT_INPUT(x) ((x) & LV2_PORT_INPUT)
  124. #define LV2_IS_PORT_OUTPUT(x) ((x) & LV2_PORT_OUTPUT)
  125. #define LV2_IS_PORT_CONTROL(x) ((x) & LV2_PORT_CONTROL)
  126. #define LV2_IS_PORT_AUDIO(x) ((x) & LV2_PORT_AUDIO)
  127. #define LV2_IS_PORT_ATOM_SEQUENCE(x) ((x) & LV2_PORT_ATOM_SEQUENCE)
  128. #define LV2_IS_PORT_CV(x) ((x) & LV2_PORT_CV)
  129. #define LV2_IS_PORT_EVENT(x) ((x) & LV2_PORT_EVENT)
  130. #define LV2_IS_PORT_MIDI_LL(x) ((x) & LV2_PORT_MIDI_LL)
  131. #define LV2_PORT_SUPPORTS_MIDI_EVENT(x) ((x) & LV2_PORT_DATA_MIDI_EVENT)
  132. #define LV2_PORT_SUPPORTS_PATCH_MESSAGE(x) ((x) & LV2_PORT_DATA_PATCH_MESSAGE)
  133. // Port Properties
  134. #define LV2_PORT_OPTIONAL 0x0001
  135. #define LV2_PORT_ENUMERATION 0x0002
  136. #define LV2_PORT_INTEGER 0x0004
  137. #define LV2_PORT_SAMPLE_RATE 0x0008
  138. #define LV2_PORT_TOGGLED 0x0010
  139. #define LV2_PORT_CAUSES_ARTIFACTS 0x0020
  140. #define LV2_PORT_CONTINUOUS_CV 0x0040
  141. #define LV2_PORT_DISCRETE_CV 0x0080
  142. #define LV2_PORT_EXPENSIVE 0x0100
  143. #define LV2_PORT_STRICT_BOUNDS 0x0200
  144. #define LV2_PORT_LOGARITHMIC 0x0400
  145. #define LV2_PORT_NOT_AUTOMATIC 0x0800
  146. #define LV2_PORT_NOT_ON_GUI 0x1000
  147. #define LV2_PORT_TRIGGER 0x2000
  148. #define LV2_IS_PORT_OPTIONAL(x) ((x) & LV2_PORT_OPTIONAL)
  149. #define LV2_IS_PORT_ENUMERATION(x) ((x) & LV2_PORT_ENUMERATION)
  150. #define LV2_IS_PORT_INTEGER(x) ((x) & LV2_PORT_INTEGER)
  151. #define LV2_IS_PORT_SAMPLE_RATE(x) ((x) & LV2_PORT_SAMPLE_RATE)
  152. #define LV2_IS_PORT_TOGGLED(x) ((x) & LV2_PORT_TOGGLED)
  153. #define LV2_IS_PORT_CAUSES_ARTIFACTS(x) ((x) & LV2_PORT_CAUSES_ARTIFACTS)
  154. #define LV2_IS_PORT_CONTINUOUS_CV(x) ((x) & LV2_PORT_CONTINUOUS_CV)
  155. #define LV2_IS_PORT_DISCRETE_CV(x) ((x) & LV2_PORT_DISCRETE_CV)
  156. #define LV2_IS_PORT_EXPENSIVE(x) ((x) & LV2_PORT_EXPENSIVE)
  157. #define LV2_IS_PORT_STRICT_BOUNDS(x) ((x) & LV2_PORT_STRICT_BOUNDS)
  158. #define LV2_IS_PORT_LOGARITHMIC(x) ((x) & LV2_PORT_LOGARITHMIC)
  159. #define LV2_IS_PORT_NOT_AUTOMATIC(x) ((x) & LV2_PORT_NOT_AUTOMATIC)
  160. #define LV2_IS_PORT_NOT_ON_GUI(x) ((x) & LV2_PORT_NOT_ON_GUI)
  161. #define LV2_IS_PORT_TRIGGER(x) ((x) & LV2_PORT_TRIGGER)
  162. // Port Designation
  163. #define LV2_PORT_DESIGNATION_FREEWHEELING 0x1
  164. #define LV2_PORT_DESIGNATION_LATENCY 0x2
  165. #define LV2_PORT_DESIGNATION_SAMPLE_RATE 0x3
  166. #define LV2_PORT_DESIGNATION_TIME_BAR 0x4
  167. #define LV2_PORT_DESIGNATION_TIME_BAR_BEAT 0x5
  168. #define LV2_PORT_DESIGNATION_TIME_BEAT 0x6
  169. #define LV2_PORT_DESIGNATION_TIME_BEAT_UNIT 0x7
  170. #define LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR 0x8
  171. #define LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE 0x9
  172. #define LV2_PORT_DESIGNATION_TIME_FRAME 0xA
  173. #define LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND 0xB
  174. #define LV2_PORT_DESIGNATION_TIME_POSITION 0xC
  175. #define LV2_PORT_DESIGNATION_TIME_SPEED 0xD
  176. #define LV2_IS_PORT_DESIGNATION_FREEWHEELING(x) ((x) == LV2_PORT_DESIGNATION_FREEWHEELING)
  177. #define LV2_IS_PORT_DESIGNATION_LATENCY(x) ((x) == LV2_PORT_DESIGNATION_LATENCY)
  178. #define LV2_IS_PORT_DESIGNATION_SAMPLE_RATE(x) ((x) == LV2_PORT_DESIGNATION_SAMPLE_RATE)
  179. #define LV2_IS_PORT_DESIGNATION_TIME_BAR(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR)
  180. #define LV2_IS_PORT_DESIGNATION_TIME_BAR_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR_BEAT)
  181. #define LV2_IS_PORT_DESIGNATION_TIME_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEAT)
  182. #define LV2_IS_PORT_DESIGNATION_TIME_BEAT_UNIT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEAT_UNIT)
  183. #define LV2_IS_PORT_DESIGNATION_TIME_BEATS_PER_BAR(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR)
  184. #define LV2_IS_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE)
  185. #define LV2_IS_PORT_DESIGNATION_TIME_FRAME(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAME)
  186. #define LV2_IS_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND)
  187. #define LV2_IS_PORT_DESIGNATION_TIME_POSITION(x) ((x) == LV2_PORT_DESIGNATION_TIME_POSITION)
  188. #define LV2_IS_PORT_DESIGNATION_TIME_SPEED(x) ((x) == LV2_PORT_DESIGNATION_TIME_SPEED)
  189. #define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) >= LV2_PORT_DESIGNATION_TIME_BAR && (x) <= LV2_PORT_DESIGNATION_TIME_SPEED)
  190. // Feature Types
  191. #define LV2_FEATURE_OPTIONAL 0x1
  192. #define LV2_FEATURE_REQUIRED 0x2
  193. #define LV2_IS_FEATURE_OPTIONAL(x) ((x) == LV2_FEATURE_OPTIONAL)
  194. #define LV2_IS_FEATURE_REQUIRED(x) ((x) == LV2_FEATURE_REQUIRED)
  195. // UI Types
  196. #define LV2_UI_GTK2 0x1
  197. #define LV2_UI_GTK3 0x2
  198. #define LV2_UI_QT4 0x3
  199. #define LV2_UI_QT5 0x4
  200. #define LV2_UI_COCOA 0x5
  201. #define LV2_UI_WINDOWS 0x6
  202. #define LV2_UI_X11 0x7
  203. #define LV2_UI_EXTERNAL 0x8
  204. #define LV2_UI_OLD_EXTERNAL 0x9
  205. #define LV2_IS_UI_GTK2(x) ((x) == LV2_UI_GTK2)
  206. #define LV2_IS_UI_GTK3(x) ((x) == LV2_UI_GTK3)
  207. #define LV2_IS_UI_QT4(x) ((x) == LV2_UI_QT4)
  208. #define LV2_IS_UI_QT5(x) ((x) == LV2_UI_QT5)
  209. #define LV2_IS_UI_COCOA(x) ((x) == LV2_UI_COCOA)
  210. #define LV2_IS_UI_WINDOWS(x) ((x) == LV2_UI_WINDOWS)
  211. #define LV2_IS_UI_X11(x) ((x) == LV2_UI_X11)
  212. #define LV2_IS_UI_EXTERNAL(x) ((x) == LV2_UI_EXTERNAL)
  213. #define LV2_IS_UI_OLD_EXTERNAL(x) ((x) == LV2_UI_OLD_EXTERNAL)
  214. // Plugin Types
  215. #define LV2_PLUGIN_DELAY 0x000001
  216. #define LV2_PLUGIN_REVERB 0x000002
  217. #define LV2_PLUGIN_SIMULATOR 0x000004
  218. #define LV2_PLUGIN_DISTORTION 0x000008
  219. #define LV2_PLUGIN_WAVESHAPER 0x000010
  220. #define LV2_PLUGIN_DYNAMICS 0x000020
  221. #define LV2_PLUGIN_AMPLIFIER 0x000040
  222. #define LV2_PLUGIN_COMPRESSOR 0x000080
  223. #define LV2_PLUGIN_ENVELOPE 0x000100
  224. #define LV2_PLUGIN_EXPANDER 0x000200
  225. #define LV2_PLUGIN_GATE 0x000400
  226. #define LV2_PLUGIN_LIMITER 0x000800
  227. #define LV2_PLUGIN_EQ 0x001000
  228. #define LV2_PLUGIN_MULTI_EQ 0x002000
  229. #define LV2_PLUGIN_PARA_EQ 0x004000
  230. #define LV2_PLUGIN_FILTER 0x008000
  231. #define LV2_PLUGIN_ALLPASS 0x010000
  232. #define LV2_PLUGIN_BANDPASS 0x020000
  233. #define LV2_PLUGIN_COMB 0x040000
  234. #define LV2_PLUGIN_HIGHPASS 0x080000
  235. #define LV2_PLUGIN_LOWPASS 0x100000
  236. #define LV2_PLUGIN_GENERATOR 0x000001
  237. #define LV2_PLUGIN_CONSTANT 0x000002
  238. #define LV2_PLUGIN_INSTRUMENT 0x000004
  239. #define LV2_PLUGIN_OSCILLATOR 0x000008
  240. #define LV2_PLUGIN_MODULATOR 0x000010
  241. #define LV2_PLUGIN_CHORUS 0x000020
  242. #define LV2_PLUGIN_FLANGER 0x000040
  243. #define LV2_PLUGIN_PHASER 0x000080
  244. #define LV2_PLUGIN_SPATIAL 0x000100
  245. #define LV2_PLUGIN_SPECTRAL 0x000200
  246. #define LV2_PLUGIN_PITCH 0x000400
  247. #define LV2_PLUGIN_UTILITY 0x000800
  248. #define LV2_PLUGIN_ANALYSER 0x001000
  249. #define LV2_PLUGIN_CONVERTER 0x002000
  250. #define LV2_PLUGIN_FUNCTION 0x008000
  251. #define LV2_PLUGIN_MIXER 0x010000
  252. #define LV2_GROUP_DELAY (LV2_PLUGIN_DELAY|LV2_PLUGIN_REVERB)
  253. #define LV2_GROUP_DISTORTION (LV2_PLUGIN_DISTORTION|LV2_PLUGIN_WAVESHAPER)
  254. #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)
  255. #define LV2_GROUP_EQ (LV2_PLUGIN_EQ|LV2_PLUGIN_MULTI_EQ|LV2_PLUGIN_PARA_EQ)
  256. #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)
  257. #define LV2_GROUP_GENERATOR (LV2_PLUGIN_GENERATOR|LV2_PLUGIN_CONSTANT|LV2_PLUGIN_INSTRUMENT|LV2_PLUGIN_OSCILLATOR)
  258. #define LV2_GROUP_MODULATOR (LV2_PLUGIN_MODULATOR|LV2_PLUGIN_CHORUS|LV2_PLUGIN_FLANGER|LV2_PLUGIN_PHASER)
  259. #define LV2_GROUP_REVERB (LV2_PLUGIN_REVERB)
  260. #define LV2_GROUP_SIMULATOR (LV2_PLUGIN_SIMULATOR|LV2_PLUGIN_REVERB)
  261. #define LV2_GROUP_SPATIAL (LV2_PLUGIN_SPATIAL)
  262. #define LV2_GROUP_SPECTRAL (LV2_PLUGIN_SPECTRAL|LV2_PLUGIN_PITCH)
  263. #define LV2_GROUP_UTILITY (LV2_PLUGIN_UTILITY|LV2_PLUGIN_ANALYSER|LV2_PLUGIN_CONVERTER|LV2_PLUGIN_FUNCTION|LV2_PLUGIN_MIXER)
  264. #define LV2_IS_DELAY(x, y) (((x) & LV2_GROUP_DELAY) || ((y) & LV2_GROUP_DELAY))
  265. #define LV2_IS_DISTORTION(x, y) (((x) & LV2_GROUP_DISTORTION) || ((y) & LV2_GROUP_DISTORTION))
  266. #define LV2_IS_DYNAMICS(x, y) (((x) & LV2_GROUP_DYNAMICS) || ((y) & LV2_GROUP_DYNAMICS))
  267. #define LV2_IS_EQ(x, y) (((x) & LV2_GROUP_EQ) || ((y) & LV2_GROUP_EQ))
  268. #define LV2_IS_FILTER(x, y) (((x) & LV2_GROUP_FILTER) || ((y) & LV2_GROUP_FILTER))
  269. #define LV2_IS_GENERATOR(x, y) (((x) & LV2_GROUP_GENERATOR) || ((y) & LV2_GROUP_GENERATOR))
  270. #define LV2_IS_MODULATOR(x, y) (((x) & LV2_GROUP_MODULATOR) || ((y) & LV2_GROUP_MODULATOR))
  271. #define LV2_IS_REVERB(x, y) (((x) & LV2_GROUP_REVERB) || ((y) & LV2_GROUP_REVERB))
  272. #define LV2_IS_SIMULATOR(x, y) (((x) & LV2_GROUP_SIMULATOR) || ((y) & LV2_GROUP_SIMULATOR))
  273. #define LV2_IS_SPATIAL(x, y) (((x) & LV2_GROUP_SPATIAL) || ((y) & LV2_GROUP_SPATIAL))
  274. #define LV2_IS_SPECTRAL(x, y) (((x) & LV2_GROUP_SPECTRAL) || ((y) & LV2_GROUP_SPECTRAL))
  275. #define LV2_IS_UTILITY(x, y) (((x) & LV2_GROUP_UTILITY) || ((y) & LV2_GROUP_UTILITY))
  276. // Port Midi Map
  277. struct LV2_RDF_PortMidiMap {
  278. LV2_Property Type;
  279. uint32_t Number;
  280. LV2_RDF_PortMidiMap()
  281. : Type(0),
  282. Number(0) {}
  283. LV2_RDF_PortMidiMap(LV2_RDF_PortMidiMap&) = delete;
  284. LV2_RDF_PortMidiMap(const LV2_RDF_PortMidiMap&) = delete;
  285. };
  286. // Port Points
  287. struct LV2_RDF_PortPoints {
  288. LV2_Property Hints;
  289. float Default;
  290. float Minimum;
  291. float Maximum;
  292. LV2_RDF_PortPoints()
  293. : Hints(0x0),
  294. Default(0.0f),
  295. Minimum(0.0f),
  296. Maximum(1.0f) {}
  297. LV2_RDF_PortPoints(LV2_RDF_PortPoints&) = delete;
  298. LV2_RDF_PortPoints(const LV2_RDF_PortPoints&) = delete;
  299. };
  300. // Port Unit
  301. struct LV2_RDF_PortUnit {
  302. LV2_Property Hints;
  303. const char* Name;
  304. const char* Render;
  305. const char* Symbol;
  306. LV2_Property Unit;
  307. LV2_RDF_PortUnit()
  308. : Hints(0x0),
  309. Name(nullptr),
  310. Render(nullptr),
  311. Symbol(nullptr),
  312. Unit(0) {}
  313. ~LV2_RDF_PortUnit()
  314. {
  315. if (Name != nullptr)
  316. delete[] Name;
  317. if (Render != nullptr)
  318. delete[] Render;
  319. if (Symbol != nullptr)
  320. delete[] Symbol;
  321. }
  322. LV2_RDF_PortUnit(LV2_RDF_PortUnit&) = delete;
  323. LV2_RDF_PortUnit(const LV2_RDF_PortUnit&) = delete;
  324. };
  325. // Port Scale Point
  326. struct LV2_RDF_PortScalePoint {
  327. const char* Label;
  328. float Value;
  329. LV2_RDF_PortScalePoint()
  330. : Label(nullptr),
  331. Value(0.0f) {}
  332. ~LV2_RDF_PortScalePoint()
  333. {
  334. if (Label != nullptr)
  335. delete[] Label;
  336. }
  337. LV2_RDF_PortScalePoint(LV2_RDF_PortScalePoint&) = delete;
  338. LV2_RDF_PortScalePoint(const LV2_RDF_PortScalePoint&) = delete;
  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()
  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. delete[] Name;
  364. if (Symbol != nullptr)
  365. delete[] Symbol;
  366. if (ScalePoints != nullptr)
  367. delete[] ScalePoints;
  368. }
  369. LV2_RDF_Port(LV2_RDF_Port&) = delete;
  370. LV2_RDF_Port(const LV2_RDF_Port&) = delete;
  371. };
  372. // Preset
  373. struct LV2_RDF_Preset {
  374. LV2_URI URI;
  375. const char* Label;
  376. LV2_RDF_Preset()
  377. : URI(nullptr),
  378. Label(nullptr) {}
  379. ~LV2_RDF_Preset()
  380. {
  381. if (URI != nullptr)
  382. delete[] URI;
  383. if (Label != nullptr)
  384. delete[] Label;
  385. }
  386. LV2_RDF_Preset(LV2_RDF_Preset&) = delete;
  387. LV2_RDF_Preset(const LV2_RDF_Preset&) = delete;
  388. };
  389. // Feature
  390. struct LV2_RDF_Feature {
  391. LV2_Property Type;
  392. LV2_URI URI;
  393. LV2_RDF_Feature()
  394. : Type(0),
  395. URI(nullptr) {}
  396. ~LV2_RDF_Feature()
  397. {
  398. if (URI != nullptr)
  399. delete[] URI;
  400. }
  401. LV2_RDF_Feature(LV2_RDF_Feature&) = delete;
  402. LV2_RDF_Feature(const LV2_RDF_Feature&) = delete;
  403. };
  404. // UI
  405. struct LV2_RDF_UI {
  406. LV2_Type Type;
  407. LV2_URI URI;
  408. const char* Binary;
  409. const char* Bundle;
  410. uint32_t FeatureCount;
  411. LV2_RDF_Feature* Features;
  412. uint32_t ExtensionCount;
  413. LV2_URI* Extensions;
  414. LV2_RDF_UI()
  415. : URI(nullptr),
  416. Binary(nullptr),
  417. Bundle(nullptr),
  418. FeatureCount(0),
  419. Features(nullptr),
  420. ExtensionCount(0),
  421. Extensions(nullptr) {}
  422. ~LV2_RDF_UI()
  423. {
  424. if (URI != nullptr)
  425. delete[] URI;
  426. if (Binary != nullptr)
  427. delete[] Binary;
  428. if (Bundle != nullptr)
  429. delete[] Bundle;
  430. if (Features != nullptr)
  431. delete[] Features;
  432. if (Extensions != nullptr)
  433. delete[] Extensions;
  434. }
  435. LV2_RDF_UI(LV2_RDF_UI&) = delete;
  436. LV2_RDF_UI(const LV2_RDF_UI&) = delete;
  437. };
  438. // Plugin
  439. struct LV2_RDF_Descriptor {
  440. LV2_Property Type[2];
  441. LV2_URI URI;
  442. const char* Name;
  443. const char* Author;
  444. const char* License;
  445. const char* Binary;
  446. const char* Bundle;
  447. unsigned long UniqueID;
  448. uint32_t PortCount;
  449. LV2_RDF_Port* Ports;
  450. uint32_t PresetCount;
  451. LV2_RDF_Preset* Presets;
  452. uint32_t FeatureCount;
  453. LV2_RDF_Feature* Features;
  454. uint32_t ExtensionCount;
  455. LV2_URI* Extensions;
  456. uint32_t UICount;
  457. LV2_RDF_UI* UIs;
  458. LV2_RDF_Descriptor()
  459. : Type{0x0},
  460. URI(nullptr),
  461. Name(nullptr),
  462. Author(nullptr),
  463. License(nullptr),
  464. Binary(nullptr),
  465. Bundle(nullptr),
  466. UniqueID(0),
  467. PortCount(0),
  468. Ports(nullptr),
  469. PresetCount(0),
  470. Presets(nullptr),
  471. FeatureCount(0),
  472. Features(nullptr),
  473. ExtensionCount(0),
  474. Extensions(nullptr),
  475. UICount(0),
  476. UIs(nullptr) {}
  477. ~LV2_RDF_Descriptor()
  478. {
  479. if (URI != nullptr)
  480. delete[] URI;
  481. if (Name != nullptr)
  482. delete[] Name;
  483. if (Author != nullptr)
  484. delete[] Author;
  485. if (License != nullptr)
  486. delete[] License;
  487. if (Binary != nullptr)
  488. delete[] Binary;
  489. if (Bundle != nullptr)
  490. delete[] Bundle;
  491. if (Ports != nullptr)
  492. delete[] Ports;
  493. if (Presets != nullptr)
  494. delete[] Presets;
  495. if (Features != nullptr)
  496. delete[] Features;
  497. if (Extensions != nullptr)
  498. delete[] Extensions;
  499. if (UIs != nullptr)
  500. delete[] UIs;
  501. }
  502. LV2_RDF_Descriptor(LV2_RDF_Descriptor&) = delete;
  503. LV2_RDF_Descriptor(const LV2_RDF_Descriptor&) = delete;
  504. };
  505. #endif // LV2_RDF_INCLUDED