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

AU: Fixed a bug setting default values for discrete parameters

This commit is contained in:
Tom Poole 2018-02-02 14:11:44 +00:00
parent 1bcc427484
commit 0a3da44f07
6 changed files with 12 additions and 8 deletions

View file

@ -886,9 +886,9 @@ public:
outParameterInfo.minValue = 0.0f;
outParameterInfo.maxValue = getMaximumParameterValue (index);
outParameterInfo.defaultValue = juceFilter->getParameterDefaultValue (index);
outParameterInfo.defaultValue = juceFilter->getParameterDefaultValue (index) * getMaximumParameterValue (index);
jassert (outParameterInfo.defaultValue >= outParameterInfo.minValue
&& outParameterInfo.defaultValue <= outParameterInfo.maxValue);
&& outParameterInfo.defaultValue <= outParameterInfo.maxValue);
return noErr;
}

View file

@ -60,7 +60,8 @@ protected:
private:
//==============================================================================
float value, defaultValue;
float value;
const float defaultValue;
float getValue() const override;
void setValue (float newValue) override;

View file

@ -71,8 +71,9 @@ protected:
private:
//==============================================================================
float value, defaultValue;
float value;
const int maxIndex;
const float defaultValue;
float getValue() const override;
void setValue (float newValue) override;

View file

@ -77,7 +77,8 @@ protected:
private:
//==============================================================================
float value, defaultValue;
float value;
const float defaultValue;
float getValue() const override;
void setValue (float newValue) override;

View file

@ -70,7 +70,8 @@ protected:
private:
//==============================================================================
const int minValue, maxValue, rangeOfValues;
float value, defaultValue;
float value;
const float defaultValue;
float getValue() const override;
void setValue (float newValue) override;

View file

@ -148,8 +148,8 @@ AudioParameterChoice::AudioParameterChoice (const String& idToUse, const String&
const StringArray& c, int def, const String& labelToUse)
: AudioProcessorParameterWithID (idToUse, nameToUse, labelToUse), choices (c),
value ((float) def),
defaultValue (convertTo0to1 (def)),
maxIndex (choices.size() - 1)
maxIndex (choices.size() - 1),
defaultValue (convertTo0to1 (def))
{
jassert (choices.size() > 0); // you must supply an actual set of items to choose from!
}