MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / winMMThread

Function winMMThread

extlibs/soloud/src/backend/winmm/soloud_winmm.cpp:64–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 };
63
64 static void winMMThread(LPVOID aParam)
65 {
66 SoLoudWinMMData *data = static_cast<SoLoudWinMMData*>(aParam);
67 while (WAIT_OBJECT_0 != WaitForSingleObject(data->audioProcessingDoneEvent, 0))
68 {
69 for (int i=0;i<BUFFER_COUNT;++i)
70 {
71 if (0 != (data->header[i].dwFlags & WHDR_INQUEUE))
72 {
73 continue;
74 }
75 short *tgtBuf = data->sampleBuffer[i];
76
77 data->soloud->mixSigned16(tgtBuf, data->samples);
78
79 if (MMSYSERR_NOERROR != waveOutWrite(data->waveOut, &data->header[i],
80 sizeof(WAVEHDR)))
81 {
82 return;
83 }
84 }
85 WaitForSingleObject(data->bufferEndEvent, INFINITE);
86 }
87 }
88
89 static void winMMCleanup(Soloud *aSoloud)
90 {

Callers

nothing calls this directly

Calls 1

mixSigned16Method · 0.80

Tested by

no test coverage detected