| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "SoundShader.h" |
| 4 |
#include "SoundPlayer.h" |
| 5 |
|
| 6 |
#include "isound.h" |
| 7 |
#include "icommandsystem.h" |
| 8 |
|
| 9 |
namespace sound |
| 10 |
{ |
| 11 |
|
| 12 |
/// SoundManager implementing class. |
| 13 |
class SoundManager final : |
| 14 |
public ISoundManager |
| 15 |
{ |
| 16 |
private: |
| 17 |
SoundShader::Ptr _emptyShader; |
| 18 |
|
| 19 |
// The helper class for playing the sounds |
| 20 |
std::unique_ptr<SoundPlayer> _soundPlayer; |
| 21 |
|
| 22 |
sigc::signal<void> _sigSoundShadersReloaded; |
| 23 |
|
| 24 |
public: |
| 25 |
SoundManager(); |
| 26 |
|
| 27 |
// ISoundManager implementation |
| 28 |
void forEachShader(std::function<void(const ISoundShader::Ptr&)>) override; |
| 29 |
ISoundShader::Ptr getSoundShader(const std::string& shaderName) override; |
| 30 |
bool playSound(const std::string& fileName) override; |
| 31 |
bool playSound(const std::string& fileName, bool loopSound) override; |
| 32 |
void stopSound() override; |
| 33 |
void reloadSounds() override; |
| 34 |
float getSoundFileDuration(const std::string& vfsPath) override; |
| 35 |
|
| 36 |
// RegisterableModule implementation |
| 37 |
const std::string& getName() const override; |
| 38 |
const StringSet& getDependencies() const override; |
| 39 |
void initialiseModule(const IApplicationContext& ctx) override; |
| 40 |
}; |
| 41 |
|
| 42 |
} |