Browse Source

Fixes for the operator= implementations of the AudioParameterXXX classes

tags/2021-05-28
jules 9 years ago
parent
commit
8622ec4004
1 changed files with 8 additions and 16 deletions
  1. +8
    -16
      modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp

+ 8
- 16
modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp View File

@@ -59,10 +59,8 @@ String AudioParameterFloat::getText (float v, int length) const
AudioParameterFloat& AudioParameterFloat::operator= (float newValue)
{
const float normalisedValue = range.convertTo0to1 (newValue);
if (value != normalisedValue)
setValueNotifyingHost (normalisedValue);
if (value != newValue)
setValueNotifyingHost (range.convertTo0to1 (newValue));
return *this;
}
@@ -92,10 +90,8 @@ String AudioParameterInt::getText (float v, int /*length*/) const { retur
AudioParameterInt& AudioParameterInt::operator= (int newValue)
{
const float normalisedValue = convertTo0to1 (newValue);
if (value != normalisedValue)
setValueNotifyingHost (normalisedValue);
if (get() != newValue)
setValueNotifyingHost (convertTo0to1 (newValue));
return *this;
}
@@ -120,10 +116,8 @@ String AudioParameterBool::getText (float v, int /*length*/) const { retur
AudioParameterBool& AudioParameterBool::operator= (bool newValue)
{
const float normalisedValue = newValue ? 1.0f : 0.0f;
if (value != normalisedValue)
setValueNotifyingHost (normalisedValue);
if (get() != newValue)
setValueNotifyingHost (newValue ? 1.0f : 0.0f);
return *this;
}
@@ -153,10 +147,8 @@ String AudioParameterChoice::getText (float v, int /*length*/) const { retur
AudioParameterChoice& AudioParameterChoice::operator= (int newValue)
{
const float normalisedValue = convertTo0to1 (newValue);
if (value != normalisedValue)
setValueNotifyingHost (normalisedValue);
if (getIndex() != newValue)
setValueNotifyingHost (convertTo0to1 (newValue));
return *this;
}

Loading…
Cancel
Save