Loading...
Searching...
No Matches
juce::StandalonePluginHolder Class Reference

## Detailed Description

An object that creates and plays a standalone instance of an AudioProcessor.

The object will create your processor using the same createPluginFilter() function that the other plugin wrappers use, and will run it through the computer's audio/MIDI devices using AudioDeviceManager and AudioProcessorPlayer.

The documentation for this class was generated from the following file:

- juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h

Inheritance diagram for juce::StandalonePluginHolder:

## Classes

struct | PluginInOuts
| Structure used for the number of inputs and outputs. More...

## Public Member Functions

| StandalonePluginHolder (PropertySet *settingsToUse, bool takeOwnershipOfSettings=true, const String &preferredDefaultDeviceName=String(), const AudioDeviceManager::AudioDeviceSetup *preferredSetupOptions=nullptr, const Array< PluginInOuts > &channels=Array< PluginInOuts >(), bool shouldAutoOpenMidiDevices=true)
| Creates an instance of the default plugin.
void | init (bool enableAudioInput, const String &preferredDefaultDeviceName)
| ~StandalonePluginHolder () override
virtual void | createPlugin ()
virtual void | deletePlugin ()
int | getNumInputChannels () const
int | getNumOutputChannels () const
Value & | getMuteInputValue ()
bool | getProcessorHasPotentialFeedbackLoop () const
void | valueChanged (Value &value) override
| Called when a Value object is changed.
File | getLastFile () const
void | setLastFile (const FileChooser &fc)
void | askUserToSaveState (const String &fileSuffix=String())
| Pops up a dialog letting the user save the processor's state to a file.
void | askUserToLoadState (const String &fileSuffix=String())
| Pops up a dialog letting the user re-load the processor's state from a file.
void | startPlaying ()
void | stopPlaying ()
void | showAudioSettingsDialog ()
| Shows an audio properties dialog box modally.
void | saveAudioDeviceState ()
void | reloadAudioDeviceState (bool enableAudioInput, const String &preferredDefaultDeviceName, const AudioDeviceManager::AudioDeviceSetup *preferredSetupOptions)
void | savePluginState ()
void | reloadPluginState ()
void | switchToHostApplication ()
bool | isInterAppAudioConnected ()
Image | getIAAHostIcon (int size)

## Static Public Member Functions

static String | getFilePatterns (const String &fileSuffix)
static StandalonePluginHolder * | getInstance ()

## Public Attributes

OptionalScopedPointer< PropertySet > | settings
std::unique_ptr< AudioProcessor > | processor
AudioDeviceManager | deviceManager
AudioProcessorPlayer | player
Array< PluginInOuts > | channelConfiguration
bool | processorHasPotentialFeedbackLoop = true
std::atomic< bool > | muteInput { true }
Value | shouldMuteInput
AudioBuffer< float > | emptyBuffer
bool | autoOpenMidiDevices
std::unique_ptr< AudioDeviceManager::AudioDeviceSetup > | options
Array< MidiDeviceInfo > | lastMidiDevices
std::unique_ptr< FileChooser > | stateFileChooser
ScopedMessageBox | messageBox

## Constructors and Destructors

## StandalonePluginHolder()

juce::StandalonePluginHolder::StandalonePluginHolder | ( | PropertySet * | settingsToUse,
|  | bool | takeOwnershipOfSettings = true,
|  | const String & | preferredDefaultDeviceName = String(),
|  | const AudioDeviceManager::AudioDeviceSetup * | preferredSetupOptions = nullptr,
|  | const Array< PluginInOuts > & | channels = Array<PluginInOuts>(),
|  | bool | shouldAutoOpenMidiDevices = true )

inline

Creates an instance of the default plugin.

The settings object can be a PropertySet that the class should use to store its settings - the takeOwnershipOfSettings indicates whether this object will delete the settings automatically when no longer needed. The settings can also be nullptr.

A default device name can be passed in.

Preferably a complete setup options object can be used, which takes precedence over the preferredDefaultDeviceName and allows you to select the input & output device names, sample rate, buffer size etc.

In all instances, the settingsToUse will take precedence over the "preferred" options if not null.

References autoOpenMidiDevices, channelConfiguration, init(), juce::RuntimePermissions::isGranted(), isInterAppAudioConnected(), juce::RuntimePermissions::isRequired(), jassert, JUCE_ANDROID, options, processor, juce::RuntimePermissions::recordAudio, juce::RuntimePermissions::request(), settings, and shouldMuteInput.

Referenced by getInstance().

## ~StandalonePluginHolder()

juce::StandalonePluginHolder::~StandalonePluginHolder | ( |  | ) |

inline override

References juce::Timer::stopTimer().

## Member Functions

## init()

void juce::StandalonePluginHolder::init | ( | bool | enableAudioInput,
|  | const String & | preferredDefaultDeviceName )

inline

References autoOpenMidiDevices, options, reloadPluginState(), startPlaying(), and juce::Timer::startTimer().

Referenced by StandalonePluginHolder().

## createPlugin()

virtual void juce::StandalonePluginHolder::createPlugin | ( |  | ) |

inline virtual

## deletePlugin()

virtual void juce::StandalonePluginHolder::deletePlugin | ( |  | ) |

inline virtual

## getNumInputChannels()

int juce::StandalonePluginHolder::getNumInputChannels | ( |  | ) | const

inline

References channelConfiguration, and processor.

Referenced by reloadAudioDeviceState().

## getNumOutputChannels()

int juce::StandalonePluginHolder::getNumOutputChannels | ( |  | ) | const

inline

References channelConfiguration, and processor.

Referenced by reloadAudioDeviceState().

## getFilePatterns()

String juce::StandalonePluginHolder::getFilePatterns | ( | const String & | fileSuffix | ) |

inline static

References juce::String::isEmpty(), and juce::String::startsWithChar().

Referenced by askUserToLoadState(), and askUserToSaveState().

## getMuteInputValue()

Value & juce::StandalonePluginHolder::getMuteInputValue | ( |  | ) |

inline

References shouldMuteInput.

## getProcessorHasPotentialFeedbackLoop()

bool juce::StandalonePluginHolder::getProcessorHasPotentialFeedbackLoop | ( |  | ) | const

inline

References processorHasPotentialFeedbackLoop.

## valueChanged()

void juce::StandalonePluginHolder::valueChanged | ( | Value & | value | ) |

inline override virtual

Called when a Value object is changed.

Note that the Value object passed as a parameter may not be exactly the same object that you registered the listener with - it might be a copy that refers to the same underlying ValueSource. To find out, you can call Value::refersToSameSourceAs().

Implements juce::Value::Listener.

References juce::Value::getValue(), and muteInput.

## getLastFile()

File juce::StandalonePluginHolder::getLastFile | ( |  | ) | const

inline

References juce::File::getSpecialLocation(), settings, and juce::File::userDocumentsDirectory.

Referenced by askUserToLoadState(), and askUserToSaveState().

## setLastFile()

void juce::StandalonePluginHolder::setLastFile | ( | const FileChooser & | fc | ) |

inline

References juce::File::getFullPathName(), juce::FileChooser::getResult(), and settings.

Referenced by askUserToLoadState(), and askUserToSaveState().

## askUserToSaveState()

void juce::StandalonePluginHolder::askUserToSaveState | ( | const String & | fileSuffix = String() | ) |

inline

Pops up a dialog letting the user save the processor's state to a file.

References juce::FileBrowserComponent::canSelectFiles, juce::MemoryBlock::getData(), getFilePatterns(), getLastFile(), juce::FileChooser::getResult(), juce::MemoryBlock::getSize(), juce::MessageBoxOptions::makeOptionsOk(), messageBox, processor, juce::File::replaceWithData(), juce::FileBrowserComponent::saveMode, setLastFile(), juce::AlertWindow::showScopedAsync(), stateFileChooser, TRANS, juce::FileBrowserComponent::warnAboutOverwriting, and juce::AlertWindow::WarningIcon.

## askUserToLoadState()

void juce::StandalonePluginHolder::askUserToLoadState | ( | const String & | fileSuffix = String() | ) |

inline

Pops up a dialog letting the user re-load the processor's state from a file.

References juce::FileBrowserComponent::canSelectFiles, juce::MemoryBlock::getData(), getFilePatterns(), getLastFile(), juce::FileChooser::getResult(), juce::MemoryBlock::getSize(), juce::File::loadFileAsData(), juce::MessageBoxOptions::makeOptionsOk(), messageBox, juce::FileBrowserComponent::openMode, processor, setLastFile(), juce::AlertWindow::showScopedAsync(), stateFileChooser, TRANS, and juce::AlertWindow::WarningIcon.

## startPlaying()

void juce::StandalonePluginHolder::startPlaying | ( |  | ) |

inline

References deviceManager, player, and processor.

Referenced by init().

## stopPlaying()

void juce::StandalonePluginHolder::stopPlaying | ( |  | ) |

inline

References player.

## showAudioSettingsDialog()

void juce::StandalonePluginHolder::showAudioSettingsDialog | ( |  | ) |

inline

Shows an audio properties dialog box modally.

References juce::ResizableWindow::backgroundColourId, channelConfiguration, juce::DialogWindow::LaunchOptions::content, deviceManager, juce::DialogWindow::LaunchOptions::dialogBackgroundColour, juce::DialogWindow::LaunchOptions::dialogTitle, juce::DialogWindow::LaunchOptions::escapeKeyTriggersCloseButton, juce::jmax(), juce::DialogWindow::LaunchOptions::launchAsync(), processor, juce::DialogWindow::LaunchOptions::resizable, TRANS, and juce::DialogWindow::LaunchOptions::useNativeTitleBar.

## saveAudioDeviceState()

void juce::StandalonePluginHolder::saveAudioDeviceState | ( |  | ) |

inline

References deviceManager, settings, and shouldMuteInput.

## reloadAudioDeviceState()

void juce::StandalonePluginHolder::reloadAudioDeviceState | ( | bool | enableAudioInput,
|  | const String & | preferredDefaultDeviceName,
|  | const AudioDeviceManager::AudioDeviceSetup * | preferredSetupOptions )

inline

References deviceManager, getNumInputChannels(), getNumOutputChannels(), processor, settings, and shouldMuteInput.

## savePluginState()

void juce::StandalonePluginHolder::savePluginState | ( |  | ) |

inline

References processor, settings, and juce::MemoryBlock::toBase64Encoding().

## reloadPluginState()

void juce::StandalonePluginHolder::reloadPluginState | ( |  | ) |

inline

References juce::MemoryBlock::fromBase64Encoding(), juce::MemoryBlock::getData(), juce::MemoryBlock::getSize(), processor, and settings.

Referenced by init().

## switchToHostApplication()

void juce::StandalonePluginHolder::switchToHostApplication | ( |  | ) |

inline

References deviceManager.

## isInterAppAudioConnected()

bool juce::StandalonePluginHolder::isInterAppAudioConnected | ( |  | ) |

inline

References deviceManager.

Referenced by StandalonePluginHolder().

## getIAAHostIcon()

Image juce::StandalonePluginHolder::getIAAHostIcon | ( | int | size | ) |

inline

References deviceManager.

## getInstance()

StandalonePluginHolder * juce::StandalonePluginHolder::getInstance | ( |  | ) |

inline static

References StandalonePluginHolder().

## Member Data Documentation

## settings

OptionalScopedPointer<PropertySet> juce::StandalonePluginHolder::settings

Referenced by getLastFile(), reloadAudioDeviceState(), reloadPluginState(), saveAudioDeviceState(), savePluginState(), setLastFile(), and StandalonePluginHolder().

## processor

std::unique_ptr<AudioProcessor> juce::StandalonePluginHolder::processor

Referenced by askUserToLoadState(), askUserToSaveState(), getNumInputChannels(), getNumOutputChannels(), reloadAudioDeviceState(), reloadPluginState(), savePluginState(), showAudioSettingsDialog(), StandalonePluginHolder(), and startPlaying().

## deviceManager

AudioDeviceManager juce::StandalonePluginHolder::deviceManager

Referenced by getIAAHostIcon(), isInterAppAudioConnected(), reloadAudioDeviceState(), saveAudioDeviceState(), showAudioSettingsDialog(), startPlaying(), and switchToHostApplication().

## player

AudioProcessorPlayer juce::StandalonePluginHolder::player

Referenced by startPlaying(), and stopPlaying().

## channelConfiguration

Array<PluginInOuts> juce::StandalonePluginHolder::channelConfiguration

Referenced by getNumInputChannels(), getNumOutputChannels(), showAudioSettingsDialog(), and StandalonePluginHolder().

## processorHasPotentialFeedbackLoop

bool juce::StandalonePluginHolder::processorHasPotentialFeedbackLoop = true

Referenced by getProcessorHasPotentialFeedbackLoop().

## muteInput

std::atomic<bool> juce::StandalonePluginHolder::muteInput { true }

Referenced by valueChanged().

## shouldMuteInput

Value juce::StandalonePluginHolder::shouldMuteInput

Referenced by getMuteInputValue(), reloadAudioDeviceState(), saveAudioDeviceState(), and StandalonePluginHolder().

## emptyBuffer

AudioBuffer<float> juce::StandalonePluginHolder::emptyBuffer

## autoOpenMidiDevices

bool juce::StandalonePluginHolder::autoOpenMidiDevices

Referenced by init(), and StandalonePluginHolder().

## options

std::unique_ptr<AudioDeviceManager::AudioDeviceSetup> juce::StandalonePluginHolder::options

Referenced by init(), and StandalonePluginHolder().

## lastMidiDevices

Array<MidiDeviceInfo> juce::StandalonePluginHolder::lastMidiDevices

## stateFileChooser

std::unique_ptr<FileChooser> juce::StandalonePluginHolder::stateFileChooser

Referenced by askUserToLoadState(), and askUserToSaveState().

## messageBox

ScopedMessageBox juce::StandalonePluginHolder::messageBox

Referenced by askUserToLoadState(), and askUserToSaveState().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited