DISTRHO Plugin Framework
|
DISTRHO Plugin Framework (or DPF for short) is a plugin framework designed to make development of new plugins an easy and enjoyable task.
It allows developers to create plugins with custom UIs using a simple C++ API.
The framework facilitates exporting various different plugin formats from the same code-base.
DPF can build for LADSPA, DSSI, LV2 and VST2 formats.
A JACK/Standalone mode is also available, allowing you to quickly test plugins.
You start by creating a "DistrhoPluginInfo.h" file describing the plugin via macros, see Plugin Macros.
This file is included in the main DPF code to select which features to activate for each plugin format.
For example, a plugin (with UI) that use states will require LV2 hosts to support Atom and Worker extensions for message passing from the UI to the plugin.
If your plugin does not make use of states, the Worker extension is not set as a required feature.
The next step is to create your plugin code by subclassing DPF's Plugin class.
You need to pass the number of parameters in the constructor and also the number of programs and states, if any.
Here's an example of an audio plugin that simply mutes the host output:
See the Plugin class for more information and to understand what each function does.
A plugin is nothing without parameters.
In DPF parameters can be inputs or outputs.
They have hints to describe how they behave plus a name and a symbol identifying them.
Parameters also have 'ranges' – a minimum, maximum and default value.
Input parameters are "read-only": the plugin can read them but not change them. (the exception being when changing programs, more on that below)
It's the host responsibility to save, restore and set input parameters.
Output parameters can be changed at anytime by the plugin.
The host will simply read their values and not change them.
Here's an example of an audio plugin that has 1 input parameter:
See the Parameter struct for more information about parameters.
Programs in DPF refer to plugin-side presets (usually called "factory presets"), an initial set of presets provided by plugin authors included in the actual plugin.
To use programs you must first enable them by setting DISTRHO_PLUGIN_WANT_PROGRAMS to 1 in your DistrhoPluginInfo.h file.
When enabled you'll need to override 2 new function in your plugin code, Plugin::initProgramName(uint32_t, String&) and Plugin::loadProgram(uint32_t).
Here's an example of a plugin with a "default" program:
describe them
describe them
describe it
describe it
describe them