I’m just getting started with JUCE and I don’t have much prior experience with C++ at all, so I’d really appreciate any help you guys can offer.
I’m currently creating a pan dial and want to set the dials textbox suffix depending on the current value of the slider. For example, if the pan dial is set to +23 then I would want the textbox suffix of the slider to be “R”, to represent the right channel.
Is there a way to just output the sliders current value as an integer?
This is my code so far, but as you can see I’m stuck because I can’t work out how to output an integer from the slider.
//Check what pan integer currently is
intPan = //Current value of the slider as an integer
//Set it's suffix to L, R or C
if (intPan > 0) {
panSlider.setTextValueSuffix("R");
} else if(intPan < 0) {
panSlider.setTextValueSuffix("L");
} else {
panSlider.setTextValueSuffix("C");
}
else {} //else do nothing
};
You can use the same lambdas for the parameter, and if you use the AudioProcessorValueTreeState::SliderAttachment, the lambdas from the parameter will be used in the slider automatically.