Collection of DPF-based plugins for packaging
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.

975 lines
29KB

  1. /*
  2. * DISTRHO Plugin Framework (DPF)
  3. * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifdef DOXYGEN
  17. #include "src/DistrhoDefines.h"
  18. START_NAMESPACE_DISTRHO
  19. /* ------------------------------------------------------------------------------------------------------------
  20. * Intro */
  21. /**
  22. @mainpage DISTRHO %Plugin Framework
  23. DISTRHO %Plugin Framework (or @b DPF for short)
  24. is a plugin framework designed to make development of new plugins an easy and enjoyable task.@n
  25. It allows developers to create plugins with custom UIs using a simple C++ API.@n
  26. The framework facilitates exporting various different plugin formats from the same code-base.
  27. DPF can build for LADSPA, DSSI, LV2, VST2, VST3 and CLAP formats.@n
  28. A JACK/Standalone mode is also available, allowing you to quickly test plugins.
  29. @section Macros
  30. You start by creating a "DistrhoPluginInfo.h" file describing the plugin via macros, see @ref PluginMacros.@n
  31. This file is included during compilation of the main DPF code to select which features to activate for each plugin format.
  32. For example, a plugin (with %UI) that use states will require LV2 hosts to support Atom and Worker extensions for
  33. message passing from the %UI to the (DSP) plugin.@n
  34. If your plugin does not make use of states, the Worker extension is not set as a required feature.
  35. @section Plugin
  36. The next step is to create your plugin code by subclassing DPF's Plugin class.@n
  37. You need to pass the number of parameters in the constructor and also the number of programs and states, if any.
  38. Do note all of DPF code is within its own C++ namespace (@b DISTRHO for DSP/plugin stuff, @b DGL for UI stuff).@n
  39. You can use @ref START_NAMESPACE_DISTRHO / @ref END_NAMESPACE_DISTRHO combo around your code, or globally set @ref USE_NAMESPACE_DISTRHO.@n
  40. These are defined as compiler macros so that you can override the namespace name during build. When in doubt, just follow the examples.
  41. @section Examples
  42. Let's begin with some examples.@n
  43. Here is one of a stereo audio plugin that simply mutes the host output:
  44. @code
  45. /* DPF plugin include */
  46. #include "DistrhoPlugin.hpp"
  47. /* Make DPF related classes available for us to use without any extra namespace references */
  48. USE_NAMESPACE_DISTRHO;
  49. /**
  50. Our custom plugin class.
  51. Subclassing `Plugin` from DPF is how this all works.
  52. By default, only information-related functions and `run` are pure virtual (that is, must be reimplemented).
  53. When enabling certain features (such as programs or states, more on that below), a few extra functions also need to be reimplemented.
  54. */
  55. class MutePlugin : public Plugin
  56. {
  57. public:
  58. /**
  59. Plugin class constructor.
  60. */
  61. MutePlugin()
  62. : Plugin(0, 0, 0) // 0 parameters, 0 programs and 0 states
  63. {
  64. }
  65. protected:
  66. /* ----------------------------------------------------------------------------------------
  67. * Information */
  68. /**
  69. Get the plugin label.
  70. This label is a short restricted name consisting of only _, a-z, A-Z and 0-9 characters.
  71. */
  72. const char* getLabel() const override
  73. {
  74. return "Mute";
  75. }
  76. /**
  77. Get the plugin author/maker.
  78. */
  79. const char* getMaker() const override
  80. {
  81. return "DPF";
  82. }
  83. /**
  84. Get the plugin license name (a single line of text).
  85. For commercial plugins this should return some short copyright information.
  86. */
  87. const char* getLicense() const override
  88. {
  89. return "MIT";
  90. }
  91. /**
  92. Get the plugin version, in hexadecimal.
  93. */
  94. uint32_t getVersion() const override
  95. {
  96. return d_version(1, 0, 0);
  97. }
  98. /**
  99. Get the plugin unique Id.
  100. This value is used by LADSPA, DSSI, VST2 and VST3 plugin formats.
  101. */
  102. int64_t getUniqueId() const override
  103. {
  104. return d_cconst('M', 'u', 't', 'e');
  105. }
  106. /* ----------------------------------------------------------------------------------------
  107. * Audio/MIDI Processing */
  108. /**
  109. Run/process function for plugins without MIDI input.
  110. */
  111. void run(const float**, float** outputs, uint32_t frames) override
  112. {
  113. // get the left and right audio outputs
  114. float* const outL = outputs[0];
  115. float* const outR = outputs[1];
  116. // mute audio
  117. std::memset(outL, 0, sizeof(float)*frames);
  118. std::memset(outR, 0, sizeof(float)*frames);
  119. }
  120. };
  121. /**
  122. Create an instance of the Plugin class.
  123. This is the entry point for DPF plugins.
  124. DPF will call this to either create an instance of your plugin for the host or to fetch some initial information for internal caching.
  125. */
  126. Plugin* createPlugin()
  127. {
  128. return new MutePlugin();
  129. }
  130. @endcode
  131. See the Plugin class for more information.
  132. @section Parameters
  133. A plugin is nothing without parameters.@n
  134. In DPF parameters can be inputs or outputs.@n
  135. They have hints to describe how they behave plus a name and a symbol identifying them.@n
  136. Parameters also have 'ranges' - a minimum, maximum and default value.
  137. Input parameters are by default "read-only": the plugin can read them but not change them.
  138. (there are exceptions and possibly a request to the host to change values, more on that below)@n
  139. It's the host responsibility to save, restore and set input parameters.
  140. Output parameters can be changed at anytime by the plugin.@n
  141. The host will simply read their values and never change them.
  142. Here's an example of an audio plugin that has 1 input parameter:
  143. @code
  144. class GainPlugin : public Plugin
  145. {
  146. public:
  147. /**
  148. Plugin class constructor.
  149. You must set all parameter values to their defaults, matching ParameterRanges::def.
  150. */
  151. GainPlugin()
  152. : Plugin(1, 0, 0), // 1 parameter, 0 programs and 0 states
  153. fGain(1.0f)
  154. {
  155. }
  156. protected:
  157. /* ----------------------------------------------------------------------------------------
  158. * Information */
  159. const char* getLabel() const override
  160. {
  161. return "Gain";
  162. }
  163. const char* getMaker() const override
  164. {
  165. return "DPF";
  166. }
  167. const char* getLicense() const override
  168. {
  169. return "MIT";
  170. }
  171. uint32_t getVersion() const override
  172. {
  173. return d_version(1, 0, 0);
  174. }
  175. int64_t getUniqueId() const override
  176. {
  177. return d_cconst('G', 'a', 'i', 'n');
  178. }
  179. /* ----------------------------------------------------------------------------------------
  180. * Init */
  181. /**
  182. Initialize a parameter.
  183. This function will be called once, shortly after the plugin is created.
  184. */
  185. void initParameter(uint32_t index, Parameter& parameter) override
  186. {
  187. // we only have one parameter so we can skip checking the index
  188. parameter.hints = kParameterIsAutomatable;
  189. parameter.name = "Gain";
  190. parameter.symbol = "gain";
  191. parameter.ranges.min = 0.0f;
  192. parameter.ranges.max = 2.0f;
  193. parameter.ranges.def = 1.0f;
  194. }
  195. /* ----------------------------------------------------------------------------------------
  196. * Internal data */
  197. /**
  198. Get the current value of a parameter.
  199. */
  200. float getParameterValue(uint32_t index) const override
  201. {
  202. // same as before, ignore index check
  203. return fGain;
  204. }
  205. /**
  206. Change a parameter value.
  207. */
  208. void setParameterValue(uint32_t index, float value) override
  209. {
  210. // same as before, ignore index check
  211. fGain = value;
  212. }
  213. /* ----------------------------------------------------------------------------------------
  214. * Audio/MIDI Processing */
  215. void run(const float**, float** outputs, uint32_t frames) override
  216. {
  217. // get the mono input and output
  218. const float* const in = inputs[0];
  219. /* */ float* const out = outputs[0];
  220. // apply gain against all samples
  221. for (uint32_t i=0; i < frames; ++i)
  222. out[i] = in[i] * fGain;
  223. }
  224. private:
  225. float fGain;
  226. };
  227. @endcode
  228. See the Parameter struct for more information about parameters.
  229. @section Programs
  230. Programs in DPF refer to plugin-side presets (usually called "factory presets").@n
  231. This is meant as an initial set of presets provided by plugin authors included in the actual plugin.
  232. To use programs you must first enable them by setting @ref DISTRHO_PLUGIN_WANT_PROGRAMS to 1 in your DistrhoPluginInfo.h file.@n
  233. When enabled you'll need to override 2 new function in your plugin code,
  234. Plugin::initProgramName(uint32_t, String&) and Plugin::loadProgram(uint32_t).
  235. Here's an example of a plugin with a "default" program:
  236. @code
  237. class PluginWithPresets : public Plugin
  238. {
  239. public:
  240. PluginWithPresets()
  241. : Plugin(2, 1, 0), // 2 parameters, 1 program and 0 states
  242. fGainL(1.0f),
  243. fGainR(1.0f),
  244. {
  245. }
  246. protected:
  247. /* ----------------------------------------------------------------------------------------
  248. * Information */
  249. const char* getLabel() const override
  250. {
  251. return "Prog";
  252. }
  253. const char* getMaker() const override
  254. {
  255. return "DPF";
  256. }
  257. const char* getLicense() const override
  258. {
  259. return "MIT";
  260. }
  261. uint32_t getVersion() const override
  262. {
  263. return d_version(1, 0, 0);
  264. }
  265. int64_t getUniqueId() const override
  266. {
  267. return d_cconst('P', 'r', 'o', 'g');
  268. }
  269. /* ----------------------------------------------------------------------------------------
  270. * Init */
  271. /**
  272. Initialize a parameter.
  273. This function will be called once, shortly after the plugin is created.
  274. */
  275. void initParameter(uint32_t index, Parameter& parameter) override
  276. {
  277. parameter.hints = kParameterIsAutomatable;
  278. parameter.ranges.min = 0.0f;
  279. parameter.ranges.max = 2.0f;
  280. parameter.ranges.def = 1.0f;
  281. switch (index)
  282. {
  283. case 0:
  284. parameter.name = "Gain Right";
  285. parameter.symbol = "gainR";
  286. break;
  287. case 1:
  288. parameter.name = "Gain Left";
  289. parameter.symbol = "gainL";
  290. break;
  291. }
  292. }
  293. /**
  294. Set the name of the program @a index.
  295. This function will be called once, shortly after the plugin is created.
  296. */
  297. void initProgramName(uint32_t index, String& programName)
  298. {
  299. // we only have one program so we can skip checking the index
  300. programName = "Default";
  301. }
  302. /* ----------------------------------------------------------------------------------------
  303. * Internal data */
  304. /**
  305. Get the current value of a parameter.
  306. */
  307. float getParameterValue(uint32_t index) const override
  308. {
  309. switch (index)
  310. {
  311. case 0:
  312. return fGainL;
  313. case 1:
  314. return fGainR;
  315. default:
  316. return 0.f;
  317. }
  318. }
  319. /**
  320. Change a parameter value.
  321. */
  322. void setParameterValue(uint32_t index, float value) override
  323. {
  324. switch (index)
  325. {
  326. case 0:
  327. fGainL = value;
  328. break;
  329. case 1:
  330. fGainR = value;
  331. break;
  332. }
  333. }
  334. /**
  335. Load a program.
  336. */
  337. void loadProgram(uint32_t index)
  338. {
  339. // same as before, ignore index check
  340. fGainL = 1.0f;
  341. fGainR = 1.0f;
  342. }
  343. /* ----------------------------------------------------------------------------------------
  344. * Audio/MIDI Processing */
  345. void run(const float**, float** outputs, uint32_t frames) override
  346. {
  347. // get the left and right audio buffers
  348. const float* const inL = inputs[0];
  349. const float* const inR = inputs[0];
  350. /* */ float* const outL = outputs[0];
  351. /* */ float* const outR = outputs[0];
  352. // apply gain against all samples
  353. for (uint32_t i=0; i < frames; ++i)
  354. {
  355. outL[i] = inL[i] * fGainL;
  356. outR[i] = inR[i] * fGainR;
  357. }
  358. }
  359. private:
  360. float fGainL, fGainR;
  361. };
  362. @endcode
  363. This is a work-in-progress documentation page. States, MIDI, Latency, Time-Position and UI are still TODO.
  364. */
  365. #if 0
  366. @section States
  367. describe them
  368. @section MIDI
  369. describe them
  370. @section Latency
  371. describe it
  372. @section Time-Position
  373. describe it
  374. @section UI
  375. describe them
  376. #endif
  377. /* ------------------------------------------------------------------------------------------------------------
  378. * Plugin Macros */
  379. /**
  380. @defgroup PluginMacros Plugin Macros
  381. C Macros that describe your plugin. (defined in the "DistrhoPluginInfo.h" file)
  382. With these macros you can tell the host what features your plugin requires.@n
  383. Depending on which macros you enable, new functions will be available to call and/or override.
  384. All values are either integer or strings.@n
  385. For boolean-like values 1 means 'on' and 0 means 'off'.
  386. The values defined in this group are for documentation purposes only.@n
  387. All macros are disabled by default.
  388. Only 4 macros are required, they are:
  389. - @ref DISTRHO_PLUGIN_NAME
  390. - @ref DISTRHO_PLUGIN_NUM_INPUTS
  391. - @ref DISTRHO_PLUGIN_NUM_OUTPUTS
  392. - @ref DISTRHO_PLUGIN_URI
  393. Additionally, @ref DISTRHO_PLUGIN_CLAP_ID is required if building CLAP plugins.
  394. @{
  395. */
  396. /**
  397. The plugin name.@n
  398. This is used to identify your plugin before a Plugin instance can be created.
  399. @note This macro is required.
  400. */
  401. #define DISTRHO_PLUGIN_NAME "Plugin Name"
  402. /**
  403. Number of audio inputs the plugin has.
  404. @note This macro is required.
  405. */
  406. #define DISTRHO_PLUGIN_NUM_INPUTS 2
  407. /**
  408. Number of audio outputs the plugin has.
  409. @note This macro is required.
  410. */
  411. #define DISTRHO_PLUGIN_NUM_OUTPUTS 2
  412. /**
  413. The plugin URI when exporting in LV2 format.
  414. @note This macro is required.
  415. */
  416. #define DISTRHO_PLUGIN_URI "urn:distrho:name"
  417. /**
  418. Whether the plugin has a custom %UI.
  419. @see DISTRHO_UI_USE_NANOVG
  420. @see UI
  421. */
  422. #define DISTRHO_PLUGIN_HAS_UI 1
  423. /**
  424. Whether the plugin processing is realtime-safe.@n
  425. TODO - list rtsafe requirements
  426. */
  427. #define DISTRHO_PLUGIN_IS_RT_SAFE 1
  428. /**
  429. Whether the plugin is a synth.@n
  430. @ref DISTRHO_PLUGIN_WANT_MIDI_INPUT is automatically enabled when this is too.
  431. @see DISTRHO_PLUGIN_WANT_MIDI_INPUT
  432. */
  433. #define DISTRHO_PLUGIN_IS_SYNTH 1
  434. /**
  435. Request the minimum buffer size for the input and output event ports.@n
  436. Currently only used in LV2, with a default value of 2048 if unset.
  437. */
  438. #define DISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE 2048
  439. /**
  440. Whether the plugin has an LV2 modgui.
  441. This will simply add a "rdfs:seeAlso <modgui.ttl>" on the LV2 manifest.@n
  442. It is up to you to create this file.
  443. */
  444. #define DISTRHO_PLUGIN_USES_MODGUI 0
  445. /**
  446. Enable direct access between the %UI and plugin code.
  447. @see UI::getPluginInstancePointer()
  448. @note DO NOT USE THIS UNLESS STRICTLY NECESSARY!!
  449. Try to avoid it at all costs!
  450. */
  451. #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
  452. /**
  453. Whether the plugin introduces latency during audio or midi processing.
  454. @see Plugin::setLatency(uint32_t)
  455. */
  456. #define DISTRHO_PLUGIN_WANT_LATENCY 1
  457. /**
  458. Whether the plugin wants MIDI input.@n
  459. This is automatically enabled if @ref DISTRHO_PLUGIN_IS_SYNTH is true.
  460. */
  461. #define DISTRHO_PLUGIN_WANT_MIDI_INPUT 1
  462. /**
  463. Whether the plugin wants MIDI output.
  464. @see Plugin::writeMidiEvent(const MidiEvent&)
  465. */
  466. #define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1
  467. /**
  468. Whether the plugin wants to change its own parameter inputs.@n
  469. Not all hosts or plugin formats support this,
  470. so Plugin::canRequestParameterValueChanges() can be used to query support at runtime.
  471. @see Plugin::requestParameterValueChange(uint32_t, float)
  472. */
  473. #define DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST 1
  474. /**
  475. Whether the plugin provides its own internal programs.
  476. @see Plugin::initProgramName(uint32_t, String&)
  477. @see Plugin::loadProgram(uint32_t)
  478. */
  479. #define DISTRHO_PLUGIN_WANT_PROGRAMS 1
  480. /**
  481. Whether the plugin uses internal non-parameter data.
  482. @see Plugin::initState(uint32_t, String&, String&)
  483. @see Plugin::setState(const char*, const char*)
  484. */
  485. #define DISTRHO_PLUGIN_WANT_STATE 1
  486. /**
  487. Whether the plugin implements the full state API.
  488. 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.
  489. This is useful for plugins that have custom internal values not exposed to the host as key-value state pairs or parameters.
  490. Most simple effects and synths will not need this.
  491. @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.
  492. @see Plugin::getState(const char*)
  493. */
  494. #define DISTRHO_PLUGIN_WANT_FULL_STATE 1
  495. /**
  496. Whether the plugin wants time position information from the host.
  497. @see Plugin::getTimePosition()
  498. */
  499. #define DISTRHO_PLUGIN_WANT_TIMEPOS 1
  500. /**
  501. Whether the %UI uses Cairo for drawing instead of the default OpenGL mode.@n
  502. When enabled your %UI instance will subclass @ref CairoTopLevelWidget instead of @ref TopLevelWidget.
  503. */
  504. #define DISTRHO_UI_USE_CAIRO 1
  505. /**
  506. Whether the %UI uses a custom toolkit implementation based on OpenGL.@n
  507. When enabled, the macros @ref DISTRHO_UI_CUSTOM_INCLUDE_PATH and @ref DISTRHO_UI_CUSTOM_WIDGET_TYPE are required.
  508. */
  509. #define DISTRHO_UI_USE_CUSTOM 1
  510. /**
  511. The include path to the header file used by the custom toolkit implementation.
  512. This path must be relative to dpf/distrho/DistrhoUI.hpp
  513. @see DISTRHO_UI_USE_CUSTOM
  514. */
  515. #define DISTRHO_UI_CUSTOM_INCLUDE_PATH
  516. /**
  517. Whether the %UI uses NanoVG for drawing instead of the default raw OpenGL mode.@n
  518. When enabled your %UI instance will subclass @ref NanoTopLevelWidget instead of @ref TopLevelWidget.
  519. */
  520. #define DISTRHO_UI_USE_NANOVG 1
  521. /**
  522. The top-level-widget typedef to use for the custom toolkit.
  523. This widget class MUST be a subclass of DGL TopLevelWindow class.
  524. It is recommended that you keep this widget class inside the DGL namespace,
  525. and define widget type as e.g. DGL_NAMESPACE::MyCustomTopLevelWidget.
  526. @see DISTRHO_UI_USE_CUSTOM
  527. */
  528. #define DISTRHO_UI_CUSTOM_WIDGET_TYPE
  529. /**
  530. Default UI width to use when creating initial and temporary windows.@n
  531. Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
  532. (which would normally be done for knowing the UI size before host creates a window for it)
  533. Value must match 1x scale factor.
  534. When this macro is defined, the companion DISTRHO_UI_DEFAULT_HEIGHT macro must be defined as well.
  535. */
  536. #define DISTRHO_UI_DEFAULT_WIDTH 300
  537. /**
  538. Default UI height to use when creating initial and temporary windows.@n
  539. Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
  540. (which would normally be done for knowing the UI size before host creates a window for it)
  541. Value must match 1x scale factor.
  542. When this macro is defined, the companion DISTRHO_UI_DEFAULT_WIDTH macro must be defined as well.
  543. */
  544. #define DISTRHO_UI_DEFAULT_HEIGHT 300
  545. /**
  546. Whether the %UI is resizable to any size by the user and OS.@n
  547. By default this is false, with resizing only allowed when coded from the the plugin UI side.@n
  548. Enabling this options makes it possible for the user to resize the plugin UI at anytime.
  549. @see UI::setGeometryConstraints(uint, uint, bool, bool)
  550. */
  551. #define DISTRHO_UI_USER_RESIZABLE 1
  552. /**
  553. Whether to %UI is going to use file browser dialogs.@n
  554. By default this is false, with the file browser APIs not available for use.
  555. */
  556. #define DISTRHO_UI_FILE_BROWSER 1
  557. /**
  558. Whether to %UI is going to use web browser views.@n
  559. By default this is false, with the web browser APIs not available for use.
  560. */
  561. #define DISTRHO_UI_WEB_VIEW 1
  562. /**
  563. The %UI URI when exporting in LV2 format.@n
  564. By default this is set to @ref DISTRHO_PLUGIN_URI with "#UI" as suffix.
  565. */
  566. #define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI"
  567. /**
  568. The AudioUnit type for a plugin.@n
  569. This is a 4-character symbol, automatically set by DPF based on other plugin macros.
  570. See https://developer.apple.com/documentation/audiotoolbox/1584142-audio_unit_types for more information.
  571. */
  572. #define DISTRHO_PLUGIN_AU_TYPE aufx
  573. /**
  574. A 4-character symbol that identifies a brand or manufacturer, with at least one non-lower case character.@n
  575. Plugins from the same brand should use the same symbol.
  576. @note This macro is required when building AU plugins, and used for VST3 if present
  577. @note Setting this macro will change the uid of a VST3 plugin.
  578. If you already released a DPF-based VST3 plugin make sure to also enable DPF_VST3_DONT_USE_BRAND_ID
  579. */
  580. #define DISTRHO_PLUGIN_BRAND_ID Dstr
  581. /**
  582. A 4-character symbol which identifies a plugin.@n
  583. It must be unique within at least a set of plugins from the brand.
  584. @note This macro is required when building AU plugins
  585. */
  586. #define DISTRHO_PLUGIN_UNIQUE_ID test
  587. /**
  588. Custom LV2 category for the plugin.@n
  589. This is a single string, and can be one of the following values:
  590. - lv2:AllpassPlugin
  591. - lv2:AmplifierPlugin
  592. - lv2:AnalyserPlugin
  593. - lv2:BandpassPlugin
  594. - lv2:ChorusPlugin
  595. - lv2:CombPlugin
  596. - lv2:CompressorPlugin
  597. - lv2:ConstantPlugin
  598. - lv2:ConverterPlugin
  599. - lv2:DelayPlugin
  600. - lv2:DistortionPlugin
  601. - lv2:DynamicsPlugin
  602. - lv2:EQPlugin
  603. - lv2:EnvelopePlugin
  604. - lv2:ExpanderPlugin
  605. - lv2:FilterPlugin
  606. - lv2:FlangerPlugin
  607. - lv2:FunctionPlugin
  608. - lv2:GatePlugin
  609. - lv2:GeneratorPlugin
  610. - lv2:HighpassPlugin
  611. - lv2:InstrumentPlugin
  612. - lv2:LimiterPlugin
  613. - lv2:LowpassPlugin
  614. - lv2:MIDIPlugin
  615. - lv2:MixerPlugin
  616. - lv2:ModulatorPlugin
  617. - lv2:MultiEQPlugin
  618. - lv2:OscillatorPlugin
  619. - lv2:ParaEQPlugin
  620. - lv2:PhaserPlugin
  621. - lv2:PitchPlugin
  622. - lv2:ReverbPlugin
  623. - lv2:SimulatorPlugin
  624. - lv2:SpatialPlugin
  625. - lv2:SpectralPlugin
  626. - lv2:UtilityPlugin
  627. - lv2:WaveshaperPlugin
  628. See http://lv2plug.in/ns/lv2core for more information.
  629. */
  630. #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:Plugin"
  631. /**
  632. Custom VST3 categories for the plugin.@n
  633. This is a single concatenated string of categories, separated by a @c |.
  634. Each effect category can be one of the following values:
  635. - Fx
  636. - Fx|Ambisonics
  637. - Fx|Analyzer
  638. - Fx|Delay
  639. - Fx|Distortion
  640. - Fx|Dynamics
  641. - Fx|EQ
  642. - Fx|Filter
  643. - Fx|Instrument
  644. - Fx|Instrument|External
  645. - Fx|Spatial
  646. - Fx|Generator
  647. - Fx|Mastering
  648. - Fx|Modulation
  649. - Fx|Network
  650. - Fx|Pitch Shift
  651. - Fx|Restoration
  652. - Fx|Reverb
  653. - Fx|Surround
  654. - Fx|Tools
  655. Each instrument category can be one of the following values:
  656. - Instrument
  657. - Instrument|Drum
  658. - Instrument|External
  659. - Instrument|Piano
  660. - Instrument|Sampler
  661. - Instrument|Synth
  662. - Instrument|Synth|Sampler
  663. And extra categories possible for any plugin type:
  664. - Mono
  665. - Stereo
  666. */
  667. #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Stereo"
  668. /**
  669. Custom CLAP features for the plugin.@n
  670. This is a list of features defined as a string array body, without the terminating @c , or nullptr.
  671. A top-level category can be set as feature and be one of the following values:
  672. - instrument
  673. - audio-effect
  674. - note-effect
  675. - analyzer
  676. The following sub-categories can also be set:
  677. - synthesizer
  678. - sampler
  679. - drum
  680. - drum-machine
  681. - filter
  682. - phaser
  683. - equalizer
  684. - de-esser
  685. - phase-vocoder
  686. - granular
  687. - frequency-shifter
  688. - pitch-shifter
  689. - distortion
  690. - transient-shaper
  691. - compressor
  692. - limiter
  693. - flanger
  694. - chorus
  695. - delay
  696. - reverb
  697. - tremolo
  698. - glitch
  699. - utility
  700. - pitch-correction
  701. - restoration
  702. - multi-effects
  703. - mixing
  704. - mastering
  705. And finally the following audio capabilities can be set:
  706. - mono
  707. - stereo
  708. - surround
  709. - ambisonic
  710. */
  711. #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "stereo"
  712. /**
  713. The plugin id when exporting in CLAP format, in reverse URI form.
  714. @note This macro is required when building CLAP plugins
  715. */
  716. #define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.effect"
  717. /** @} */
  718. /* ------------------------------------------------------------------------------------------------------------
  719. * Plugin Macros */
  720. /**
  721. @defgroup ExtraPluginMacros Extra Plugin Macros
  722. C Macros to customize DPF behaviour.
  723. These are macros that do not set plugin features or information, but instead change DPF internals.
  724. They are all optional.
  725. Unless stated otherwise, values are assumed to be a simple/empty define.
  726. @{
  727. */
  728. /**
  729. Whether to enable runtime plugin tests.@n
  730. This will check, during initialization of the plugin, if parameters, programs and states are setup properly.@n
  731. Useful to enable as part of CI, can be safely skipped.@n
  732. Under DPF makefiles this can be enabled by using `make DPF_RUNTIME_TESTING=true`.
  733. @note Some checks are only available with the GCC compiler,
  734. for detecting if a virtual function has been reimplemented.
  735. */
  736. #define DPF_RUNTIME_TESTING
  737. /**
  738. Whether to show parameter outputs in the VST2 plugins.@n
  739. This is disabled (unset) by default, as the VST2 format has no notion of read-only parameters.
  740. */
  741. #define DPF_VST_SHOW_PARAMETER_OUTPUTS
  742. /**
  743. Forcibly ignore DISTRHO_PLUGIN_BRAND_ID for VST3 plugins.@n
  744. This is required for DPF-based VST3 plugins that got released without setting DISTRHO_PLUGIN_BRAND_ID first.
  745. */
  746. #define DPF_VST3_DONT_USE_BRAND_ID
  747. /**
  748. Disable resource files, like internally used fonts.@n
  749. Must be set as compiler macro when building DGL. (e.g. `CXXFLAGS="-DDGL_NO_SHARED_RESOURCES"`)
  750. */
  751. #define DGL_NO_SHARED_RESOURCES
  752. /** @} */
  753. /* ------------------------------------------------------------------------------------------------------------
  754. * Namespace Macros */
  755. /**
  756. @defgroup NamespaceMacros Namespace Macros
  757. C Macros to use and customize DPF namespaces.
  758. These are macros that serve as helpers around C++ namespaces, and also as a way to set custom namespaces during a build.
  759. @{
  760. */
  761. /**
  762. Compiler macro that sets the C++ namespace for DPF plugins.@n
  763. If unset during build, it will use the name @b DISTRHO by default.
  764. Unless you know exactly what you are doing, you do need to modify this value.@n
  765. The only probable useful case for customizing it is if you are building a big collection of very similar DPF-based plugins in your application.@n
  766. For example, having 2 different versions of the same plugin that should behave differently but still exist within the same binary.
  767. On macOS (where due to Objective-C restrictions all code that interacts with Cocoa needs to be in a flat namespace),
  768. DPF will automatically use the plugin name as prefix to flat namespace functions in order to avoid conflicts.
  769. So, basically, it is DPF's job to make sure plugin binaries are 100% usable as-is.@n
  770. You typically do not need to care about this at all.
  771. */
  772. #define DISTRHO_NAMESPACE DISTRHO
  773. /**
  774. Compiler macro that begins the C++ namespace for @b DISTRHO, as needed for (the DSP side of) plugins.@n
  775. All classes in DPF are within this namespace except for UI/graphics stuff.
  776. @see END_NAMESPACE_DISTRHO
  777. */
  778. #define START_NAMESPACE_DISTRHO namespace DISTRHO_NAMESPACE {
  779. /**
  780. Close the namespace previously started by @ref START_NAMESPACE_DISTRHO.@n
  781. This doesn't really need to be a macro, it is just prettier/more consistent that way.
  782. */
  783. #define END_NAMESPACE_DISTRHO }
  784. /**
  785. Make the @b DISTRHO namespace available in the current function scope.@n
  786. This is not set by default in order to avoid conflicts with commonly used names such as "Parameter" and "Plugin".
  787. */
  788. #define USE_NAMESPACE_DISTRHO using namespace DISTRHO_NAMESPACE;
  789. /* TODO
  790. *
  791. * DISTRHO_MACRO_AS_STRING_VALUE
  792. * DISTRHO_MACRO_AS_STRING
  793. * DISTRHO_PROPER_CPP11_SUPPORT
  794. * DONT_SET_USING_DISTRHO_NAMESPACE
  795. *
  796. */
  797. // -----------------------------------------------------------------------------------------------------------
  798. END_NAMESPACE_DISTRHO
  799. #endif // DOXYGEN