JUCE
Public Member Functions | List of all members
AudioProcessorPlayer Class Reference

An AudioIODeviceCallback object which streams audio through an AudioProcessor. More...

Inheritance diagram for AudioProcessorPlayer:

Public Member Functions

 AudioProcessorPlayer (bool doDoublePrecisionProcessing=false)
 
 ~AudioProcessorPlayer () override
 Destructor. More...
 
void setProcessor (AudioProcessor *processorToPlay)
 Sets the processor that should be played. More...
 
AudioProcessorgetCurrentProcessor () const noexcept
 Returns the current audio processor that is being played. More...
 
MidiMessageCollectorgetMidiMessageCollector () noexcept
 Returns a midi message collector that you can pass midi messages to if you want them to be injected into the midi stream that is being sent to the processor. More...
 
void setMidiOutput (MidiOutput *midiOutputToUse)
 Sets the MIDI output that should be used, if required. More...
 
void setDoublePrecisionProcessing (bool doublePrecision)
 Switch between double and single floating point precisions processing. More...
 
bool getDoublePrecisionProcessing ()
 Returns true if this player processes internally processes the samples with double floating point precision. More...
 
void audioDeviceIOCallback (const float **, int, float **, int, int) override
 
void audioDeviceAboutToStart (AudioIODevice *) override
 
void audioDeviceStopped () override
 
void handleIncomingMidiMessage (MidiInput *, const MidiMessage &) override
 
- Public Member Functions inherited from AudioIODeviceCallback
virtual ~AudioIODeviceCallback ()=default
 Destructor. More...
 
virtual void audioDeviceError (const String &errorMessage)
 This can be overridden to be told if the device generates an error while operating. More...
 
- Public Member Functions inherited from MidiInputCallback
virtual ~MidiInputCallback ()=default
 Destructor. More...
 
virtual void handlePartialSysexMessage (MidiInput *source, const uint8 *messageData, int numBytesSoFar, double timestamp)
 Notification sent each time a packet of a multi-packet sysex message arrives. More...
 

Detailed Description

An AudioIODeviceCallback object which streams audio through an AudioProcessor.

To use one of these, just make it the callback used by your AudioIODevice, and give it a processor to use by calling setProcessor().

It's also a MidiInputCallback, so you can connect it to both an audio and midi input to send both streams through the processor. To set a MidiOutput for the processor, use the setMidiOutput() method.

See also
AudioProcessor, AudioProcessorGraph

Constructor & Destructor Documentation

◆ AudioProcessorPlayer()

AudioProcessorPlayer::AudioProcessorPlayer ( bool  doDoublePrecisionProcessing = false)

◆ ~AudioProcessorPlayer()

AudioProcessorPlayer::~AudioProcessorPlayer ( )
override

Destructor.

Member Function Documentation

◆ setProcessor()

void AudioProcessorPlayer::setProcessor ( AudioProcessor processorToPlay)

Sets the processor that should be played.

The processor that is passed in will not be deleted or owned by this object. To stop anything playing, pass a nullptr to this method.

Referenced by StandalonePluginHolder::startPlaying(), and StandalonePluginHolder::stopPlaying().

◆ getCurrentProcessor()

AudioProcessor* AudioProcessorPlayer::getCurrentProcessor ( ) const
noexcept

Returns the current audio processor that is being played.

◆ getMidiMessageCollector()

MidiMessageCollector& AudioProcessorPlayer::getMidiMessageCollector ( )
noexcept

Returns a midi message collector that you can pass midi messages to if you want them to be injected into the midi stream that is being sent to the processor.

Referenced by StandalonePluginHolder::startPlaying().

◆ setMidiOutput()

void AudioProcessorPlayer::setMidiOutput ( MidiOutput midiOutputToUse)

Sets the MIDI output that should be used, if required.

The MIDI output will not be deleted or owned by this object. If the MIDI output is deleted, pass a nullptr to this method.

◆ setDoublePrecisionProcessing()

void AudioProcessorPlayer::setDoublePrecisionProcessing ( bool  doublePrecision)

Switch between double and single floating point precisions processing.

The audio IO callbacks will still operate in single floating point precision, however, all internal processing including the AudioProcessor will be processed in double floating point precision if the AudioProcessor supports it (see AudioProcessor::supportsDoublePrecisionProcessing()). Otherwise, the processing will remain single precision irrespective of the parameter doublePrecision.

◆ getDoublePrecisionProcessing()

bool AudioProcessorPlayer::getDoublePrecisionProcessing ( )

◆ audioDeviceIOCallback()

void AudioProcessorPlayer::audioDeviceIOCallback ( const float **  ,
int  ,
float **  ,
int  ,
int   
)
overridevirtual

Implements AudioIODeviceCallback.

◆ audioDeviceAboutToStart()

void AudioProcessorPlayer::audioDeviceAboutToStart ( AudioIODevice )
overridevirtual

Implements AudioIODeviceCallback.

◆ audioDeviceStopped()

void AudioProcessorPlayer::audioDeviceStopped ( )
overridevirtual

Implements AudioIODeviceCallback.

◆ handleIncomingMidiMessage()

void AudioProcessorPlayer::handleIncomingMidiMessage ( MidiInput ,
const MidiMessage  
)
overridevirtual

Implements MidiInputCallback.


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