mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-17 00:44:19 +00:00
Fixes for the operator= implementations of the AudioParameterXXX classes
This commit is contained in:
parent
613aaa765a
commit
8622ec4004
1 changed files with 8 additions and 16 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue