From 76886ea268393617cb2fcdde3d6b97f062d878a6 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 13 Jan 2016 12:53:38 +0000 Subject: [PATCH] Added some optimisations to AudioProcessorValueTreeState to avoid it refreshing unnecessarily --- .../utilities/juce_AudioProcessorValueTreeState.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp index 76063062c1..27a4ac9fdb 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp @@ -258,21 +258,21 @@ void AudioProcessorValueTreeState::updateParameterConnectionsToChildTrees() } } -void AudioProcessorValueTreeState::valueTreePropertyChanged (ValueTree&, const Identifier& property) +void AudioProcessorValueTreeState::valueTreePropertyChanged (ValueTree& tree, const Identifier& property) { - if (property == idPropertyID) + if (property == idPropertyID && tree.hasType (valueType) && tree.getParent() == state) updateParameterConnectionsToChildTrees(); } -void AudioProcessorValueTreeState::valueTreeChildAdded (ValueTree& parent, ValueTree&) +void AudioProcessorValueTreeState::valueTreeChildAdded (ValueTree& parent, ValueTree& tree) { - if (parent == state) + if (parent == state && tree.hasType (valueType)) updateParameterConnectionsToChildTrees(); } -void AudioProcessorValueTreeState::valueTreeChildRemoved (ValueTree& parent, ValueTree&, int) +void AudioProcessorValueTreeState::valueTreeChildRemoved (ValueTree& parent, ValueTree& tree, int) { - if (parent == state) + if (parent == state && tree.hasType (valueType)) updateParameterConnectionsToChildTrees(); }