CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/WASAPIStream.h
Views: 1401
1
#pragma once
2
3
#include <atomic>
4
#include "WindowsAudio.h"
5
6
// This should only be included from WindowsAudio.cpp and WASAPIStream.cpp.
7
8
class WASAPIAudioBackend : public WindowsAudioBackend {
9
public:
10
WASAPIAudioBackend();
11
~WASAPIAudioBackend();
12
13
bool Init(HWND window, StreamCallback callback, int sampleRate) override; // If fails, can safely delete the object
14
int GetSampleRate() const override { return sampleRate_; }
15
16
private:
17
int RunThread();
18
static unsigned int WINAPI soundThread(void *param);
19
20
HANDLE hThread_ = nullptr;
21
StreamCallback callback_ = nullptr;
22
int sampleRate_ = 0;
23
std::atomic<int> threadData_;
24
};
25
26