Latest examples

When I create a plugin in JUCE Projucer, there are 4 automatically generated source files
PluginProcessor.h
PluginProcessor.c
PluginEditor.h
PluginEditor.cpp

But when I browse the example projects in JUCE Projucer, they are not setup like that.
Instead they use Main.cpp

Where can I find a full fledged example using the current file structure?

The examples are all distributed in individual header files. The code they contain is exactly the same as a project that uses multiple files. The only difference is the way that the code is arranged.

To split up the examples into separate editor/processor files, in general you’d do something like:

  • Move the class derived from AudioProcessor into PluginProcessor.h
  • Move the class derived from AudioProcessorEditor into PluginEditor.h
  • If there are supporting classes, make additional headers for those classes and include them in PluginProcessor.h and PluginEditor.h
  • For each non-template function definition, remove it from the header, leaving the function declaration. Add the definition to the header’s corresponding .cpp.
1 Like