Dusk Audio Framework
Loading...
Searching...
No Matches
DafInfo.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/DafDefines.h"
20
22
23/* ------------------------------------------------------------------------------------------------------------
24 * Intro */
25
26/**
27 @mainpage Overview
28
29 The Dusk Audio Framework (or @b DAF 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 DAF can build for LADSPA, DSSI, LV2, VST2, VST3, CLAP and AU 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 "DafPluginInfo.h" file describing the plugin via macros, see @ref PluginMacros.@n
39 This file is included during compilation of the main DAF 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 DAF'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 DAF code is within its own C++ namespace (@b DAF for DSP/plugin stuff, @b DGL for UI stuff).@n
50 You can use @ref START_NAMESPACE_DAF / @ref END_NAMESPACE_DAF combo around your code, or globally set @ref USE_NAMESPACE_DAF.@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 /* DAF plugin include */
58 #include "DafPlugin.hpp"
59
60 /* Make DAF related classes available for us to use without any extra namespace references */
62
63 /**
64 Our custom plugin class.
65 Subclassing `Plugin` from DAF 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 "DAF";
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 DAF plugins.
149 DAF 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 DAF 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 "DAF";
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 DAF 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 DAF_PLUGIN_WANT_PROGRAMS to 1 in your DafPluginInfo.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 "DAF";
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 "DafPluginInfo.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 DAF_PLUGIN_NAME
475 - @ref DAF_PLUGIN_NUM_INPUTS
476 - @ref DAF_PLUGIN_NUM_OUTPUTS
477 - @ref DAF_PLUGIN_URI
478
479 Additionally, @ref DAF_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 DAF_PLUGIN_NAME "Plugin Name"
489
490/**
491 Number of audio inputs the plugin has.
492 @note This macro is required.
493 */
494#define DAF_PLUGIN_NUM_INPUTS 2
495
496/**
497 Number of audio outputs the plugin has.
498 @note This macro is required.
499 */
500#define DAF_PLUGIN_NUM_OUTPUTS 2
501
502/**
503 The plugin URI when exporting in LV2 format.
504 @note This macro is required.
505 */
506#define DAF_PLUGIN_URI "urn:daf:name"
507
508/**
509 Whether the plugin has a custom %UI.
510 @see DAF_UI_USE_NANOVG
511 @see UI
512 */
513#define DAF_PLUGIN_HAS_UI 1
514
515/**
516 Whether the plugin processing is realtime-safe.@n
517 TODO - list rtsafe requirements
518 */
519#define DAF_PLUGIN_IS_RT_SAFE 1
520
521/**
522 Whether the plugin is a synth.@n
523 @ref DAF_PLUGIN_WANT_MIDI_INPUT is automatically enabled when this is too.
524 @see DAF_PLUGIN_WANT_MIDI_INPUT
525 */
526#define DAF_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 DAF_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 DAF_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 DAF_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 DAF_PLUGIN_WANT_LATENCY 1
555
556/**
557 Whether the plugin keeps producing output after its input goes silent (reverbs,
558 delays, anything with a decay). The tail is reported to VST3, AU and CLAP hosts.
559 @see Plugin::setTail(uint32_t)
560 */
561#define DAF_PLUGIN_WANT_TAIL 1
562
563/**
564 Whether the plugin wants MPE for MIDI input and/or output.
565 @note Only AU and CLAP formats implement this at the moment
566*/
567#define DAF_PLUGIN_WANT_MIDI_AS_MPE 0
568
569/**
570 Whether the plugin wants MIDI input.@n
571 This is automatically enabled if @ref DAF_PLUGIN_IS_SYNTH is true.
572 */
573#define DAF_PLUGIN_WANT_MIDI_INPUT 1
574
575/**
576 Whether the plugin wants MIDI output.
577 @see Plugin::writeMidiEvent(const MidiEvent&)
578 */
579#define DAF_PLUGIN_WANT_MIDI_OUTPUT 1
580
581/**
582 Whether the plugin wants to change its own parameter inputs.@n
583 Not all hosts or plugin formats support this,
584 so Plugin::canRequestParameterValueChanges() can be used to query support at runtime.
585 @see Plugin::requestParameterValueChange(uint32_t, float)
586 */
587#define DAF_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST 1
588
589/**
590 Whether the plugin provides its own internal programs.
591 @see Plugin::initProgramName(uint32_t, String&)
592 @see Plugin::loadProgram(uint32_t)
593 */
594#define DAF_PLUGIN_WANT_PROGRAMS 1
595
596/**
597 Whether the plugin uses internal non-parameter data.
598 @see Plugin::initState(uint32_t, String&, String&)
599 @see Plugin::setState(const char*, const char*)
600 */
601#define DAF_PLUGIN_WANT_STATE 1
602
603/**
604 Whether the plugin implements the full state API.
605 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.
606 This is useful for plugins that have custom internal values not exposed to the host as key-value state pairs or parameters.
607 Most simple effects and synths will not need this.
608 @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.
609 @see Plugin::getState(const char*)
610 */
611#define DAF_PLUGIN_WANT_FULL_STATE 1
612
613/**
614 Whether the plugin wants time position information from the host.
615 @see Plugin::getTimePosition()
616 */
617#define DAF_PLUGIN_WANT_TIMEPOS 1
618
619/**
620 Whether the %UI uses Cairo for drawing instead of the default OpenGL mode.@n
621 When enabled your %UI instance will subclass @ref CairoTopLevelWidget instead of @ref TopLevelWidget.
622 */
623#define DAF_UI_USE_CAIRO 1
624
625/**
626 Whether the %UI uses a custom toolkit implementation based on OpenGL.@n
627 When enabled, the macros @ref DAF_UI_CUSTOM_INCLUDE_PATH and @ref DAF_UI_CUSTOM_WIDGET_TYPE are required.
628 */
629#define DAF_UI_USE_CUSTOM 1
630
631/**
632 The include path to the header file used by the custom toolkit implementation.
633 This path must be relative to dpf/daf/DafUI.hpp
634 @see DAF_UI_USE_CUSTOM
635 */
636#define DAF_UI_CUSTOM_INCLUDE_PATH
637
638/**
639 Whether the %UI uses NanoVG for drawing instead of the default raw OpenGL mode.@n
640 When enabled your %UI instance will subclass @ref NanoTopLevelWidget instead of @ref TopLevelWidget.
641 */
642#define DAF_UI_USE_NANOVG 1
643
644/**
645 The top-level-widget typedef to use for the custom toolkit.
646 This widget class MUST be a subclass of DGL TopLevelWindow class.
647 It is recommended that you keep this widget class inside the DGL namespace,
648 and define widget type as e.g. DGL_NAMESPACE::MyCustomTopLevelWidget.
649 @see DAF_UI_USE_CUSTOM
650 */
651#define DAF_UI_CUSTOM_WIDGET_TYPE
652
653/**
654 Default UI width to use when creating initial and temporary windows.@n
655 Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
656 (which would normally be done for knowing the UI size before host creates a window for it)
657
658 Value must match 1x scale factor.
659
660 When this macro is defined, the companion DAF_UI_DEFAULT_HEIGHT macro must be defined as well.
661 */
662#define DAF_UI_DEFAULT_WIDTH 300
663
664/**
665 Default UI height to use when creating initial and temporary windows.@n
666 Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts.
667 (which would normally be done for knowing the UI size before host creates a window for it)
668
669 Value must match 1x scale factor.
670
671 When this macro is defined, the companion DAF_UI_DEFAULT_WIDTH macro must be defined as well.
672 */
673#define DAF_UI_DEFAULT_HEIGHT 300
674
675/**
676 Whether the %UI is resizable to any size by the user and OS.@n
677 By default this is false, with resizing only allowed when coded from the the plugin UI side.@n
678 Enabling this options makes it possible for the user to resize the plugin UI at anytime.
679 @see UI::setGeometryConstraints(uint, uint, bool, bool)
680 */
681#define DAF_UI_USER_RESIZABLE 1
682
683/**
684 Whether to %UI is going to use file browser dialogs.@n
685 By default this is false, with the file browser APIs not available for use.
686 */
687#define DAF_UI_FILE_BROWSER 1
688
689/**
690 Whether to %UI is going to use web browser views.@n
691 By default this is false, with the web browser APIs not available for use.
692 */
693#define DAF_UI_WEB_VIEW 1
694
695/**
696 The %UI URI when exporting in LV2 format.@n
697 By default this is set to @ref DAF_PLUGIN_URI with "#UI" as suffix.
698 */
699#define DAF_UI_URI DAF_PLUGIN_URI "#UI"
700
701/**
702 The AudioUnit type for a plugin.@n
703 This is a 4-character symbol, automatically set by DAF based on other plugin macros.
704 See https://developer.apple.com/documentation/audiotoolbox/1584142-audio_unit_types for more information.
705 */
706#define DAF_PLUGIN_AU_TYPE aufx
707
708/**
709 A 4-character symbol that identifies a brand or manufacturer, with at least one non-lower case character.@n
710 Plugins from the same brand should use the same symbol.
711 @note This macro is required when building AU plugins, and used for VST3 if present
712 @note Setting this macro will change the uid of a VST3 plugin.
713 If you already released a DAF-based VST3 plugin make sure to also enable DAF_VST3_DONT_USE_BRAND_ID
714 */
715#define DAF_PLUGIN_BRAND_ID Dstr
716
717/**
718 A 4-character symbol which identifies a plugin.@n
719 It must be unique within at least a set of plugins from the brand.
720 @note This macro is required when building AU plugins
721 */
722#define DAF_PLUGIN_UNIQUE_ID test
723
724/**
725 Custom LV2 category for the plugin.@n
726 This is a single string, and can be one of the following values:
727
728 - lv2:AllpassPlugin
729 - lv2:AmplifierPlugin
730 - lv2:AnalyserPlugin
731 - lv2:BandpassPlugin
732 - lv2:ChorusPlugin
733 - lv2:CombPlugin
734 - lv2:CompressorPlugin
735 - lv2:ConstantPlugin
736 - lv2:ConverterPlugin
737 - lv2:DelayPlugin
738 - lv2:DistortionPlugin
739 - lv2:DynamicsPlugin
740 - lv2:EQPlugin
741 - lv2:EnvelopePlugin
742 - lv2:ExpanderPlugin
743 - lv2:FilterPlugin
744 - lv2:FlangerPlugin
745 - lv2:FunctionPlugin
746 - lv2:GatePlugin
747 - lv2:GeneratorPlugin
748 - lv2:HighpassPlugin
749 - lv2:InstrumentPlugin
750 - lv2:LimiterPlugin
751 - lv2:LowpassPlugin
752 - lv2:MIDIPlugin
753 - lv2:MixerPlugin
754 - lv2:ModulatorPlugin
755 - lv2:MultiEQPlugin
756 - lv2:OscillatorPlugin
757 - lv2:ParaEQPlugin
758 - lv2:PhaserPlugin
759 - lv2:PitchPlugin
760 - lv2:ReverbPlugin
761 - lv2:SimulatorPlugin
762 - lv2:SpatialPlugin
763 - lv2:SpectralPlugin
764 - lv2:UtilityPlugin
765 - lv2:WaveshaperPlugin
766
767 See http://lv2plug.in/ns/lv2core for more information.
768 */
769#define DAF_PLUGIN_LV2_CATEGORY "lv2:Plugin"
770
771/**
772 Custom VST3 categories for the plugin.@n
773 This is a single concatenated string of categories, separated by a @c |.
774
775 Each effect category can be one of the following values:
776
777 - Fx
778 - Fx|Ambisonics
779 - Fx|Analyzer
780 - Fx|Delay
781 - Fx|Distortion
782 - Fx|Dynamics
783 - Fx|EQ
784 - Fx|Filter
785 - Fx|Instrument
786 - Fx|Instrument|External
787 - Fx|Spatial
788 - Fx|Generator
789 - Fx|Mastering
790 - Fx|Modulation
791 - Fx|Network
792 - Fx|Pitch Shift
793 - Fx|Restoration
794 - Fx|Reverb
795 - Fx|Surround
796 - Fx|Tools
797
798 Each instrument category can be one of the following values:
799
800 - Instrument
801 - Instrument|Drum
802 - Instrument|External
803 - Instrument|Piano
804 - Instrument|Sampler
805 - Instrument|Synth
806 - Instrument|Synth|Sampler
807
808 And extra categories possible for any plugin type:
809
810 - Mono
811 - Stereo
812 */
813#define DAF_PLUGIN_VST3_CATEGORIES "Fx|Stereo"
814
815/**
816 Custom CLAP features for the plugin.@n
817 This is a list of features defined as a string array body, without the terminating @c , or nullptr.
818
819 A top-level category can be set as feature and be one of the following values:
820
821 - instrument
822 - audio-effect
823 - note-effect
824 - analyzer
825
826 The following sub-categories can also be set:
827
828 - synthesizer
829 - sampler
830 - drum
831 - drum-machine
832
833 - filter
834 - phaser
835 - equalizer
836 - de-esser
837 - phase-vocoder
838 - granular
839 - frequency-shifter
840 - pitch-shifter
841
842 - distortion
843 - transient-shaper
844 - compressor
845 - limiter
846
847 - flanger
848 - chorus
849 - delay
850 - reverb
851
852 - tremolo
853 - glitch
854
855 - utility
856 - pitch-correction
857 - restoration
858
859 - multi-effects
860
861 - mixing
862 - mastering
863
864 And finally the following audio capabilities can be set:
865
866 - mono
867 - stereo
868 - surround
869 - ambisonic
870*/
871#define DAF_PLUGIN_CLAP_FEATURES "audio-effect", "stereo"
872
873/**
874 The plugin id when exporting in CLAP format, in reverse URI form.
875 @note This macro is required when building CLAP plugins
876*/
877#define DAF_PLUGIN_CLAP_ID "studio.kx.daf.effect"
878
879/**
880 Plugin name abbreviation consisting of 2 or 3 characters in uppercase.
881 @note This macro is required when building plugins for the Darkglass Anagram unit.
882*/
883#define DAF_PLUGIN_ABBREVIATION "DFX"
884
885/**
886 Path to a in-bundle/local 200x200 PNG image file to be used as the plugin's block image asset when OFF.
887 @note This macro is required when building plugins for the Darkglass Anagram unit.
888*/
889#define DAF_PLUGIN_ANAGRAM_BLOCK_IMAGE_OFF "anagram-block-off.png"
890
891/**
892 Path to a in-bundle/local 200x200 PNG image file to be used as the plugin's block image asset when ON.
893 @note This macro is required when building plugins for the Darkglass Anagram unit.
894*/
895#define DAF_PLUGIN_ANAGRAM_BLOCK_IMAGE_ON "anagram-block-on.png"
896
897/** @} */
898
899/* ------------------------------------------------------------------------------------------------------------
900 * Plugin Macros */
901
902/**
903 @defgroup ExtraPluginMacros Extra Plugin Macros
904
905 C Macros to customize DAF behaviour.
906
907 These are macros that do not set plugin features or information, but instead change DAF internals.
908 They are all optional.
909
910 Unless stated otherwise, values are assumed to be a simple/empty define.
911 @{
912 */
913
914/**
915 Whether to enable runtime plugin tests.@n
916 This will check, during initialization of the plugin, if parameters, programs and states are setup properly.@n
917 Useful to enable as part of CI, can be safely skipped.@n
918 Under DAF makefiles this can be enabled by using `make DAF_RUNTIME_TESTING=true`.
919
920 @note Some checks are only available with the GCC compiler,
921 for detecting if a virtual function has been reimplemented.
922 */
923#define DAF_RUNTIME_TESTING
924
925/**
926 Whether to show parameter outputs in the VST2 plugins.@n
927 This is disabled (unset) by default, as the VST2 format has no notion of read-only parameters.
928 */
929#define DAF_VST_SHOW_PARAMETER_OUTPUTS
930
931/**
932 Forcibly ignore DAF_PLUGIN_BRAND_ID for VST3 plugins.@n
933 This is required for DAF-based VST3 plugins that got released without setting DAF_PLUGIN_BRAND_ID first.
934 */
935#define DAF_VST3_DONT_USE_BRAND_ID
936
937/**
938 Give a VST3 plugin the same class ID string on Windows as on Linux and macOS.@n
939 By default the class ID bytes are the same on every platform, but on Windows the VST3 SDK reads the
940 first 8 of them as the fields of a COM GUID, so the class ID string differs from the one on other
941 platforms and sessions do not find the plugin across them.
942 Defining this lays the Windows class IDs out so the strings match. Linux and macOS IDs do not change.
943 @note Recommended for new plugins only.
944 Enabling it changes the Windows class IDs of an already-released VST3 plugin,
945 and existing Windows sessions using that plugin will no longer find it.
946 */
947#define DAF_VST3_CROSS_PLATFORM_UID
948
949/**
950 Disable resource files, like internally used fonts.@n
951 Must be set as compiler macro when building DGL. (e.g. `CXXFLAGS="-DDGL_NO_SHARED_RESOURCES"`)
952 */
953#define DGL_NO_SHARED_RESOURCES
954
955/** @} */
956
957/* ------------------------------------------------------------------------------------------------------------
958 * Namespace Macros */
959
960/**
961 @defgroup NamespaceMacros Namespace Macros
962
963 C Macros to use and customize DAF namespaces.
964
965 These are macros that serve as helpers around C++ namespaces, and also as a way to set custom namespaces during a build.
966 @{
967 */
968
969/**
970 Compiler macro that sets the C++ namespace for DAF plugins.@n
971 If unset during build, it will use the name @b DAF by default.
972
973 Unless you know exactly what you are doing, you do need to modify this value.@n
974 The only probable useful case for customizing it is if you are building a big collection of very similar DAF-based plugins in your application.@n
975 For example, having 2 different versions of the same plugin that should behave differently but still exist within the same binary.
976
977 On macOS (where due to Objective-C restrictions all code that interacts with Cocoa needs to be in a flat namespace),
978 DAF will automatically use the plugin name as prefix to flat namespace functions in order to avoid conflicts.
979
980 So, basically, it is DAF's job to make sure plugin binaries are 100% usable as-is.@n
981 You typically do not need to care about this at all.
982 */
983#define DAF_NAMESPACE DAF
984
985/**
986 Compiler macro that begins the C++ namespace for @b DAF, as needed for (the DSP side of) plugins.@n
987 All classes in DAF are within this namespace except for UI/graphics stuff.
988 @see END_NAMESPACE_DAF
989 */
990#define START_NAMESPACE_DAF namespace DAF_NAMESPACE {
991
992/**
993 Close the namespace previously started by @ref START_NAMESPACE_DAF.@n
994 This doesn't really need to be a macro, it is just prettier/more consistent that way.
995 */
996#define END_NAMESPACE_DAF }
997
998/**
999 Make the @b DAF namespace available in the current function scope.@n
1000 This is not set by default in order to avoid conflicts with commonly used names such as "Parameter" and "Plugin".
1001 */
1002#define USE_NAMESPACE_DAF using namespace DAF_NAMESPACE;
1003
1004/* TODO
1005 *
1006 * DAF_MACRO_AS_STRING_VALUE
1007 * DAF_MACRO_AS_STRING
1008 * DAF_PROPER_CPP11_SUPPORT
1009 * DONT_SET_USING_DAF_NAMESPACE
1010 *
1011 */
1012
1013// -----------------------------------------------------------------------------------------------------------
1014
1016
1017#endif // DOXYGEN
Definition DafPlugin.hpp:61
virtual void loadProgram(uint32_t index)
Plugin * createPlugin()
#define USE_NAMESPACE_DAF
Definition DafInfo.hpp:1002
#define END_NAMESPACE_DAF
Definition DafInfo.hpp:996
#define START_NAMESPACE_DAF
Definition DafInfo.hpp:990
#define DAF_PLUGIN_WANT_PROGRAMS
Definition DafInfo.hpp:594
float max
Definition DafDetails.hpp:366
float min
Definition DafDetails.hpp:361
float def
Definition DafDetails.hpp:356
ParameterRanges ranges
Definition DafDetails.hpp:653
uint32_t hints
Definition DafDetails.hpp:612
String symbol
Definition DafDetails.hpp:634
String name
Definition DafDetails.hpp:619