mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Standalone: Add a dummy output channel to MIDI effect plug-ins
This commit is contained in:
parent
107a2cfe27
commit
04fdc4c209
1 changed files with 26 additions and 15 deletions
|
|
@ -128,13 +128,7 @@ public:
|
|||
processor->disableNonMainBuses();
|
||||
processor->setRateAndBufferSizeDetails (44100, 512);
|
||||
|
||||
int inChannels = (channelConfiguration.size() > 0 ? channelConfiguration[0].numIns
|
||||
: processor->getMainBusNumInputChannels());
|
||||
|
||||
int outChannels = (channelConfiguration.size() > 0 ? channelConfiguration[0].numOuts
|
||||
: processor->getMainBusNumOutputChannels());
|
||||
|
||||
processorHasPotentialFeedbackLoop = (inChannels > 0 && outChannels > 0);
|
||||
processorHasPotentialFeedbackLoop = (getNumInputChannels() > 0 && getNumOutputChannels() > 0);
|
||||
}
|
||||
|
||||
virtual void deletePlugin()
|
||||
|
|
@ -143,6 +137,24 @@ public:
|
|||
processor = nullptr;
|
||||
}
|
||||
|
||||
int getNumInputChannels() const
|
||||
{
|
||||
if (processor == nullptr)
|
||||
return 0;
|
||||
|
||||
return (channelConfiguration.size() > 0 ? channelConfiguration[0].numIns
|
||||
: processor->getMainBusNumInputChannels());
|
||||
}
|
||||
|
||||
int getNumOutputChannels() const
|
||||
{
|
||||
if (processor == nullptr)
|
||||
return 0;
|
||||
|
||||
return (channelConfiguration.size() > 0 ? channelConfiguration[0].numOuts
|
||||
: processor->getMainBusNumOutputChannels());
|
||||
}
|
||||
|
||||
static String getFilePatterns (const String& fileSuffix)
|
||||
{
|
||||
if (fileSuffix.isEmpty())
|
||||
|
|
@ -305,18 +317,17 @@ public:
|
|||
#endif
|
||||
}
|
||||
|
||||
auto totalInChannels = processor->getMainBusNumInputChannels();
|
||||
auto totalOutChannels = processor->getMainBusNumOutputChannels();
|
||||
auto inputChannels = getNumInputChannels();
|
||||
auto outputChannels = getNumOutputChannels();
|
||||
|
||||
if (channelConfiguration.size() > 0)
|
||||
if (inputChannels == 0 && outputChannels == 0 && processor->isMidiEffect())
|
||||
{
|
||||
auto defaultConfig = channelConfiguration.getReference (0);
|
||||
totalInChannels = defaultConfig.numIns;
|
||||
totalOutChannels = defaultConfig.numOuts;
|
||||
// add a dummy output channel for MIDI effect plug-ins so they can receive audio callbacks
|
||||
outputChannels = 1;
|
||||
}
|
||||
|
||||
deviceManager.initialise (enableAudioInput ? totalInChannels : 0,
|
||||
totalOutChannels,
|
||||
deviceManager.initialise (enableAudioInput ? inputChannels : 0,
|
||||
outputChannels,
|
||||
savedState.get(),
|
||||
true,
|
||||
preferredDefaultDeviceName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue