// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // 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_AUDIO_SOUND_HPP #define NAZARA_AUDIO_SOUND_HPP #include #include #include #include namespace Nz { class NAZARA_AUDIO_API Sound : public SoundEmitter { public: Sound() = default; Sound(std::shared_ptr soundBuffer); Sound(const Sound&) = default; Sound(Sound&&) noexcept = default; ~Sound(); void EnableLooping(bool loop) override; const std::shared_ptr& GetBuffer() const; UInt32 GetDuration() const override; UInt32 GetPlayingOffset() const override; SoundStatus GetStatus() const override; bool IsLooping() const override; bool IsPlayable() 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()); bool LoadFromStream(Stream& stream, const SoundBufferParams& params = SoundBufferParams()); void Pause() override; void Play() override; void SetBuffer(std::shared_ptr soundBuffer); void SetPlayingOffset(UInt32 offset); void Stop() override; Sound& operator=(const Sound&) = delete; ///TODO? Sound& operator=(Sound&&) noexcept = default; private: std::shared_ptr m_buffer; }; } #endif // NAZARA_AUDIO_SOUND_HPP