In this module some additions to JUCE (www.juce.com) are provided to attach a Slider, ComboBox or RadioButtonGroup to a leaf in a ValueTree.This is especially useful to keep GUI components in sync with a ValueTree, e.g. th tree behind AudioProcessorValueTreeState. So you can store values that are not exposed to the host as parameters.
- See Also
- ValueTreeSliderAttachment, ValueTreeComboBoxAttachment, ValueTreeRadioButtonGroupAttachment, ValueTreeLabelAttachment
They are used exatly the same as AudioProcessorValueTree::SliderAttachment. In the ValueTreeSliderAttachment you can also supply a range for the slider.
ValueTree tree = ValueTree ("TestTree");
ValueTree select = tree.getOrCreateChildWithName ("ComboBox", nullptr);
ValueTree option1 = ValueTree ("Option");
option1.setProperty ("name", "Anything", nullptr);
select.addChild (option1, 0, nullptr);
ValueTree option2 = ValueTree ("Option");
option2.setProperty ("name", "Something", nullptr);
option2.setProperty ("selected", 1, nullptr);
select.addChild (option2, 1, nullptr);
ValueTree option3 = ValueTree ("Option");
option3.setProperty ("name", "Nothing", nullptr);
select.addChild (option3, 2, nullptr);
ComboBox* combo = new ComboBox();
Have fun... Daniel