Browse Source

Changed a variable name to more clearly denote a normalised parameter value

tags/2021-05-28
Tom Poole 7 years ago
parent
commit
072ff1ec02
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h
  2. +1
    -1
      modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp

+ 2
- 2
modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h View File

@@ -147,12 +147,12 @@ public:
*/ */
virtual bool isBoolean() const; virtual bool isBoolean() const;
/** Returns a textual version of the supplied parameter value.
/** Returns a textual version of the supplied normalised parameter value.
The default implementation just returns the floating point value The default implementation just returns the floating point value
as a string, but this could do anything you need for a custom type as a string, but this could do anything you need for a custom type
of value. of value.
*/ */
virtual String getText (float value, int /*maximumStringLength*/) const;
virtual String getText (float normalisedValue, int /*maximumStringLength*/) const;
/** Should parse a string and return the appropriate value for it. */ /** Should parse a string and return the appropriate value for it. */
virtual float getValueForText (const String& text) const = 0; virtual float getValueForText (const String& text) const = 0;


+ 1
- 1
modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp View File

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


Loading…
Cancel
Save