Is this possible? I seem to only be able to get the initial text, and not the current selected text when using this:
gkTest cabbageGet "ArpMode", "text"
My plan is to use the string value as if-conditions to avoid reading the index of an array where the index has been jumbled after adding new elements in between. Perhaps this is problematic to achieve?
If you use a combobox with channelType("string") you can use cabbageGetValue, which will return the current string. Not possible with an options button, but what I would do in that case is simply define an array of strings corresponding to the button values.
The only thing a host gets is a value between 0 and 1. I was reluctant to add ‘string’ comboboxes for this reason, but they can still be quite useful. What are you trying to achieve exactly?
Trying to make plugins as future-proof as possible. Say you have a combobox sorted alphabetically. When using the integer value as an if-condition, you would need to insert the new element at the end of the combobox to not scramble the order for existing users. Using strings however, should solve this I imagine.
Well, you can’t change the range of any VST parameter are the plugin has been instantiated. So adding extra items to a combobox will only work if that parameter is marked as non-automatable. Does this botch your plans?
I’m not talking about changing the range during runtime, but hard-coded in the Cabbage-section of the .csd, e.g. as part of an update. Surely this would update the range for the channel when opening the project in a host?
The VST SDK does provide a way of doing this as far as I can tell, but I’ve never implemented it. I can tke a crack at it over the coming days. The goal here is to have text appear in the native UI instead of numbers?
Yes, and to use the string channel-value in if-conditions. This means elements in comboboxes would not be tied to index integers, and be more future-proof in terms of adding new elements.
Looks like a good start, but the problem is the host still only broadcasts numbers, not strings. So if you use a combobox like this for automation, Cabbage will only receive numbers. So you’ll still need to work of indices? Should I continue?
I’ll keep at it. I know what you’re looking for, and it would be useful. I’m afraid it might break some things, but we’ll test it out first to make sure. And if it does, we’ll need to make a call on it.
See String combobox - potential breaking change This should give you exactly what you were looking for. Thanks for the push, it’s a big improvement over the older way of doing things.