1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-19 01:04:20 +00:00

APVTS: Send parameter change notifications more proactively

This commit is contained in:
reuk 2019-08-01 18:22:07 +01:00 committed by Tom Poole
parent 016b04c64f
commit 8480d0110a
2 changed files with 12 additions and 0 deletions

View file

@ -65,6 +65,15 @@ bool AudioProcessorValueTreeState::Parameter::isAutomatable() const { return
bool AudioProcessorValueTreeState::Parameter::isDiscrete() const { return discrete; }
bool AudioProcessorValueTreeState::Parameter::isBoolean() const { return boolean; }
void AudioProcessorValueTreeState::Parameter::valueChanged (float newValue)
{
if (lastValue == newValue)
return;
lastValue = newValue;
sendValueChangedMessageToListeners (newValue);
}
//==============================================================================
class AudioProcessorValueTreeState::ParameterAdapter : private AudioProcessorParameter::Listener
{

View file

@ -414,8 +414,11 @@ public:
bool isBoolean() const override;
private:
void valueChanged (float) override;
const float unsnappedDefault;
const bool metaParameter, automatable, discrete, boolean;
float lastValue = 0.0f;
};
//==============================================================================