SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL::AudioDeviceBase Struct Reference

Base class to AudioDevice. More...

Inheritance diagram for SDL::AudioDeviceBase:
[legend]

Public Member Functions

void Close ()
 Close a previously-opened audio device.
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 (AudioStreamRef stream)
 Bind a single audio stream 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.
void SetPostmixCallback (AudioPostmixCB callback)
 Set a callback that fires when data is about to be fed to an audio device.
AudioStream OpenStream (OptionalRef< const AudioSpec > spec, AudioStreamCallback callback, void *userdata)
 Convenience function for straightforward audio init for the common case.
AudioStream OpenStream (OptionalRef< const AudioSpec > spec, AudioStreamCB callback)
 Convenience function for straightforward audio init for the common case.
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr ResourceBaseT (RawPointer resource)
 Constructs from resource pointer.
constexpr ResourceBaseT (std::nullptr_t)
 Constructs null/invalid.
constexpr ResourceBaseT (const ResourceBaseT &)=default
 Copy constructor.
constexpr ResourceBaseT (ResourceBaseT &&) noexcept=default
 Move constructor.
Public Member Functions inherited from SDL::ResourceBaseT< AudioDeviceID >
constexpr ResourceBaseT ()=default
 Default constructor, creates null/invalid resource.
constexpr operator bool () const
 Converts to bool.
constexpr auto operator<=> (const ResourceBaseT &other) const=default
 Comparison.
constexpr RawConstPointer operator-> () const noexcept
 member access to underlying resource pointer.
constexpr RawPointer get () const noexcept
 Retrieves underlying resource pointer.
constexpr RawPointer release () noexcept
 Retrieves underlying resource pointer and clear this.

Additional Inherited Members

Public Types inherited from SDL::ResourceBaseT< AudioDeviceID >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.
Protected Member Functions inherited from SDL::ResourceBaseT< AudioDeviceID >
constexpr ~ResourceBaseT ()=default
 Destructor.
constexpr ResourceBaseToperator= (const ResourceBaseT &)=default
 Assignment operator.

Detailed Description

Base class to AudioDevice.

See also
AudioDevice

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