Bug in juce_AudioProcessorGraph.cpp


#1

Hi,

a git blame on juce_AudioProcessorGraph.cpp reveals a commit, 6859b99 (Bit of a clean-up in AudioProcessorGraph.) on Dec 23, 2014, which -- among other things -- provided an overriden implementation for AudioProcessor::setPlayHead().

Unfortunately, the newly-overriden method fails to call AudioProcessor::setPlayHead as a preamble, thus changing the behaviour of the method and failing to set the processor graph's play head. This has ramifications on future AudioProcessorGraph::addNode() calls, namely that the play head for contained nodes are no longer correctly set.

The fix is to simply insert a call to the superclass' setPlayHead() method, like so:

void AudioProcessorGraph::setPlayHead (AudioPlayHead* audioPlayHead)
{
    AudioProcessor::setPlayHead(audioPlayHead);

    const ScopedLock sl (getCallbackLock());

    for (int i = 0; i < nodes.size(); ++i)
        nodes.getUnchecked(i)->getProcessor()->setPlayHead (audioPlayHead);
}

Kind regards, and as always, JUCE is a joy to use!


#2

Thanks, much appreciated! Will sort that out..