SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::AudioDevice Struct Reference

Handle to an owned audioDevice. More...

Inheritance diagram for SDL::AudioDevice:
Inheritance graph
[legend]

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.
 
AudioDeviceoperator= (AudioDevice other)
 Assignment operator.
 
constexpr AudioDeviceRef (const AudioDeviceRef &other)
 Copy constructor.
 
constexpr AudioDeviceRef (AudioDeviceRef &&other)
 Move constructor.
 
- Public Member Functions inherited from SDL::AudioDeviceRef
constexpr AudioDeviceRef (const AudioDeviceRef &other)
 Copy constructor.
 
constexpr AudioDeviceRef (AudioDeviceRef &&other)
 Move constructor.
 
constexpr ~AudioDeviceRef ()=default
 Default constructor.
 
AudioDeviceRefoperator= (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.
 
- Public Member Functions inherited from SDL::AudioDeviceBase
 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
 
- Public Member Functions inherited from SDL::Resource< SDL_AudioDeviceID >
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
 
Resourceoperator= (const Resource &other)=delete
 
Resourceoperator= (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.
 

Detailed Description

Category:
Resource
See also
AudioDeviceBase
AudioDeviceRef

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