An object that creates and plays a standalone instance of an AudioProcessor. More...
#include <juce_StandaloneFilterWindow.h>
Classes | |
struct | PluginInOuts |
Structure used for the number of inputs and outputs. More... | |
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 |
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, | ||
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 Value::addListener(), channelConfiguration, AudioProcessor::getMainBusNumInputChannels(), init(), RuntimePermissions::isGranted(), isInterAppAudioConnected(), RuntimePermissions::isRequired(), options, processor, RuntimePermissions::recordAudio, RuntimePermissions::request(), and shouldMuteInput.
|
override |
References Timer::stopTimer().
void StandalonePluginHolder::init | ( | bool | enableAudioInput, |
const String & | preferredDefaultDeviceName ) |
References autoOpenMidiDevices, options, reloadPluginState(), startPlaying(), and Timer::startTimer().
Referenced by StandalonePluginHolder().
Referenced by StandaloneFilterWindow::resetToDefaultState().
Referenced by StandaloneFilterWindow::resetToDefaultState().
int StandalonePluginHolder::getNumInputChannels | ( | ) | const |
References channelConfiguration, AudioProcessor::getMainBusNumInputChannels(), and processor.
Referenced by reloadAudioDeviceState().
int StandalonePluginHolder::getNumOutputChannels | ( | ) | const |
References channelConfiguration, AudioProcessor::getMainBusNumOutputChannels(), and processor.
Referenced by reloadAudioDeviceState().
Referenced by askUserToLoadState(), and askUserToSaveState().
Value & StandalonePluginHolder::getMuteInputValue | ( | ) |
References shouldMuteInput.
bool StandalonePluginHolder::getProcessorHasPotentialFeedbackLoop | ( | ) | const |
References processorHasPotentialFeedbackLoop.
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 Value::Listener.
References Value::getValue(), and muteInput.
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 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 FileBrowserComponent::canSelectFiles, MemoryBlock::getData(), getFilePatterns(), getLastFile(), MemoryBlock::getSize(), AudioProcessor::getStateInformation(), FileChooser::launchAsync(), MessageBoxOptions::makeOptionsOk(), messageBox, processor, FileBrowserComponent::saveMode, setLastFile(), AlertWindow::showScopedAsync(), stateFileChooser, TRANS, FileBrowserComponent::warnAboutOverwriting, and AlertWindow::WarningIcon.
Referenced by StandaloneFilterWindow::handleMenuResult().
Pops up a dialog letting the user re-load the processor's state from a file.
References FileBrowserComponent::canSelectFiles, MemoryBlock::getData(), getFilePatterns(), getLastFile(), MemoryBlock::getSize(), FileChooser::launchAsync(), MessageBoxOptions::makeOptionsOk(), messageBox, FileBrowserComponent::openMode, processor, setLastFile(), AudioProcessor::setStateInformation(), AlertWindow::showScopedAsync(), stateFileChooser, TRANS, and AlertWindow::WarningIcon.
Referenced by StandaloneFilterWindow::handleMenuResult().
void StandalonePluginHolder::startPlaying | ( | ) |
void StandalonePluginHolder::stopPlaying | ( | ) |
References player, and AudioProcessorPlayer::setProcessor().
Referenced by StandaloneFilterWindow::resetToDefaultState(), and StandaloneFilterWindow::~StandaloneFilterWindow().
void StandalonePluginHolder::showAudioSettingsDialog | ( | ) |
Shows an audio properties dialog box modally.
References ResizableWindow::backgroundColourId, channelConfiguration, deviceManager, AudioProcessor::getBus(), jmax(), processor, and TRANS.
Referenced by StandaloneFilterWindow::handleMenuResult().
void StandalonePluginHolder::saveAudioDeviceState | ( | ) |
void StandalonePluginHolder::savePluginState | ( | ) |
References AudioProcessor::getStateInformation(), processor, settings, PropertySet::setValue(), and MemoryBlock::toBase64Encoding().
Referenced by StandaloneFilterWindow::closeButtonPressed().
void StandalonePluginHolder::reloadPluginState | ( | ) |
References MemoryBlock::fromBase64Encoding(), MemoryBlock::getData(), MemoryBlock::getSize(), PropertySet::getValue(), processor, AudioProcessor::setStateInformation(), and settings.
Referenced by init().
void StandalonePluginHolder::switchToHostApplication | ( | ) |
References deviceManager, and AudioDeviceManager::getCurrentAudioDevice().
bool StandalonePluginHolder::isInterAppAudioConnected | ( | ) |
References deviceManager, and AudioDeviceManager::getCurrentAudioDevice().
Referenced by StandalonePluginHolder().
References deviceManager, and AudioDeviceManager::getCurrentAudioDevice().
OptionalScopedPointer<PropertySet> StandalonePluginHolder::settings |
std::unique_ptr<AudioProcessor> StandalonePluginHolder::processor |
AudioDeviceManager StandalonePluginHolder::deviceManager |
AudioProcessorPlayer StandalonePluginHolder::player |
Referenced by startPlaying(), and stopPlaying().
Array<PluginInOuts> StandalonePluginHolder::channelConfiguration |
Referenced by getNumInputChannels(), getNumOutputChannels(), showAudioSettingsDialog(), and StandalonePluginHolder().
Referenced by getProcessorHasPotentialFeedbackLoop().
Referenced by valueChanged().
Value StandalonePluginHolder::shouldMuteInput |
Referenced by getMuteInputValue(), reloadAudioDeviceState(), saveAudioDeviceState(), and StandalonePluginHolder().
AudioBuffer<float> StandalonePluginHolder::emptyBuffer |
std::unique_ptr<AudioDeviceManager::AudioDeviceSetup> StandalonePluginHolder::options |
Referenced by init(), and StandalonePluginHolder().
Array<MidiDeviceInfo> StandalonePluginHolder::lastMidiDevices |
std::unique_ptr<FileChooser> StandalonePluginHolder::stateFileChooser |
Referenced by askUserToLoadState(), and askUserToSaveState().
ScopedMessageBox StandalonePluginHolder::messageBox |
Referenced by askUserToLoadState(), and askUserToSaveState().