Audio: Minor fixes

This commit is contained in:
Jérôme Leclercq
2021-05-29 19:34:51 +02:00
parent d121393267
commit 28f1d8aa76
6 changed files with 27 additions and 13 deletions

View File

@@ -32,7 +32,6 @@ namespace Nz
bool IsLooping() const override;
bool IsPlayable() const;
bool IsPlaying() const;
bool LoadFromFile(const std::filesystem::path& filePath, const SoundBufferParams& params = SoundBufferParams());
bool LoadFromMemory(const void* data, std::size_t size, const SoundBufferParams& params = SoundBufferParams());

View File

@@ -37,6 +37,7 @@ namespace Nz
float GetVolume() const;
virtual bool IsLooping() const = 0;
inline bool IsPlaying() const;
bool IsSpatialized() const;
virtual void Pause() = 0;
@@ -67,4 +68,7 @@ namespace Nz
unsigned int m_source;
};
}
#include <Nazara/Audio/SoundEmitter.inl>
#endif // NAZARA_SOUNDEMITTER_HPP

View File

@@ -0,0 +1,20 @@
// Copyright (C) 2020 Jérôme Leclercq
// This file is part of the "Nazara Engine - Audio module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Audio/SoundEmitter.hpp>
#include <Nazara/Audio/Debug.hpp>
namespace Nz
{
/*!
* \brief Checks whether the sound is playing
* \return true if it is the case
*/
bool SoundEmitter::IsPlaying() const
{
return GetStatus() == SoundStatus::Playing;
}
}
#include <Nazara/Audio/DebugOff.hpp>