2012-10-13 18:29:53 +00:00
|
|
|
#ifndef _AUDIOMANAGER_H_
|
|
|
|
#define _AUDIOMANAGER_H_
|
|
|
|
|
2013-05-14 19:31:39 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <memory>
|
2012-10-13 18:29:53 +00:00
|
|
|
|
2013-05-14 19:31:39 +00:00
|
|
|
#include "SDL_audio.h"
|
|
|
|
|
|
|
|
#include "Sound.h"
|
|
|
|
|
|
|
|
|
|
|
|
class AudioManager
|
2012-10-13 18:29:53 +00:00
|
|
|
{
|
2013-05-14 19:31:39 +00:00
|
|
|
static SDL_AudioSpec sAudioFormat;
|
|
|
|
static std::vector<std::shared_ptr<Sound>> sSoundVector;
|
|
|
|
static std::shared_ptr<AudioManager> sInstance;
|
|
|
|
|
|
|
|
static void mixAudio(void *unused, Uint8 *stream, int len);
|
|
|
|
|
|
|
|
AudioManager();
|
|
|
|
|
|
|
|
public:
|
|
|
|
static void registerSound(std::shared_ptr<Sound> & sound);
|
|
|
|
static void unregisterSound(std::shared_ptr<Sound> & sound);
|
2012-10-13 18:29:53 +00:00
|
|
|
|
2013-05-14 19:31:39 +00:00
|
|
|
static void play();
|
2012-10-13 18:29:53 +00:00
|
|
|
|
2013-05-14 19:31:39 +00:00
|
|
|
virtual ~AudioManager();
|
|
|
|
};
|
2012-10-13 18:29:53 +00:00
|
|
|
|
|
|
|
#endif
|