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