Files
Aerofoil/PortabilityLayer/PLSound.h

31 lines
666 B
C
Raw Normal View History

2019-11-11 00:11:59 -05:00
#pragma once
#include "PLCore.h"
2019-12-31 04:49:38 -05:00
namespace PortabilityLayer
2019-11-11 00:11:59 -05:00
{
2019-12-31 04:49:38 -05:00
struct AudioChannel;
typedef void (*AudioChannelCallback_t)(PortabilityLayer::AudioChannel *channel);
struct AudioChannel
{
virtual void Destroy(bool wait) = 0;
virtual bool AddBuffer(const void *lengthTaggedBuffer, bool blocking) = 0;
2019-12-31 04:49:38 -05:00
virtual bool AddCallback(AudioChannelCallback_t callback, bool blocking) = 0;
virtual void ClearAllCommands() = 0;
virtual void Stop() = 0;
};
class SoundSystem
{
public:
virtual AudioChannel *CreateChannel() = 0;
virtual void SetVolume(uint8_t vol) = 0;
virtual uint8_t GetVolume() const = 0;
static SoundSystem *GetInstance();
};
}