libSDL2pp
C++ bindings/wrapper for SDL2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL2pp::AudioSpec Class Reference

Audio format specification. More...

#include <SDL2pp/AudioSpec.hh>

Inheritance diagram for SDL2pp::AudioSpec:

Public Member Functions

 AudioSpec ()
 Create empty (invalid) audio format specification.
 
 AudioSpec (int freq, SDL_AudioFormat format, Uint8 channels, Uint16 samples)
 Create audio format specification with given properties.
 
 ~AudioSpec ()
 Destructor.
 
 AudioSpec (AudioSpec &&other)
 Move constructor.
 
AudioSpecoperator= (AudioSpec &&other)
 Move assignment operator.
 
 AudioSpec (const AudioSpec &other)=delete
 Deleted copy constructor.
 
AudioSpecoperator= (const AudioSpec &other)=delete
 Deleted assignment operator.
 
const SDL_AudioSpec * Get () const
 Get pointer to managed SDL_AudioSpec structure.
 
void MergeChanges (const SDL_AudioSpec &obtained)
 Merges audio format changes from another SDL2pp::AudioSpec.
 
bool IsSameFormat (const AudioSpec &other) const
 Checks if format of another SDL2pp::AudioSpec is the same.
 

Detailed Description

Audio format specification.

This class extends SDL_AudioSpec - a structure that describes audio format. It may be used to describe format of loaded SDL2pp::Wav audio fragments and to specify desired or actual audio output format of SDL2pp::AudioDevice

See also
http://wiki.libsdl.org/SDL_AudioSpec

Constructor & Destructor Documentation

◆ AudioSpec() [1/4]

SDL2pp::AudioSpec::AudioSpec ( )

Create empty (invalid) audio format specification.

This is needed for cases where e.g. SDL_LoadWAV() fills existing SDL_AudioSpec structure with values.

◆ AudioSpec() [2/4]

SDL2pp::AudioSpec::AudioSpec ( int  freq,
SDL_AudioFormat  format,
Uint8  channels,
Uint16  samples 
)

Create audio format specification with given properties.

Parameters
[in]freqSampling frequency in samples/second
[in]formatSample format, see http://wiki.libsdl.org/SDL_AudioSpec#Remarks
[in]channelsNumber of separate audio channels
[in]samplesAudio buffer size in samples (power of 2)
See also
http://wiki.libsdl.org/SDL_AudioSpec#Remarks

◆ ~AudioSpec()

SDL2pp::AudioSpec::~AudioSpec ( )

Destructor.

◆ AudioSpec() [3/4]

SDL2pp::AudioSpec::AudioSpec ( AudioSpec &&  other)
default

Move constructor.

Parameters
[in]otherSDL2pp::AudioSpec object to move data from

◆ AudioSpec() [4/4]

SDL2pp::AudioSpec::AudioSpec ( const AudioSpec other)
delete

Deleted copy constructor.

This class is not copyable

Member Function Documentation

◆ Get()

const SDL_AudioSpec * SDL2pp::AudioSpec::Get ( ) const

Get pointer to managed SDL_AudioSpec structure.

Returns
Pointer to managed SDL_AudioSpec structure

◆ IsSameFormat()

bool SDL2pp::AudioSpec::IsSameFormat ( const AudioSpec other) const

Checks if format of another SDL2pp::AudioSpec is the same.

Parameters
[in]otherSDL2pp::AudioSpec to compare to

◆ MergeChanges()

void SDL2pp::AudioSpec::MergeChanges ( const SDL_AudioSpec &  obtained)

Merges audio format changes from another SDL2pp::AudioSpec.

Parameters
[in]obtainedSDL2pp::AudioSpec to merge data from

◆ operator=() [1/2]

AudioSpec & SDL2pp::AudioSpec::operator= ( AudioSpec &&  other)
default

Move assignment operator.

Parameters
[in]otherSDL2pp::AudioSpec object to move data from
Returns
Reference to self

◆ operator=() [2/2]

AudioSpec & SDL2pp::AudioSpec::operator= ( const AudioSpec other)
delete

Deleted assignment operator.

This class is not copyable


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