pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Audio::Output Class Referenceabstract

Base audio output class (abstract). More...

#include <audiooutput.h>

Inheritance diagram for Audio::Output:
Inheritance graph
[legend]

Public Member Functions

virtual ~Output ()
 
virtual bool play (void *buffer, unsigned number_of_bytes)=0
 Play output. More...
 
char bytesPerSample ()
 

Static Public Member Functions

static bool isValidOutput (const AudioSettings &settings)
 Check if audio settings are valid. More...
 
static bool outputCanCrossfade (const AudioSettings &settings)
 Check if audio settings are valid. More...
 
static OutputgetOutput (const AudioSettings &settings, const AudioFormat &format)
 Factory gets whatever kind of output is best, or requested by the audio settings. More...
 
static void reportLibrariesAndVersions (int verbose)
 Report audio libraries in use, and their versions. More...
 

Protected Attributes

char bytes_per_sample_set
 

Detailed Description

Base audio output class (abstract).

Constructor & Destructor Documentation

◆ ~Output()

virtual Audio::Output::~Output ( )
inlinevirtual

Member Function Documentation

◆ bytesPerSample()

char Audio::Output::bytesPerSample ( )
inline

◆ getOutput()

Output * Audio::Output::getOutput ( const AudioSettings settings,
const AudioFormat format 
)
static

Factory gets whatever kind of output is best, or requested by the audio settings.

Parameters
settingsWhere to send the audio output.
formatThe form in which the audio data will arrive.
Returns
A ready-to-go output device, or a nullptr if there is no matching device.
Exceptions
AudioExceptionor a derivative if opening/setting up the device failed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValidOutput()

bool Audio::Output::isValidOutput ( const AudioSettings settings)
static

Check if audio settings are valid.

Parameters
settingsWhere to send the audio output.
Returns
True if valid, false otherwise.
Exceptions
AudioExceptionor a derivative if opening/setting up the device failed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ outputCanCrossfade()

bool Audio::Output::outputCanCrossfade ( const AudioSettings settings)
static

Check if audio settings are valid.

Parameters
settingsWhere to send the audio output.
Returns
True if valid, false otherwise.
Exceptions
AudioExceptionor a derivative if opening/setting up the device failed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ play()

virtual bool Audio::Output::play ( void *  buffer,
unsigned  number_of_bytes 
)
pure virtual

Play output.

Parameters
bufferThe samples, in packed (interleaved) format if multichannel.
number_of_bytesSize of the buffer; number of samples is determined by the audio format set when opening the channel.

Implemented in Audio::LibsdlOutput, Audio::LibaoOutput, Audio::GstreamerOutput, and Audio::AvDeviceOutput.

◆ reportLibrariesAndVersions()

void Audio::Output::reportLibrariesAndVersions ( int  verbose)
static

Report audio libraries in use, and their versions.

Parameters
verboseIf > 0, include more detail.
Here is the caller graph for this function:

Member Data Documentation

◆ bytes_per_sample_set

char Audio::Output::bytes_per_sample_set
protected

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