From 548838e13996d53e3c36420cb3465cfbf800da9d Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 20 Feb 2019 09:25:48 +0000 Subject: [PATCH] Updated the documentation AudioProcessorValueTreeState::Listener::parameterChanged() to clarify that retrieving the value of the parameter that has changed via the other AudioProcessorValueTreeState methods whilst within the callback is not guaranteed to return an up-to-date value --- .../utilities/juce_AudioProcessorValueTreeState.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h index acc1dfb0ac..1ef3e4ad2b 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h @@ -279,8 +279,11 @@ public: /** Returns a parameter by its ID string. */ RangedAudioParameter* getParameter (StringRef parameterID) const noexcept; - /** Returns a pointer to a floating point representation of a particular - parameter which a realtime process can read to find out its current value. + /** Returns a pointer to a floating point representation of a particular parameter which a realtime + process can read to find out its current value. + + Note that calling this method from within AudioProcessorValueTreeState::Listener::parameterChanged() + is not guaranteed to return an up-to-date value for the parameter. */ float* getRawParameterValue (StringRef parameterID) const noexcept; @@ -292,7 +295,12 @@ public: { virtual ~Listener() = default; - /** This callback method is called by the AudioProcessorValueTreeState when a parameter changes. */ + /** This callback method is called by the AudioProcessorValueTreeState when a parameter changes. + + Within this call, retrieving the value of the parameter that has changed via the getRawParameterValue() + or getParameter() methods is not guaranteed to return the up-to-date value. If you need this you should + instead use the newValue parameter. + */ virtual void parameterChanged (const String& parameterID, float newValue) = 0; };