So, I have this module with a switch that changes default min/max values for a knob.
Back in v0.6 it was all good as just rescaling the parameter value was needed to get the knob to work in both settings fine, now that the tooltips show the knob values the workaround works, but still shows the original config. Any way around this?
It might be possible, but doing so is currently an unsupported hack and might break in any update.
Thanks Andrew, don’t want to hack things again, so I’ll just leave it like that or remove the parameter change option.
I’ve worked around this by passing a custom
ParamQuantity struct to
Module::configParam and overriding
getDisplayValueString for each
ParamWidget with variable min/max. To prevent showing menu items in the tooltip that aren’t applicable, I override
ModuleWidget::onButton and consume events if my
ParamWidget bounding box contains
Don’t know if this constitutes an “unsupported hack”, but it only uses public interfaces as far as I can tell.
Writing a custom ParamQuantity is technique that Andrew described when I asked how to do it. I do hope it’s not an unsupported hack, because the standard configParam stuff can do only linear and exponential tapers, and some of my knobs have other tapers.
It can do logarithmic also see engine/ParamQuanity.hpp
/** Set to 0 for linear, positive for exponential, negative for logarithmic. */