1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-09 12:22:34 +01:00

Implemented playMusic method

This commit is contained in:
Timmy Sjöstedt 2016-05-27 14:29:14 +02:00
parent 6a14dc3e02
commit 861dbf0c2a
4 changed files with 11 additions and 0 deletions

View File

@ -49,6 +49,7 @@ public:
~MADStream();
bool openFromFile(const std::string& loc);
void play();
};
#endif

View File

@ -25,6 +25,7 @@ public:
bool playBackground(const std::string& fileName);
bool loadMusic(const std::string& name, const std::string& fileName);
void playMusic(const std::string& name);
void pause(bool p);

View File

@ -148,3 +148,8 @@ bool MADStream::openFromFile(const std::string& loc)
return true;
}
void MADStream::play()
{
alCheck(alSourcePlay(alSource));
}

View File

@ -132,6 +132,10 @@ bool SoundManager::loadMusic(const std::string& name, const std::string& fileNam
musics.emplace(std::piecewise_construct, std::forward_as_tuple(name), std::forward_as_tuple());
return musics[name].openFromFile(fileName);
}
void SoundManager::playMusic(const std::string& name)
{
musics[name].play();
}
void SoundManager::pause(bool p)
{