DISTRHO Plugin Framework
 All Classes Functions Variables Modules Pages
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.

Macros

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 figure out which features for each plugin format to export.

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.

Plugin

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:

class MutePlugin : public Plugin
{
public:
MutePlugin()
: Plugin(0, 0, 0) // 0 parameters, 0 programs and 0 states
{
}
protected:
const char* getLabel() const override
{
return "Mute";
}
const char* getMaker() const override
{
return "DPF";
}
const char* getLicense() const override
{
return "MIT";
}
uint32_t getVersion() const override
{
return 0x1000;
}
int64_t getUniqueId() const override
{
return cconst('M', 'u', 't', 'e');
}
void run(const float**, float** outputs, uint32_t frames) override
{
// get the left and right audio outputs
float* const outL = outputs[0];
float* const outR = outputs[1];
// mute audio
std::memset(outL, 0, sizeof(float)*frames);
std::memset(outR, 0, sizeof(float)*frames);
}
};

See the Plugin class for more information and to understand what each function does.

Parameters

describe input and output, automable and rt safe, boolean etc, cv

Programs

describe them

States

describe them

MIDI

describe them

Latency

describe it

Time-Position

describe it

UI

describe them