JUCE LV2 Plugin Wrapper

Ok, things are advancing and only 1 feature is missing to complete the wrapper (TimePos information)

Let me point some changes needed to make in Juce source code.

1 - Accept LV2 as a build type. juce_CheckSettingMacros.h should have:

#if ! (JucePlugin_Build_VST || JucePlugin_Build_AU || JucePlugin_Build_RTAS || JucePlugin_Build_Standalone || JucePlugin_Build_LV2) #error "You need to enable at least one plugin format!" #endif

2 - To build LV2, JucePlugin_LV2URI macro must be defined. should be checked on juce_CheckSettingMacros.h too, like so:

#ifndef JucePlugin_LV2URI #error "You need to define the JucePlugin_LV2URI value!" #endif
LV2 uses URI as id system (kinda like VST uses UniqueId). URIs must be unique. By default the value can be “urn:juce:PluginName” (Plugin name with no spaces or special chars).
The auto-generated AppConfig.h should have something like:

(Note that a real URI, like http://www.rawmaterialsoftware.com/DemoPlugin, is of course good too)

3 - Defining LV2 category using JucePlugin_LV2Category macro.
This is not required, when not set the plugin will be a normal effect.
All Possible values currently are:

GeneratorPlugin InstrumentPlugin OscillatorPlugin UtilityPlugin ConverterPlugin AnalyserPlugin MixerPlugin SimulatorPlugin DelayPlugin ModulatorPlugin ReverbPlugin PhaserPlugin FlangerPlugin ChorusPlugin FilterPlugin LowpassPlugin BandpassPlugin HighpassPlugin CombPlugin AllpassPlugin EQPlugin ParaEQPlugin MultiEQPlugin SpatialPlugin SpectralPlugin PitchPlugin AmplifierPlugin DistortionPlugin WaveshaperPlugin DynamicsPlugin CompressorPlugin ExpanderPlugin LimiterPlugin GatePlugin
If a plugin is a synth, then it must have category “InstrumentPlugin”. example:

(If this gets into the IntroJucer, a combo-box will be nice for this)

4 - Feature Macros
I added some macros to the code so that non-needed features are disabled
They can be undefined or set to 0 to disable. Set to 1 to enable them,
The macros are:

JucePlugin_WantsLV2Presets - Wherever it makes sense to export presets or not
Note that on LV2 presets are stored on the host-side, not internally like in VST. So if a plugin has 1 single preset it won’t make sense to set this.

JucePlugin_WantsLV2State - Wherever the plugin saves data that are not parameters (files, nodes, etc)

JucePlugin_WantsLV2StateString - Save the state as strings (usually XML), using the new API I spoke about earlier in this thread
This macro requires JucePlugin_WantsLV2State

JucePlugin_WantsLV2TimePos - Wherever the plugin is interested on getting Time information or not
Note that some old hosts don’t support this, or may just export the BPM

JucePlugin_WantsLV2InstanceAccess - Wherever the GUI requires direct access to the plugin code
This is usually true for Juce plugins. It should be enabled if JucePlugin_WantsLV2State is enabled too.
(The only plugins that I saw that don’t need to enabled this are those who only store parameter values and have no “fancy” GUI stuff like a MIDI keyboard)