1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

StandaloneFilterWindow: Allow plugin to run when no display is present

This is useful on headless Linux systems. When no display is attached,
window creation is bypassed but a StandalonePluginHolder is still
created, allowing audio to be processed.
This commit is contained in:
reuk 2024-10-17 14:32:05 +01:00
parent 420922253f
commit 1f56562652
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
2 changed files with 83 additions and 43 deletions

View file

@ -723,26 +723,11 @@ public:
//==============================================================================
typedef StandalonePluginHolder::PluginInOuts PluginInOuts;
//==============================================================================
/** Creates a window with a given title and colour.
The settings object can be a PropertySet that the class should use to
store its settings (it can also be null). If takeOwnershipOfSettings is
true, then the settings object will be owned and deleted by this object.
*/
StandaloneFilterWindow (const String& title,
Colour backgroundColour,
PropertySet* settingsToUse,
bool takeOwnershipOfSettings,
const String& preferredDefaultDeviceName = String(),
const AudioDeviceManager::AudioDeviceSetup* preferredSetupOptions = nullptr,
const Array<PluginInOuts>& constrainToConfiguration = {},
#if JUCE_ANDROID || JUCE_IOS
bool autoOpenMidiDevices = true
#else
bool autoOpenMidiDevices = false
#endif
)
std::unique_ptr<StandalonePluginHolder> pluginHolderIn)
: DocumentWindow (title, backgroundColour, DocumentWindow::minimiseButton | DocumentWindow::closeButton),
pluginHolder (std::move (pluginHolderIn)),
optionsButton ("Options")
{
setConstrainer (&decoratorConstrainer);
@ -757,10 +742,6 @@ public:
optionsButton.setTriggeredOnMouseDown (true);
#endif
pluginHolder.reset (new StandalonePluginHolder (settingsToUse, takeOwnershipOfSettings,
preferredDefaultDeviceName, preferredSetupOptions,
constrainToConfiguration, autoOpenMidiDevices));
#if JUCE_IOS || JUCE_ANDROID
setFullScreen (true);
updateContent();
@ -809,6 +790,36 @@ public:
#endif
}
//==============================================================================
/** Creates a window with a given title and colour.
The settings object can be a PropertySet that the class should use to
store its settings (it can also be null). If takeOwnershipOfSettings is
true, then the settings object will be owned and deleted by this object.
*/
StandaloneFilterWindow (const String& title,
Colour backgroundColour,
PropertySet* settingsToUse,
bool takeOwnershipOfSettings,
const String& preferredDefaultDeviceName = String(),
const AudioDeviceManager::AudioDeviceSetup* preferredSetupOptions = nullptr,
const Array<PluginInOuts>& constrainToConfiguration = {},
#if JUCE_ANDROID || JUCE_IOS
bool autoOpenMidiDevices = true
#else
bool autoOpenMidiDevices = false
#endif
)
: StandaloneFilterWindow (title,
backgroundColour,
std::make_unique<StandalonePluginHolder> (settingsToUse,
takeOwnershipOfSettings,
preferredDefaultDeviceName,
preferredSetupOptions,
constrainToConfiguration,
autoOpenMidiDevices))
{
}
~StandaloneFilterWindow() override
{
#if (! JUCE_IOS) && (! JUCE_ANDROID)