// Copyright (C) 2012 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 #pragma once #ifndef NAZARA_SOUND_HPP #define NAZARA_SOUND_HPP #include #include #include #include class NAZARA_API NzSound : public NzSoundEmitter { public: NzSound() = default; NzSound(const NzSoundBuffer* soundBuffer); NzSound(const NzSound& sound); ~NzSound(); void EnableLooping(bool loop); const NzSoundBuffer* GetBuffer() const; nzUInt32 GetDuration() const; nzUInt32 GetPlayingOffset() const; nzSoundStatus GetStatus() const; bool IsLooping() const; bool LoadFromFile(const NzString& filePath, const NzSoundBufferParams& params = NzSoundBufferParams()); bool LoadFromMemory(const void* data, std::size_t size, const NzSoundBufferParams& params = NzSoundBufferParams()); bool LoadFromStream(NzInputStream& stream, const NzSoundBufferParams& params = NzSoundBufferParams()); void Pause(); bool Play(); void SetBuffer(const NzSoundBuffer* buffer); void SetPlayingOffset(nzUInt32 offset); void Stop(); private: const NzSoundBuffer* m_buffer = nullptr; }; #endif // NAZARA_SOUND_HPP