LMMS
Loading...
Searching...
No Matches
juce::AudioDeviceManager::CallbackHandler Class Reference
Inheritance diagram for juce::AudioDeviceManager::CallbackHandler:
juce::AudioIODeviceCallback juce::MidiInputCallback juce::AudioIODeviceType::Listener

Public Member Functions

 CallbackHandler (AudioDeviceManager &adm) noexcept
Public Member Functions inherited from juce::AudioIODeviceCallback
virtual ~AudioIODeviceCallback ()=default
virtual void audioDeviceIOCallback (const float **inputChannelData, int numInputChannels, float **outputChannelData, int numOutputChannels, int numSamples)
Public Member Functions inherited from juce::MidiInputCallback
virtual ~MidiInputCallback ()=default
virtual void handlePartialSysexMessage (MidiInput *source, const uint8 *messageData, int numBytesSoFar, double timestamp)
Public Member Functions inherited from juce::AudioIODeviceType::Listener
virtual ~Listener ()=default

Private Member Functions

void audioDeviceIOCallbackWithContext (const float **ins, int numIns, float **outs, int numOuts, int numSamples, const AudioIODeviceCallbackContext &context) override
void audioDeviceAboutToStart (AudioIODevice *device) override
void audioDeviceStopped () override
void audioDeviceError (const String &message) override
void handleIncomingMidiMessage (MidiInput *source, const MidiMessage &message) override
void audioDeviceListChanged () override

Private Attributes

AudioDeviceManagerowner

Constructor & Destructor Documentation

◆ CallbackHandler()

juce::AudioDeviceManager::CallbackHandler::CallbackHandler ( AudioDeviceManager & adm)
inlinenoexcept

Member Function Documentation

◆ audioDeviceAboutToStart()

void juce::AudioDeviceManager::CallbackHandler::audioDeviceAboutToStart ( AudioIODevice * device)
inlineoverrideprivatevirtual

Called to indicate that the device is about to start calling back.

This will be called just before the audio callbacks begin, either when this callback has just been added to an audio device, or after the device has been restarted because of a sample-rate or block-size change.

You can use this opportunity to find out the sample rate and block size that the device is going to use by calling the AudioIODevice::getCurrentSampleRate() and AudioIODevice::getCurrentBufferSizeSamples() on the supplied pointer.

Parameters
devicethe audio IO device that will be used to drive the callback. Note that if you're going to store this this pointer, it is only valid until the next time that audioDeviceStopped is called.

Implements juce::AudioIODeviceCallback.

◆ audioDeviceError()

void juce::AudioDeviceManager::CallbackHandler::audioDeviceError ( const String & errorMessage)
inlineoverrideprivatevirtual

This can be overridden to be told if the device generates an error while operating. Be aware that this could be called by any thread! And not all devices perform this callback.

Reimplemented from juce::AudioIODeviceCallback.

◆ audioDeviceIOCallbackWithContext()

void juce::AudioDeviceManager::CallbackHandler::audioDeviceIOCallbackWithContext ( const float ** inputChannelData,
int numInputChannels,
float ** outputChannelData,
int numOutputChannels,
int numSamples,
const AudioIODeviceCallbackContext & context )
inlineoverrideprivatevirtual

The same as audioDeviceIOCallback(), but with an additional context argument.

The default implementation of this function will call audioDeviceIOCallback(), but you can override this function if you need to make use of the context information.

Reimplemented from juce::AudioIODeviceCallback.

◆ audioDeviceListChanged()

void juce::AudioDeviceManager::CallbackHandler::audioDeviceListChanged ( )
inlineoverrideprivatevirtual

Called when the list of available audio devices changes.

Implements juce::AudioIODeviceType::Listener.

◆ audioDeviceStopped()

void juce::AudioDeviceManager::CallbackHandler::audioDeviceStopped ( )
inlineoverrideprivatevirtual

Called to indicate that the device has stopped.

Implements juce::AudioIODeviceCallback.

◆ handleIncomingMidiMessage()

void juce::AudioDeviceManager::CallbackHandler::handleIncomingMidiMessage ( MidiInput * source,
const MidiMessage & message )
inlineoverrideprivatevirtual

Receives an incoming message.

A MidiInput object will call this method when a midi event arrives. It'll be called on a high-priority system thread, so avoid doing anything time-consuming in here, and avoid making any UI calls. You might find the MidiBuffer class helpful for queueing incoming messages for use later.

Parameters
sourcethe MidiInput object that generated the message
messagethe incoming message. The message's timestamp is set to a value equivalent to (Time::getMillisecondCounter() / 1000.0) to specify the time when the message arrived

Implements juce::MidiInputCallback.

Member Data Documentation

◆ owner

AudioDeviceManager& juce::AudioDeviceManager::CallbackHandler::owner
private

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