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