Producerで作成したProjectのProjet Settingsに{0,2}, {0,4}などと書いても思った通りには反映されないので、コードで対応する必要がある。
- Producerで作成したProjectのProject SettingsでPlugin Channel Configurationsを空白(empty)にする。
- AudioProcessorを継承したクラスのコンストラクタで下記のようにbusを足していく。この例ではMain Outの他にAux Outを追加。
- isBusesLayoutSupported()をオーバーライドしてbusの有効性をチェックするコードを追加。
SampleAudioProcessor::SampleAudioProcessor()
# ifndef JucePlugin_PreferredChannelConfigurations
: AudioProcessor (BusesProperties()
#if ! JucePlugin_IsMidiEffect
#if ! JucePlugin_IsSynth
.withInput ("Input", AudioChannelSet::stereo(), true)
#endif
.withOutput ("Main Out", AudioChannelSet::stereo(), true)
.withOutput ("Aux Out", AudioChannelSet::stereo(), true)
#endif
)
# endif
{
}
# ifndef JucePlugin_PreferredChannelConfigurations
bool SampleAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
#if JucePlugin_IsMidiEffect
ignoreUnused (layouts);
return true;
#else
// This is the place where you check if the layout is supported.
// In this template code we only support mono or stereo.
if (layouts.getChannelSet(false, 0) != AudioChannelSet::stereo())
return false;
if (layouts.outputBuses.size() == 2)
{
if (layouts.getChannelSet(false, 1) != AudioChannelSet::stereo())
return false;
}
// This checks if the input layout matches the output layout
#if ! JucePlugin_IsSynth
if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
return false;
#endif
return true;
#endif
}
# endif

