Styling the Standalone plugin window?

There are two approaches here that you could do:

  1. you use the standalone app that JUCE already provides for you. Then you don’t need any macros etc. This is the approach that JUCE’s audio plugin demo uses. If you want different behaviour in your standalone app (compared to your plug-in), you can use:

    PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_Standalone

    For example, you could use this in a parentHierarchyChanged callback in your plug-ins editor to change the window styling of the top-level window.

  1. You write your own standalone app class just the way you would when writing a standalone JUCE app. If you look at any JUCE GUI example project (which isn’t a plugin), there is a START_JUCE_APPLICATION (JUCEHelloWorldApplication) at the very end. So for this option, you subclass JUCEApplication, just as you would when writing a standalone app, and it’s up to you to initialise the device manager and instantiate your AudioProcessor etc. This is obviously much more work, but gives you a lot more flexibility.

To try out option 2) just copy the source files of the HelloWorld project into the JUCE audio plugin demo. Then in the Projucer add the source files (Main.cpp, MainComponent.cpp, MainComponent.h) to the audio demo plugin project and ensure that JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1 in Preprocesser definitions. Then just build and run your app. The standalone target will now just show the HelloWorld window. Obviously, for an audio plug-in you would change the HelloWorld code to instantiate your plug-in and editor.

6 Likes