1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-19 17:01:44 +02:00

Implemented pauseSound method

This commit is contained in:
Timmy Sjöstedt 2016-05-24 23:33:30 +02:00
parent ad137421fb
commit 2bf0500a34
2 changed files with 7 additions and 0 deletions

View File

@ -17,6 +17,7 @@ public:
bool loadSound(const std::string& name, const std::string& fileName);
bool isLoaded(const std::string& name);
void playSound(const std::string& name);
void pauseSound(const std::string& name);
bool isPlaying(const std::string& name);
bool playBackground(const std::string& fileName);

View File

@ -105,6 +105,12 @@ void SoundManager::playSound(const std::string& name)
alSourcePlay(sounds[name].buffer.source);
}
}
void SoundManager::pauseSound(const std::string& name)
{
if (sounds.find(name) != sounds.end()) {
alSourcePause(sounds[name].buffer.source);
}
}
bool SoundManager::isPlaying(const std::string& name)
{
if (sounds.find(name) != sounds.end()) {