mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
21bd50dcb0
Might as well sleep for a short period instead, same effect really.
25 lines
630 B
C++
25 lines
630 B
C++
#pragma once
|
|
|
|
#include <atomic>
|
|
#include "WindowsAudio.h"
|
|
|
|
// This should only be included from WindowsAudio.cpp and WASAPIStream.cpp.
|
|
|
|
class WASAPIAudioBackend : public WindowsAudioBackend {
|
|
public:
|
|
WASAPIAudioBackend();
|
|
~WASAPIAudioBackend();
|
|
|
|
bool Init(HWND window, StreamCallback callback, int sampleRate) override; // If fails, can safely delete the object
|
|
int GetSampleRate() const override { return sampleRate_; }
|
|
|
|
private:
|
|
int RunThread();
|
|
static unsigned int WINAPI soundThread(void *param);
|
|
|
|
HANDLE hThread_ = nullptr;
|
|
StreamCallback callback_ = nullptr;
|
|
int sampleRate_ = 0;
|
|
std::atomic<int> threadData_;
|
|
};
|