mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +00:00
Choose stereo layout as default layout when using legacy channel configuration field
This commit is contained in:
parent
3aa68f3d00
commit
d0d9b9c181
1 changed files with 11 additions and 22 deletions
|
|
@ -42,36 +42,25 @@ AudioProcessor::AudioProcessor()
|
|||
nonRealtime (false),
|
||||
processingPrecision (singlePrecision)
|
||||
{
|
||||
#if ! JucePlugin_IsMidiEffect
|
||||
#ifdef JucePlugin_PreferredChannelConfigurations
|
||||
const short channelConfigs[][2] = { JucePlugin_PreferredChannelConfigurations };
|
||||
#else
|
||||
const short channelConfigs[][2] = { {2, 2} };
|
||||
#endif
|
||||
int numChannelConfigs = sizeof (channelConfigs) / sizeof (*channelConfigs);
|
||||
|
||||
if (numChannelConfigs > 0)
|
||||
{
|
||||
int defaultLayoutIdx = 0;
|
||||
#if ! JucePlugin_IsMidiEffect
|
||||
#if ! JucePlugin_IsSynth
|
||||
busArrangement.inputBuses.add (AudioProcessorBus ("Input", AudioChannelSet::canonicalChannelSet (channelConfigs[0][0])));
|
||||
#endif
|
||||
busArrangement.outputBuses.add (AudioProcessorBus ("Output", AudioChannelSet::canonicalChannelSet (channelConfigs[0][1])));
|
||||
|
||||
// prefer stereo if available
|
||||
for (int i = 0; i < numChannelConfigs; ++i)
|
||||
{
|
||||
if (channelConfigs[i][0] == 2 || channelConfigs[i][1] == 2)
|
||||
{
|
||||
defaultLayoutIdx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if ! JucePlugin_IsSynth
|
||||
busArrangement.inputBuses.add (AudioProcessorBus ("Input", AudioChannelSet::canonicalChannelSet (channelConfigs[defaultLayoutIdx][0])));
|
||||
#endif
|
||||
|
||||
busArrangement.outputBuses.add (AudioProcessorBus ("Output", AudioChannelSet::canonicalChannelSet (channelConfigs[defaultLayoutIdx][1])));
|
||||
}
|
||||
#ifdef JucePlugin_PreferredChannelConfigurations
|
||||
#if ! JucePlugin_IsSynth
|
||||
AudioProcessor::setPreferredBusArrangement (true, 0, AudioChannelSet::stereo());
|
||||
#endif
|
||||
AudioProcessor::setPreferredBusArrangement (false, 0, AudioChannelSet::stereo());
|
||||
#endif
|
||||
|
||||
#endif
|
||||
updateSpeakerFormatStrings();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue