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:
parent
1bcc427484
commit
0a3da44f07
6 changed files with 12 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ protected:
|
|||
|
||||
private:
|
||||
//==============================================================================
|
||||
float value, defaultValue;
|
||||
float value;
|
||||
const float defaultValue;
|
||||
|
||||
float getValue() const override;
|
||||
void setValue (float newValue) override;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,8 @@ protected:
|
|||
|
||||
private:
|
||||
//==============================================================================
|
||||
float value, defaultValue;
|
||||
float value;
|
||||
const float defaultValue;
|
||||
|
||||
float getValue() const override;
|
||||
void setValue (float newValue) override;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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!
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue