SDL3pp
A slim C++ wrapper for SDL3
|
Handle to an owned audioDevice. More...
Public Member Functions | |
constexpr | AudioDevice (SDL_AudioDeviceID resource={}) |
Constructs from the underlying resource. | |
constexpr | AudioDevice (const AudioDevice &other)=delete |
constexpr | AudioDevice (AudioDevice &&other)=default |
Move constructor. | |
~AudioDevice () | |
Frees up resource when object goes out of scope. | |
AudioDevice & | operator= (AudioDevice other) |
Assignment operator. | |
constexpr | AudioDeviceRef (const AudioDeviceRef &other) |
Copy constructor. | |
constexpr | AudioDeviceRef (AudioDeviceRef &&other) |
Move constructor. | |
![]() | |
constexpr | AudioDeviceRef (const AudioDeviceRef &other) |
Copy constructor. | |
constexpr | AudioDeviceRef (AudioDeviceRef &&other) |
Move constructor. | |
constexpr | ~AudioDeviceRef ()=default |
Default constructor. | |
AudioDeviceRef & | operator= (AudioDeviceRef other) |
Assignment operator. | |
void | reset (SDL_AudioDeviceID newResource={}) |
Close a previously-opened audio device. | |
AudioDeviceBase (const AudioDeviceBase &devid, OptionalRef< const SDL_AudioSpec > spec) | |
Open a specific audio device. | |
![]() | |
AudioDeviceBase (const AudioDeviceBase &devid, OptionalRef< const SDL_AudioSpec > spec) | |
Open a specific audio device. | |
constexpr auto | operator<=> (const AudioDeviceBase &other) const |
Comparison. | |
const char * | GetName () const |
Get the human-readable name of a specific audio device. | |
AudioSpec | GetFormat (int *sample_frames=nullptr) const |
Get the current audio format of a specific audio device. | |
OwnArray< int > | GetChannelMap () const |
Get the current channel map of an audio device. | |
bool | IsPhysical () const |
Determine if an audio device is physical (instead of logical). | |
bool | IsPlayback () const |
Determine if an audio device is a playback device (instead of recording). | |
void | Pause () |
Use this function to pause audio playback on a specified device. | |
void | Resume () |
Use this function to unpause audio playback on a specified device. | |
bool | Paused () const |
Use this function to query if an audio device is paused. | |
float | GetGain () const |
Get the gain of an audio device. | |
void | SetGain (float gain) |
Change the gain of an audio device. | |
void | BindAudioStreams (std::span< AudioStreamRef > streams) |
Bind a list of audio streams to an audio device. | |
void | BindAudioStream (AudioStreamBase &stream) |
Bind a single audio stream to an audio device. | |
void | SetPostmixCallback (AudioPostmixCB callback) |
Set a callback that fires when data is about to be fed to an audio device. | |
void | SetPostmixCallback (AudioPostmixCallback callback, void *userdata) |
Set a callback that fires when data is about to be fed to an audio device. | |
constexpr | Resource (T resource={}) |
Constructs the underlying resource. | |
constexpr | Resource (std::nullptr_t) |
Equivalent to default ctor. | |
constexpr | Resource (std::nullopt_t) |
Equivalent to default ctor. | |
Resource (const Resource &other)=delete | |
Resource (Resource &&other)=delete | |
![]() | |
constexpr | Resource (SDL_AudioDeviceID resource={}) |
Constructs the underlying resource. | |
constexpr | Resource (std::nullptr_t) |
Equivalent to default ctor. | |
constexpr | Resource (std::nullopt_t) |
Equivalent to default ctor. | |
Resource (const Resource &other)=delete | |
Resource (Resource &&other)=delete | |
Resource & | operator= (const Resource &other)=delete |
Resource & | operator= (Resource &&other)=delete |
constexpr | operator bool () const |
True if contains a valid resource. | |
constexpr bool | operator== (const Resource &other) const=default |
Comparison. | |
constexpr bool | operator== (std::nullopt_t) const |
Comparison. | |
constexpr bool | operator== (std::nullptr_t) const |
Comparison. | |
constexpr SDL_AudioDeviceID | get () const |
Return contained resource;. | |
constexpr SDL_AudioDeviceID | release (SDL_AudioDeviceID newResource={}) |
Return contained resource and empties or replace value. | |
constexpr const SDL_AudioDeviceID | operator-> () const |
Access to fields. | |
constexpr SDL_AudioDeviceID | operator-> () |
Access to fields. | |