1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

APVTS: Improved the default string displayed for parameter values

This commit is contained in:
Tom Poole 2018-06-11 12:47:10 +01:00
parent 7063d9a7a4
commit d3cada1bc5

View file

@ -68,10 +68,11 @@ struct AudioProcessorValueTreeState::Parameter : public AudioProcessorParamete
: text.getFloatValue());
}
String getText (float v, int length) const override
String getText (float normalisedValue, int length) const override
{
return valueToTextFunction != nullptr ? valueToTextFunction (range.convertFrom0to1 (v))
: AudioProcessorParameter::getText (v, length);
auto value = range.convertFrom0to1 (normalisedValue);
return valueToTextFunction != nullptr ? valueToTextFunction (value)
: AudioProcessorParameter::getText (value, length);
}
int getNumSteps() const override