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

Function winMMCleanup

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

Source from the content-addressed store, hash-verified

87 }
88
89 static void winMMCleanup(Soloud *aSoloud)
90 {
91 if (0 == aSoloud->mBackendData)
92 {
93 return;
94 }
95 SoLoudWinMMData *data = static_cast<SoLoudWinMMData*>(aSoloud->mBackendData);
96 SetEvent(data->audioProcessingDoneEvent);
97 SetEvent(data->bufferEndEvent);
98 if (data->threadHandle)
99 {
100 Thread::wait(data->threadHandle);
101 Thread::release(data->threadHandle);
102 }
103 waveOutReset(data->waveOut);
104 for (int i=0;i<BUFFER_COUNT;++i)
105 {
106 waveOutUnprepareHeader(data->waveOut, &data->header[i], sizeof(WAVEHDR));
107 if (0 != data->sampleBuffer[i])
108 {
109 delete[] data->sampleBuffer[i];
110 }
111 }
112 waveOutClose(data->waveOut);
113 CloseHandle(data->audioProcessingDoneEvent);
114 CloseHandle(data->bufferEndEvent);
115 delete data;
116 aSoloud->mBackendData = 0;
117 }
118
119 result winmm_init(Soloud *aSoloud, unsigned int aFlags, unsigned int aSamplerate, unsigned int aBuffer, unsigned int aChannels)
120 {

Callers

nothing calls this directly

Calls 2

waitFunction · 0.85
releaseFunction · 0.85

Tested by

no test coverage detected