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.

939 lines
28KB

  1. /*
  2. * DISTRHO Plugin Framework (DPF)
  3. * Copyright (C) 2012-2022 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 and VST3 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. @{
  394. */
  395. /**
  396. The plugin name.@n
  397. This is used to identify your plugin before a Plugin instance can be created.
  398. @note This macro is required.
  399. */
  400. #define DISTRHO_PLUGIN_NAME "Plugin Name"
  401. /**
  402. Number of audio inputs the plugin has.
  403. @note This macro is required.
  404. */
  405. #define DISTRHO_PLUGIN_NUM_INPUTS 2
  406. /**
  407. Number of audio outputs the plugin has.
  408. @note This macro is required.
  409. */
  410. #define DISTRHO_PLUGIN_NUM_OUTPUTS 2
  411. /**
  412. The plugin URI when exporting in LV2 format.
  413. @note This macro is required.
  414. */
  415. #define DISTRHO_PLUGIN_URI "urn:distrho:name"
  416. /**
  417. Whether the plugin has a custom %UI.
  418. @see DISTRHO_UI_USE_NANOVG
  419. @see UI
  420. */
  421. #define DISTRHO_PLUGIN_HAS_UI 1
  422. /**
  423. Whether the plugin processing is realtime-safe.@n
  424. TODO - list rtsafe requirements
  425. */
  426. #define DISTRHO_PLUGIN_IS_RT_SAFE 1
  427. /**
  428. Whether the plugin is a synth.@n
  429. @ref DISTRHO_PLUGIN_WANT_MIDI_INPUT is automatically enabled when this is too.
  430. @see DISTRHO_PLUGIN_WANT_MIDI_INPUT
  431. */
  432. #define DISTRHO_PLUGIN_IS_SYNTH 1
  433. /**
  434. Request the minimum buffer size for the input and output event ports.@n
  435. Currently only used in LV2, with a default value of 2048 if unset.
  436. */
  437. #define DISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE 2048
  438. /**
  439. Whether the plugin has an LV2 modgui.
  440. This will simply add a "rdfs:seeAlso <modgui.ttl>" on the LV2 manifest.@n
  441. It is up to you to create this file.
  442. */
  443. #define DISTRHO_PLUGIN_USES_MODGUI 0
  444. /**
  445. Enable direct access between the %UI and plugin code.
  446. @see UI::getPluginInstancePointer()
  447. @note DO NOT USE THIS UNLESS STRICTLY NECESSARY!!
  448. Try to avoid it at all costs!
  449. */
  450. #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
  451. /**
  452. Whether the plugin introduces latency during audio or midi processing.
  453. @see Plugin::setLatency(uint32_t)
  454. */
  455. #define DISTRHO_PLUGIN_WANT_LATENCY 1
  456. /**
  457. Whether the plugin wants MIDI input.@n
  458. This is automatically enabled if @ref DISTRHO_PLUGIN_IS_SYNTH is true.
  459. */
  460. #define DISTRHO_PLUGIN_WANT_MIDI_INPUT 1
  461. /**
  462. Whether the plugin wants MIDI output.
  463. @see Plugin::writeMidiEvent(const MidiEvent&)
  464. */
  465. #define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1
  466. /**
  467. Whether the plugin wants to change its own parameter inputs.@n
  468. Not all hosts or plugin formats support this,
  469. so Plugin::canRequestParameterValueChanges() can be used to query support at runtime.
  470. @see Plugin::requestParameterValueChange(uint32_t, float)
  471. */
  472. #define DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST 1
  473. /**
  474. Whether the plugin provides its own internal programs.
  475. @see Plugin::initProgramName(uint32_t, String&)
  476. @see Plugin::loadProgram(uint32_t)
  477. */
  478. #define DISTRHO_PLUGIN_WANT_PROGRAMS 1
  479. /**
  480. Whether the plugin uses internal non-parameter data.
  481. @see Plugin::initState(uint32_t, String&, String&)
  482. @see Plugin::setState(const char*, const char*)
  483. */
  484. #define DISTRHO_PLUGIN_WANT_STATE 1
  485. /**
  486. Whether the plugin implements the full state API.
  487. 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.
  488. This is useful for plugins that have custom internal values not exposed to the host as key-value state pairs or parameters.
  489. Most simple effects and synths will not need this.
  490. @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.
  491. @see Plugin::getState(const char*)
  492. */
  493. #define DISTRHO_PLUGIN_WANT_FULL_STATE 1
  494. /**
  495. Whether the plugin wants time position information from the host.
  496. @see Plugin::getTimePosition()
  497. */
  498. #define DISTRHO_PLUGIN_WANT_TIMEPOS 1
  499. /**
  500. Whether the %UI uses a custom toolkit implementation based on OpenGL.@n
  501. When enabled, the macros @ref DISTRHO_UI_CUSTOM_INCLUDE_PATH and @ref DISTRHO_UI_CUSTOM_WIDGET_TYPE are required.
  502. */
  503. #define DISTRHO_UI_USE_CUSTOM 1
  504. /**
  505. The include path to the header file used by the custom toolkit implementation.
  506. This path must be relative to dpf/distrho/DistrhoUI.hpp
  507. @see DISTRHO_UI_USE_CUSTOM
  508. */
  509. #define DISTRHO_UI_CUSTOM_INCLUDE_PATH
  510. /**
  511. The top-level-widget typedef to use for the custom toolkit.
  512. This widget class MUST be a subclass of DGL TopLevelWindow class.
  513. It is recommended that you keep this widget class inside the DGL namespace,
  514. and define widget type as e.g. DGL_NAMESPACE::MyCustomTopLevelWidget.
  515. @see DISTRHO_UI_USE_CUSTOM
  516. */
  517. #define DISTRHO_UI_CUSTOM_WIDGET_TYPE
  518. /**
  519. Default UI width to use when creating initial and temporary windows.@n
  520. Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
  521. (which would normally be done for knowing the UI size before host creates a window for it)
  522. When this macro is defined, the companion DISTRHO_UI_DEFAULT_HEIGHT macro must be defined as well.
  523. */
  524. #define DISTRHO_UI_DEFAULT_WIDTH 300
  525. /**
  526. Default UI height to use when creating initial and temporary windows.@n
  527. Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
  528. (which would normally be done for knowing the UI size before host creates a window for it)
  529. When this macro is defined, the companion DISTRHO_UI_DEFAULT_WIDTH macro must be defined as well.
  530. */
  531. #define DISTRHO_UI_DEFAULT_HEIGHT 300
  532. /**
  533. Whether the %UI uses NanoVG for drawing instead of the default raw OpenGL calls.@n
  534. When enabled your %UI instance will subclass @ref NanoWidget instead of @ref Widget.
  535. */
  536. #define DISTRHO_UI_USE_NANOVG 1
  537. /**
  538. Whether the %UI is resizable to any size by the user.@n
  539. By default this is false, and resizing is only allowed under the plugin UI control,@n
  540. Enabling this options makes it possible for the user to resize the plugin UI at anytime.
  541. @see UI::setGeometryConstraints(uint, uint, bool, bool)
  542. */
  543. #define DISTRHO_UI_USER_RESIZABLE 1
  544. /**
  545. The %UI URI when exporting in LV2 format.@n
  546. By default this is set to @ref DISTRHO_PLUGIN_URI with "#UI" as suffix.
  547. */
  548. #define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI"
  549. /**
  550. Custom LV2 category for the plugin.@n
  551. This is a single string, and can be one of the following values:
  552. - lv2:AllpassPlugin
  553. - lv2:AmplifierPlugin
  554. - lv2:AnalyserPlugin
  555. - lv2:BandpassPlugin
  556. - lv2:ChorusPlugin
  557. - lv2:CombPlugin
  558. - lv2:CompressorPlugin
  559. - lv2:ConstantPlugin
  560. - lv2:ConverterPlugin
  561. - lv2:DelayPlugin
  562. - lv2:DistortionPlugin
  563. - lv2:DynamicsPlugin
  564. - lv2:EQPlugin
  565. - lv2:EnvelopePlugin
  566. - lv2:ExpanderPlugin
  567. - lv2:FilterPlugin
  568. - lv2:FlangerPlugin
  569. - lv2:FunctionPlugin
  570. - lv2:GatePlugin
  571. - lv2:GeneratorPlugin
  572. - lv2:HighpassPlugin
  573. - lv2:InstrumentPlugin
  574. - lv2:LimiterPlugin
  575. - lv2:LowpassPlugin
  576. - lv2:MIDIPlugin
  577. - lv2:MixerPlugin
  578. - lv2:ModulatorPlugin
  579. - lv2:MultiEQPlugin
  580. - lv2:OscillatorPlugin
  581. - lv2:ParaEQPlugin
  582. - lv2:PhaserPlugin
  583. - lv2:PitchPlugin
  584. - lv2:ReverbPlugin
  585. - lv2:SimulatorPlugin
  586. - lv2:SpatialPlugin
  587. - lv2:SpectralPlugin
  588. - lv2:UtilityPlugin
  589. - lv2:WaveshaperPlugin
  590. See http://lv2plug.in/ns/lv2core for more information.
  591. */
  592. #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:Plugin"
  593. /**
  594. Custom VST3 categories for the plugin.@n
  595. This is a single concatenated string of categories, separated by a @c |.
  596. Each effect category can be one of the following values:
  597. - Fx
  598. - Fx|Ambisonics
  599. - Fx|Analyzer
  600. - Fx|Delay
  601. - Fx|Distortion
  602. - Fx|Dynamics
  603. - Fx|EQ
  604. - Fx|Filter
  605. - Fx|Instrument
  606. - Fx|Instrument|External
  607. - Fx|Spatial
  608. - Fx|Generator
  609. - Fx|Mastering
  610. - Fx|Modulation
  611. - Fx|Network
  612. - Fx|Pitch Shift
  613. - Fx|Restoration
  614. - Fx|Reverb
  615. - Fx|Surround
  616. - Fx|Tools
  617. Each instrument category can be one of the following values:
  618. - Instrument
  619. - Instrument|Drum
  620. - Instrument|External
  621. - Instrument|Piano
  622. - Instrument|Sampler
  623. - Instrument|Synth
  624. - Instrument|Synth|Sampler
  625. And extra categories possible for any plugin type:
  626. - Mono
  627. - Stereo
  628. */
  629. #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Stereo"
  630. /**
  631. Custom CLAP features for the plugin.@n
  632. This is a list of features defined as a string array body, without the terminating @c , or nullptr.
  633. A top-level category can be set as feature and be one of the following values:
  634. - instrument
  635. - audio-effect
  636. - note-effect
  637. - analyzer
  638. The following sub-categories can also be set:
  639. - synthesizer
  640. - sampler
  641. - drum
  642. - drum-machine
  643. - filter
  644. - phaser
  645. - equalizer
  646. - de-esser
  647. - phase-vocoder
  648. - granular
  649. - frequency-shifter
  650. - pitch-shifter
  651. - distortion
  652. - transient-shaper
  653. - compressor
  654. - limiter
  655. - flanger
  656. - chorus
  657. - delay
  658. - reverb
  659. - tremolo
  660. - glitch
  661. - utility
  662. - pitch-correction
  663. - restoration
  664. - multi-effects
  665. - mixing
  666. - mastering
  667. And finally the following audio capabilities can be set:
  668. - mono
  669. - stereo
  670. - surround
  671. - ambisonic
  672. */
  673. #define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "stereo"
  674. /** @} */
  675. /* ------------------------------------------------------------------------------------------------------------
  676. * Plugin Macros */
  677. /**
  678. @defgroup ExtraPluginMacros Extra Plugin Macros
  679. C Macros to customize DPF behaviour.
  680. These are macros that do not set plugin features or information, but instead change DPF internals.
  681. They are all optional.
  682. Unless stated otherwise, values are assumed to be a simple/empty define.
  683. @{
  684. */
  685. /**
  686. Whether to enable runtime plugin tests.@n
  687. This will check, during initialization of the plugin, if parameters, programs and states are setup properly.@n
  688. Useful to enable as part of CI, can safely be skipped.@n
  689. Under DPF makefiles this can be enabled by using `make DPF_RUNTIME_TESTING=true`.
  690. @note Some checks are only available with the GCC compiler,
  691. for detecting if a virtual function has been reimplemented.
  692. */
  693. #define DPF_RUNTIME_TESTING
  694. /**
  695. Whether to show parameter outputs in the VST2 plugins.@n
  696. This is disabled (unset) by default, as the VST2 format has no notion of read-only parameters.
  697. */
  698. #define DPF_VST_SHOW_PARAMETER_OUTPUTS
  699. /**
  700. Disable all file browser related code.@n
  701. Must be set as compiler macro when building DGL. (e.g. `CXXFLAGS="-DDGL_FILE_BROWSER_DISABLED"`)
  702. */
  703. #define DGL_FILE_BROWSER_DISABLED
  704. /**
  705. Disable resource files, like internally used fonts.@n
  706. Must be set as compiler macro when building DGL. (e.g. `CXXFLAGS="-DDGL_NO_SHARED_RESOURCES"`)
  707. */
  708. #define DGL_NO_SHARED_RESOURCES
  709. /**
  710. Whether to use OpenGL3 instead of the default OpenGL2 compatility profile.
  711. Under DPF makefiles this can be enabled by using `make USE_OPENGL3=true` on the dgl build step.
  712. @note This is experimental and incomplete, contributions are welcome and appreciated.
  713. */
  714. #define DGL_USE_OPENGL3
  715. /**
  716. Whether to use the GPLv2+ vestige header instead of the official Steinberg VST2 SDK.@n
  717. This is a boolean, and enabled (set to 1) by default.@n
  718. Set this to 0 in order to create non-GPL binaries.
  719. (but then at your own discretion in regards to Steinberg licensing)@n
  720. When set to 0, DPF will import the VST2 definitions from `"vst/aeffectx.h"` (not shipped with DPF).
  721. */
  722. #define VESTIGE_HEADER 1
  723. /** @} */
  724. /* ------------------------------------------------------------------------------------------------------------
  725. * Namespace Macros */
  726. /**
  727. @defgroup NamespaceMacros Namespace Macros
  728. C Macros to use and customize DPF namespaces.
  729. These are macros that serve as helpers around C++ namespaces, and also as a way to set custom namespaces during a build.
  730. @{
  731. */
  732. /**
  733. Compiler macro that sets the C++ namespace for DPF plugins.@n
  734. If unset during build, it will use the name @b DISTRHO by default.
  735. Unless you know exactly what you are doing, you do need to modify this value.@n
  736. 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
  737. For example, having 2 different versions of the same plugin that should behave differently but still exist within the same binary.
  738. On macOS (where due to Objective-C restrictions all code that interacts with Cocoa needs to be in a flat namespace),
  739. DPF will automatically use the plugin name as prefix to flat namespace functions in order to avoid conflicts.
  740. So, basically, it is DPF's job to make sure plugin binaries are 100% usable as-is.@n
  741. You typically do not need to care about this at all.
  742. */
  743. #define DISTRHO_NAMESPACE DISTRHO
  744. /**
  745. Compiler macro that begins the C++ namespace for @b DISTRHO, as needed for (the DSP side of) plugins.@n
  746. All classes in DPF are within this namespace except for UI/graphics stuff.
  747. @see END_NAMESPACE_DISTRHO
  748. */
  749. #define START_NAMESPACE_DISTRHO namespace DISTRHO_NAMESPACE {
  750. /**
  751. Close the namespace previously started by @ref START_NAMESPACE_DISTRHO.@n
  752. This doesn't really need to be a macro, it is just prettier/more consistent that way.
  753. */
  754. #define END_NAMESPACE_DISTRHO }
  755. /**
  756. Make the @b DISTRHO namespace available in the current function scope.@n
  757. This is not set by default in order to avoid conflicts with commonly used names such as "Parameter" and "Plugin".
  758. */
  759. #define USE_NAMESPACE_DISTRHO using namespace DISTRHO_NAMESPACE;
  760. /* TODO
  761. *
  762. * DISTRHO_MACRO_AS_STRING_VALUE
  763. * DISTRHO_MACRO_AS_STRING
  764. * DISTRHO_PROPER_CPP11_SUPPORT
  765. * DONT_SET_USING_DISTRHO_NAMESPACE
  766. *
  767. */
  768. // -----------------------------------------------------------------------------------------------------------
  769. END_NAMESPACE_DISTRHO
  770. #endif // DOXYGEN