2015-01-11 21:00:56 +01:00
|
|
|
#pragma once
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2013-07-28 21:01:49 -07:00
|
|
|
#include "Common/CommonWindows.h"
|
2015-01-24 13:50:27 +01:00
|
|
|
#include "Core/Config.h"
|
2012-11-17 22:44:29 +00:00
|
|
|
|
2015-01-11 14:11:09 +01:00
|
|
|
typedef int (*StreamCallback)(short *buffer, int numSamples, int bits, int rate, int channels);
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2015-01-11 21:44:31 +01:00
|
|
|
// Note that the backend may override the passed in sample rate. The actual sample rate
|
|
|
|
// should be returned by GetSampleRate though.
|
2015-01-11 21:00:56 +01:00
|
|
|
class WindowsAudioBackend {
|
|
|
|
public:
|
|
|
|
WindowsAudioBackend() {}
|
|
|
|
virtual ~WindowsAudioBackend() {}
|
|
|
|
virtual bool Init(HWND window, StreamCallback _callback, int sampleRate) = 0;
|
|
|
|
virtual void Update() {} // Doesn't have to do anything
|
|
|
|
virtual int GetSampleRate() = 0;
|
|
|
|
};
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2015-01-11 21:00:56 +01:00
|
|
|
// Factory
|
|
|
|
WindowsAudioBackend *CreateAudioBackend(AudioBackendType type);
|