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

LV2 Host: Ensure default parameter value lies between min and max when not explicitly provided

This commit is contained in:
reuk 2022-05-04 11:50:51 +01:00
parent e85a6b595e
commit e68a62af7f
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -4101,11 +4101,14 @@ static SupportedParameter getInfoForPatchParameter (World& worldIn,
jassertfalse; // A ScalePoint must have both a rdfs:label and a rdf:value
}
const auto minimum = getValue (LV2_CORE__minimum, 0.0f);
const auto maximum = getValue (LV2_CORE__maximum, 1.0f);
return { { std::move (parsedScalePoints),
"des:" + String::fromUTF8 (property.getTyped()),
getValue (LV2_CORE__default, 0.0f),
getValue (LV2_CORE__minimum, 0.0f),
getValue (LV2_CORE__maximum, 1.0f),
getValue (LV2_CORE__default, (minimum + maximum) * 0.5f),
minimum,
maximum,
typeUrid == urids.mLV2_ATOM__Bool || hasPortProperty (LV2_CORE__toggled),
typeUrid == urids.mLV2_ATOM__Int || typeUrid == urids.mLV2_ATOM__Long,
hasPortProperty (LV2_CORE__enumeration) },