Browse Source

APVTS: Improved the default string displayed for parameter values

tags/2021-05-28
Tom Poole 7 years ago
parent
commit
d3cada1bc5
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp

+ 4
- 3
modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp 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


Loading…
Cancel
Save