34 lines
723 B
C++
34 lines
723 B
C++
#ifndef _H_AUDIO_ENGINE_H
|
|
#define _H_AUDIO_ENGINE_H
|
|
|
|
#include <AL/al.h>
|
|
#include <AL/alc.h>
|
|
#include <memory>
|
|
|
|
#include "utility/events.h"
|
|
#include "sound/audiostream.h"
|
|
#include "utility/resourcemanager.h"
|
|
#include "utility/logger.h"
|
|
|
|
class AudioEngine
|
|
{
|
|
public:
|
|
AudioEngine(std::weak_ptr<ResourceManager> _resource);
|
|
|
|
void hookEventManager(std::weak_ptr<EventManager> _events);
|
|
void pushMusic(std::string _songName);
|
|
void playMusic();
|
|
void pauseMusic();
|
|
void killMusic();
|
|
|
|
~AudioEngine();
|
|
private:
|
|
std::unique_ptr<AudioStream> musicPlayer;
|
|
std::weak_ptr<EventManager> globalEventManager;
|
|
std::weak_ptr<ResourceManager> resourceManager;
|
|
ALCdevice *device;
|
|
ALCcontext *context;
|
|
};
|
|
|
|
|
|
#endif // _H_AUDIO_ENGINE_H
|