JUCE
|
An object that creates and plays a standalone instance of an AudioProcessor. More...
Public Member Functions | |
StandalonePluginHolder (PropertySet *settingsToUse, bool takeOwnershipOfSettings=true, const String &preferredDefaultDeviceName=String(), const AudioDeviceManager::AudioDeviceSetup *preferredSetupOptions=nullptr) | |
Creates an instance of the default plugin. More... | |
virtual | ~StandalonePluginHolder () |
virtual void | createPlugin () |
virtual void | deletePlugin () |
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. More... | |
void | askUserToLoadState (const String &fileSuffix=String()) |
Pops up a dialog letting the user re-load the processor's state from a file. More... | |
void | startPlaying () |
void | stopPlaying () |
void | showAudioSettingsDialog () |
Shows an audio properties dialog box modally. More... | |
void | saveAudioDeviceState () |
void | reloadAudioDeviceState (const String &preferredDefaultDeviceName, const AudioDeviceManager::AudioDeviceSetup *preferredSetupOptions) |
void | savePluginState () |
void | reloadPluginState () |
Static Public Member Functions | |
static String | getFilePatterns (const String &fileSuffix) |
Public Attributes | |
OptionalScopedPointer< PropertySet > | settings |
ScopedPointer< AudioProcessor > | processor |
AudioDeviceManager | deviceManager |
AudioProcessorPlayer | player |
StringArray | lastMidiDevices |
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.
StandalonePluginHolder::StandalonePluginHolder | ( | PropertySet * | settingsToUse, |
bool | takeOwnershipOfSettings = true , |
||
const String & | preferredDefaultDeviceName = String() , |
||
const AudioDeviceManager::AudioDeviceSetup * | preferredSetupOptions = nullptr |
||
) |
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 createPlugin(), reloadPluginState(), startPlaying(), and Timer::startTimer().
Referenced by StandaloneFilterWindow::StandaloneFilterWindow().
|
virtual |
References deletePlugin(), and Timer::stopTimer().
|
virtual |
References AudioProcessor::busArrangement, createPluginFilterOfType(), AudioChannelSet::disabled(), AudioProcessor::AudioBusArrangement::inputBuses, jassert, AudioProcessor::AudioBusArrangement::outputBuses, processor, AudioProcessor::setPreferredBusArrangement(), AudioProcessor::setRateAndBufferSizeDetails(), AudioProcessor::setTypeOfNextNewPlugin(), AudioProcessor::wrapperType_Standalone, and AudioProcessor::wrapperType_Undefined.
Referenced by StandalonePluginHolder().
|
virtual |
References processor, and stopPlaying().
Referenced by ~StandalonePluginHolder().
References String::isEmpty(), and String::startsWithChar().
Referenced by askUserToLoadState(), and askUserToSaveState().
File StandalonePluginHolder::getLastFile | ( | ) | const |
References File::getSpecialLocation(), PropertySet::getValue(), settings, and File::userDocumentsDirectory.
Referenced by askUserToLoadState(), and askUserToSaveState().
void StandalonePluginHolder::setLastFile | ( | const FileChooser & | fc | ) |
References File::getFullPathName(), FileChooser::getResult(), settings, and PropertySet::setValue().
Referenced by askUserToLoadState(), and askUserToSaveState().
Pops up a dialog letting the user save the processor's state to a file.
References FileChooser::browseForFileToSave(), MemoryBlock::getData(), getFilePatterns(), getLastFile(), FileChooser::getResult(), MemoryBlock::getSize(), AudioProcessor::getStateInformation(), ignoreUnused(), processor, File::replaceWithData(), setLastFile(), AlertWindow::showMessageBoxAsync(), TRANS, and AlertWindow::WarningIcon.
Pops up a dialog letting the user re-load the processor's state from a file.
References FileChooser::browseForFileToOpen(), MemoryBlock::getData(), getFilePatterns(), getLastFile(), FileChooser::getResult(), MemoryBlock::getSize(), ignoreUnused(), File::loadFileAsData(), processor, setLastFile(), AudioProcessor::setStateInformation(), AlertWindow::showMessageBoxAsync(), TRANS, and AlertWindow::WarningIcon.
void StandalonePluginHolder::startPlaying | ( | ) |
References player, processor, and AudioProcessorPlayer::setProcessor().
Referenced by StandalonePluginHolder().
void StandalonePluginHolder::stopPlaying | ( | ) |
References player, and AudioProcessorPlayer::setProcessor().
Referenced by deletePlugin().
void StandalonePluginHolder::showAudioSettingsDialog | ( | ) |
Shows an audio properties dialog box modally.
References DialogWindow::LaunchOptions::content, deviceManager, DialogWindow::LaunchOptions::dialogBackgroundColour, DialogWindow::LaunchOptions::dialogTitle, DialogWindow::LaunchOptions::escapeKeyTriggersCloseButton, AudioProcessor::getTotalNumInputChannels(), AudioProcessor::getTotalNumOutputChannels(), DialogWindow::LaunchOptions::launchAsync(), processor, DialogWindow::LaunchOptions::resizable, OptionalScopedPointer< ObjectType >::setOwned(), Component::setSize(), TRANS, and DialogWindow::LaunchOptions::useNativeTitleBar.
void StandalonePluginHolder::saveAudioDeviceState | ( | ) |
References AudioDeviceManager::createStateXml(), deviceManager, settings, and PropertySet::setValue().
void StandalonePluginHolder::reloadAudioDeviceState | ( | const String & | preferredDefaultDeviceName, |
const AudioDeviceManager::AudioDeviceSetup * | preferredSetupOptions | ||
) |
void StandalonePluginHolder::savePluginState | ( | ) |
void StandalonePluginHolder::reloadPluginState | ( | ) |
OptionalScopedPointer<PropertySet> StandalonePluginHolder::settings |
Referenced by getLastFile(), reloadAudioDeviceState(), reloadPluginState(), saveAudioDeviceState(), savePluginState(), and setLastFile().
ScopedPointer<AudioProcessor> StandalonePluginHolder::processor |
AudioDeviceManager StandalonePluginHolder::deviceManager |
Referenced by reloadAudioDeviceState(), saveAudioDeviceState(), and showAudioSettingsDialog().
AudioProcessorPlayer StandalonePluginHolder::player |
Referenced by startPlaying(), and stopPlaying().
StringArray StandalonePluginHolder::lastMidiDevices |