Audio: Handle AudioBuffer compatibility
OpenAL buffers are shared between contextes
This commit is contained in:
@@ -29,6 +29,8 @@ namespace Nz
|
||||
virtual UInt32 GetSize() const = 0;
|
||||
virtual UInt32 GetSampleRate() const = 0;
|
||||
|
||||
virtual bool IsCompatibleWith(const AudioDevice& device) const = 0;
|
||||
|
||||
virtual bool Reset(AudioFormat format, UInt64 sampleCount, UInt32 sampleRate, const void* samples) = 0;
|
||||
|
||||
AudioBuffer& operator=(const AudioBuffer&) = default;
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace Nz
|
||||
virtual Quaternionf GetListenerRotation() const = 0;
|
||||
virtual Vector3f GetListenerVelocity() const = 0;
|
||||
virtual float GetSpeedOfSound() const = 0;
|
||||
virtual const void* GetSubSystemIdentifier() const = 0;
|
||||
|
||||
virtual bool IsFormatSupported(AudioFormat format) const = 0;
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace Nz
|
||||
UInt32 GetSize() const override;
|
||||
UInt32 GetSampleRate() const override;
|
||||
|
||||
bool IsCompatibleWith(const AudioDevice& device) const override;
|
||||
|
||||
bool Reset(AudioFormat format, UInt64 sampleCount, UInt32 sampleRate, const void* samples) override;
|
||||
|
||||
OpenALBuffer& operator=(const OpenALBuffer&) = delete;
|
||||
|
||||
@@ -39,9 +39,10 @@ namespace Nz
|
||||
float GetGlobalVolume() const override;
|
||||
Vector3f GetListenerDirection(Vector3f* up = nullptr) const override;
|
||||
Vector3f GetListenerPosition() const override;
|
||||
Quaternionf GetListenerRotation(Vector3f* up = nullptr) const override;
|
||||
Quaternionf GetListenerRotation() const override;
|
||||
Vector3f GetListenerVelocity() const override;
|
||||
float GetSpeedOfSound() const override;
|
||||
const void* GetSubSystemIdentifier() const override;
|
||||
|
||||
bool IsFormatSupported(AudioFormat format) const override;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Nz
|
||||
SoundBuffer(SoundBuffer&&) = delete;
|
||||
~SoundBuffer() = default;
|
||||
|
||||
const std::shared_ptr<AudioBuffer>& GetBuffer(AudioDevice* device);
|
||||
const std::shared_ptr<AudioBuffer>& GetAudioBuffer(AudioDevice* device);
|
||||
|
||||
inline UInt32 GetDuration() const;
|
||||
inline AudioFormat GetFormat() const;
|
||||
|
||||
Reference in New Issue
Block a user