Okay - I’m not sure if y’all would go for this…
Since my Standalone has to have a different set of Bus properties than my non-standalone version…
In juce_PluginUtilities.cpp
//==============================================================================
/** Somewhere in the codebase of your plugin, you need to implement this function
and make it return a new instance of the filter subclass that you're building.
*/
extern AudioProcessor* JUCE_CALLTYPE createPluginFilter (bool);
:
AudioProcessor* JUCE_API JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType type)
{
AudioProcessor::setTypeOfNextNewPlugin (type);
AudioProcessor* const pluginInstance = createPluginFilter (type == AudioProcessor::WrapperType::wrapperType_Standalone);
AudioProcessor::setTypeOfNextNewPlugin (AudioProcessor::wrapperType_Undefined);
// your createPluginFilter() method must return an object!
jassert (pluginInstance != nullptr && pluginInstance->wrapperType == type);
return pluginInstance;
}
Then in my processor class have two constructors:
MyAudioProcessor();
MyAudioProcessor (bool bStandalone);
and change:
//==============================================================================
// This creates new instances of the plugin..
AudioProcessor* JUCE_CALLTYPE createPluginFilter (bool bStandalone = false)
{
if (bStandalone)
return new CPlayerAudioProcessor (bStandalone);
return new CPlayerAudioProcessor();
}
I can now have a separate ctor for Standalone and non-Standalone…
MyAudioProcessor:: MyAudioProcessor (bool bStandalone) : AudioProcessor (BusesProperties().withOutput ("Out", AudioChannelSet::discreteChannels (16), true) )
{
}
MyAudioProcessor:: MyAudioProcessor() : AudioProcessor (BusesProperties()
.withOutput ("Out 1-2", AudioChannelSet::stereo(), true)
.withOutput ("Out 3-4", AudioChannelSet::stereo(), false)
.withOutput ("Out 5-6", AudioChannelSet::stereo(), false)
.withOutput ("Out 7-8", AudioChannelSet::stereo(), false)
.withOutput ("Out 9-10", AudioChannelSet::stereo(), false)
.withOutput ("Out 11-12", AudioChannelSet::stereo(), false)
.withOutput ("Out 13-14", AudioChannelSet::stereo(), false)
.withOutput ("Out 15-16", AudioChannelSet::stereo(), false)
)
{
}
Cheers,
Rail