Added Sound::Is[Playable|Playing]

Former-commit-id: 526edb3f87884f45c6b677f44329a90457d3444b
This commit is contained in:
Lynix 2013-12-20 19:36:36 +01:00
parent bd98490d9f
commit 4f671db265
2 changed files with 12 additions and 0 deletions

View File

@ -28,6 +28,8 @@ class NAZARA_API NzSound : public NzSoundEmitter
nzSoundStatus GetStatus() const;
bool IsLooping() const;
bool IsPlayable() const;
bool IsPlaying() const;
bool LoadFromFile(const NzString& filePath, const NzSoundBufferParams& params = NzSoundBufferParams());
bool LoadFromMemory(const void* data, std::size_t size, const NzSoundBufferParams& params = NzSoundBufferParams());

View File

@ -72,6 +72,16 @@ bool NzSound::IsLooping() const
return loop != AL_FALSE;
}
bool NzSound::IsPlayable() const
{
return m_buffer != nullptr;
}
bool NzSound::IsPlaying() const
{
return GetStatus() == nzSoundStatus_Playing;
}
bool NzSound::LoadFromFile(const NzString& filePath, const NzSoundBufferParams& params)
{
std::unique_ptr<NzSoundBuffer> buffer(new NzSoundBuffer);