8#ifndef __SOUND__HPP_H__
9#define __SOUND__HPP_H__
52 int loadWav(
const std::string &filename);
59 int loadMusic(
const std::string &filename);
76 int playWav(
int id,
int value = 0,
int channel = 0);
93 std::vector<Mix_Chunk *>
wav;
void init()
Open the audio device (called automatically by constructor).
int playWav(int id, int value=0, int channel=0)
Play a previously loaded WAV chunk.
std::vector< Mix_Chunk * > wav
Loaded WAV chunks.
Mixer(const Mixer &)=delete
void cleanup()
Free all loaded audio chunks and music tracks.
bool isPlaying(int channel) const
Query whether a mixer channel is currently playing.
Mixer & operator=(const Mixer &)=delete
bool init_
Whether the audio device is open.
Mixer & operator=(Mixer &&)=delete
int playMusic(int id, int value=0)
Start playing a previously loaded music track.
Mixer()
Initialise SDL_mixer and open the audio device.
std::vector< Mix_Music * > files
Loaded music tracks.
void stopMusic()
Stop background music playback immediately.
int loadWav(const std::string &filename)
Load a WAV file as a sound effect chunk.
int loadMusic(const std::string &filename)
Load an audio file as streaming background music.
~Mixer()
Halt all playback and free all loaded audio resources.
Compile-time feature flags and version macros for libmx.