5 #ifndef __RD_SDL_AUDIO_MANAGER_HPP__
6 #define __RD_SDL_AUDIO_MANAGER_HPP__
11 #include <SDL_mixer.h>
13 #include "AudioManager.hpp"
27 bool load(
const std::string& music_filepath,
const std::string&
id,
const int& type);
28 bool play(
const std::string &
id,
int loop);
49 static const std::string
id;
79 #endif //-- __RD_SDL_AUDIO_MANAGER_HPP__
bool load(const std::string &music_filepath, const std::string &id, const int &type)
Loads an audio file, assigning it a string as identifier.
Definition: SDLAudioManager.cpp:29
Music and sound effects manager.
Definition: AudioManager.hpp:28
virtual bool stop()
Stops the AudioManager.
Definition: SDLAudioManager.cpp:106
The main, catch-all namespace for Robot Devastation.
Definition: groups.dox:4
static const std::string id
String that identifies this manager.
Definition: SDLAudioManager.hpp:49
bool play(const std::string &id, int loop)
Plays a music/sound effect file previously loaded.
Definition: SDLAudioManager.cpp:59
bool stopMusic()
Stops the music being played currently.
Definition: SDLAudioManager.cpp:88
virtual bool start()
Start the AudioManager.
Definition: SDLAudioManager.cpp:100
Music and sound effects manager using SDL libraries.
Definition: SDLAudioManager.hpp:23
SDLAudioManager()
Constructor.
Definition: SDLAudioManager.cpp:17
static SDLAudioManager * uniqueInstance
Stores the unique instance of the AudioManager.
Definition: SDLAudioManager.hpp:65
static bool RegisterManager()
Register this manager in the AudioManager registry so that can be used.
Definition: SDLAudioManager.cpp:118
std::map< std::string, Mix_Chunk * > fx_sounds
Dictionary for the sound effects.
Definition: SDLAudioManager.hpp:68
std::map< std::string, Mix_Music * > music_sounds
Dictionary for the music tracks.
Definition: SDLAudioManager.hpp:71
virtual ~SDLAudioManager()
Destructor. Used to reset the local static reference after destroying this manager.
Definition: SDLAudioManager.cpp:128
virtual bool isStopped() const
True if the manager is not active.
Definition: SDLAudioManager.cpp:113