* Sync up to trunk head (r64377).
[reactos.git] / dll / win32 / mmdrv / wave.h
1 #pragma once
2
3 // FIXME: Should be moved somewhere else?
4 typedef struct _WAVE_DD_VOLUME {
5 ULONG Left;
6 ULONG Right;
7 } WAVE_DD_VOLUME, *PWAVE_DD_VOLUME;
8
9 // driver
10 #define WAVE_DD_STOP 0x0001
11 #define WAVE_DD_PLAY 0x0002 // output devices only
12 #define WAVE_DD_RECORD 0x0003 // input devices only
13 #define WAVE_DD_RESET 0x0004
14
15 // ioctl
16 #define WAVE_DD_IDLE 0x0000
17 #define WAVE_DD_STOPPED 0x0001 // stopped
18 #define WAVE_DD_PLAYING 0x0002 // output devices only
19 #define WAVE_DD_RECORDING 0x0003 // input devices only
20
21
22
23 typedef enum {
24 WaveThreadInvalid,
25 WaveThreadAddBuffer,
26 WaveThreadSetState,
27 WaveThreadSetData,
28 WaveThreadGetData,
29 WaveThreadBreakLoop,
30 WaveThreadClose,
31 WaveThreadTerminate
32 } WAVETHREADFUNCTION;
33
34 // WARNING: MS code below!!
35 typedef struct {
36 OVERLAPPED Ovl;
37 LPWAVEHDR WaveHdr;
38 } WAVEOVL, *PWAVEOVL;
39
40 // WARNING: MS code below!!
41 // per allocation structure for wave
42 typedef struct tag_WAVEALLOC {
43 struct tag_WAVEALLOC *Next; // Chaining
44 UINT DeviceNumber; // Which device
45 UINT DeviceType; // WaveInput or WaveOutput
46 DWORD dwCallback; // client's callback
47 DWORD dwInstance; // client's instance data
48 DWORD dwFlags; // Open flags
49 HWAVE hWave; // handle for stream
50
51 HANDLE hDev; // Wave device handle
52 LPWAVEHDR DeviceQueue; // Buffers queued by application
53 LPWAVEHDR NextBuffer; // Next buffer to send to device
54 DWORD BufferPosition; // How far we're into a large buffer
55 DWORD BytesOutstanding;
56 // Bytes being processed by device
57 LPWAVEHDR LoopHead; // Start of loop if any
58 DWORD LoopCount; // Number more loops to go
59
60 WAVEOVL DummyWaveOvl; // For break loop
61 //
62 HANDLE Event; // Event for driver syncrhonization
63 // and notification of auxiliary
64 // task operation completion.
65 WAVETHREADFUNCTION AuxFunction; // Function for thread to perform
66 union {
67 LPWAVEHDR pHdr; // Buffer to pass in aux task
68 ULONG State; // State to set
69 struct {
70 ULONG Function; // IOCTL to use
71 PBYTE pData; // Data to set or get
72 ULONG DataLen; // Length of data
73 } GetSetData;
74
75 } AuxParam;
76 // 0 means terminate task.
77 HANDLE AuxEvent1; // Aux thread waits on this
78 HANDLE AuxEvent2; // Caller of Aux thread waits on this
79 HANDLE ThreadHandle; // Handle for thread termination ONLY
80 MMRESULT AuxReturnCode; // Return code from Aux task
81 }WAVEALLOC, *PWAVEALLOC;
82
83 /* Misc should move to own header */
84 MMRESULT GetDeviceCapabilities(DWORD ID, UINT DeviceType,
85 LPBYTE pCaps, DWORD Size);
86
87 DWORD AuxGetAudio(DWORD dwID, PBYTE pVolume, DWORD sizeVolume);
88 DWORD AuxSetAudio(DWORD dwID, PBYTE pVolume, DWORD sizeVolume);
89
90 typedef struct _AUX_DD_VOLUME {
91 ULONG Left;
92 ULONG Right;
93 } AUX_DD_VOLUME, *PAUX_DD_VOLUME;