DISTRHO Plugin Framework
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.

398 lines
11KB

  1. #pragma once
  2. /**
  3. This file contains C Macros that describe this plugin.
  4. With these macros we can tell the host what features the plugin requires.
  5. New functions will be available to call and/or override depending on which macros are enabled.
  6. All values are either integer or strings.
  7. For boolean-like values 1 means 'on' and 0 means 'off'.
  8. */
  9. /**
  10. The plugin name.
  11. This is used to identify your plugin before a Plugin instance can be created.
  12. @note This macro is required.
  13. */
  14. #define DISTRHO_PLUGIN_NAME "CairoUI"
  15. /**
  16. Number of audio inputs the plugin has.
  17. @note This macro is required.
  18. */
  19. #define DISTRHO_PLUGIN_NUM_INPUTS 1
  20. /**
  21. Number of audio outputs the plugin has.
  22. @note This macro is required.
  23. */
  24. #define DISTRHO_PLUGIN_NUM_OUTPUTS 1
  25. /**
  26. The plugin URI when exporting in LV2 format.
  27. TODO describe what a URI is
  28. @note This macro is required.
  29. */
  30. #define DISTRHO_PLUGIN_URI "http://distrho.sf.net/examples/CairoUI"
  31. /**
  32. Whether the plugin has a custom UI.
  33. */
  34. #define DISTRHO_PLUGIN_HAS_UI 1
  35. /**
  36. Whether the plugin processing is realtime-safe.
  37. TODO - list rtsafe requirements
  38. */
  39. #define DISTRHO_PLUGIN_IS_RT_SAFE 1
  40. /**
  41. Whether the plugin is a synth.
  42. @ref DISTRHO_PLUGIN_WANT_MIDI_INPUT is automatically enabled when this is too.
  43. @see DISTRHO_PLUGIN_WANT_MIDI_INPUT
  44. */
  45. // #define DISTRHO_PLUGIN_IS_SYNTH 0
  46. /**
  47. Request the minimum buffer size for the input and output event ports.
  48. Currently only used in LV2, with a default value of 2048 if unset.
  49. */
  50. // #define DISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE 2048
  51. /**
  52. Whether the plugin has an LV2 modgui.
  53. This will simply add a "rdfs:seeAlso <modgui.ttl>" on the LV2 manifest.
  54. It is up to you to create this file.
  55. */
  56. // #define DISTRHO_PLUGIN_USES_MODGUI 0
  57. /**
  58. Enable direct access between the UI and plugin code.
  59. @see UI::getPluginInstancePointer()
  60. @note DO NOT USE THIS UNLESS STRICTLY NECESSARY!!
  61. Try to avoid it at all costs!
  62. */
  63. // #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
  64. /**
  65. Whether the plugin introduces latency during audio or midi processing.
  66. @see Plugin::setLatency(uint32_t)
  67. */
  68. // #define DISTRHO_PLUGIN_WANT_LATENCY 0
  69. /**
  70. Whether the plugin wants MIDI input.
  71. This is automatically enabled if @ref DISTRHO_PLUGIN_IS_SYNTH is true.
  72. */
  73. // #define DISTRHO_PLUGIN_WANT_MIDI_INPUT 0
  74. /**
  75. Whether the plugin wants MIDI output.
  76. @see Plugin::writeMidiEvent(const MidiEvent&)
  77. */
  78. // #define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 0
  79. /**
  80. Whether the plugin wants to change its own parameter inputs.
  81. Not all hosts or plugin formats support this,
  82. so Plugin::canRequestParameterValueChanges() can be used to query support at runtime.
  83. @see Plugin::requestParameterValueChange(uint32_t, float)
  84. */
  85. // #define DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST 0
  86. /**
  87. Whether the plugin provides its own internal programs.
  88. @see Plugin::initProgramName(uint32_t, String&)
  89. @see Plugin::loadProgram(uint32_t)
  90. */
  91. // #define DISTRHO_PLUGIN_WANT_PROGRAMS 0
  92. /**
  93. Whether the plugin uses internal non-parameter data.
  94. @see Plugin::initState(uint32_t, String&, String&)
  95. @see Plugin::setState(const char*, const char*)
  96. */
  97. // #define DISTRHO_PLUGIN_WANT_STATE 0
  98. /**
  99. Whether the plugin implements the full state API.
  100. When this macro is enabled, the plugin must implement a new getState(const char* key) function, which the host calls when saving its session/project.
  101. This is useful for plugins that have custom internal values not exposed to the host as key-value state pairs or parameters.
  102. Most simple effects and synths will not need this.
  103. @note this macro is automatically enabled if a plugin has programs and state, as the key-value state pairs need to be updated when the current program changes.
  104. @see Plugin::getState(const char*)
  105. */
  106. // #define DISTRHO_PLUGIN_WANT_FULL_STATE 0
  107. /**
  108. Whether the plugin wants time position information from the host.
  109. @see Plugin::getTimePosition()
  110. */
  111. // #define DISTRHO_PLUGIN_WANT_TIMEPOS 0
  112. /**
  113. Whether the UI uses Cairo for drawing instead of the default OpenGL mode.
  114. When enabled your UI instance will subclass CairoTopLevelWidget instead of TopLevelWidget.
  115. */
  116. #define DISTRHO_UI_USE_CAIRO 1
  117. /**
  118. Whether the UI uses a custom toolkit implementation based on OpenGL.
  119. When enabled, the macros DISTRHO_UI_CUSTOM_INCLUDE_PATH and DISTRHO_UI_CUSTOM_WIDGET_TYPE are required.
  120. */
  121. // #define DISTRHO_UI_USE_CUSTOM 0
  122. /**
  123. The include path to the header file used by the custom toolkit implementation.
  124. This path must be relative to dpf/distrho/DistrhoUI.hpp
  125. */
  126. // #define DISTRHO_UI_CUSTOM_INCLUDE_PATH
  127. /**
  128. The top-level-widget typedef to use for the custom toolkit.
  129. This widget class MUST be a subclass of DGL TopLevelWindow class.
  130. It is recommended that you keep this widget class inside the DGL namespace,
  131. and define widget type as e.g. DGL_NAMESPACE::MyCustomTopLevelWidget.
  132. */
  133. // #define DISTRHO_UI_CUSTOM_WIDGET_TYPE
  134. /**
  135. Whether the %UI uses NanoVG for drawing instead of the default raw OpenGL mode.@n
  136. When enabled your %UI instance will subclass NanoTopLevelWidget instead of TopLevelWidget.
  137. */
  138. // #define DISTRHO_UI_USE_NANOVG 0
  139. /**
  140. Default UI width to use when creating initial and temporary windows.
  141. Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
  142. (which would normally be done for knowing the UI size before host creates a window for it)
  143. Value must match 1x scale factor.
  144. When this macro is defined, the companion DISTRHO_UI_DEFAULT_HEIGHT macro must be defined as well.
  145. */
  146. #define DISTRHO_UI_DEFAULT_WIDTH 200
  147. /**
  148. Default UI height to use when creating initial and temporary windows.
  149. Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
  150. (which would normally be done for knowing the UI size before host creates a window for it)
  151. Value must match 1x scale factor.
  152. When this macro is defined, the companion DISTRHO_UI_DEFAULT_WIDTH macro must be defined as well.
  153. */
  154. #define DISTRHO_UI_DEFAULT_HEIGHT 200
  155. /**
  156. Whether the UI is resizable to any size by the user and OS.
  157. By default this is false, with resizing only allowed when coded from the the plugin UI side.
  158. Enabling this options makes it possible for the user to resize the plugin UI at anytime.
  159. @see UI::setGeometryConstraints(uint, uint, bool, bool)
  160. */
  161. // #define DISTRHO_UI_USER_RESIZABLE 0
  162. /**
  163. Whether to UI is going to use file browser dialogs.
  164. By default this is false, with the file browser APIs not available for use.
  165. */
  166. // #define DISTRHO_UI_FILE_BROWSER 0
  167. /**
  168. Whether to UI is going to use web browser views.
  169. By default this is false, with the web browser APIs not available for use.
  170. */
  171. // #define DISTRHO_UI_WEB_VIEW 0
  172. /**
  173. The UI URI when exporting in LV2 format.
  174. By default this is set to @ref DISTRHO_PLUGIN_URI with "#UI" as suffix.
  175. */
  176. // #define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI"
  177. /**
  178. The AudioUnit type for a plugin.
  179. This is a 4-character symbol, automatically set by DPF based on other plugin macros.
  180. See https://developer.apple.com/documentation/audiotoolbox/1584142-audio_unit_types for more information.
  181. */
  182. // #define DISTRHO_PLUGIN_AU_TYPE aufx
  183. /**
  184. A 4-character symbol that identifies a brand or manufacturer, with at least one non-lower case character.
  185. Plugins from the same brand should use the same symbol.
  186. @note This macro is required when building AU plugins, and used for VST3 if present
  187. @note Setting this macro will change the uid of a VST3 plugin.
  188. If you already released a DPF-based VST3 plugin make sure to also enable DPF_VST3_DONT_USE_BRAND_ID
  189. */
  190. #define DISTRHO_PLUGIN_BRAND_ID Dstr
  191. /**
  192. A 4-character symbol which identifies a plugin.
  193. It must be unique within at least a set of plugins from the brand.
  194. @note This macro is required when building AU plugins
  195. */
  196. #define DISTRHO_PLUGIN_UNIQUE_ID dCai
  197. /**
  198. Custom LV2 category for the plugin.
  199. This is a single string, and can be one of the following values:
  200. - lv2:AllpassPlugin
  201. - lv2:AmplifierPlugin
  202. - lv2:AnalyserPlugin
  203. - lv2:BandpassPlugin
  204. - lv2:ChorusPlugin
  205. - lv2:CombPlugin
  206. - lv2:CompressorPlugin
  207. - lv2:ConstantPlugin
  208. - lv2:ConverterPlugin
  209. - lv2:DelayPlugin
  210. - lv2:DistortionPlugin
  211. - lv2:DynamicsPlugin
  212. - lv2:EQPlugin
  213. - lv2:EnvelopePlugin
  214. - lv2:ExpanderPlugin
  215. - lv2:FilterPlugin
  216. - lv2:FlangerPlugin
  217. - lv2:FunctionPlugin
  218. - lv2:GatePlugin
  219. - lv2:GeneratorPlugin
  220. - lv2:HighpassPlugin
  221. - lv2:InstrumentPlugin
  222. - lv2:LimiterPlugin
  223. - lv2:LowpassPlugin
  224. - lv2:MIDIPlugin
  225. - lv2:MixerPlugin
  226. - lv2:ModulatorPlugin
  227. - lv2:MultiEQPlugin
  228. - lv2:OscillatorPlugin
  229. - lv2:ParaEQPlugin
  230. - lv2:PhaserPlugin
  231. - lv2:PitchPlugin
  232. - lv2:ReverbPlugin
  233. - lv2:SimulatorPlugin
  234. - lv2:SpatialPlugin
  235. - lv2:SpectralPlugin
  236. - lv2:UtilityPlugin
  237. - lv2:WaveshaperPlugin
  238. See http://lv2plug.in/ns/lv2core for more information.
  239. */
  240. #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:UtilityPlugin"
  241. /**
  242. Custom VST3 categories for the plugin.
  243. This is a single concatenated string of categories, separated by a @c |.
  244. Each effect category can be one of the following values:
  245. - Fx
  246. - Fx|Ambisonics
  247. - Fx|Analyzer
  248. - Fx|Delay
  249. - Fx|Distortion
  250. - Fx|Dynamics
  251. - Fx|EQ
  252. - Fx|Filter
  253. - Fx|Instrument
  254. - Fx|Instrument|External
  255. - Fx|Spatial
  256. - Fx|Generator
  257. - Fx|Mastering
  258. - Fx|Modulation
  259. - Fx|Network
  260. - Fx|Pitch Shift
  261. - Fx|Restoration
  262. - Fx|Reverb
  263. - Fx|Surround
  264. - Fx|Tools
  265. Each instrument category can be one of the following values:
  266. - Instrument
  267. - Instrument|Drum
  268. - Instrument|External
  269. - Instrument|Piano
  270. - Instrument|Sampler
  271. - Instrument|Synth
  272. - Instrument|Synth|Sampler
  273. And extra categories possible for any plugin type:
  274. - Mono
  275. - Stereo
  276. */
  277. #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Tools|Mono"
  278. /**
  279. Custom CLAP features for the plugin.
  280. This is a list of features defined as a string array body, without the terminating @c , or nullptr.
  281. A top-level category can be set as feature and be one of the following values:
  282. - instrument
  283. - audio-effect
  284. - note-effect
  285. - analyzer
  286. The following sub-categories can also be set:
  287. - synthesizer
  288. - sampler
  289. - drum
  290. - drum-machine
  291. - filter
  292. - phaser
  293. - equalizer
  294. - de-esser
  295. - phase-vocoder
  296. - granular
  297. - frequency-shifter
  298. - pitch-shifter
  299. - distortion
  300. - transient-shaper
  301. - compressor
  302. - limiter
  303. - flanger
  304. - chorus
  305. - delay
  306. - reverb
  307. - tremolo
  308. - glitch
  309. - utility
  310. - pitch-correction
  311. - restoration
  312. - multi-effects
  313. - mixing
  314. - mastering
  315. And finally the following audio capabilities can be set:
  316. - mono
  317. - stereo
  318. - surround
  319. - ambisonic
  320. */
  321. #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "utility", "mono"
  322. /**
  323. The plugin id when exporting in CLAP format, in reverse URI form.
  324. @note This macro is required when building CLAP plugins
  325. */
  326. #define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.examples.cairo-ui"
  327. enum Parameters {
  328. kParameterKnob,
  329. kParameterTriState,
  330. kParameterButton,
  331. kParameterCount
  332. };