I’m having a frustratingly strange problem. I’ve verified it is the same with either PopupMenu or ComboBox (unsurprisingly).
If I create either, then attach them to my ValueTreeState, they work fine in all the desktop versions, and in iOS Standalone, but in the iOS AUv3, they’re sending the wrong values. In this example, there are four items in the list.
ctrl_combo_recmodes.reset(new ComboBox()); addAndMakeVisible(ctrl_combo_recmodes.get()); ctrl_combo_recmodes>addItemList(valueTreeState.getParameter(String(ParamID::kInputMonitor))->getAllValueStrings(), 1); ctrl_combo_recmodes->setComponentID(String(ParamID::kInputMonitor)); attachCombo(valueTreeState, ParamID::kInputMonitor, ctrl_combo_recmodes.get());
The attachCombo is just a little helper function to call AudioProcessorValueTreeState::ComboBoxAttachment.
As I said, in the desktop and standalone versions, everything is correct. In the iOS AUv3 version, if I select items 1 or 2, the ValueTreeState gets set to item 1 (float value 0) and if I select items 3 or 4, ValueTreeState gets set to item 2 (float value 0.25f).
I’ve tried this with a PopupMenu and setting the parameter value directly as well, with identical results. I can set the value correctly using the generic controls in the host (in BeatMaker 3 and GarageBand), and when I go back to the UI, the ComboBox reflects the correct value. But as soon as I make a selection from the UI, the error returns.
Any thoughts? I’ve used a metric cockton of PopupMenus and ComboBoxen in our other 11 (!) AUv3 products, but this is the first time we’re using ValueTreeState for our parameter management.