StandaloneFilterApp create the StandaloneFilterWindow with a transparent colour

The StandaloneFilterApp is creating an instance of a StandaloneFilterWindow with a transparentBlack colour (resulting in the titlebar being transparent)

mainWindow = new StandaloneFilterWindow (getApplicationName(), Colour(), nullptr, true);

Would be cool if this was injectable somehow.

This has been added to JUCE 4.2.1 and works fine:

    virtual StandaloneFilterWindow* createWindow()
    {
        return new StandaloneFilterWindow (getApplicationName(),
                       Colours::white, nullptr, true);
    }

Thanks Jules! :slight_smile:

However, I’m wondering how to correctly use this. The file juce_StandaloneFilterApp.cpp contains the macro

START_JUCE_APPLICATION (StandaloneFilterApp);

so when I subclass StandaloneFilterWindow, a stand-alone window with the base class will automatically be opened.

In order to open a stand-alone window with the subclass (to make use of the overridden createWindow method), I have to comment out the macro START_JUCE_APPLICATION. Am I missing something here?

Another thing - I want the stand-alone to remember its current settings for the next session:

StandaloneFilterWindow *KmeterStandalone::createWindow()
{
    PropertiesFile::Options settings;

    settings.applicationName = "kmeter_stereo";
    settings.filenameSuffix  = "ini";
    settings.folderName      = ".config";

    PropertiesFile *propertiesFile = new PropertiesFile(settings);

    return StandaloneFilterWindow(getApplicationName(), Colours::black,
               propertiesFile, true);
}


void KmeterStandalone::shutdown()
{
    mainWindow->pluginHolder->savePluginState();
    mainWindow = nullptr;
}

However, I can’t access savePluginState because mainWindow is set to private. Could it be changed to protected instead?

protected:
    ScopedPointer<StandaloneFilterWindow> mainWindow;

That would be awesome! :slight_smile: