I’ve got an APVTS structure with a number of SliderAttachment
entries for my knobs.
I want to add a TextButton. I’ve set this clicking toggle state to true
.
How do I add this TextButton to my APVTS, and can I use getRawParameterValue
to find its toggle state?
Here’s what I have so far:
PluginEditor.h
juce::TextButton mybutton_button;
juce::AudioProcessorValueTreeState::ButtonAttachment mybutton_buttonAttachment;
In PluginEditor.cpp
mybutton_button.setButtonText("my button text");
mybutton_button.setClickingTogglesState(true);
addAndMakeVisible(mybutton_button);
PluginEditor Constructor:
mybutton_buttonAttachment(audioProcessor.apvts, "mybutton", mybutton_button) {
In PluginProcessor.cpp
mybutton_value = apvts.getRawParameterValue("mybutton")->load();
for my sliders, I am adding them to the layout with createParameterLayout()
. I think I can’t add the mybutton attachment here… … or can I