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

Base class to Mixer. More...

Inheritance diagram for SDL::MixerBase:
[legend]

Public Member Functions

void Destroy ()
 Free a mixer.
PropertiesRef GetProperties ()
 Get the properties associated with a mixer.
void GetFormat (AudioSpec *spec)
 Get the audio format a mixer is generating.
MixerLock Lock ()
 Lock a mixer by obtaining its internal mutex.
void Unlock (MixerLock &&lock)
 Unlock a mixer previously locked by a call to LockMixer().
Audio LoadAudio_IO (IOStreamRef io, bool predecode, bool closeio=false)
 Load audio for playback from an IOStream.
Audio LoadAudio (StringParam path, bool predecode)
 Load audio for playback from a file.
Audio LoadAudioNoCopy (SourceBytes data, bool free_when_done)
 Load audio for playback from a memory buffer without making a copy.
Audio LoadRawAudio_IO (IOStreamRef io, const AudioSpec &spec, bool closeio=false)
 Load raw PCM data from an IOStream.
Audio LoadRawAudio (SourceBytes data, const AudioSpec &spec)
 Load raw PCM data from a memory buffer.
Audio LoadRawAudioNoCopy (SourceBytes data, const AudioSpec &spec, bool free_when_done)
 Load raw PCM data from a memory buffer without making a copy.
Audio CreateSineWaveAudio (int hz, float amplitude, Sint64 ms)
 Create a Audio that generates a sinewave.
TrackRef CreateTrack ()
 Create a new track on a mixer.
OwnArray< TrackRefGetTaggedTracks (StringParam tag)
 Get all tracks with a specific tag.
void PlayTag (StringParam tag, PropertiesRef options)
 Start (or restart) mixing all tracks with a specific tag for playback.
bool PlayAudio (AudioRef audio)
 Play a Audio from start to finish without any management.
void StopAllTracks (Sint64 fade_out_ms)
 Halt all currently-playing tracks, possibly fading out over time.
void StopTag (StringParam tag, Sint64 fade_out_ms)
 Halt all tracks with a specific tag, possibly fading out over time.
void PauseAllTracks ()
 Pause all currently-playing tracks.
void PauseTag (StringParam tag)
 Pause all tracks with a specific tag.
void ResumeAllTracks ()
 Resume all currently-paused tracks.
void ResumeTag (StringParam tag)
 Resume all tracks with a specific tag.
void SetGain (float gain)
 Set a mixer's master gain control.
float GetGain ()
 Get a mixer's master gain control.
void SetTagGain (StringParam tag, float gain)
 Set the gain control of all tracks with a specific tag.
void SetFrequencyRatio (float ratio)
 Set a mixer's master frequency ratio.
float GetFrequencyRatio ()
 Get a mixer's master frequency ratio.
GroupRef CreateGroup ()
 Create a mixing group.
void SetPostMixCallback (PostMixCallback cb, void *userdata)
 Set a callback that fires when all mixing has completed.
void SetPostMixCallback (PostMixCB cb)
 Set a callback that fires when all mixing has completed.
int Generate (TargetBytes buffer)
 Generate mixer output when not driving an audio device.
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< MixerRaw >
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< MixerRaw >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.
Protected Member Functions inherited from SDL::ResourceBaseT< MixerRaw >
constexpr ~ResourceBaseT ()=default
 Destructor.
constexpr ResourceBaseToperator= (const ResourceBaseT &)=default
 Assignment operator.

Detailed Description

Base class to Mixer.

See also
Mixer

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