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.

551 lines
20KB

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