From 655ff0bce8731e17575f8af2df943ebb6a5fed78 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 21 Apr 2015 13:04:42 +0200 Subject: [PATCH] Change midi macros, start documentation rework --- distrho/DistrhoPlugin.hpp | 176 +++++++++++++- distrho/DistrhoPluginMain.cpp | 2 +- distrho/DistrhoUI.hpp | 2 +- distrho/DistrhoUIMain.cpp | 2 +- distrho/DistrhoUtils.hpp | 2 +- distrho/src/DistrhoDefines.h | 2 +- distrho/src/DistrhoPlugin.cpp | 4 +- distrho/src/DistrhoPluginCarla.cpp | 2 +- distrho/src/DistrhoPluginChecks.h | 78 +++--- distrho/src/DistrhoPluginInternal.hpp | 2 +- distrho/src/DistrhoPluginJack.cpp | 2 +- distrho/src/DistrhoPluginLADSPA+DSSI.cpp | 14 +- distrho/src/DistrhoPluginLV2.cpp | 16 +- distrho/src/DistrhoPluginLV2export.cpp | 10 +- distrho/src/DistrhoPluginVST.cpp | 20 +- distrho/src/DistrhoUI.cpp | 2 +- distrho/src/DistrhoUIDSSI.cpp | 2 +- distrho/src/DistrhoUIInternal.hpp | 2 +- distrho/src/DistrhoUILV2.cpp | 2 +- dpf.doxygen | 294 +++++++++++++++++++++++ 20 files changed, 550 insertions(+), 86 deletions(-) create mode 100644 dpf.doxygen diff --git a/distrho/DistrhoPlugin.hpp b/distrho/DistrhoPlugin.hpp index 817c2661..0f2ebba5 100644 --- a/distrho/DistrhoPlugin.hpp +++ b/distrho/DistrhoPlugin.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -34,6 +34,157 @@ START_NAMESPACE_DISTRHO +/** + @defgroup dpf DISTRHO Plugin Framework + + A plugin framework designed to make development of new plugins an easy and enjoyable task.@n + It allows developers to create plugins with custom UIs using a simple C++ API. + + @section Macros + You start by creating a "DistrhoPluginInfo.h" file describing the plugin via macros, see PluginMacros. + + @section Plugin + TODO + + @section Parameters + describe input and output, automable and rt safe, boolean etc, cv + @{ +*/ + +/* ------------------------------------------------------------------------------------------------------------ + * Plugin Macros */ + +#ifdef DOXYGEN + +/** + @defgroup PluginMacros Plugin Macros + + 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.@n + Depending on which macros you enable, new functions will be available to call and/or override. + + All values are either integer or strings.@n + For boolean-like values 1 means 'on' and 0 means 'off'. + + The values defined in this file are for documentation purposes only.@n + All macros are disabled by default. + + Only 4 macros are required, they are: + - @ref DISTRHO_PLUGIN_NAME + - @ref DISTRHO_PLUGIN_NUM_INPUTS + - @ref DISTRHO_PLUGIN_NUM_OUTPUTS + - @ref DISTRHO_PLUGIN_URI + @{ + */ + +/** + The plugin name.@n + This is used to identify your plugin before a Plugin instance can be created. + @note This macro is required. + */ +#define DISTRHO_PLUGIN_NAME "Plugin Name" + +/** + Number of audio inputs the plugin has. + @note This macro is required. + */ +#define DISTRHO_PLUGIN_NUM_INPUTS 2 + +/** + Number of audio outputs the plugin has. + @note This macro is required. + */ +#define DISTRHO_PLUGIN_NUM_OUTPUTS 2 + +/** + The plugin URI when exporting in LV2 format. + @note This macro is required. + */ +#define DISTRHO_PLUGIN_URI "urn:distrho:name" + +/** + Wherever the plugin has a custom UI. + @see DISTRHO_UI_USE_NANOVG + @see UI + */ +#define DISTRHO_PLUGIN_HAS_UI 1 + +/** + Wherever the plugin processing is realtime-safe.@n + TODO - list rtsafe requirements + */ +#define DISTRHO_PLUGIN_IS_RT_SAFE 1 + +/** + Wherever the plugin is a synth.@n + @ref DISTRHO_PLUGIN_WANTS_MIDI_INPUT is automatically enabled when this is too. + @see DISTRHO_PLUGIN_WANTS_MIDI_INPUT + */ +#define DISTRHO_PLUGIN_IS_SYNTH 1 + +/** + Enable direct access between the UI and plugin code. + @see UI::d_getPluginInstancePointer() + @note DO NOT USE THIS UNLESS STRICTLY NECESSARY!! + Try to avoid it at all costs! + */ +#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 1 + +/** + Wherever the plugin introduces latency during audio or midi processing. + @see Plugin::d_setLatency(uint32_t) + */ +#define DISTRHO_PLUGIN_WANT_LATENCY 1 + +/** + Wherever the plugin wants MIDI input.@n + This is automatically enabled if @ref DISTRHO_PLUGIN_IS_SYNTH is true. + */ +#define DISTRHO_PLUGIN_WANTS_MIDI_INPUT 1 + +/** + Wherever the plugin wants MIDI output. + @see Plugin::d_writeMidiEvent(const MidiEvent&) + */ +#define DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT 1 + +/** + Wherever the plugin provides its own internal programs. + @see Plugin::d_initProgramName(uint32_t, d_string&) + @see Plugin::d_setProgram(uint32_t) + */ +#define DISTRHO_PLUGIN_WANT_PROGRAMS 1 + +/** + Wherever the plugin uses internal non-parameter data. + @see Plugin::d_initState(uint32_t, d_string&, d_string&) + @see Plugin::d_setState(const char*, const char*) + */ +#define DISTRHO_PLUGIN_WANT_STATE 1 + +/** + Wherever the plugin wants time position information from the host. + @see Plugin::d_getTimePosition() + */ +#define DISTRHO_PLUGIN_WANT_TIMEPOS 1 + +/** + Wherever the UI uses NanoVG for drawing instead of the default raw OpenGL calls.@n + When enabled your UI instance will subclass @ref NanoWidget instead of @ref Widget. + */ +#define DISTRHO_UI_USE_NANOVG 1 + +/** + The UI URI when exporting in LV2 format.@n + By default this is set as @ref DISTRHO_PLUGIN_URI with "#UI" as suffix. + */ +#define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI" + +/** @} */ + +#endif + /* ------------------------------------------------------------------------------------------------------------ * Parameter Hints */ @@ -77,11 +228,21 @@ static const uint32_t kParameterIsLogarithmic = 0x08; */ static const uint32_t kParameterIsOutput = 0x10; +/** + Parameter can be used as control voltage (LV2 only). + */ +static const uint32_t kParameterIsCV = 0x20; + /** @} */ /* ------------------------------------------------------------------------------------------------------------ * DPF Base structs */ +/** + @defgroup BaseStructs Base Structs + @{ + */ + /** Parameter ranges. This is used to set the default, minimum and maximum values of a parameter. @@ -375,6 +536,8 @@ struct TimePosition { bbt() {} }; +/** @} */ + /* ------------------------------------------------------------------------------------------------------------ * DPF Plugin */ @@ -401,7 +564,7 @@ struct TimePosition { DISTRHO_PLUGIN_WANT_STATE activates internal state features. When enabled you need to implement d_initStateKey() and d_setState(). - The process function d_run() changes wherever DISTRHO_PLUGIN_HAS_MIDI_INPUT is enabled or not. + The process function d_run() changes wherever DISTRHO_PLUGIN_WANTS_MIDI_INPUT is enabled or not. When enabled it provides midi input events. */ class Plugin @@ -452,11 +615,12 @@ public: /** Change the plugin audio output latency to @a frames. This function should only be called in the constructor, d_activate() and d_run(). + @note This function is only available if DISTRHO_PLUGIN_WANT_LATENCY is enabled. */ - void d_setLatency(const uint32_t frames) noexcept; + void d_setLatency(uint32_t frames) noexcept; #endif -#if DISTRHO_PLUGIN_HAS_MIDI_OUTPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT /** Write a MIDI output event. This function must only be called during d_run(). @@ -577,7 +741,7 @@ protected: */ virtual void d_deactivate() {} -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT /** Run/process function for plugins with MIDI input. @note: Some parameters might be null if there are no audio inputs/outputs or MIDI events. @@ -629,6 +793,8 @@ private: */ extern Plugin* createPlugin(); +/** @} */ + // ----------------------------------------------------------------------------------------------------------- END_NAMESPACE_DISTRHO diff --git a/distrho/DistrhoPluginMain.cpp b/distrho/DistrhoPluginMain.cpp index 8fce7dbd..76dea76a 100644 --- a/distrho/DistrhoPluginMain.cpp +++ b/distrho/DistrhoPluginMain.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/DistrhoUI.hpp b/distrho/DistrhoUI.hpp index ef75f6c0..c3a03006 100644 --- a/distrho/DistrhoUI.hpp +++ b/distrho/DistrhoUI.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/DistrhoUIMain.cpp b/distrho/DistrhoUIMain.cpp index cb1cb6e7..ee4a6e52 100644 --- a/distrho/DistrhoUIMain.cpp +++ b/distrho/DistrhoUIMain.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/DistrhoUtils.hpp b/distrho/DistrhoUtils.hpp index b1391efa..55861e81 100644 --- a/distrho/DistrhoUtils.hpp +++ b/distrho/DistrhoUtils.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/src/DistrhoDefines.h b/distrho/src/DistrhoDefines.h index 59e4c349..83d4256d 100644 --- a/distrho/src/DistrhoDefines.h +++ b/distrho/src/DistrhoDefines.h @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/src/DistrhoPlugin.cpp b/distrho/src/DistrhoPlugin.cpp index 9b301be8..1730d972 100644 --- a/distrho/src/DistrhoPlugin.cpp +++ b/distrho/src/DistrhoPlugin.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -96,7 +96,7 @@ void Plugin::d_setLatency(const uint32_t frames) noexcept } #endif -#if DISTRHO_PLUGIN_HAS_MIDI_OUTPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT bool Plugin::d_writeMidiEvent(const MidiEvent& /*midiEvent*/) noexcept { // TODO diff --git a/distrho/src/DistrhoPluginCarla.cpp b/distrho/src/DistrhoPluginCarla.cpp index 1f0a75e4..f849e1b0 100644 --- a/distrho/src/DistrhoPluginCarla.cpp +++ b/distrho/src/DistrhoPluginCarla.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/distrho/src/DistrhoPluginChecks.h b/distrho/src/DistrhoPluginChecks.h index 16d6b43e..9135e35e 100644 --- a/distrho/src/DistrhoPluginChecks.h +++ b/distrho/src/DistrhoPluginChecks.h @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -26,14 +26,6 @@ # error DISTRHO_PLUGIN_NAME undefined! #endif -#ifndef DISTRHO_PLUGIN_HAS_UI -# error DISTRHO_PLUGIN_HAS_UI undefined! -#endif - -#ifndef DISTRHO_PLUGIN_IS_SYNTH -# error DISTRHO_PLUGIN_IS_SYNTH undefined! -#endif - #ifndef DISTRHO_PLUGIN_NUM_INPUTS # error DISTRHO_PLUGIN_NUM_INPUTS undefined! #endif @@ -42,51 +34,47 @@ # error DISTRHO_PLUGIN_NUM_OUTPUTS undefined! #endif -#ifndef DISTRHO_PLUGIN_WANT_LATENCY -# error DISTRHO_PLUGIN_WANT_LATENCY undefined! +#ifndef DISTRHO_PLUGIN_URI +# error DISTRHO_PLUGIN_URI undefined! #endif -#ifndef DISTRHO_PLUGIN_WANT_PROGRAMS -# error DISTRHO_PLUGIN_WANT_PROGRAMS undefined! -#endif +// ----------------------------------------------------------------------- +// Define optional macros if not done yet -#ifndef DISTRHO_PLUGIN_WANT_STATE -# error DISTRHO_PLUGIN_WANT_STATE undefined! +#ifndef DISTRHO_PLUGIN_HAS_UI +# define DISTRHO_PLUGIN_HAS_UI 0 #endif -#ifndef DISTRHO_PLUGIN_WANT_TIMEPOS -# error DISTRHO_PLUGIN_WANT_TIMEPOS undefined! +#ifndef DISTRHO_PLUGIN_IS_RT_SAFE +# define DISTRHO_PLUGIN_IS_RT_SAFE 0 #endif -// ----------------------------------------------------------------------- -// Test if synth has audio outputs - -#if DISTRHO_PLUGIN_IS_SYNTH && DISTRHO_PLUGIN_NUM_OUTPUTS == 0 -# error Synths need audio output to work! +#ifndef DISTRHO_PLUGIN_IS_SYNTH +# define DISTRHO_PLUGIN_IS_SYNTH 0 #endif -// ----------------------------------------------------------------------- -// Enable MIDI input if synth, test if midi-input disabled when synth +#ifndef DISTRHO_PLUGIN_WANT_DIRECT_ACCESS +# define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0 +#endif -#ifndef DISTRHO_PLUGIN_HAS_MIDI_INPUT -# define DISTRHO_PLUGIN_HAS_MIDI_INPUT DISTRHO_PLUGIN_IS_SYNTH -#elif DISTRHO_PLUGIN_IS_SYNTH && ! DISTRHO_PLUGIN_HAS_MIDI_INPUT -# error Synths need MIDI input to work! +#ifndef DISTRHO_PLUGIN_WANT_LATENCY +# define DISTRHO_PLUGIN_WANT_LATENCY 0 #endif -// ----------------------------------------------------------------------- -// Define optional macros if not done yet +#ifndef DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT +# define DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT 0 +#endif -#ifndef DISTRHO_PLUGIN_HAS_MIDI_OUTPUT -# define DISTRHO_PLUGIN_HAS_MIDI_OUTPUT 0 +#ifndef DISTRHO_PLUGIN_WANT_PROGRAMS +# define DISTRHO_PLUGIN_WANT_PROGRAMS 0 #endif -#ifndef DISTRHO_PLUGIN_IS_RT_SAFE -# define DISTRHO_PLUGIN_IS_RT_SAFE 0 +#ifndef DISTRHO_PLUGIN_WANT_STATE +# define DISTRHO_PLUGIN_WANT_STATE 0 #endif -#ifndef DISTRHO_PLUGIN_WANT_DIRECT_ACCESS -# define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0 +#ifndef DISTRHO_PLUGIN_WANT_TIMEPOS +# define DISTRHO_PLUGIN_WANT_TIMEPOS 0 #endif #ifndef DISTRHO_UI_USE_NANOVG @@ -100,6 +88,22 @@ # define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#UI" #endif +// ----------------------------------------------------------------------- +// Test if synth has audio outputs + +#if DISTRHO_PLUGIN_IS_SYNTH && DISTRHO_PLUGIN_NUM_OUTPUTS == 0 +# error Synths need audio output to work! +#endif + +// ----------------------------------------------------------------------- +// Enable MIDI input if synth, test if midi-input disabled when synth + +#ifndef DISTRHO_PLUGIN_WANTS_MIDI_INPUT +# define DISTRHO_PLUGIN_WANTS_MIDI_INPUT DISTRHO_PLUGIN_IS_SYNTH +#elif DISTRHO_PLUGIN_IS_SYNTH && ! DISTRHO_PLUGIN_WANTS_MIDI_INPUT +# error Synths need MIDI input to work! +#endif + // ----------------------------------------------------------------------- #endif // DISTRHO_PLUGIN_CHECKS_H_INCLUDED diff --git a/distrho/src/DistrhoPluginInternal.hpp b/distrho/src/DistrhoPluginInternal.hpp index e9e2e23c..d41be3d9 100644 --- a/distrho/src/DistrhoPluginInternal.hpp +++ b/distrho/src/DistrhoPluginInternal.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/src/DistrhoPluginJack.cpp b/distrho/src/DistrhoPluginJack.cpp index 2de1165b..7866f594 100644 --- a/distrho/src/DistrhoPluginJack.cpp +++ b/distrho/src/DistrhoPluginJack.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/distrho/src/DistrhoPluginLADSPA+DSSI.cpp b/distrho/src/DistrhoPluginLADSPA+DSSI.cpp index 11a310d7..7d1be91d 100644 --- a/distrho/src/DistrhoPluginLADSPA+DSSI.cpp +++ b/distrho/src/DistrhoPluginLADSPA+DSSI.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -16,7 +16,7 @@ #include "DistrhoPluginInternal.hpp" -#if DISTRHO_PLUGIN_HAS_MIDI_OUTPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT # error Cannot use MIDI Output with LADSPA or DSSI #endif @@ -24,7 +24,7 @@ # include "dssi/dssi.h" #else # include "ladspa/ladspa.h" -# if DISTRHO_PLUGIN_HAS_MIDI_INPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_INPUT # error Cannot use MIDI with LADSPA # endif # if DISTRHO_PLUGIN_WANT_STATE @@ -190,7 +190,7 @@ public: } } -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT // Get MIDI Events uint32_t midiEventCount = 0; MidiEvent midiEvents[eventCount]; @@ -271,7 +271,7 @@ public: updateParameterOutputs(); -#if defined(DISTRHO_PLUGIN_TARGET_DSSI) && ! DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if defined(DISTRHO_PLUGIN_TARGET_DSSI) && ! DISTRHO_PLUGIN_WANTS_MIDI_INPUT return; // unused (void)events; (void)eventCount; #endif @@ -435,7 +435,7 @@ static void dssi_select_program(LADSPA_Handle instance, ulong bank, ulong progra } # endif -# if DISTRHO_PLUGIN_HAS_MIDI_INPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_INPUT static void dssi_run_synth(LADSPA_Handle instance, ulong sampleCount, snd_seq_event_t* events, ulong eventCount) { instancePtr->dssi_run_synth(sampleCount, events, eventCount); @@ -490,7 +490,7 @@ static DSSI_Descriptor sDssiDescriptor = { /* select_program */ nullptr, # endif /* get_midi_controller_for_port */ nullptr, -# if DISTRHO_PLUGIN_HAS_MIDI_INPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_INPUT dssi_run_synth, # else /* run_synth */ nullptr, diff --git a/distrho/src/DistrhoPluginLV2.cpp b/distrho/src/DistrhoPluginLV2.cpp index 27393383..78d6f90b 100644 --- a/distrho/src/DistrhoPluginLV2.cpp +++ b/distrho/src/DistrhoPluginLV2.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -44,8 +44,8 @@ # warning LV2 TimePos still TODO #endif -#define DISTRHO_LV2_USE_EVENTS_IN (DISTRHO_PLUGIN_HAS_MIDI_INPUT || DISTRHO_PLUGIN_WANT_TIMEPOS || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) -#define DISTRHO_LV2_USE_EVENTS_OUT (DISTRHO_PLUGIN_HAS_MIDI_OUTPUT || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) +#define DISTRHO_LV2_USE_EVENTS_IN (DISTRHO_PLUGIN_WANTS_MIDI_INPUT || DISTRHO_PLUGIN_WANT_TIMEPOS || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) +#define DISTRHO_LV2_USE_EVENTS_OUT (DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) START_NAMESPACE_DISTRHO @@ -271,7 +271,7 @@ public: } #if DISTRHO_LV2_USE_EVENTS_IN -# if DISTRHO_PLUGIN_HAS_MIDI_INPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_INPUT uint32_t midiEventCount = 0; # endif LV2_ATOM_SEQUENCE_FOREACH(fPortEventsIn, event) @@ -279,7 +279,7 @@ public: if (event == nullptr) break; -# if DISTRHO_PLUGIN_HAS_MIDI_INPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_INPUT if (event->body.type == fURIDs.midiEvent) { if (midiEventCount >= kMaxMidiEvents) @@ -477,7 +477,7 @@ public: fPlugin.setTimePosition(fTimePosition); # endif -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT fPlugin.run(fPortAudioIns, fPortAudioOuts, sampleCount, fMidiEvents, midiEventCount); #else fPlugin.run(fPortAudioIns, fPortAudioOuts, sampleCount); @@ -529,7 +529,7 @@ public: uint32_t size, offset = 0; LV2_Atom_Event* aev; -# if DISTRHO_PLUGIN_HAS_MIDI_OUTPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT // TODO # endif # if (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI) @@ -783,7 +783,7 @@ private: // Temporary data float* fLastControlValues; double fSampleRate; -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT MidiEvent fMidiEvents[kMaxMidiEvents]; #endif #if DISTRHO_PLUGIN_WANT_TIMEPOS diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp index f777bd10..265f02c1 100644 --- a/distrho/src/DistrhoPluginLV2export.cpp +++ b/distrho/src/DistrhoPluginLV2export.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -49,8 +49,8 @@ # define DISTRHO_PLUGIN_HAS_UI 0 #endif -#define DISTRHO_LV2_USE_EVENTS_IN (DISTRHO_PLUGIN_HAS_MIDI_INPUT || DISTRHO_PLUGIN_WANT_TIMEPOS || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) -#define DISTRHO_LV2_USE_EVENTS_OUT (DISTRHO_PLUGIN_HAS_MIDI_OUTPUT || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) +#define DISTRHO_LV2_USE_EVENTS_IN (DISTRHO_PLUGIN_WANTS_MIDI_INPUT || DISTRHO_PLUGIN_WANT_TIMEPOS || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) +#define DISTRHO_LV2_USE_EVENTS_OUT (DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT || (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI)) // ----------------------------------------------------------------------- @@ -255,7 +255,7 @@ void lv2_generate_ttl(const char* const basename) # if (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI) pluginString += " atom:supports <" LV2_ATOM__String "> ;\n"; # endif -# if DISTRHO_PLUGIN_HAS_MIDI_INPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_INPUT pluginString += " atom:supports <" LV2_MIDI__MidiEvent "> ;\n"; # endif # if DISTRHO_PLUGIN_WANT_TIMEPOS @@ -276,7 +276,7 @@ void lv2_generate_ttl(const char* const basename) # if (DISTRHO_PLUGIN_WANT_STATE && DISTRHO_PLUGIN_HAS_UI) pluginString += " atom:supports <" LV2_ATOM__String "> ;\n"; # endif -# if DISTRHO_PLUGIN_HAS_MIDI_OUTPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT pluginString += " atom:supports <" LV2_MIDI__MidiEvent "> ;\n"; # endif pluginString += " ] ;\n\n"; diff --git a/distrho/src/DistrhoPluginVST.cpp b/distrho/src/DistrhoPluginVST.cpp index eaabd1dd..4767f12e 100644 --- a/distrho/src/DistrhoPluginVST.cpp +++ b/distrho/src/DistrhoPluginVST.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -202,7 +202,7 @@ protected: void sendNote(const uint8_t channel, const uint8_t note, const uint8_t velocity) { -#if 0 //DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if 0 //DISTRHO_PLUGIN_WANTS_MIDI_INPUT // TODO #else return; // unused @@ -278,7 +278,7 @@ public: std::memset(fProgramName, 0, sizeof(char)*(32+1)); std::strcpy(fProgramName, "Default"); -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT fMidiEventCount = 0; #endif @@ -390,7 +390,7 @@ public: if (value != 0) { fPlugin.activate(); -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT fMidiEventCount = 0; #endif } @@ -548,7 +548,7 @@ public: } #endif // DISTRHO_PLUGIN_WANT_STATE -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT case effProcessEvents: if (const VstEvents* const events = (const VstEvents*)ptr) { @@ -586,7 +586,7 @@ public: } break; -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT || DISTRHO_PLUGIN_HAS_MIDI_OUTPUT || DISTRHO_PLUGIN_WANT_TIMEPOS || DISTRHO_OS_MAC +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT || DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT || DISTRHO_PLUGIN_WANT_TIMEPOS || DISTRHO_OS_MAC case effCanDo: if (const char* const canDo = (const char*)ptr) { @@ -597,13 +597,13 @@ public: return 0xbeef0000; } # endif -# if DISTRHO_PLUGIN_HAS_MIDI_INPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_INPUT if (std::strcmp(canDo, "receiveVstEvents") == 0) return 1; if (std::strcmp(canDo, "receiveVstMidiEvent") == 0) return 1; # endif -# if DISTRHO_PLUGIN_HAS_MIDI_OUTPUT +# if DISTRHO_PLUGIN_WANTS_MIDI_OUTPUT if (std::strcmp(canDo, "sendVstEvents") == 0) return 1; if (std::strcmp(canDo, "sendVstMidiEvent") == 0) @@ -690,7 +690,7 @@ public: } #endif -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT fPlugin.run(inputs, outputs, sampleFrames, fMidiEvents, fMidiEventCount); fMidiEventCount = 0; #else @@ -724,7 +724,7 @@ private: // Temporary data char fProgramName[32+1]; -#if DISTRHO_PLUGIN_HAS_MIDI_INPUT +#if DISTRHO_PLUGIN_WANTS_MIDI_INPUT uint32_t fMidiEventCount; MidiEvent fMidiEvents[kMaxMidiEvents]; #endif diff --git a/distrho/src/DistrhoUI.cpp b/distrho/src/DistrhoUI.cpp index 4e977300..78bfd88e 100644 --- a/distrho/src/DistrhoUI.cpp +++ b/distrho/src/DistrhoUI.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/src/DistrhoUIDSSI.cpp b/distrho/src/DistrhoUIDSSI.cpp index 0a3d6f91..55b28dc5 100644 --- a/distrho/src/DistrhoUIDSSI.cpp +++ b/distrho/src/DistrhoUIDSSI.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/src/DistrhoUIInternal.hpp b/distrho/src/DistrhoUIInternal.hpp index a07719ca..24cdcd85 100644 --- a/distrho/src/DistrhoUIInternal.hpp +++ b/distrho/src/DistrhoUIInternal.hpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/distrho/src/DistrhoUILV2.cpp b/distrho/src/DistrhoUILV2.cpp index 2aa6565a..2353844a 100644 --- a/distrho/src/DistrhoUILV2.cpp +++ b/distrho/src/DistrhoUILV2.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Plugin Framework (DPF) - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/dpf.doxygen b/dpf.doxygen new file mode 100644 index 00000000..9229cd9d --- /dev/null +++ b/dpf.doxygen @@ -0,0 +1,294 @@ +# Doxyfile 1.7.6.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "DISTRHO Plugin Framework" +PROJECT_NUMBER = +PROJECT_BRIEF = +PROJECT_LOGO = +OUTPUT_DIRECTORY = docs +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 4 +ALIASES = +TCL_SUBST = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = YES +SYMBOL_CACHE_SIZE = 0 +LOOKUP_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +FORCE_LOCAL_INCLUDES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = distrho +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = NO +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = . +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = YES +HTML_ALIGN_MEMBERS = YES +HTML_DYNAMIC_SECTIONS = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = NO +GENERATE_TREEVIEW = NO +ENUM_VALUES_PER_LINE = 4 +USE_INLINE_TREES = NO +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +USE_MATHJAX = NO +MATHJAX_RELPATH = http://www.mathjax.org/mathjax +MATHJAX_EXTENSIONS = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4 +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +LATEX_SOURCE_CODE = NO +LATEX_BIB_STYLE = plain +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = DOXYGEN \ + DISTRHO_PLUGIN_HAS_MIDI_INPUT \ + DISTRHO_PLUGIN_HAS_MIDI_OUTPUT \ + DISTRHO_PLUGIN_WANT_DIRECT_ACCESS \ + DISTRHO_PLUGIN_WANT_LATENCY \ + DISTRHO_PLUGIN_WANT_PROGRAMS \ + DISTRHO_PLUGIN_WANT_STATE \ + DISTRHO_PLUGIN_WANT_TIMEPOS +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = YES +GENERATE_LEGEND = YES +DOT_CLEANUP = YES