|
|
|
@@ -647,7 +647,9 @@ public: |
|
|
|
|
|
|
|
void audioProcessorChanged (AudioProcessor*)
|
|
|
|
{
|
|
|
|
PropertyChanged (kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0);
|
|
|
|
PropertyChanged (kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0);
|
|
|
|
PropertyChanged (kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, 0);
|
|
|
|
PropertyChanged (kAudioUnitProperty_ParameterInfo, kAudioUnitScope_Global, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool StreamFormatWritable (AudioUnitScope, AudioUnitElement) override
|
|
|
|
@@ -664,9 +666,9 @@ public: |
|
|
|
ComponentResult Initialize() override
|
|
|
|
{
|
|
|
|
#if ! JucePlugin_IsSynth
|
|
|
|
const int numIns = GetInput(0) != 0 ? (int) GetInput(0)->GetStreamFormat().mChannelsPerFrame : 0;
|
|
|
|
const int numIns = findNumInputChannels();
|
|
|
|
#endif
|
|
|
|
const int numOuts = GetOutput(0) != 0 ? (int) GetOutput(0)->GetStreamFormat().mChannelsPerFrame : 0;
|
|
|
|
const int numOuts = findNumOutputChannels();
|
|
|
|
|
|
|
|
bool isValidChannelConfig = false;
|
|
|
|
|
|
|
|
@@ -710,19 +712,32 @@ public: |
|
|
|
return JuceAUBaseClass::Reset (inScope, inElement);
|
|
|
|
}
|
|
|
|
|
|
|
|
int findNumInputChannels()
|
|
|
|
{
|
|
|
|
#if JucePlugin_IsSynth
|
|
|
|
if (AUInputElement* e = GetInput(0))
|
|
|
|
return (int) e->GetStreamFormat().mChannelsPerFrame;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int findNumOutputChannels()
|
|
|
|
{
|
|
|
|
if (AUOutputElement* e = GetOutput(0))
|
|
|
|
return (int) e->GetStreamFormat().mChannelsPerFrame;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void prepareToPlay()
|
|
|
|
{
|
|
|
|
if (juceFilter != nullptr)
|
|
|
|
{
|
|
|
|
juceFilter->setPlayConfigDetails (
|
|
|
|
#if ! JucePlugin_IsSynth
|
|
|
|
(int) GetInput(0)->GetStreamFormat().mChannelsPerFrame,
|
|
|
|
#else
|
|
|
|
0,
|
|
|
|
#endif
|
|
|
|
(int) GetOutput(0)->GetStreamFormat().mChannelsPerFrame,
|
|
|
|
getSampleRate(),
|
|
|
|
(int) GetMaxFramesPerSlice());
|
|
|
|
juceFilter->setPlayConfigDetails (findNumInputChannels(),
|
|
|
|
findNumOutputChannels(),
|
|
|
|
getSampleRate(),
|
|
|
|
(int) GetMaxFramesPerSlice());
|
|
|
|
|
|
|
|
bufferSpace.setSize (juceFilter->getNumInputChannels() + juceFilter->getNumOutputChannels(),
|
|
|
|
(int) GetMaxFramesPerSlice() + 32);
|
|
|
|
|