mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-13 19:49:36 +00:00
Refactor audio buffering API, this should mainly prevent SDL audio driver from allocating memory in the mixer callback.
This commit is contained in:
8
GpCommon/IGpAudioBuffer.h
Normal file
8
GpCommon/IGpAudioBuffer.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
struct IGpAudioBuffer
|
||||
{
|
||||
public:
|
||||
virtual void AddRef() = 0;
|
||||
virtual void Release() = 0;
|
||||
};
|
||||
@@ -3,11 +3,12 @@
|
||||
#include <stddef.h>
|
||||
|
||||
struct IGpAudioChannelCallbacks;
|
||||
struct IGpAudioBuffer;
|
||||
|
||||
struct IGpAudioChannel
|
||||
{
|
||||
virtual void SetAudioChannelContext(IGpAudioChannelCallbacks *callbacks) = 0;
|
||||
virtual void PostBuffer(const void *buffer, size_t bufferSize) = 0;
|
||||
virtual bool PostBuffer(IGpAudioBuffer *buffer) = 0;
|
||||
virtual void Stop() = 0;
|
||||
virtual void Destroy() = 0;
|
||||
};
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
|
||||
struct IGpAudioChannel;
|
||||
struct IGpPrefsHandler;
|
||||
struct IGpAudioBuffer;
|
||||
|
||||
struct IGpAudioDriver
|
||||
{
|
||||
public:
|
||||
virtual IGpAudioBuffer *CreateBuffer(const void *buffer, size_t bufferSize) = 0;
|
||||
virtual IGpAudioChannel *CreateChannel() = 0;
|
||||
|
||||
virtual void SetMasterVolume(uint32_t vol, uint32_t maxVolume) = 0;
|
||||
|
||||
Reference in New Issue
Block a user