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.

563 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_SPEED 0xD
  161. #define LV2_IS_PORT_DESIGNATION_CONTROL(x) ((x) == LV2_PORT_DESIGNATION_CONTROL)
  162. #define LV2_IS_PORT_DESIGNATION_FREEWHEELING(x) ((x) == LV2_PORT_DESIGNATION_FREEWHEELING)
  163. #define LV2_IS_PORT_DESIGNATION_LATENCY(x) ((x) == LV2_PORT_DESIGNATION_LATENCY)
  164. #define LV2_IS_PORT_DESIGNATION_SAMPLE_RATE(x) ((x) == LV2_PORT_DESIGNATION_SAMPLE_RATE)
  165. #define LV2_IS_PORT_DESIGNATION_TIME_BAR(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR)
  166. #define LV2_IS_PORT_DESIGNATION_TIME_BAR_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR_BEAT)
  167. #define LV2_IS_PORT_DESIGNATION_TIME_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEAT)
  168. #define LV2_IS_PORT_DESIGNATION_TIME_BEAT_UNIT(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEAT_UNIT)
  169. #define LV2_IS_PORT_DESIGNATION_TIME_BEATS_PER_BAR(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR)
  170. #define LV2_IS_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE(x) ((x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE)
  171. #define LV2_IS_PORT_DESIGNATION_TIME_FRAME(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAME)
  172. #define LV2_IS_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND)
  173. #define LV2_IS_PORT_DESIGNATION_TIME_SPEED(x) ((x) == LV2_PORT_DESIGNATION_TIME_SPEED)
  174. #define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) >= LV2_PORT_DESIGNATION_TIME_BAR && (x) <= LV2_PORT_DESIGNATION_TIME_SPEED)
  175. // Feature Types
  176. #define LV2_FEATURE_OPTIONAL 0x1
  177. #define LV2_FEATURE_REQUIRED 0x2
  178. #define LV2_IS_FEATURE_OPTIONAL(x) ((x) == LV2_FEATURE_OPTIONAL)
  179. #define LV2_IS_FEATURE_REQUIRED(x) ((x) == LV2_FEATURE_REQUIRED)
  180. // UI Types
  181. #define LV2_UI_GTK2 0x1
  182. #define LV2_UI_GTK3 0x2
  183. #define LV2_UI_QT4 0x3
  184. #define LV2_UI_QT5 0x4
  185. #define LV2_UI_COCOA 0x5
  186. #define LV2_UI_WINDOWS 0x6
  187. #define LV2_UI_X11 0x7
  188. #define LV2_UI_EXTERNAL 0x8
  189. #define LV2_UI_OLD_EXTERNAL 0x9
  190. #define LV2_IS_UI_GTK2(x) ((x) == LV2_UI_GTK2)
  191. #define LV2_IS_UI_GTK3(x) ((x) == LV2_UI_GTK3)
  192. #define LV2_IS_UI_QT4(x) ((x) == LV2_UI_QT4)
  193. #define LV2_IS_UI_QT5(x) ((x) == LV2_UI_QT5)
  194. #define LV2_IS_UI_COCOA(x) ((x) == LV2_UI_COCOA)
  195. #define LV2_IS_UI_WINDOWS(x) ((x) == LV2_UI_WINDOWS)
  196. #define LV2_IS_UI_X11(x) ((x) == LV2_UI_X11)
  197. #define LV2_IS_UI_EXTERNAL(x) ((x) == LV2_UI_EXTERNAL)
  198. #define LV2_IS_UI_OLD_EXTERNAL(x) ((x) == LV2_UI_OLD_EXTERNAL)
  199. // Plugin Types
  200. #define LV2_PLUGIN_DELAY 0x000001
  201. #define LV2_PLUGIN_REVERB 0x000002
  202. #define LV2_PLUGIN_SIMULATOR 0x000004
  203. #define LV2_PLUGIN_DISTORTION 0x000008
  204. #define LV2_PLUGIN_WAVESHAPER 0x000010
  205. #define LV2_PLUGIN_DYNAMICS 0x000020
  206. #define LV2_PLUGIN_AMPLIFIER 0x000040
  207. #define LV2_PLUGIN_COMPRESSOR 0x000080
  208. #define LV2_PLUGIN_ENVELOPE 0x000100
  209. #define LV2_PLUGIN_EXPANDER 0x000200
  210. #define LV2_PLUGIN_GATE 0x000400
  211. #define LV2_PLUGIN_LIMITER 0x000800
  212. #define LV2_PLUGIN_EQ 0x001000
  213. #define LV2_PLUGIN_MULTI_EQ 0x002000
  214. #define LV2_PLUGIN_PARA_EQ 0x004000
  215. #define LV2_PLUGIN_FILTER 0x008000
  216. #define LV2_PLUGIN_ALLPASS 0x010000
  217. #define LV2_PLUGIN_BANDPASS 0x020000
  218. #define LV2_PLUGIN_COMB 0x040000
  219. #define LV2_PLUGIN_HIGHPASS 0x080000
  220. #define LV2_PLUGIN_LOWPASS 0x100000
  221. #define LV2_PLUGIN_GENERATOR 0x000001
  222. #define LV2_PLUGIN_CONSTANT 0x000002
  223. #define LV2_PLUGIN_INSTRUMENT 0x000004
  224. #define LV2_PLUGIN_OSCILLATOR 0x000008
  225. #define LV2_PLUGIN_MODULATOR 0x000010
  226. #define LV2_PLUGIN_CHORUS 0x000020
  227. #define LV2_PLUGIN_FLANGER 0x000040
  228. #define LV2_PLUGIN_PHASER 0x000080
  229. #define LV2_PLUGIN_SPATIAL 0x000100
  230. #define LV2_PLUGIN_SPECTRAL 0x000200
  231. #define LV2_PLUGIN_PITCH 0x000400
  232. #define LV2_PLUGIN_UTILITY 0x000800
  233. #define LV2_PLUGIN_ANALYSER 0x001000
  234. #define LV2_PLUGIN_CONVERTER 0x002000
  235. #define LV2_PLUGIN_FUNCTION 0x008000
  236. #define LV2_PLUGIN_MIXER 0x010000
  237. #define LV2_GROUP_DELAY (LV2_PLUGIN_DELAY|LV2_PLUGIN_REVERB)
  238. #define LV2_GROUP_DISTORTION (LV2_PLUGIN_DISTORTION|LV2_PLUGIN_WAVESHAPER)
  239. #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)
  240. #define LV2_GROUP_EQ (LV2_PLUGIN_EQ|LV2_PLUGIN_MULTI_EQ|LV2_PLUGIN_PARA_EQ)
  241. #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)
  242. #define LV2_GROUP_GENERATOR (LV2_PLUGIN_GENERATOR|LV2_PLUGIN_CONSTANT|LV2_PLUGIN_INSTRUMENT|LV2_PLUGIN_OSCILLATOR)
  243. #define LV2_GROUP_MODULATOR (LV2_PLUGIN_MODULATOR|LV2_PLUGIN_CHORUS|LV2_PLUGIN_FLANGER|LV2_PLUGIN_PHASER)
  244. #define LV2_GROUP_REVERB (LV2_PLUGIN_REVERB)
  245. #define LV2_GROUP_SIMULATOR (LV2_PLUGIN_SIMULATOR|LV2_PLUGIN_REVERB)
  246. #define LV2_GROUP_SPATIAL (LV2_PLUGIN_SPATIAL)
  247. #define LV2_GROUP_SPECTRAL (LV2_PLUGIN_SPECTRAL|LV2_PLUGIN_PITCH)
  248. #define LV2_GROUP_UTILITY (LV2_PLUGIN_UTILITY|LV2_PLUGIN_ANALYSER|LV2_PLUGIN_CONVERTER|LV2_PLUGIN_FUNCTION|LV2_PLUGIN_MIXER)
  249. #define LV2_IS_DELAY(x, y) (((x) & LV2_GROUP_DELAY) || ((y) & LV2_GROUP_DELAY))
  250. #define LV2_IS_DISTORTION(x, y) (((x) & LV2_GROUP_DISTORTION) || ((y) & LV2_GROUP_DISTORTION))
  251. #define LV2_IS_DYNAMICS(x, y) (((x) & LV2_GROUP_DYNAMICS) || ((y) & LV2_GROUP_DYNAMICS))
  252. #define LV2_IS_EQ(x, y) (((x) & LV2_GROUP_EQ) || ((y) & LV2_GROUP_EQ))
  253. #define LV2_IS_FILTER(x, y) (((x) & LV2_GROUP_FILTER) || ((y) & LV2_GROUP_FILTER))
  254. #define LV2_IS_GENERATOR(x, y) (((x) & LV2_GROUP_GENERATOR) || ((y) & LV2_GROUP_GENERATOR))
  255. #define LV2_IS_MODULATOR(x, y) (((x) & LV2_GROUP_MODULATOR) || ((y) & LV2_GROUP_MODULATOR))
  256. #define LV2_IS_REVERB(x, y) (((x) & LV2_GROUP_REVERB) || ((y) & LV2_GROUP_REVERB))
  257. #define LV2_IS_SIMULATOR(x, y) (((x) & LV2_GROUP_SIMULATOR) || ((y) & LV2_GROUP_SIMULATOR))
  258. #define LV2_IS_SPATIAL(x, y) (((x) & LV2_GROUP_SPATIAL) || ((y) & LV2_GROUP_SPATIAL))
  259. #define LV2_IS_SPECTRAL(x, y) (((x) & LV2_GROUP_SPECTRAL) || ((y) & LV2_GROUP_SPECTRAL))
  260. #define LV2_IS_UTILITY(x, y) (((x) & LV2_GROUP_UTILITY) || ((y) & LV2_GROUP_UTILITY))
  261. // Port Midi Map
  262. struct LV2_RDF_PortMidiMap {
  263. LV2_Property Type;
  264. uint32_t Number;
  265. LV2_RDF_PortMidiMap()
  266. : Type(0),
  267. Number(0) {}
  268. LV2_RDF_PortMidiMap(LV2_RDF_PortMidiMap&) = delete;
  269. LV2_RDF_PortMidiMap(const LV2_RDF_PortMidiMap&) = delete;
  270. };
  271. // Port Points
  272. struct LV2_RDF_PortPoints {
  273. LV2_Property Hints;
  274. float Default;
  275. float Minimum;
  276. float Maximum;
  277. LV2_RDF_PortPoints()
  278. : Hints(0x0),
  279. Default(0.0f),
  280. Minimum(0.0f),
  281. Maximum(1.0f) {}
  282. //LV2_RDF_PortPoints(LV2_RDF_PortPoints&) = delete;
  283. //LV2_RDF_PortPoints(const LV2_RDF_PortPoints&) = delete;
  284. };
  285. // Port Unit
  286. struct LV2_RDF_PortUnit {
  287. LV2_Property Hints;
  288. const char* Name;
  289. const char* Render;
  290. const char* Symbol;
  291. LV2_Property Unit;
  292. LV2_RDF_PortUnit()
  293. : Hints(0x0),
  294. Name(nullptr),
  295. Render(nullptr),
  296. Symbol(nullptr),
  297. Unit(0) {}
  298. ~LV2_RDF_PortUnit()
  299. {
  300. if (Name != nullptr)
  301. delete[] Name;
  302. if (Render != nullptr)
  303. delete[] Render;
  304. if (Symbol != nullptr)
  305. delete[] Symbol;
  306. }
  307. LV2_RDF_PortUnit(LV2_RDF_PortUnit&) = delete;
  308. LV2_RDF_PortUnit(const LV2_RDF_PortUnit&) = delete;
  309. };
  310. // Port Scale Point
  311. struct LV2_RDF_PortScalePoint {
  312. const char* Label;
  313. float Value;
  314. LV2_RDF_PortScalePoint()
  315. : Label(nullptr),
  316. Value(0.0f) {}
  317. ~LV2_RDF_PortScalePoint()
  318. {
  319. if (Label != nullptr)
  320. delete[] Label;
  321. }
  322. LV2_RDF_PortScalePoint(LV2_RDF_PortScalePoint&) = delete;
  323. LV2_RDF_PortScalePoint(const LV2_RDF_PortScalePoint&) = delete;
  324. };
  325. // Port
  326. struct LV2_RDF_Port {
  327. LV2_Property Types;
  328. LV2_Property Properties;
  329. LV2_Property Designation;
  330. const char* Name;
  331. const char* Symbol;
  332. LV2_RDF_PortMidiMap MidiMap;
  333. LV2_RDF_PortPoints Points;
  334. LV2_RDF_PortUnit Unit;
  335. uint32_t ScalePointCount;
  336. LV2_RDF_PortScalePoint* ScalePoints;
  337. LV2_RDF_Port()
  338. : Types(0x0),
  339. Properties(0x0),
  340. Designation(0),
  341. Name(nullptr),
  342. Symbol(nullptr),
  343. ScalePointCount(0),
  344. ScalePoints(nullptr) {}
  345. ~LV2_RDF_Port()
  346. {
  347. if (Name != nullptr)
  348. delete[] Name;
  349. if (Symbol != nullptr)
  350. delete[] Symbol;
  351. if (ScalePoints != nullptr)
  352. delete[] ScalePoints;
  353. }
  354. LV2_RDF_Port(LV2_RDF_Port&) = delete;
  355. LV2_RDF_Port(const LV2_RDF_Port&) = delete;
  356. };
  357. // Preset
  358. struct LV2_RDF_Preset {
  359. LV2_URI URI;
  360. const char* Label;
  361. LV2_RDF_Preset()
  362. : URI(nullptr),
  363. Label(nullptr) {}
  364. ~LV2_RDF_Preset()
  365. {
  366. if (URI != nullptr)
  367. delete[] URI;
  368. if (Label != nullptr)
  369. delete[] Label;
  370. }
  371. LV2_RDF_Preset(LV2_RDF_Preset&) = delete;
  372. LV2_RDF_Preset(const LV2_RDF_Preset&) = delete;
  373. };
  374. // Feature
  375. struct LV2_RDF_Feature {
  376. LV2_Property Type;
  377. LV2_URI URI;
  378. LV2_RDF_Feature()
  379. : Type(0),
  380. URI(nullptr) {}
  381. ~LV2_RDF_Feature()
  382. {
  383. if (URI != nullptr)
  384. delete[] URI;
  385. }
  386. LV2_RDF_Feature(LV2_RDF_Feature&) = delete;
  387. LV2_RDF_Feature(const LV2_RDF_Feature&) = delete;
  388. };
  389. // UI
  390. struct LV2_RDF_UI {
  391. LV2_Property Type;
  392. LV2_URI URI;
  393. const char* Binary;
  394. const char* Bundle;
  395. uint32_t FeatureCount;
  396. LV2_RDF_Feature* Features;
  397. uint32_t ExtensionCount;
  398. LV2_URI* Extensions;
  399. LV2_RDF_UI()
  400. : Type(0),
  401. URI(nullptr),
  402. Binary(nullptr),
  403. Bundle(nullptr),
  404. FeatureCount(0),
  405. Features(nullptr),
  406. ExtensionCount(0),
  407. Extensions(nullptr) {}
  408. ~LV2_RDF_UI()
  409. {
  410. if (URI != nullptr)
  411. delete[] URI;
  412. if (Binary != nullptr)
  413. delete[] Binary;
  414. if (Bundle != nullptr)
  415. delete[] Bundle;
  416. if (Features != nullptr)
  417. delete[] Features;
  418. if (Extensions != nullptr)
  419. delete[] Extensions;
  420. }
  421. LV2_RDF_UI(LV2_RDF_UI&) = delete;
  422. LV2_RDF_UI(const LV2_RDF_UI&) = delete;
  423. };
  424. // Plugin
  425. struct LV2_RDF_Descriptor {
  426. LV2_Property Type[2];
  427. LV2_URI URI;
  428. const char* Name;
  429. const char* Author;
  430. const char* License;
  431. const char* Binary;
  432. const char* Bundle;
  433. unsigned long UniqueID;
  434. uint32_t PortCount;
  435. LV2_RDF_Port* Ports;
  436. uint32_t PresetCount;
  437. LV2_RDF_Preset* Presets;
  438. uint32_t FeatureCount;
  439. LV2_RDF_Feature* Features;
  440. uint32_t ExtensionCount;
  441. LV2_URI* Extensions;
  442. uint32_t UICount;
  443. LV2_RDF_UI* UIs;
  444. LV2_RDF_Descriptor()
  445. : Type{0x0},
  446. URI(nullptr),
  447. Name(nullptr),
  448. Author(nullptr),
  449. License(nullptr),
  450. Binary(nullptr),
  451. Bundle(nullptr),
  452. UniqueID(0),
  453. PortCount(0),
  454. Ports(nullptr),
  455. PresetCount(0),
  456. Presets(nullptr),
  457. FeatureCount(0),
  458. Features(nullptr),
  459. ExtensionCount(0),
  460. Extensions(nullptr),
  461. UICount(0),
  462. UIs(nullptr) {}
  463. ~LV2_RDF_Descriptor()
  464. {
  465. if (URI != nullptr)
  466. delete[] URI;
  467. if (Name != nullptr)
  468. delete[] Name;
  469. if (Author != nullptr)
  470. delete[] Author;
  471. if (License != nullptr)
  472. delete[] License;
  473. if (Binary != nullptr)
  474. delete[] Binary;
  475. if (Bundle != nullptr)
  476. delete[] Bundle;
  477. if (Ports != nullptr)
  478. delete[] Ports;
  479. if (Presets != nullptr)
  480. delete[] Presets;
  481. if (Features != nullptr)
  482. delete[] Features;
  483. if (Extensions != nullptr)
  484. delete[] Extensions;
  485. if (UIs != nullptr)
  486. delete[] UIs;
  487. }
  488. LV2_RDF_Descriptor(LV2_RDF_Descriptor&) = delete;
  489. LV2_RDF_Descriptor(const LV2_RDF_Descriptor&) = delete;
  490. };
  491. #endif // LV2_RDF_INCLUDED