I am trying to use shape buttons however because the class does not have a default constructor i need to construct it in the main component constructor. Normally i can manage this in my plugin processor and construct multiple different classes with no issue. However, i am unsure how to do this in a main component. (This is my first time building an app instead of a plugin)
This is what i am currently doing.
MainComponent::MainComponent() ,samplePad1("samplePad1", juce::Colours::red, juce::Colours::orange, juce::Colours::orangered)
{
// Make sure you set the size of the component after
// you add any child components.
setSize (800, 600);
// Some platforms require permissions to open input channels so request that here
if (juce::RuntimePermissions::isRequired (juce::RuntimePermissions::recordAudio)
&& ! juce::RuntimePermissions::isGranted (juce::RuntimePermissions::recordAudio))
{
juce::RuntimePermissions::request (juce::RuntimePermissions::recordAudio,
[&] (bool granted) { setAudioChannels (granted ? 2 : 0, 2); });
}
else
{
// Specify the number of input and output channels that we want to open
setAudioChannels (2, 2);
}
}
The constructor for the shape button is sample pad 1. Thanks for any assistance.