1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

AudioProcessorGraph: Fix an issue where IO nodes sometimes failed to update their channel counts

This commit is contained in:
reuk 2022-12-08 17:54:52 +00:00
parent 3fe8f8a86a
commit 76adebee13
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -1453,8 +1453,7 @@ public:
if (lastNodeID < idToUse)
lastNodeID = idToUse;
if (auto* ioProc = dynamic_cast<AudioGraphIOProcessor*> (added->getProcessor()))
ioProc->setParentGraph (owner);
setParentGraph (added->getProcessor());
topologyChanged (updateKind);
return added;
@ -1606,6 +1605,12 @@ public:
auto* getAudioThreadState() const { return renderSequenceExchange.getAudioThreadState(); }
private:
void setParentGraph (AudioProcessor* p) const
{
if (auto* ioProc = dynamic_cast<AudioGraphIOProcessor*> (p))
ioProc->setParentGraph (owner);
}
void topologyChanged (UpdateKind updateKind)
{
owner->sendChangeMessage();
@ -1620,6 +1625,9 @@ private:
{
if (const auto newSettings = nodeStates.applySettings (nodes))
{
for (const auto node : nodes.getNodes())
setParentGraph (node->getProcessor());
auto sequence = std::make_unique<RenderSequence> (*newSettings, nodes, connections);
owner->setLatencySamples (sequence->getLatencySamples());
renderSequenceExchange.set (std::move (sequence));