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.

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