Core: Add MovablePtr class
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Audio/Enums.hpp>
|
||||
#include <Nazara/Audio/SoundEmitter.hpp>
|
||||
#include <Nazara/Core/MovablePtr.hpp>
|
||||
#include <Nazara/Core/Resource.hpp>
|
||||
#include <Nazara/Core/ResourceLoader.hpp>
|
||||
#include <Nazara/Core/ResourceParameters.hpp>
|
||||
@@ -37,7 +38,7 @@ namespace Nz
|
||||
public:
|
||||
Music() = default;
|
||||
Music(const Music&) = delete;
|
||||
Music(Music&&) = delete; ///TODO
|
||||
Music(Music&&) noexcept = default;
|
||||
~Music();
|
||||
|
||||
bool Create(SoundStream* soundStream);
|
||||
@@ -66,10 +67,10 @@ namespace Nz
|
||||
void Stop() override;
|
||||
|
||||
Music& operator=(const Music&) = delete;
|
||||
Music& operator=(Music&&) = delete; ///TODO
|
||||
Music& operator=(Music&&) noexcept = default;
|
||||
|
||||
private:
|
||||
MusicImpl* m_impl = nullptr;
|
||||
MovablePtr<MusicImpl> m_impl = nullptr;
|
||||
|
||||
bool FillAndQueueBuffer(unsigned int buffer);
|
||||
void MusicThread();
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Audio/Config.hpp>
|
||||
#include <Nazara/Audio/Enums.hpp>
|
||||
#include <Nazara/Core/MovablePtr.hpp>
|
||||
#include <Nazara/Core/ObjectRef.hpp>
|
||||
#include <Nazara/Core/ObjectLibrary.hpp>
|
||||
#include <Nazara/Core/RefCounted.hpp>
|
||||
@@ -52,7 +53,7 @@ namespace Nz
|
||||
SoundBuffer() = default;
|
||||
SoundBuffer(AudioFormat format, UInt64 sampleCount, UInt32 sampleRate, const Int16* samples);
|
||||
SoundBuffer(const SoundBuffer&) = delete;
|
||||
SoundBuffer(SoundBuffer&&) = delete;
|
||||
SoundBuffer(SoundBuffer&&) noexcept = default;
|
||||
~SoundBuffer();
|
||||
|
||||
bool Create(AudioFormat format, UInt64 sampleCount, UInt32 sampleRate, const Int16* samples);
|
||||
@@ -74,7 +75,7 @@ namespace Nz
|
||||
template<typename... Args> static SoundBufferRef New(Args&&... args);
|
||||
|
||||
SoundBuffer& operator=(const SoundBuffer&) = delete;
|
||||
SoundBuffer& operator=(SoundBuffer&&) = delete; ///TODO
|
||||
SoundBuffer& operator=(SoundBuffer&&) noexcept = default;
|
||||
|
||||
// Signals:
|
||||
NazaraSignal(OnSoundBufferDestroy, const SoundBuffer* /*soundBuffer*/);
|
||||
@@ -86,7 +87,7 @@ namespace Nz
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
SoundBufferImpl* m_impl = nullptr;
|
||||
MovablePtr<SoundBufferImpl> m_impl = nullptr;
|
||||
|
||||
static SoundBufferLibrary::LibraryMap s_library;
|
||||
static SoundBufferLoader::LoaderList s_loaders;
|
||||
|
||||
Reference in New Issue
Block a user