I just began experimenting with creating UI Components using the JUCE wysiwyg editor, and it’s working well. However, with my other hand-written components I am using the AudioProcessorValueTreeState and SliderAttachments to connect the UI to the state, not implementing SliderListener by hand.
I am having a very hard time, making a connection between Sliders stored as ScopedPointers in sub components and the ValueTreeState. It seems the constructor for SliderAttachment can not accept a pointer to a dynamically allocated Slider instance. In my other components where I’ve used Sliders and SliderAttachments successfully I’ve had to store the Sliders as objects, not pointers.
Slider midiSlider = new Slider(); // SliderAttachment works with this type, but that's not what is generated by the component editor. Slider *midiSlider; // SliderAttachment will not work with a pointer ScopedPointer<Slider> midiSlider; // Calling midiSlider.get() returns a pointer, which will not work with SliderAttachment
So the question is; the visual component editor stores the Sliders as ScopedPointers, so how can I use those underlying Slider objects (without changing generated code) with the AudioProcessorValueTreeState through a SliderAttachment (which only accepts non-pointer Slider objects), when I’m unable to obtain a basic Slider object from the ScopedPointer?
Thank you so much!