#include "mmdrv.h"
#include <debug.h>
Go to the source code of this file.
◆ MAX_WAVE_BUFFER_SIZE
#define MAX_WAVE_BUFFER_SIZE 65536 |
◆ NDEBUG
◆ GetWaveFormatExSize()
Definition at line 320 of file wave.c.
321{
324 else
326}
struct pcmwaveformat_tag PCMWAVEFORMAT
Referenced by SetWaveFormat().
◆ ProcessSessionThreadRequest()
Definition at line 136 of file wave.c.
137{
139
141 {
143 {
146 break;
147 }
148
150 {
151
152 break;
153 }
154
156 {
157
158 break;
159 }
160
162 {
163
164 break;
165 }
166
168 {
169
170 break;
171 }
172
174 {
179 break;
180 }
181
183 {
188 break;
189 }
190
192 {
193 break;
194 }
195
197 {
198#if 0
202#endif
203 break;
204 }
205
207 {
212 break;
213 }
214
216 {
221 break;
222 }
223
225 {
226 DPRINT(
"Thread was asked if OK to close device\n");
227
230 else
232
233 break;
234 }
235
237 {
238 DPRINT(
"Terminating thread...\n");
240 break;
241 }
242
243 default :
244 {
245 DPRINT(
"INVALID FUNCTION\n");
247 break;
248 }
249 }
250
251
252
254}
BOOL GetDeviceData(LPD3D9_DEVICEDATA pDeviceData)
MMRESULT SetDeviceData(HANDLE device_handle, DWORD ioctl, PBYTE input_buffer, DWORD buffer_size)
#define WODM_SETPLAYBACKRATE
#define WODM_GETPLAYBACKRATE
MMRESULT QueueWaveBuffer(SessionInfo *session_info, LPWAVEHDR wave_header)
#define IOCTL_WAVE_SET_PLAYBACK_RATE
#define IOCTL_WAVE_GET_PITCH
#define IOCTL_WAVE_GET_VOLUME
#define IOCTL_WAVE_SET_PITCH
#define IOCTL_WAVE_GET_PLAYBACK_RATE
#define WAVERR_STILLPLAYING
HANDLE kernel_device_handle
Referenced by WaveThread().
◆ QueryWaveFormat()
◆ QueueWaveBuffer()
Definition at line 21 of file wave.c.
24{
26 DPRINT(
"Queueing wave buffer\n");
27
28 if ( ! wave_header )
29 {
31 }
32
33 if ( ! wave_header->
lpData )
34 {
36 }
37
38
40 {
41 DPRINT(
"I was given a header which hasn't been prepared yet!\n");
43 }
44
45
47 {
48 DPRINT(
"I was given a header for a buffer which is already playing\n");
50 }
51
52
54
55
56 wave_header->
dwFlags &= ~WHDR_DONE;
58
59
61
62
65
66 while ( queue_node )
67 {
68 previous_node = queue_node;
69 queue_node = queue_node->
lpNext;
70 }
71
72
73 queue_node = previous_node;
74
75
76 queue_node->
lpNext = wave_header;
78
79
80#if 0
81 if ( ! session_info->next_buffer )
82 {
84 session_info->next_buffer = wave_header;
85 }
86#endif
87
88
89
91}
#define MMSYSERR_INVALPARAM
#define WAVERR_UNPREPARED
struct wavehdr_tag * lpNext
Referenced by ProcessSessionThreadRequest().
◆ ReturnCompletedBuffers()
Definition at line 94 of file wave.c.
95{
97
98
100 {
102 {
104
105
106 header->dwFlags &= ~WHDR_INQUEUE;
108
109
111
112
115
116 DPRINT(
"Notifying client that buffer 0x%p is done\n",
header);
117
118
120 }
121 }
122
123
124}
BOOL NotifyClient(SessionInfo *session_info, DWORD message, DWORD_PTR parameter1, DWORD_PTR parameter2)
Referenced by WaveThread().
◆ SetWaveFormat()
Definition at line 349 of file wave.c.
352{
353 DWORD bytes_returned;
355
357
358 DPRINT(
"SetWaveFormat\n");
359
365 0,
366 &bytes_returned,
368}
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD GetWaveFormatExSize(PWAVEFORMATEX format)
#define IOCTL_WAVE_SET_FORMAT
◆ WaveThread()
Definition at line 266 of file wave.c.
267{
271
272
274
275 DPRINT(
"Wave processing thread setting ready state\n");
276
278
280 {
281
285 {
286
288 }
289
290 DPRINT(
"Wave processing thread woken up\n");
291
292
294
295
296 DPRINT(
"Processing thread request\n");
298
299
301
302
303 DPRINT(
"Performing wave I/O\n");
305
306
307 DPRINT(
"Wave processing thread sleeping\n");
309 }
310
311 return 0;
312}
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
DWORD ProcessSessionThreadRequest(SessionInfo *session_info)
VOID ReturnCompletedBuffers(SessionInfo *session_info)
void MSVCRT() terminate()
VOID PerformWaveIO(SessionInfo *session_info)
DWORD WINAPI WaitForSingleObjectEx(IN HANDLE hHandle, IN DWORD dwMilliseconds, IN BOOL bAlertable)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
HANDLE WINAPI GetCurrentThread(void)
#define WAIT_IO_COMPLETION
#define THREAD_PRIORITY_TIME_CRITICAL
Referenced by StartSessionThread().
◆ WriteWaveBuffer()
Definition at line 372 of file wave.c.
376{
379
380
382}
MMRESULT CallSessionThread(SessionInfo *session_info, ThreadFunction function, PVOID thread_parameter)
Referenced by wodMessage().