2015-12-03 00:37:02 +00:00
|
|
|
#ifndef UTIL_SOUND_MIXER_H
|
|
|
|
#define UTIL_SOUND_MIXER_H
|
|
|
|
|
|
|
|
#include <SDL_sound.h>
|
|
|
|
#include <SDL_mixer.h>
|
|
|
|
#include "sound_device.h"
|
|
|
|
#include "Singleton.h"
|
|
|
|
|
|
|
|
namespace Audio {
|
|
|
|
class Mixer {
|
|
|
|
public:
|
|
|
|
Mixer();
|
|
|
|
~Mixer();
|
|
|
|
|
|
|
|
Audio::SoundDevice device;
|
|
|
|
|
|
|
|
int setVolume(int channel, int volume);
|
|
|
|
int setVolumeMusic();
|
|
|
|
int getVolume(int channel);
|
|
|
|
int getVolumeMusic();
|
|
|
|
|
|
|
|
void playSample(const size_t & sampleId);
|
|
|
|
|
|
|
|
void pause(int channel);
|
|
|
|
void pauseMusic();
|
|
|
|
private:
|
|
|
|
inline bool checkDeviceOK() { return (device.getStatus() ==
|
|
|
|
Audio::SoundDevice::OPEN); }
|
|
|
|
};
|
|
|
|
|
2018-09-23 05:57:34 +00:00
|
|
|
typedef Loki::SingletonHolder<Mixer> MixerHolder;
|
2015-12-03 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|