mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-12-18 02:05:38 +00:00
edc26aa4e1
Add volume control int Windows through the mixer API (until XP) and the EndpointVolume API (Vista and above). Add volume control in Linux through ALSA. Convert AudioManager to use shared_ptrs.
38 lines
648 B
C++
38 lines
648 B
C++
#ifndef _AUDIOMANAGER_H_
|
|
#define _AUDIOMANAGER_H_
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
|
|
#include "SDL_audio.h"
|
|
|
|
#include "Sound.h"
|
|
|
|
|
|
class AudioManager
|
|
{
|
|
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 std::shared_ptr<AudioManager> & getInstance();
|
|
|
|
void init();
|
|
void deinit();
|
|
|
|
void registerSound(std::shared_ptr<Sound> & sound);
|
|
void unregisterSound(std::shared_ptr<Sound> & sound);
|
|
|
|
void play();
|
|
void stop();
|
|
|
|
virtual ~AudioManager();
|
|
};
|
|
|
|
#endif
|