DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 9c14be03a672c51c52bbd93abf95f3d67cdb0619
parent 4f65386ced127f6ead21eb580c20cd01d7183249
Author: falkTX <falktx@falktx.com>
Date:   Fri, 14 Apr 2023 11:32:48 +0200

LADSPA doesn't allow bounded hints on toggles

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mdistrho/src/DistrhoPluginLADSPA+DSSI.cpp | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/distrho/src/DistrhoPluginLADSPA+DSSI.cpp b/distrho/src/DistrhoPluginLADSPA+DSSI.cpp @@ -618,13 +618,19 @@ static const struct DescriptorInitializer else portDescriptors[port] |= LADSPA_PORT_INPUT; + const uint32_t hints = plugin.getParameterHints(i); + { const ParameterRanges& ranges(plugin.getParameterRanges(i)); const float defValue = ranges.def; - portRangeHints[port].HintDescriptor = LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE; - portRangeHints[port].LowerBound = ranges.min; - portRangeHints[port].UpperBound = ranges.max; + // LADSPA doesn't allow bounded hints on toggles + portRangeHints[port].HintDescriptor = hints & kParameterIsBoolean + ? 0 + : LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE; + + portRangeHints[port].LowerBound = ranges.min; + portRangeHints[port].UpperBound = ranges.max; /**/ if (d_isZero(defValue)) portRangeHints[port].HintDescriptor |= LADSPA_HINT_DEFAULT_0; @@ -654,8 +660,6 @@ static const struct DescriptorInitializer } { - const uint32_t hints = plugin.getParameterHints(i); - if (hints & kParameterIsBoolean) { portRangeHints[port].HintDescriptor |= LADSPA_HINT_TOGGLED;