Plugin GUI Design using Projucer

gui
projucer

#1

Plugin GUI Design using Projucer

I’m trying to design my plugin GUI using the live build function of the Projucer. When I do so using a Gui App template it works create. But using the Plugin template, it doesn’t let me live build the Editor Window.

Since it gives me the error: No default constructor. Is there a way to simulate one?


#2

The Component that you are previewing needs to have a constructor that can be called without any arguments, but the AudioProcessorEditor base class needs a reference to an AudioProcessorEditor.

One way of getting around this is to design your GUI in a separate Component with a default constructor that you then add to your editor as a child component. This way you can preview your GUI separate from the audio processor.

It’s also possible to ‘fake’ a reference to your processor when using the live-build engine by doing something like this in your editor’s header:

class YourPluginEditor  : public AudioProcessorEditor
{
public:
   #if JUCE_PROJUCER_LIVE_BUILD
    YourPluginEditor();
   #endif
    YourPluginEditor (YourAudioProcessor&);

...

private:
   #if JUCE_PROJUCER_LIVE_BUILD
    JuceDemoPluginAudioProcessor fakeProcessor;
   #endif

and then in your .cpp:

#if JUCE_PROJUCER_LIVE_BUILD
 YourPluginEditor::YourPluginEditor()
     : YourPluginEditor (fakeProcessor)
 {}
#endif

// normal constructor
YourPluginEditor::YourPluginEditor (JuceDemoPluginAudioProcessor& owner)
{
...

#3

Thanks for the quick answer. One of my problems when using seperate components, is that I need a reference to th processor for the valuetreestate in my subcomponents. This make the constructor have arguments again. I’ll try your second tip now.


#4
#if JUCE_PROJUCER_LIVE_BUILD
LiveBuildPluginGuiAudioProcessorEditor::LiveBuildPluginGuiAudioProcessorEditor(): 
AudioProcessorEditor (fakeProcessor)
 {}
#endif

this line is giving me the error:

error: ~/liveBuildPluginGui/Source/PluginEditor.cpp: constructor for 'LiveBuildPluginGuiAudioProcessorEditor' must explicitly initialize the reference member 'processor'