Should AudioProcessorGraph::prepareToPlay() check if either of the parameters have changed before rebuilding the graph?
void AudioProcessorGraph::prepareToPlay (double sampleRate, int estimatedSamplesPerBlock)
{
// Should it have this check?
if (sampleRate == getSampleRate() && estimatedSamplesPerBlock == getBlockSize())
return;
audioBuffers->prepareInOutBuffers (jmax (1, getNumOutputChannels()), estimatedSamplesPerBlock);
currentMidiInputBuffer = nullptr;
currentMidiOutputBuffer.clear();
clearRenderingSequence();
buildRenderingSequence();
}
Cheers,
Rail