I don’t understand how to connect my Combobox to the valuetreestate,
I already know how to connect a slider using SliderAttachement, I have Seen that there is a ComboboxAtachemment but I don’t really know how to do it and what write in my parameters.
Thank you !
It works best with AudioParameterChoice:
auto parameter = std::make_unique<AudioParameterChoice> ("foo", "Foo", StringArray ("foo", "bar", "baz"), 0);
new AudioProcessorValueTreeState::ComboBoxAttachment (processor.tree, "foo", combo);
hello and thank you for you reply !
StringArray(“Low pass”,“High Pass”)
I initialise in my parameters like that but I have an error that the AudioParameterChoice desn’t have constructor with three parameters,
I have that in my processor editor : AudioProcessorValueTreeState::ComboBoxAttachment *filterTypeAttachement;
and that into the constructor : filterTypeAttachement = new AudioProcessorValueTreeState::ComboBoxAttachment(valueTreeState, “filterType”, filterType);
But I don’t know if it’s wrong…
and I have another question about when I have connected everything what kind of variable I have to associate with the getRawValue(filterType) ?
thank you !
Oh sorry, the default is also mandatory, I should have checked the docs.
The getRawParameterValue is the unnormalised, so if you do a
roundToInt (value) it is the index in your StringArray…
I’ll edit the line above
Thank you I will try tomorrow but I don’t really understant the type of pointer I should déclare to do the getrawvalue ! Could you help me ?