Browse Source

LADSPA doesn't allow bounded hints on toggles

Signed-off-by: falkTX <falktx@falktx.com>
pull/421/head
falkTX 2 years ago
parent
commit
9c14be03a6
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      distrho/src/DistrhoPluginLADSPA+DSSI.cpp

+ 9
- 5
distrho/src/DistrhoPluginLADSPA+DSSI.cpp View File

@@ -618,13 +618,19 @@ static const struct DescriptorInitializer
else else
portDescriptors[port] |= LADSPA_PORT_INPUT; portDescriptors[port] |= LADSPA_PORT_INPUT;


const uint32_t hints = plugin.getParameterHints(i);

{ {
const ParameterRanges& ranges(plugin.getParameterRanges(i)); const ParameterRanges& ranges(plugin.getParameterRanges(i));
const float defValue = ranges.def; 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)) /**/ if (d_isZero(defValue))
portRangeHints[port].HintDescriptor |= LADSPA_HINT_DEFAULT_0; 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) if (hints & kParameterIsBoolean)
{ {
portRangeHints[port].HintDescriptor |= LADSPA_HINT_TOGGLED; portRangeHints[port].HintDescriptor |= LADSPA_HINT_TOGGLED;


Loading…
Cancel
Save