13
0

Fix LADSPA log-scale default (correct e1ef2c7e0d)

This commit is contained in:
Robin Gareus 2023-03-06 20:34:35 +01:00
parent 4ca947f078
commit 7a18ef6ceb
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -201,7 +201,7 @@ LadspaPlugin::_default_value (uint32_t port) const
else if (LADSPA_IS_HINT_DEFAULT_LOW(prh[port].HintDescriptor)) { else if (LADSPA_IS_HINT_DEFAULT_LOW(prh[port].HintDescriptor)) {
if (logarithmic && prh[port].LowerBound * prh[port].UpperBound > 0) { if (logarithmic && prh[port].LowerBound * prh[port].UpperBound > 0) {
ret = exp (log(prh[port].LowerBound)) * 0.75f + log (prh[port].UpperBound) * 0.25f; ret = exp (log(prh[port].LowerBound) * 0.75f + log (prh[port].UpperBound) * 0.25f);
} else { } else {
ret = prh[port].LowerBound * 0.75f + prh[port].UpperBound * 0.25f; ret = prh[port].LowerBound * 0.75f + prh[port].UpperBound * 0.25f;
} }
@ -210,7 +210,7 @@ LadspaPlugin::_default_value (uint32_t port) const
} }
else if (LADSPA_IS_HINT_DEFAULT_MIDDLE(prh[port].HintDescriptor)) { else if (LADSPA_IS_HINT_DEFAULT_MIDDLE(prh[port].HintDescriptor)) {
if (logarithmic && prh[port].LowerBound * prh[port].UpperBound > 0) { if (logarithmic && prh[port].LowerBound * prh[port].UpperBound > 0) {
ret = exp (log(prh[port].LowerBound)) * 0.5f + log (prh[port].UpperBound) * 0.5f; ret = exp (log(prh[port].LowerBound) * 0.5f + log (prh[port].UpperBound) * 0.5f);
} else { } else {
ret = prh[port].LowerBound * 0.5f + prh[port].UpperBound * 0.5f; ret = prh[port].LowerBound * 0.5f + prh[port].UpperBound * 0.5f;
} }
@ -219,7 +219,7 @@ LadspaPlugin::_default_value (uint32_t port) const
} }
else if (LADSPA_IS_HINT_DEFAULT_HIGH(prh[port].HintDescriptor)) { else if (LADSPA_IS_HINT_DEFAULT_HIGH(prh[port].HintDescriptor)) {
if (logarithmic && prh[port].LowerBound * prh[port].UpperBound > 0) { if (logarithmic && prh[port].LowerBound * prh[port].UpperBound > 0) {
ret = exp (log(prh[port].LowerBound)) * 0.25f + log (prh[port].UpperBound) * 0.75f; ret = exp (log(prh[port].LowerBound) * 0.25f + log (prh[port].UpperBound) * 0.75f);
} else { } else {
ret = prh[port].LowerBound * 0.25f + prh[port].UpperBound * 0.75f; ret = prh[port].LowerBound * 0.25f + prh[port].UpperBound * 0.75f;
} }