-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
To reproduce:
- Create an Option Menu through the visual editor and bind it to a parameter with a step count of more than 2
Despite the option box showing all options (in respect to the number of steps) selecting any of them always results in a fallback to the zero value of the parameter.
Through logging this issue I found that after the user input, setParamNormalized() is called on the controller with valid values however the menu's attached listener then immediately calls setParamNormalized() multiple times with decrementing step values (normalized) until the parameter value is zero.
The only way I was able to fix this in my project was by creating my own wrapper of the COptionMenu and injecting it my own IOptionMenuListener implementation with only the following method overridden:
bool PresetMenuListener::onOptionMenuSetPopupResult(COptionMenu *menu, COptionMenu *selectedMenu, int32_t selectedIndex)
{
if (!_controller || !menu)
return false;
ParamID tag = menu->getTag();
auto* param = _controller->getParameterObject(tag);
if (!param)
return false;
const auto normalized = static_cast<float>(selectedIndex) / static_cast<float>(param->getInfo().stepCount);
_controller->setParamNormalized(tag, normalized);
menu->setValue(static_cast<float>(selectedIndex));
return true;
}version: VST SDK 3.7.14
Metadata
Metadata
Assignees
Labels
No labels