Hi all,
I’ve been trying to use the juce::Array object to hold a dynamic amount of GUI objects “FXChainComponent”.
PluginEditor.h
Array<FXChainComponent> m_FXChainComponents;
void addFXChain();
PluginEditor.cpp
[code]void CrossroadsAudioProcessorEditor::addFXChain()
{
//Check to make sure Num of FX Chains is under the custom limit (5)
const int n = m_FXChainComponents.size();
if (n > 5)
return;
//Add new FXChainComponent (append to end of array)
m_FXChainComponents.add(FXChainComponent());
//Return pointer to last element in array & add to editor
addAndMakeVisible(m_FXChainComponents.end());
}[/code]
Everything’s great albeit one error upon compilation: “Calling a private constructor of class ‘FXChainComponent’”
Taking a look at FXChainComponent.h I only see the default (public) constructor.
[code]class FXChainComponent : public Component,
public SliderListener
{
public:
//==============================================================================
FXChainComponent ();
~FXChainComponent();
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
//[/UserMethods]
void paint (Graphics& g);
void resized();
void sliderValueChanged (Slider* sliderThatWasMoved);
private:
//[UserVariables] – You can add your own custom variables in this section.
//[/UserVariables]
//==============================================================================
ScopedPointer<Slider> m_Slider1;
ScopedPointer<Slider> m_Slider2;
ScopedPointer<Slider> m_Slider3;
ScopedPointer<Label> m_LabelParam1;
ScopedPointer<Label> m_LabelParam2;
ScopedPointer<Label> m_LabelParam3;
ScopedPointer<Label> m_LabelHead;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FXChainComponent)
};[/code]
Is there something I missed on the juce::Array? I’ve looked over the documentation several times :oops: Any help would be much appreciated :mrgreen:

