JUCE
|
An object that creates and plays a standalone instance of an AudioProcessor. More...
Classes | |
struct | PluginInOuts |
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. More... | |
void | init (bool enableAudioInput, const String &preferredDefaultDeviceName) |
virtual | ~StandalonePluginHolder () |
virtual void | createPlugin () |
virtual void | deletePlugin () |
Value & | getMuteInputValue () |
bool | getProcessorHasPotentialFeedbackLoop () const |
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 (bool enableAudioInput, const String &preferredDefaultDeviceName, const AudioDeviceManager::AudioDeviceSetup *preferredSetupOptions) |
void | savePluginState () |
void | reloadPluginState () |
void | switchToHostApplication () |
bool | isInterAppAudioConnected () |
Static Public Member Functions | |
static String | getFilePatterns (const String &fileSuffix) |
static StandalonePluginHolder * | getInstance () |
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.
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 |
||
) |
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 channelConfiguration, createPlugin(), init(), juce::RuntimePermissions::isGranted(), juce::RuntimePermissions::isRequired(), options, processor, juce::RuntimePermissions::recordAudio, and juce::RuntimePermissions::request().
Referenced by juce::StandaloneFilterWindow::StandaloneFilterWindow().
|
virtual |
References deletePlugin(), and juce::Timer::stopTimer().
void juce::StandalonePluginHolder::init | ( | bool | enableAudioInput, |
const String & | preferredDefaultDeviceName | ||
) |
References autoOpenMidiDevices, options, reloadPluginState(), startPlaying(), and juce::Timer::startTimer().
Referenced by StandalonePluginHolder().
|
virtual |
|
virtual |
References processor, and stopPlaying().
Referenced by ~StandalonePluginHolder().
References juce::String::isEmpty(), and juce::String::startsWithChar().
Referenced by askUserToLoadState(), and askUserToSaveState().
Value& juce::StandalonePluginHolder::getMuteInputValue | ( | ) |
References shouldMuteInput.
bool juce::StandalonePluginHolder::getProcessorHasPotentialFeedbackLoop | ( | ) | const |
References processorHasPotentialFeedbackLoop.
File juce::StandalonePluginHolder::getLastFile | ( | ) | const |
References juce::File::getSpecialLocation(), settings, and juce::File::userDocumentsDirectory.
Referenced by askUserToLoadState(), and askUserToSaveState().
void juce::StandalonePluginHolder::setLastFile | ( | const FileChooser & | fc | ) |
References juce::File::getFullPathName(), juce::FileChooser::getResult(), and settings.
Referenced by askUserToLoadState(), and askUserToSaveState().
Pops up a dialog letting the user save the processor's state to a file.
References juce::FileChooser::browseForFileToSave(), juce::MemoryBlock::getData(), getFilePatterns(), getLastFile(), juce::FileChooser::getResult(), juce::MemoryBlock::getSize(), juce::ignoreUnused(), processor, juce::File::replaceWithData(), setLastFile(), juce::AlertWindow::showMessageBoxAsync(), TRANS, and juce::AlertWindow::WarningIcon.
Pops up a dialog letting the user re-load the processor's state from a file.
References juce::FileChooser::browseForFileToOpen(), juce::MemoryBlock::getData(), getFilePatterns(), getLastFile(), juce::FileChooser::getResult(), juce::MemoryBlock::getSize(), juce::ignoreUnused(), juce::File::loadFileAsData(), processor, setLastFile(), juce::AlertWindow::showMessageBoxAsync(), TRANS, and juce::AlertWindow::WarningIcon.
void juce::StandalonePluginHolder::startPlaying | ( | ) |
void juce::StandalonePluginHolder::stopPlaying | ( | ) |
References player, and juce::AudioProcessorPlayer::setProcessor().
Referenced by deletePlugin().
void juce::StandalonePluginHolder::showAudioSettingsDialog | ( | ) |
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::jmin(), juce::DialogWindow::LaunchOptions::launchAsync(), max(), processor, juce::DialogWindow::LaunchOptions::resizable, TRANS, and juce::DialogWindow::LaunchOptions::useNativeTitleBar.
void juce::StandalonePluginHolder::saveAudioDeviceState | ( | ) |
void juce::StandalonePluginHolder::reloadAudioDeviceState | ( | bool | enableAudioInput, |
const String & | preferredDefaultDeviceName, | ||
const AudioDeviceManager::AudioDeviceSetup * | preferredSetupOptions | ||
) |
void juce::StandalonePluginHolder::savePluginState | ( | ) |
References processor, settings, and juce::MemoryBlock::toBase64Encoding().
void juce::StandalonePluginHolder::reloadPluginState | ( | ) |
References juce::MemoryBlock::fromBase64Encoding(), juce::MemoryBlock::getData(), juce::MemoryBlock::getSize(), processor, and settings.
Referenced by init().
void juce::StandalonePluginHolder::switchToHostApplication | ( | ) |
References deviceManager, and juce::AudioDeviceManager::getCurrentAudioDevice().
bool juce::StandalonePluginHolder::isInterAppAudioConnected | ( | ) |
|
static |
References juce::Desktop::getInstance(), juce::PluginHostType::getPluginLoadedAs(), and juce::AudioProcessor::wrapperType_Standalone.
Referenced by isInterAppAudioConnected().
OptionalScopedPointer<PropertySet> juce::StandalonePluginHolder::settings |
Referenced by getLastFile(), reloadAudioDeviceState(), reloadPluginState(), saveAudioDeviceState(), savePluginState(), and setLastFile().
ScopedPointer<AudioProcessor> juce::StandalonePluginHolder::processor |
AudioDeviceManager juce::StandalonePluginHolder::deviceManager |
AudioProcessorPlayer juce::StandalonePluginHolder::player |
Referenced by startPlaying(), and stopPlaying().
Array<PluginInOuts> juce::StandalonePluginHolder::channelConfiguration |
Referenced by createPlugin(), reloadAudioDeviceState(), showAudioSettingsDialog(), and StandalonePluginHolder().
bool juce::StandalonePluginHolder::processorHasPotentialFeedbackLoop = true |
Referenced by createPlugin(), and getProcessorHasPotentialFeedbackLoop().
Value juce::StandalonePluginHolder::shouldMuteInput |
Referenced by getMuteInputValue(), reloadAudioDeviceState(), and saveAudioDeviceState().
AudioBuffer<float> juce::StandalonePluginHolder::emptyBuffer |
bool juce::StandalonePluginHolder::autoOpenMidiDevices |
Referenced by init(), and juce::StandaloneFilterWindow::StandaloneFilterWindow().
ScopedPointer<AudioDeviceManager::AudioDeviceSetup> juce::StandalonePluginHolder::options |
Referenced by init(), and StandalonePluginHolder().
StringArray juce::StandalonePluginHolder::lastMidiDevices |