Replace float/UInt64 durations by a more precise Time class (#388)

Improve Clock class with atomic RestartIfOver method and allows to choose required precision
This commit is contained in:
Jérôme Leclercq
2022-12-29 21:31:46 +01:00
committed by GitHub
parent 1de5f65536
commit dd421a6385
84 changed files with 1278 additions and 663 deletions

View File

@@ -16,6 +16,7 @@
#include <Nazara/Core/ResourceLoader.hpp>
#include <Nazara/Core/ResourceManager.hpp>
#include <Nazara/Core/ResourceParameters.hpp>
#include <Nazara/Core/Time.hpp>
#include <memory>
#include <unordered_map>
@@ -52,7 +53,7 @@ namespace Nz
const std::shared_ptr<AudioBuffer>& GetAudioBuffer(AudioDevice* device);
inline UInt32 GetDuration() const;
inline Time GetDuration() const;
inline AudioFormat GetFormat() const;
inline const Int16* GetSamples() const;
inline UInt64 GetSampleCount() const;
@@ -76,7 +77,7 @@ namespace Nz
std::unordered_map<AudioDevice*, AudioDeviceEntry> m_audioBufferByDevice;
std::unique_ptr<Int16[]> m_samples;
AudioFormat m_format;
UInt32 m_duration;
Time m_duration;
UInt32 m_sampleRate;
UInt64 m_sampleCount;
};