Om  1.0.0
A universal framework for multimedia simulation
Public Attributes | List of all members
om::sound::devices::SoundDeviceDelegate Class Reference

A class that contains function objects that recieve SoundDevice events. More...

#include <omSoundDeviceDelegate.h>

Public Attributes

SoundInputCallback inputCallback
 A function object that is called whenever the device provides input audio. More...
 
SoundOutputCallback outputCallback
 A function object that is called whenever the device requests output audio. More...
 
Function< void(SoundDevice &device)> processOverload
 A function called whenever the device detects that the user has taken too long to process audio I/O. More...
 
Function< void(SoundDevice &device)> removed
 A function object that is called whenever the sound device is removed from the system. More...
 
Function< void(SoundDevice &device, SampleRate newSampleRate)> sampleRateChanged
 A function object that is called whenever the sampling rate for a SoundDevice has changed. More...
 

Detailed Description

A class that contains function objects that recieve SoundDevice events.

Any device-related event that might be processed has an appropriate callback function object. Each callback function is called by the device whenever such an event is received. If a callback function in the delegate is not initialized, the device simply ignores it.

Member Data Documentation

SoundInputCallback om::sound::devices::SoundDeviceDelegate::inputCallback

A function object that is called whenever the device provides input audio.

This callback is called whenever the SoundDevice has audio that it has captured on its inputs. The implementor of the callback method can read the samples from the given input sound buffer.

This method will be called from a separate thread (the audio processing thread) so any data accessed in the callback function should use proper thread synchonization to avoid unsafe access. The input callback for a device is always called before the output callback.

SoundOutputCallback om::sound::devices::SoundDeviceDelegate::outputCallback

A function object that is called whenever the device requests output audio.

This callback is called whenever the SoundDevice needs output audio to send to the device. The implementor of the callback method should produce sound that is written to the output buffer for the requested number of samples. If the callback takes too long to process the samples for output, the result is that output buffers are dropped, producing choppy audio.

This method will be called from a separate thread (the audio processing thread) so any data accessed in the callback function should use proper thread synchonization to avoid unsafe access. The output callback for a device is always called after the input callback.

Function<void ( SoundDevice& device )> om::sound::devices::SoundDeviceDelegate::processOverload

A function called whenever the device detects that the user has taken too long to process audio I/O.

When this happens, the device must drop input or output frames, causing glitchy audio. This callback exists so that the user can detect this event and reduce the audio thread processing load.

Function<void ( SoundDevice& device )> om::sound::devices::SoundDeviceDelegate::removed

A function object that is called whenever the sound device is removed from the system.

Function<void ( SoundDevice& device, SampleRate newSampleRate )> om::sound::devices::SoundDeviceDelegate::sampleRateChanged

A function object that is called whenever the sampling rate for a SoundDevice has changed.


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