diff --git a/include/Nazara/Audio/Sound.hpp b/include/Nazara/Audio/Sound.hpp index 11cb1c966..a7fba9f47 100644 --- a/include/Nazara/Audio/Sound.hpp +++ b/include/Nazara/Audio/Sound.hpp @@ -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()); diff --git a/src/Nazara/Audio/Sound.cpp b/src/Nazara/Audio/Sound.cpp index 8f507afbc..0ecdb8b0d 100644 --- a/src/Nazara/Audio/Sound.cpp +++ b/src/Nazara/Audio/Sound.cpp @@ -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 buffer(new NzSoundBuffer);