libSDL2pp  0.16.0
C++11 bindings/wrapper for SDL2
Public Types | List of all members
SDL2pp::Mixer Class Reference

Audio mixer. More...

#include <SDL2pp/Mixer.hh>

Public Types

typedef void(* ChannelFinishedHandler) (int)
 Function type for channel finished callback.
 
typedef void(* MusicFinishedHandler) ()
 Function type for music finished callback.
 
typedef std::function< void(Uint8 *stream, int len)> MusicHook
 Custom music hook.
 

Public Member Functions

Construction and destruction
 Mixer (int frequency, Uint16 format, int channels, int chunksize)
 Construct a mixer and open an audio device. More...
 
 ~Mixer ()
 Destructor. More...
 
Copy and move
 Mixer (Mixer &&other) noexcept
 Move constructor. More...
 
Mixeroperator= (Mixer &&other) noexcept
 Move assignment operator. More...
 
 Mixer (const Mixer &other)=delete
 Deleted copy constructor. More...
 
Mixeroperator= (const Mixer &other)=delete
 Deleted assignment operator. More...
 
Channels: setup
int AllocateChannels (int numchans)
 Set the number of channels to mix. More...
 
int GetNumChannels () const
 Get the number of channels being mixed. More...
 
int SetVolume (int channel, int volume)
 Set the mix volume of a channel. More...
 
int GetVolume (int channel) const
 Get the mix volume of a channel. More...
 
Channels: playing
int PlayChannel (int channel, const Chunk &chunk, int loops=0)
 Play loop. More...
 
int PlayChannel (int channel, const Chunk &chunk, int loops, int ticks)
 Play loop and limit by time. More...
 
int FadeInChannel (int channel, const Chunk &chunk, int loops, int ms)
 Play loop with fade in. More...
 
int FadeInChannel (int channel, const Chunk &chunk, int loops, int ms, int ticks)
 loop with fade in and limit by time More...
 
Channels: pausing
void PauseChannel (int channel=-1)
 Pause a channel. More...
 
void ResumeChannel (int channel=-1)
 Resume a paused channel. More...
 
Channels: stopping
void HaltChannel (int channel=-1)
 Stop playing on a channel. More...
 
int ExpireChannel (int channel, int ticks)
 Change the timed stoppage of a channel. More...
 
int FadeOutChannel (int channel, int ms)
 Stop playing channel after timed fade out. More...
 
void SetChannelFinishedHandler (ChannelFinishedHandler channel_finished)
 Set callback for when channel finishes playing. More...
 
void RemoveChannelFinishedHandler ()
 Remove callback for when channel finishes playing. More...
 
Channels: info
int IsChannelPlaying (int channel) const
 Get the active playing status of a channel. More...
 
int IsChannelPaused (int channel) const
 Get the pause status of a channel. More...
 
Mix_Fading GetChannelFading (int which) const
 Get the fade status of a channel. More...
 
Groups: setup
int ReserveChannels (int num)
 Prevent channels from being used in default group. More...
 
void GroupChannel (int which, int tag)
 Add/remove channel to/from group. More...
 
void GroupChannels (int from, int to, int tag)
 Add/remove segment of channels to/from group. More...
 
Groups: info
int GetGroupNumChannels (int tag) const
 Get number of channels in group. More...
 
int GetGroupAvailableChannel (int tag) const
 Get first inactive channel in group. More...
 
int GetGroupOldestChannel (int tag) const
 Get oldest busy channel in group. More...
 
int GetGroupNewestChannel (int tag) const
 Get youngest busy channel in group. More...
 
Groups: stopping
int FadeOutGroup (int tag, int ms)
 Fade out a group over time. More...
 
void HaltGroup (int tag)
 Stop a group. More...
 
Music: playing
void PlayMusic (const Music &music, int loops=-1)
 Play music. More...
 
void FadeInMusic (const Music &music, int loops=-1, int ms=0)
 Play music, with looping, and fade in. More...
 
void SetMusicHook (MusicHook &&hook)
 Hook for a custom music player. More...
 
Music: settings
int SetMusicVolume (int volume)
 Set music volume. More...
 
int GetMusicVolume () const
 Get music volume. More...
 
void PauseMusic ()
 Pause music. More...
 
void ResumeMusic ()
 Resume paused music. More...
 
void RewindMusic ()
 Rewind music to beginning. More...
 
void SetMusicPosition (double position)
 Set position of playback in stream. More...
 
Music: stopping
void HaltMusic ()
 Stop music playback. More...
 
bool FadeOutMusic (int ms)
 Stop music, with fade out. More...
 
void SetMusicFinishedHandler (MusicFinishedHandler music_finished)
 Set a callback for when music stops. More...
 
void RemoveMusicFinishedHandler ()
 Remove a callback for when music stops. More...
 
Music: info
bool IsMusicPlaying () const
 Test whether music is playing. More...
 
bool IsMusicPaused () const
 Test whether music is paused. More...
 
Mix_Fading GetMusicFading () const
 Get status of current music fade activity. More...
 
Effects
void SetPanning (int channel, Uint8 left, Uint8 right)
 Stereo panning. More...
 
void UnsetPanning (int channel)
 Disable stereo panning. More...
 
void SetDistance (int channel, Uint8 distance)
 Distance attenuation (volume) More...
 
void UnsetDistance (int channel)
 Disable distance attenuation. More...
 
void SetPosition (int channel, Sint16 angle, Uint8 distance)
 Panning (angular) and distance. More...
 
void UnsetPosition (int channel)
 Disable panning and distance. More...
 
void SetReverseStereo (int channel)
 Swap stereo left and right. More...
 
void UnsetReverseStereo (int channel)
 Disable stereo swapping. More...
 

Detailed Description

Audio mixer.

This class represents open SDL_mixer audio device. Object of this class must be constructed before calling any other mixer functions.

Constructor & Destructor Documentation

◆ Mixer() [1/3]

SDL2pp::Mixer::Mixer ( int  frequency,
Uint16  format,
int  channels,
int  chunksize 
)

Construct a mixer and open an audio device.

Parameters
[in]frequencyOutput sampling frequency in samples per second (Hz). You might use MIX_DEFAULT_FREQUENCY(22050) since that is a good value for most games
[in]formatOutput sample format
[in]channelsNumber of sound channels in output. Set to 2 for stereo, 1 for mono. This has nothing to do with mixing channels
[in]chunksizeBytes used per output sample
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC11

◆ ~Mixer()

SDL2pp::Mixer::~Mixer ( )

◆ Mixer() [2/3]

SDL2pp::Mixer::Mixer ( Mixer &&  other)
noexcept

Move constructor.

Parameters
[in]otherSDL2pp::Mixer object to move data from

◆ Mixer() [3/3]

SDL2pp::Mixer::Mixer ( const Mixer other)
delete

Deleted copy constructor.

This class is not copyable

Member Function Documentation

◆ AllocateChannels()

int SDL2pp::Mixer::AllocateChannels ( int  numchans)

Set the number of channels to mix.

Parameters
[in]numchansNumber of channels to allocate for mixing
Returns
The number of channels allocated
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC26

◆ ExpireChannel()

int SDL2pp::Mixer::ExpireChannel ( int  channel,
int  ticks 
)

Change the timed stoppage of a channel.

Parameters
[in]channelChannel to stop playing, or -1 for all channels
[in]ticksMillisecons until channel(s) halt playback
Returns
Number of channels set to expire. Whether or not they are active
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC35

◆ FadeInChannel() [1/2]

int SDL2pp::Mixer::FadeInChannel ( int  channel,
const Chunk chunk,
int  loops,
int  ms 
)

Play loop with fade in.

Parameters
[in]channelChannel to play on, or -1 for the first free unreserved channel
[in]chunkSample to play
[in]loopsNumber of loops, -1 is infinite loops. Passing one here plays the sample twice (1 loop).
[in]msMilliseconds of time that the fade-in effect should take to go from silence to full volume
Returns
The channel the sample is played on
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC30

◆ FadeInChannel() [2/2]

int SDL2pp::Mixer::FadeInChannel ( int  channel,
const Chunk chunk,
int  loops,
int  ms,
int  ticks 
)

loop with fade in and limit by time

Parameters
[in]channelChannel to play on, or -1 for the first free unreserved channel
[in]chunkSample to play
[in]loopsNumber of loops, -1 is infinite loops. Passing one here plays the sample twice (1 loop).
[in]msMilliseconds of time that the fade-in effect should take to go from silence to full volume
[in]ticksMillisecond limit to play sample, at most. If not enough loops or the sample chunk is not long enough, then the sample may stop before this timeout occurs. -1 means play forever
Returns
The channel the sample is played on
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC31

◆ FadeInMusic()

void SDL2pp::Mixer::FadeInMusic ( const Music music,
int  loops = -1,
int  ms = 0 
)

Play music, with looping, and fade in.

Parameters
[in]musicMusic to play
[in]loopsnumber of times to play through the music. 0 plays the music zero times... -1 plays the music forever
[in]msMilliseconds for the fade-in effect to complete
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC57

◆ FadeOutChannel()

int SDL2pp::Mixer::FadeOutChannel ( int  channel,
int  ms 
)

Stop playing channel after timed fade out.

Parameters
[in]channelChannel to fade out, or -1 to fade all channels out
[in]msMilliseconds of time that the fade-out effect should take to go to silence, starting now
Returns
The number of channels set to fade out
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC36

◆ FadeOutGroup()

int SDL2pp::Mixer::FadeOutGroup ( int  tag,
int  ms 
)

Fade out a group over time.

Parameters
[in]tagGroup to fade out
[in]msMilliseconds of time that the fade-out effect should take to go to silence, starting now
Returns
The number of channels set to fade out
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC50

◆ FadeOutMusic()

bool SDL2pp::Mixer::FadeOutMusic ( int  ms)

Stop music, with fade out.

Parameters
[in]msMilliseconds of time that the fade-out effect should take to go to silence, starting now.
Returns
True in success, false on failure
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC68

◆ GetChannelFading()

Mix_Fading SDL2pp::Mixer::GetChannelFading ( int  which) const

Get the fade status of a channel.

Parameters
[in]whichChannel to get the fade activity status from
Returns
The fading status
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC40

◆ GetGroupAvailableChannel()

int SDL2pp::Mixer::GetGroupAvailableChannel ( int  tag) const

Get first inactive channel in group.

Parameters
[in]tagA group number
Returns
The channel found on success. -1 is returned when no channels in the group are available
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC47

◆ GetGroupNewestChannel()

int SDL2pp::Mixer::GetGroupNewestChannel ( int  tag) const

Get youngest busy channel in group.

Parameters
[in]tagA group number
Returns
The channel found on success. -1 is returned when no channels in the group are available
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC49

◆ GetGroupNumChannels()

int SDL2pp::Mixer::GetGroupNumChannels ( int  tag) const

Get number of channels in group.

Parameters
[in]tagA group number
Returns
The number of channels found in the group
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC46

◆ GetGroupOldestChannel()

int SDL2pp::Mixer::GetGroupOldestChannel ( int  tag) const

Get oldest busy channel in group.

Parameters
[in]tagA group number
Returns
The channel found on success. -1 is returned when no channels in the group are available
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC48

◆ GetMusicFading()

Mix_Fading SDL2pp::Mixer::GetMusicFading ( ) const

Get status of current music fade activity.

Returns
The fading status
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC73

◆ GetMusicVolume()

int SDL2pp::Mixer::GetMusicVolume ( ) const

Get music volume.

Returns
Current volume setting
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC61

◆ GetNumChannels()

int SDL2pp::Mixer::GetNumChannels ( ) const

Get the number of channels being mixed.

Returns
The number of channels allocated
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC26

◆ GetVolume()

int SDL2pp::Mixer::GetVolume ( int  channel) const

Get the mix volume of a channel.

Parameters
[in]channelChannel to set mix volume for. -1 will return the average volume.
Returns
Current volume of the channel. If channel is -1, the average volume is returned
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC27

◆ GroupChannel()

void SDL2pp::Mixer::GroupChannel ( int  which,
int  tag 
)

Add/remove channel to/from group.

Parameters
[in]whichChannel number to assign tag to.
[in]tagA group number. Any positive numbers (including zero). -1 is the default group. Use -1 to remove a group tag essentially.
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC44

◆ GroupChannels()

void SDL2pp::Mixer::GroupChannels ( int  from,
int  to,
int  tag 
)

Add/remove segment of channels to/from group.

Parameters
[in]fromFirst Channel number of channels to assign tag to.
[in]toLast Channel number of channels to assign tag to
[in]tagA group number. Any positive numbers (including zero). -1 is the default group. Use -1 to remove a group tag essentially.
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC45

◆ HaltChannel()

void SDL2pp::Mixer::HaltChannel ( int  channel = -1)

Stop playing on a channel.

Parameters
[in]channelChannel to stop playing, or -1 for all channels
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC34

◆ HaltGroup()

void SDL2pp::Mixer::HaltGroup ( int  tag)

Stop a group.

Parameters
[in]tagGroup to fade out
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC51

◆ HaltMusic()

void SDL2pp::Mixer::HaltMusic ( )

◆ IsChannelPaused()

int SDL2pp::Mixer::IsChannelPaused ( int  channel) const

Get the pause status of a channel.

Parameters
[in]channelChannel to test whether it is paused or not. -1 will tell you how many channels are playing
Returns
Zero if the channel is not paused. Otherwise if you passed in -1, the number of paused channels is returned. If you passed in a specific channel, then 1 is returned if it is paused.
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC39

◆ IsChannelPlaying()

int SDL2pp::Mixer::IsChannelPlaying ( int  channel) const

Get the active playing status of a channel.

Parameters
[in]channelChannel to test whether it is playing or not. -1 will tell you how many channels are playing
Returns
Zero if the channel is not playing. Otherwise if you passed in -1, the number of channels playing is returned. If you passed in a specific channel, then 1 is returned if it is playing.
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC38

◆ IsMusicPaused()

bool SDL2pp::Mixer::IsMusicPaused ( ) const

Test whether music is paused.

Returns
True if music is paused
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC72

◆ IsMusicPlaying()

bool SDL2pp::Mixer::IsMusicPlaying ( ) const

Test whether music is playing.

Returns
True if music is actively playing
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC71

◆ operator=() [1/2]

Mixer & SDL2pp::Mixer::operator= ( Mixer &&  other)
noexcept

Move assignment operator.

Parameters
[in]otherSDL2pp::Mixer object to move data from
Returns
Reference to self

◆ operator=() [2/2]

Mixer& SDL2pp::Mixer::operator= ( const Mixer other)
delete

Deleted assignment operator.

This class is not copyable

◆ PauseChannel()

void SDL2pp::Mixer::PauseChannel ( int  channel = -1)

Pause a channel.

Parameters
[in]channelChannel to pause on, or -1 for all channels
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC32

◆ PauseMusic()

void SDL2pp::Mixer::PauseMusic ( )

◆ PlayChannel() [1/2]

int SDL2pp::Mixer::PlayChannel ( int  channel,
const Chunk chunk,
int  loops = 0 
)

Play loop.

Parameters
[in]channelChannel to play on, or -1 for the first free unreserved channel
[in]chunkSample to play
[in]loopsNumber of loops, -1 is infinite loops. Passing one here plays the sample twice (1 loop).
Returns
The channel the sample is played on
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC28

◆ PlayChannel() [2/2]

int SDL2pp::Mixer::PlayChannel ( int  channel,
const Chunk chunk,
int  loops,
int  ticks 
)

Play loop and limit by time.

Parameters
[in]channelChannel to play on, or -1 for the first free unreserved channel
[in]chunkSample to play
[in]loopsNumber of loops, -1 is infinite loops. Passing one here plays the sample twice (1 loop).
[in]ticksMillisecond limit to play sample, at most. If not enough loops or the sample chunk is not long enough, then the sample may stop before this timeout occurs. -1 means play forever
Returns
The channel the sample is played on
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC29

◆ PlayMusic()

void SDL2pp::Mixer::PlayMusic ( const Music music,
int  loops = -1 
)

Play music.

Parameters
[in]musicMusic to play
[in]loopsnumber of times to play through the music. 0 plays the music zero times... -1 plays the music forever
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC57

◆ RemoveChannelFinishedHandler()

void SDL2pp::Mixer::RemoveChannelFinishedHandler ( )

Remove callback for when channel finishes playing.

See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC37

◆ RemoveMusicFinishedHandler()

void SDL2pp::Mixer::RemoveMusicFinishedHandler ( )

Remove a callback for when music stops.

See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC69

◆ ReserveChannels()

int SDL2pp::Mixer::ReserveChannels ( int  num)

Prevent channels from being used in default group.

Parameters
[in]numNumber of channels to reserve from default mixing. Zero removes all reservations
Returns
The number of channels reserved. Never fails, but may return less channels than you ask for, depending on the number of channels previously allocated
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC43

◆ ResumeChannel()

void SDL2pp::Mixer::ResumeChannel ( int  channel = -1)

Resume a paused channel.

Parameters
[in]channelChannel to resume playing, or -1 for all channels
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC33

◆ ResumeMusic()

void SDL2pp::Mixer::ResumeMusic ( )

◆ RewindMusic()

void SDL2pp::Mixer::RewindMusic ( )

◆ SetChannelFinishedHandler()

void SDL2pp::Mixer::SetChannelFinishedHandler ( ChannelFinishedHandler  channel_finished)

Set callback for when channel finishes playing.

Parameters
[in]channel_finishedFunction to call when any channel finishes playback
Note
Since Mix_ChannelFinished doesn't take any custom data pointer, unfortunately there's no safe way of using std::function here.
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC37

◆ SetDistance()

void SDL2pp::Mixer::SetDistance ( int  channel,
Uint8  distance 
)

Distance attenuation (volume)

Parameters
[in]channelChannel number to register this effect on or MIX_CHANNEL_POST to process the postmix stream
[in]distanceSpecify the distance from the listener, from 0 (close/loud) to 255 (far/quiet)
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC81

◆ SetMusicFinishedHandler()

void SDL2pp::Mixer::SetMusicFinishedHandler ( MusicFinishedHandler  music_finished)

Set a callback for when music stops.

Parameters
[in]music_finishedFunction to call when music stops
Note
Since Mix_HookMusicFinished doesn't take any custom data pointer, unfortunately there's no safe way of using std::function here.
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC69

◆ SetMusicHook()

void SDL2pp::Mixer::SetMusicHook ( MusicHook &&  hook)

Hook for a custom music player.

Parameters
[in]hookMusic player mixer function
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC60

◆ SetMusicPosition()

void SDL2pp::Mixer::SetMusicPosition ( double  position)

Set position of playback in stream.

Parameters
[in]positionPosistion to play from
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC65

◆ SetMusicVolume()

int SDL2pp::Mixer::SetMusicVolume ( int  volume)

Set music volume.

Parameters
[in]volumeThe volume to use from 0 to MIX_MAX_VOLUME(128)
Returns
The previous volume setting
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC61

◆ SetPanning()

void SDL2pp::Mixer::SetPanning ( int  channel,
Uint8  left,
Uint8  right 
)

Stereo panning.

Parameters
[in]channelChannel number to register this effect on or MIX_CHANNEL_POST to process the postmix stream
[in]leftVolume for the left channel, range is 0 (silence) to 255 (loud)
[in]rightVolume for the right channel, range is 0 (silence) to 255 (loud)
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC80

◆ SetPosition()

void SDL2pp::Mixer::SetPosition ( int  channel,
Sint16  angle,
Uint8  distance 
)

Panning (angular) and distance.

Parameters
[in]channelChannel number to register this effect on or MIX_CHANNEL_POST to process the postmix stream
[in]angleDirection in relation to forward from 0 to 360 degrees. Larger angles will be reduced to this range using angles % 360. 0 = directly in front, 90 = directly to the right etc.
[in]distanceSpecify the distance from the listener, from 0 (close/loud) to 255 (far/quiet)
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC82

◆ SetReverseStereo()

void SDL2pp::Mixer::SetReverseStereo ( int  channel)

Swap stereo left and right.

Parameters
[in]channelChannel number to register this effect on or MIX_CHANNEL_POST to process the postmix stream
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC83

◆ SetVolume()

int SDL2pp::Mixer::SetVolume ( int  channel,
int  volume 
)

Set the mix volume of a channel.

Parameters
[in]channelChannel to set mix volume for. -1 will set the volume for all allocated channels.
[in]volumeThe volume to use from 0 to MIX_MAX_VOLUME(128)
Returns
Current volume of the channel. If channel is -1, the average volume is returned
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC27

◆ UnsetDistance()

void SDL2pp::Mixer::UnsetDistance ( int  channel)

Disable distance attenuation.

Parameters
[in]channelChannel number to unregister this effect from or MIX_CHANNEL_POST to unregister from the postmix stream
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC81

◆ UnsetPanning()

void SDL2pp::Mixer::UnsetPanning ( int  channel)

Disable stereo panning.

Parameters
[in]channelChannel number to unregister this effect from or MIX_CHANNEL_POST to unregister from the postmix stream
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC80

◆ UnsetPosition()

void SDL2pp::Mixer::UnsetPosition ( int  channel)

Disable panning and distance.

Parameters
[in]channelChannel number to unregister this effect from or MIX_CHANNEL_POST to unregister from the postmix stream
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC82

◆ UnsetReverseStereo()

void SDL2pp::Mixer::UnsetReverseStereo ( int  channel)

Disable stereo swapping.

Parameters
[in]channelChannel number to unregister this effect from or MIX_CHANNEL_POST to unregister from the postmix stream
Exceptions
SDL2pp::Exception
See also
https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC83

The documentation for this class was generated from the following files: