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->disableNonMainBuses();
|
||||||
processor->setRateAndBufferSizeDetails (44100, 512);
|
processor->setRateAndBufferSizeDetails (44100, 512);
|
||||||
|
|
||||||
int inChannels = (channelConfiguration.size() > 0 ? channelConfiguration[0].numIns
|
processorHasPotentialFeedbackLoop = (getNumInputChannels() > 0 && getNumOutputChannels() > 0);
|
||||||
: processor->getMainBusNumInputChannels());
|
|
||||||
|
|
||||||
int outChannels = (channelConfiguration.size() > 0 ? channelConfiguration[0].numOuts
|
|
||||||
: processor->getMainBusNumOutputChannels());
|
|
||||||
|
|
||||||
processorHasPotentialFeedbackLoop = (inChannels > 0 && outChannels > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void deletePlugin()
|
virtual void deletePlugin()
|
||||||
|
|
@ -143,6 +137,24 @@ public:
|
||||||
processor = nullptr;
|
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)
|
static String getFilePatterns (const String& fileSuffix)
|
||||||
{
|
{
|
||||||
if (fileSuffix.isEmpty())
|
if (fileSuffix.isEmpty())
|
||||||
|
|
@ -305,18 +317,17 @@ public:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
auto totalInChannels = processor->getMainBusNumInputChannels();
|
auto inputChannels = getNumInputChannels();
|
||||||
auto totalOutChannels = processor->getMainBusNumOutputChannels();
|
auto outputChannels = getNumOutputChannels();
|
||||||
|
|
||||||
if (channelConfiguration.size() > 0)
|
if (inputChannels == 0 && outputChannels == 0 && processor->isMidiEffect())
|
||||||
{
|
{
|
||||||
auto defaultConfig = channelConfiguration.getReference (0);
|
// add a dummy output channel for MIDI effect plug-ins so they can receive audio callbacks
|
||||||
totalInChannels = defaultConfig.numIns;
|
outputChannels = 1;
|
||||||
totalOutChannels = defaultConfig.numOuts;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceManager.initialise (enableAudioInput ? totalInChannels : 0,
|
deviceManager.initialise (enableAudioInput ? inputChannels : 0,
|
||||||
totalOutChannels,
|
outputChannels,
|
||||||
savedState.get(),
|
savedState.get(),
|
||||||
true,
|
true,
|
||||||
preferredDefaultDeviceName,
|
preferredDefaultDeviceName,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue