DISTRHO Plugin Framework
Macros
Plugin Macros

C Macros that describe your plugin. (defined in the "DistrhoPluginInfo.h" file) More...

Macros

#define DISTRHO_PLUGIN_NAME   "Plugin Name"
 
#define DISTRHO_PLUGIN_NUM_INPUTS   2
 
#define DISTRHO_PLUGIN_NUM_OUTPUTS   2
 
#define DISTRHO_PLUGIN_URI   "urn:distrho:name"
 
#define DISTRHO_PLUGIN_HAS_UI   1
 
#define DISTRHO_PLUGIN_IS_RT_SAFE   1
 
#define DISTRHO_PLUGIN_IS_SYNTH   1
 
#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS   0
 
#define DISTRHO_PLUGIN_WANT_LATENCY   1
 
#define DISTRHO_PLUGIN_WANT_MIDI_INPUT   1
 
#define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT   1
 
#define DISTRHO_PLUGIN_WANT_PROGRAMS   1
 
#define DISTRHO_PLUGIN_WANT_STATE   1
 
#define DISTRHO_PLUGIN_WANT_FULL_STATE   1
 
#define DISTRHO_PLUGIN_WANT_TIMEPOS   1
 
#define DISTRHO_UI_USE_CUSTOM   1
 
#define DISTRHO_UI_CUSTOM_INCLUDE_PATH
 
#define DISTRHO_UI_CUSTOM_WIDGET_TYPE
 
#define DISTRHO_UI_USE_NANOVG   1
 
#define DISTRHO_UI_USER_RESIZABLE   1
 
#define DISTRHO_UI_URI   DISTRHO_PLUGIN_URI "#UI"
 

Detailed Description

C Macros that describe your plugin. (defined in the "DistrhoPluginInfo.h" file)

With these macros you can tell the host what features your plugin requires.
Depending on which macros you enable, new functions will be available to call and/or override.

All values are either integer or strings.
For boolean-like values 1 means 'on' and 0 means 'off'.

The values defined in this group are for documentation purposes only.
All macros are disabled by default.

Only 4 macros are required, they are:

Macro Definition Documentation

◆ DISTRHO_PLUGIN_NAME

#define DISTRHO_PLUGIN_NAME   "Plugin Name"

The plugin name.
This is used to identify your plugin before a Plugin instance can be created.

Note
This macro is required.

◆ DISTRHO_PLUGIN_NUM_INPUTS

#define DISTRHO_PLUGIN_NUM_INPUTS   2

Number of audio inputs the plugin has.

Note
This macro is required.

◆ DISTRHO_PLUGIN_NUM_OUTPUTS

#define DISTRHO_PLUGIN_NUM_OUTPUTS   2

Number of audio outputs the plugin has.

Note
This macro is required.

◆ DISTRHO_PLUGIN_URI

#define DISTRHO_PLUGIN_URI   "urn:distrho:name"

The plugin URI when exporting in LV2 format.

Note
This macro is required.

◆ DISTRHO_PLUGIN_HAS_UI

#define DISTRHO_PLUGIN_HAS_UI   1

Wherever the plugin has a custom UI.

See also
DISTRHO_UI_USE_NANOVG
UI

◆ DISTRHO_PLUGIN_IS_RT_SAFE

#define DISTRHO_PLUGIN_IS_RT_SAFE   1

Wherever the plugin processing is realtime-safe.
TODO - list rtsafe requirements

◆ DISTRHO_PLUGIN_IS_SYNTH

#define DISTRHO_PLUGIN_IS_SYNTH   1

Wherever the plugin is a synth.
DISTRHO_PLUGIN_WANT_MIDI_INPUT is automatically enabled when this is too.

See also
DISTRHO_PLUGIN_WANT_MIDI_INPUT

◆ DISTRHO_PLUGIN_WANT_DIRECT_ACCESS

#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS   0

Enable direct access between the UI and plugin code.

See also
UI::getPluginInstancePointer()
Note
DO NOT USE THIS UNLESS STRICTLY NECESSARY!! Try to avoid it at all costs!

◆ DISTRHO_PLUGIN_WANT_LATENCY

#define DISTRHO_PLUGIN_WANT_LATENCY   1

Wherever the plugin introduces latency during audio or midi processing.

See also
Plugin::setLatency(uint32_t)

◆ DISTRHO_PLUGIN_WANT_MIDI_INPUT

#define DISTRHO_PLUGIN_WANT_MIDI_INPUT   1

Wherever the plugin wants MIDI input.
This is automatically enabled if DISTRHO_PLUGIN_IS_SYNTH is true.

◆ DISTRHO_PLUGIN_WANT_MIDI_OUTPUT

#define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT   1

Wherever the plugin wants MIDI output.

See also
Plugin::writeMidiEvent(const MidiEvent&)

◆ DISTRHO_PLUGIN_WANT_PROGRAMS

#define DISTRHO_PLUGIN_WANT_PROGRAMS   1

Wherever the plugin provides its own internal programs.

See also
Plugin::initProgramName(uint32_t, String&)
Plugin::loadProgram(uint32_t)

◆ DISTRHO_PLUGIN_WANT_STATE

#define DISTRHO_PLUGIN_WANT_STATE   1

Wherever the plugin uses internal non-parameter data.

See also
Plugin::initState(uint32_t, String&, String&)
Plugin::setState(const char*, const char*)

◆ DISTRHO_PLUGIN_WANT_FULL_STATE

#define DISTRHO_PLUGIN_WANT_FULL_STATE   1

Wherever the plugin implements the full state API. 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. This is useful for plugins that have custom internal values not exposed to the host as key-value state pairs or parameters. Most simple effects and synths will not need this.

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.
See also
Plugin::getState(const char*)

◆ DISTRHO_PLUGIN_WANT_TIMEPOS

#define DISTRHO_PLUGIN_WANT_TIMEPOS   1

Wherever the plugin wants time position information from the host.

See also
Plugin::getTimePosition()

◆ DISTRHO_UI_USE_CUSTOM

#define DISTRHO_UI_USE_CUSTOM   1

Wherever the UI uses a custom toolkit implementation based on OpenGL.
When enabled, the macros DISTRHO_UI_CUSTOM_INCLUDE_PATH and DISTRHO_UI_CUSTOM_WIDGET_TYPE are required.

◆ DISTRHO_UI_CUSTOM_INCLUDE_PATH

#define DISTRHO_UI_CUSTOM_INCLUDE_PATH

The include path to the header file used by the custom toolkit implementation. This path must be relative to dpf/distrho/DistrhoUI.hpp

See also
DISTRHO_UI_USE_CUSTOM

◆ DISTRHO_UI_CUSTOM_WIDGET_TYPE

#define DISTRHO_UI_CUSTOM_WIDGET_TYPE

The top-level-widget typedef to use for the custom toolkit. This widget class MUST be a subclass of DGL TopLevelWindow class. It is recommended that you keep this widget class inside the DGL namespace, and define widget type as e.g. DGL_NAMESPACE::MyCustomTopLevelWidget.

See also
DISTRHO_UI_USE_CUSTOM

◆ DISTRHO_UI_USE_NANOVG

#define DISTRHO_UI_USE_NANOVG   1

Wherever the UI uses NanoVG for drawing instead of the default raw OpenGL calls.
When enabled your UI instance will subclass NanoWidget instead of Widget.

◆ DISTRHO_UI_USER_RESIZABLE

#define DISTRHO_UI_USER_RESIZABLE   1

Wherever the UI is resizable to any size by the user.
By default this is false, and resizing is only allowed under the plugin UI control,
Enabling this options makes it possible for the user to resize the plugin UI at anytime.

See also
UI::setGeometryConstraints(uint, uint, bool, bool)

◆ DISTRHO_UI_URI

#define DISTRHO_UI_URI   DISTRHO_PLUGIN_URI "#UI"

The UI URI when exporting in LV2 format.
By default this is set to DISTRHO_PLUGIN_URI with "#UI" as suffix.