19 #include "src/DistrhoDefines.h"
21 START_NAMESPACE_DISTRHO
70 const char* getLabel()
const override
78 const char* getMaker()
const override
87 const char* getLicense()
const override
95 uint32_t getVersion()
const override
97 return d_version(1, 0, 0);
104 int64_t getUniqueId()
const override
106 return d_cconst(
'M',
'u',
't',
'e');
116 void run(
const float**,
float** outputs, uint32_t frames)
override
119 float*
const outL = outputs[0];
120 float*
const outR = outputs[1];
123 std::memset(outL, 0,
sizeof(
float)*frames);
124 std::memset(outR, 0,
sizeof(
float)*frames);
130 See the
Plugin class for more information and to understand what each function does.
133 A plugin is nothing without parameters.@n
134 In DPF parameters can be inputs or outputs.@n
135 They have hints to describe how they behave plus a name and a symbol identifying them.@n
136 Parameters also have 'ranges' – a minimum, maximum and default value.
138 Input parameters are "read-only": the plugin can read them but not change them.
139 (the exception being when changing programs, more on that below)@n
140 It's the host responsibility to save, restore and set input parameters.
142 Output parameters can be changed at anytime by the plugin.@n
143 The host will simply read their values and not change them.
145 Here's an example of an audio plugin that has 1 input parameter:
147 class GainPlugin :
public Plugin
164 const char* getLabel()
const override
169 const char* getMaker()
const override
174 const char* getLicense()
const override
179 uint32_t getVersion()
const override
181 return d_version(1, 0, 0);
184 int64_t getUniqueId()
const override
186 return d_cconst(
'G',
'a',
'i',
'n');
196 void initParameter(uint32_t index,
Parameter& parameter)
override
201 parameter.
name =
"Gain";
202 parameter.
symbol =
"gain";
214 float getParameterValue(uint32_t index)
const override
224 void setParameterValue(uint32_t index,
float value)
override
234 void run(
const float**,
float** outputs, uint32_t frames)
override
237 const float*
const in = inputs[0];
238 float*
const out = outputs[0];
241 for (uint32_t i=0; i < frames; ++i)
242 out[i] = in[i] * fGain;
250 See the
Parameter struct for more information about parameters.
253 Programs in DPF refer to plugin-side presets (usually called "factory presets"),
254 an initial set of presets provided by plugin authors included in the actual plugin.
257 When enabled you'll need to override 2 new function in your plugin code,
260 Here's an example of a plugin with a "default" program:
262 class PluginWithPresets :
public Plugin
276 const char* getLabel()
const override
281 const char* getMaker()
const override
286 const char* getLicense()
const override
291 uint32_t getVersion()
const override
293 return d_version(1, 0, 0);
296 int64_t getUniqueId()
const override
298 return d_cconst(
'P',
'r',
'o',
'g');
308 void initParameter(uint32_t index,
Parameter& parameter)
override
318 parameter.
name =
"Gain Right";
319 parameter.
symbol =
"gainR";
322 parameter.
name =
"Gain Left";
323 parameter.
symbol =
"gainL";
332 void initProgramName(uint32_t index,
String& programName)
337 programName =
"Default";
348 float getParameterValue(uint32_t index)
const override
362 void setParameterValue(uint32_t index,
float value)
override
378 void loadProgram(uint32_t index)
392 void run(
const float**,
float** outputs, uint32_t frames)
override
395 const float*
const inL = inputs[0];
396 const float*
const inR = inputs[0];
397 float*
const outL = outputs[0];
398 float*
const outR = outputs[0];
401 for (uint32_t i=0; i < frames; ++i)
403 outL[i] = inL[i] * fGainL;
404 outR[i] = inR[i] * fGainR;
409 float fGainL, fGainR;
413 This is a work-in-progress documentation page. States, MIDI, Latency, Time-Position and
UI are still TODO.
426 @section Time-Position
463 #define DISTRHO_PLUGIN_NAME "Plugin Name"
469 #define DISTRHO_PLUGIN_NUM_INPUTS 2
475 #define DISTRHO_PLUGIN_NUM_OUTPUTS 2
481 #define DISTRHO_PLUGIN_URI "urn:distrho:name"
488 #define DISTRHO_PLUGIN_HAS_UI 1
494 #define DISTRHO_PLUGIN_IS_RT_SAFE 1
501 #define DISTRHO_PLUGIN_IS_SYNTH 1
507 #define DISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE 2048
515 #define DISTRHO_PLUGIN_USES_MODGUI 0
523 #define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
529 #define DISTRHO_PLUGIN_WANT_LATENCY 1
535 #define DISTRHO_PLUGIN_WANT_MIDI_INPUT 1
541 #define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1
549 #define DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST 1
556 #define DISTRHO_PLUGIN_WANT_PROGRAMS 1
563 #define DISTRHO_PLUGIN_WANT_STATE 1
573 #define DISTRHO_PLUGIN_WANT_FULL_STATE 1
579 #define DISTRHO_PLUGIN_WANT_TIMEPOS 1
585 #define DISTRHO_UI_USE_CUSTOM 1
592 #define DISTRHO_UI_CUSTOM_INCLUDE_PATH
601 #define DISTRHO_UI_CUSTOM_WIDGET_TYPE
607 #define DISTRHO_UI_USE_NANOVG 1
615 #define DISTRHO_UI_USER_RESIZABLE 1
621 #define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI"
649 #define DPF_RUNTIME_TESTING
655 #define DPF_VST_SHOW_PARAMETER_OUTPUTS
663 #define DGL_USE_OPENGL3
672 #define VESTIGE_HEADER 1
678 END_NAMESPACE_DISTRHO