Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/Audio/PortAudio/PortAudioDevice.hpp
1175 views
1
#define LockAudioDevice()
2
#define UnlockAudioDevice()
3
4
#include <thread>
5
6
namespace RSDK
7
{
8
class AudioDevice : public AudioDeviceBase
9
{
10
public:
11
static PaStream *stream;
12
13
static bool32 Init();
14
static void Release();
15
16
static void FrameInit() {}
17
18
inline static void HandleStreamLoad(ChannelInfo *channel, bool32 async)
19
{
20
if (async) {
21
std::thread thread(LoadStream, channel);
22
thread.detach();
23
}
24
else
25
LoadStream(channel);
26
}
27
28
private:
29
static uint8 contextInitialized;
30
31
static void InitAudioChannels();
32
33
static int AudioCallback(const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo,
34
PaStreamCallbackFlags statusFlags, void *userData);
35
};
36
} // namespace RSDK
37