libSDL2pp
C++ bindings/wrapper for SDL2
|
Audio format specification. More...
#include <SDL2pp/AudioSpec.hh>
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. | |
AudioSpec & | operator= (AudioSpec &&other) |
Move assignment operator. | |
AudioSpec (const AudioSpec &other)=delete | |
Deleted copy constructor. | |
AudioSpec & | operator= (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. | |
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
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.
SDL2pp::AudioSpec::AudioSpec | ( | int | freq, |
SDL_AudioFormat | format, | ||
Uint8 | channels, | ||
Uint16 | samples | ||
) |
Create audio format specification with given properties.
[in] | freq | Sampling frequency in samples/second |
[in] | format | Sample format, see http://wiki.libsdl.org/SDL_AudioSpec#Remarks |
[in] | channels | Number of separate audio channels |
[in] | samples | Audio buffer size in samples (power of 2) |
SDL2pp::AudioSpec::~AudioSpec | ( | ) |
Destructor.
|
default |
Move constructor.
[in] | other | SDL2pp::AudioSpec object to move data from |
|
delete |
Deleted copy constructor.
This class is not copyable
const SDL_AudioSpec * SDL2pp::AudioSpec::Get | ( | ) | const |
Get pointer to managed SDL_AudioSpec structure.
bool SDL2pp::AudioSpec::IsSameFormat | ( | const AudioSpec & | other | ) | const |
Checks if format of another SDL2pp::AudioSpec is the same.
[in] | other | SDL2pp::AudioSpec to compare to |
void SDL2pp::AudioSpec::MergeChanges | ( | const SDL_AudioSpec & | obtained | ) |
Merges audio format changes from another SDL2pp::AudioSpec.
[in] | obtained | SDL2pp::AudioSpec to merge data from |
Move assignment operator.
[in] | other | SDL2pp::AudioSpec object to move data from |
Deleted assignment operator.
This class is not copyable