Hello there,
I’m trying to have a parameter as a drop-down menu with text items, this parameter is used in the processor directly.
I created a custom view as described here:
https://steinbergmedia.github.io/vst3_doc/vstgui/html/create_your_own_view.html
namespace VSTGUI {
class DropDownViewFactory : public ViewCreatorAdapter
{
public:
DropDownViewFactory () { UIViewFactory::registerViewCreator (*this); }
IdStringPtr getViewName () const override { return "Drop-Down View"; }
IdStringPtr getBaseViewName () const override { return UIViewCreator::kCControl; }
CView* create (const UIAttributes& attributes, const IUIDescription* description) const override
{
COptionMenu *dropDownMenu = new COptionMenu();
presetMenu->addEntry("entry 1");
presetMenu->addEntry("entry 2");
return dropDownMenu;
}
};
// create a static instance so that it registers itself with the view factory
DropDownViewFactory __gDropDownViewFactory;
} // namespace VSTGUI
The new view gets added to the UI description editor and I can see the entries just fine.
However, when I add the tag of my parameter in the live editor, the option menu shows the float values of the tag and not the original strings from the view factory. I’m not sure if this is the correct way to use the option menu.
My parameter is defined in the controller as follows:
Vst::Parameter* dropDown = new Vst::Parameter (
STR16("Dropdown"),
static_cast<int32_t>(ParameterId::Dropdown),
nullptr,
0.6,
5,
Vst::ParameterInfo::kIsList|Vst::ParameterInfo::kCanAutomate
);
How can I bind the option menu to a parameter and keep the text labels?
Thanks!