For anyone (just like me) that’s tired of adding children line by line I made a simple wrapper for it:
inline void addAndShow(juce::Component* comp, std::initializer_list<std::reference_wrapper<juce::Component>> list) {
for (auto& child : list)
comp->addAndMakeVisible(child);
}
So this:
addAndMakeVisible(lfoGraph);
addAndMakeVisible(freq);
addAndMakeVisible(phase);
addAndMakeVisible(depth);
addAndMakeVisible(shape);
addAndMakeVisible(smooth);
addAndMakeVisible(sync);
becomes this:
addAndShow(this, {lfoGraph, freq, phase, depth, shape, smooth, sync});