]> git.proxmox.com Git - rustc.git/blame - vendor/winapi/src/um/mmsystem.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / vendor / winapi / src / um / mmsystem.rs
CommitLineData
ff7c6d11
XL
1// Licensed under the Apache License, Version 2.0
2// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4// All files in the project carrying such notice may not be copied, modified, or distributed
5// except according to those terms.
6//! MM procedure declarations, constant definitions and macros
7use shared::basetsd::DWORD_PTR;
8use shared::minwindef::{BYTE, DWORD, UINT, WORD};
9use shared::mmreg::WAVEFORMATEX;
10use um::winnt::{LPSTR, WCHAR};
11//109 (Win 7 SDK)
12pub type MMVERSION = UINT;
13pub type MMRESULT = UINT;
8faf50e0 14STRUCT!{#[repr(packed)] struct MMTIME_smpte {
ff7c6d11
XL
15 hour: BYTE,
16 min: BYTE,
17 sec: BYTE,
18 frame: BYTE,
19 fps: BYTE,
20 dummy: BYTE,
21 pad: [BYTE; 2],
22}}
8faf50e0 23STRUCT!{#[repr(packed)] struct MMTIME_midi {
ff7c6d11
XL
24 songptrpos: DWORD,
25}}
8faf50e0
XL
26UNION!{#[repr(packed)] union MMTIME_u {
27 [u32; 2],
ff7c6d11
XL
28 ms ms_mut: DWORD,
29 sample sample_mut: DWORD,
30 cb cb_mut: DWORD,
31 ticks ticks_mut: DWORD,
32 smpte smpte_mut: MMTIME_smpte,
33 midi midi_mut: MMTIME_midi,
34}}
8faf50e0 35STRUCT!{#[repr(packed)] struct MMTIME {
ff7c6d11
XL
36 wType: UINT,
37 u: MMTIME_u,
38}}
39pub type PMMTIME = *mut MMTIME;
40pub type NPMMTIME = *mut MMTIME;
41pub type LPMMTIME = *mut MMTIME;
42pub const TIME_MS: UINT = 0x0001;
43pub const TIME_SAMPLES: UINT = 0x0002;
44pub const TIME_BYTES: UINT = 0x0004;
45pub const TIME_SMPTE: UINT = 0x0008;
46pub const TIME_MIDI: UINT = 0x0010;
47pub const TIME_TICKS: UINT = 0x0020;
48pub const MM_JOY1MOVE: UINT = 0x3A0;
49pub const MM_JOY2MOVE: UINT = 0x3A1;
50pub const MM_JOY1ZMOVE: UINT = 0x3A2;
51pub const MM_JOY2ZMOVE: UINT = 0x3A3;
52pub const MM_JOY1BUTTONDOWN: UINT = 0x3B5;
53pub const MM_JOY2BUTTONDOWN: UINT = 0x3B6;
54pub const MM_JOY1BUTTONUP: UINT = 0x3B7;
55pub const MM_JOY2BUTTONUP: UINT = 0x3B8;
56pub const MM_MCINOTIFY: UINT = 0x3B9;
57pub const MM_WOM_OPEN: UINT = 0x3BB;
58pub const MM_WOM_CLOSE: UINT = 0x3BC;
59pub const MM_WOM_DONE: UINT = 0x3BD;
60pub const MM_WIM_OPEN: UINT = 0x3BE;
61pub const MM_WIM_CLOSE: UINT = 0x3BF;
62pub const MM_WIM_DATA: UINT = 0x3C0;
63pub const MM_MIM_OPEN: UINT = 0x3C1;
64pub const MM_MIM_CLOSE: UINT = 0x3C2;
65pub const MM_MIM_DATA: UINT = 0x3C3;
66pub const MM_MIM_LONGDATA: UINT = 0x3C4;
67pub const MM_MIM_ERROR: UINT = 0x3C5;
68pub const MM_MIM_LONGERROR: UINT = 0x3C6;
69pub const MM_MOM_OPEN: UINT = 0x3C7;
70pub const MM_MOM_CLOSE: UINT = 0x3C8;
71pub const MM_MOM_DONE: UINT = 0x3C9;
72pub const MMSYSERR_BASE: MMRESULT = 0;
73pub const WAVERR_BASE: MMRESULT = 32;
74pub const MIDIERR_BASE: MMRESULT = 64;
75pub const TIMERR_BASE: MMRESULT = 96;
76pub const JOYERR_BASE: MMRESULT = 160;
77pub const MCIERR_BASE: MMRESULT = 256;
78pub const MIXERR_BASE: MMRESULT = 1024;
79pub const MMSYSERR_NOERROR: MMRESULT = 0;
80pub const MMSYSERR_ERROR: MMRESULT = MMSYSERR_BASE + 1;
81pub const MMSYSERR_BADDEVICEID: MMRESULT = MMSYSERR_BASE + 2;
82pub const MMSYSERR_NOTENABLED: MMRESULT = MMSYSERR_BASE + 3;
83pub const MMSYSERR_ALLOCATED: MMRESULT = MMSYSERR_BASE + 4;
84pub const MMSYSERR_INVALHANDLE: MMRESULT = MMSYSERR_BASE + 5;
85pub const MMSYSERR_NODRIVER: MMRESULT = MMSYSERR_BASE + 6;
86pub const MMSYSERR_NOMEM: MMRESULT = MMSYSERR_BASE + 7;
87pub const MMSYSERR_NOTSUPPORTED: MMRESULT = MMSYSERR_BASE + 8;
88pub const MMSYSERR_BADERRNUM: MMRESULT = MMSYSERR_BASE + 9;
89pub const MMSYSERR_INVALFLAG: MMRESULT = MMSYSERR_BASE + 10;
90pub const MMSYSERR_INVALPARAM: MMRESULT = MMSYSERR_BASE + 11;
91pub const MMSYSERR_HANDLEBUSY: MMRESULT = MMSYSERR_BASE + 12;
92pub const MMSYSERR_INVALIDALIAS: MMRESULT = MMSYSERR_BASE + 13;
93pub const MMSYSERR_BADDB: MMRESULT = MMSYSERR_BASE + 14;
94pub const MMSYSERR_KEYNOTFOUND: MMRESULT = MMSYSERR_BASE + 15;
95pub const MMSYSERR_READERROR: MMRESULT = MMSYSERR_BASE + 16;
96pub const MMSYSERR_WRITEERROR: MMRESULT = MMSYSERR_BASE + 17;
97pub const MMSYSERR_DELETEERROR: MMRESULT = MMSYSERR_BASE + 18;
98pub const MMSYSERR_VALNOTFOUND: MMRESULT = MMSYSERR_BASE + 19;
99pub const MMSYSERR_NODRIVERCB: MMRESULT = MMSYSERR_BASE + 20;
100pub const MMSYSERR_MOREDATA: MMRESULT = MMSYSERR_BASE + 21;
101pub const MMSYSERR_LASTERROR: MMRESULT = MMSYSERR_BASE + 21;
102pub const MIDIERR_UNPREPARED: MMRESULT = MIDIERR_BASE + 0;
103pub const MIDIERR_STILLPLAYING: MMRESULT = MIDIERR_BASE + 1;
104pub const MIDIERR_NOMAP: MMRESULT = MIDIERR_BASE + 2;
105pub const MIDIERR_NOTREADY: MMRESULT = MIDIERR_BASE + 3;
106pub const MIDIERR_NODEVICE: MMRESULT = MIDIERR_BASE + 4;
107pub const MIDIERR_INVALIDSETUP: MMRESULT = MIDIERR_BASE + 5;
108pub const MIDIERR_BADOPENMODE: MMRESULT = MIDIERR_BASE + 6;
109pub const MIDIERR_DONT_CONTINUE: MMRESULT = MIDIERR_BASE + 7;
110pub const MIDIERR_LASTERROR: MMRESULT = MIDIERR_BASE + 7;
111pub const CALLBACK_TYPEMASK: DWORD = 0x00070000;
112pub const CALLBACK_NULL: DWORD = 0x00000000;
113pub const CALLBACK_WINDOW: DWORD = 0x00010000;
114pub const CALLBACK_TASK: DWORD = 0x00020000;
115pub const CALLBACK_FUNCTION: DWORD = 0x00030000;
116pub const CALLBACK_THREAD: DWORD = CALLBACK_TASK;
117pub const CALLBACK_EVENT: DWORD = 0x00050000;
118//497 (Win 7 SDK)
119pub const WAVERR_BADFORMAT: MMRESULT = WAVERR_BASE + 0;
120pub const WAVERR_STILLPLAYING: MMRESULT = WAVERR_BASE + 1;
121pub const WAVERR_UNPREPARED: MMRESULT = WAVERR_BASE + 2;
122pub const WAVERR_SYNC: MMRESULT = WAVERR_BASE + 3;
123pub const WAVERR_LASTERROR: MMRESULT = WAVERR_BASE + 3;
0bf4aa26
XL
124DECLARE_HANDLE!{HWAVEIN, HWAVEIN__}
125DECLARE_HANDLE!{HWAVEOUT, HWAVEOUT__}
ff7c6d11
XL
126pub type LPHWAVEIN = *mut HWAVEIN;
127pub type LPHWAVEOUT = *mut HWAVEOUT;
128pub const WOM_OPEN: UINT = MM_WOM_OPEN;
129pub const WOM_CLOSE: UINT = MM_WOM_CLOSE;
130pub const WOM_DONE: UINT = MM_WOM_DONE;
131pub const WIM_OPEN: UINT = MM_WIM_OPEN;
132pub const WIM_CLOSE: UINT = MM_WIM_CLOSE;
133pub const WIM_DATA: UINT = MM_WIM_DATA;
134pub const WAVE_MAPPER: UINT = 0xFFFFFFFF;
135pub const WAVE_FORMAT_QUERY: DWORD = 0x0001;
136pub const WAVE_ALLOWSYNC: DWORD = 0x0002;
137pub const WAVE_MAPPED: DWORD = 0x0004;
138pub const WAVE_FORMAT_DIRECT: DWORD = 0x0008;
139pub const WAVE_FORMAT_DIRECT_QUERY: DWORD = WAVE_FORMAT_QUERY | WAVE_FORMAT_DIRECT;
140pub const WAVE_MAPPED_DEFAULT_COMMUNICATION_DEVICE: DWORD = 0x0010;
8faf50e0 141STRUCT!{#[repr(packed)] struct WAVEHDR {
ff7c6d11
XL
142 lpData: LPSTR,
143 dwBufferLength: DWORD,
144 dwBytesRecorded: DWORD,
145 dwUser: DWORD_PTR,
146 dwFlags: DWORD,
147 dwLoops: DWORD,
148 lpNext: *mut WAVEHDR,
149 reserved: DWORD_PTR,
150}}
151pub type PWAVEHDR = *mut WAVEHDR;
152pub type NPWAVEHDR = *mut WAVEHDR;
153pub type LPWAVEHDR = *mut WAVEHDR;
8faf50e0 154STRUCT!{#[repr(packed)] struct WAVEOUTCAPSW {
ff7c6d11
XL
155 wMid: WORD,
156 wPid: WORD,
157 vDriverVersion: MMVERSION,
158 szPname: [WCHAR; 32],
159 dwFormats: DWORD,
160 wChannels: WORD,
161 wReserved1: WORD,
162 dwSupport: DWORD,
163}}
164pub type PWAVEOUTCAPSW = *mut WAVEOUTCAPSW;
165pub type NPWAVEOUTCAPSW = *mut WAVEOUTCAPSW;
166pub type LPWAVEOUTCAPSW = *mut WAVEOUTCAPSW;
8faf50e0 167STRUCT!{#[repr(packed)] struct WAVEINCAPSW {
ff7c6d11
XL
168 wMid: WORD,
169 wPid: WORD,
170 vDriverVersion: MMVERSION,
171 szPname: [WCHAR; 32],
172 dwFormats: DWORD,
173 wChannels: WORD,
174 wReserved1: WORD,
175}}
176pub type PWAVEINCAPSW = *mut WAVEINCAPSW;
177pub type NPWAVEINCAPSW = *mut WAVEINCAPSW;
178pub type LPWAVEINCAPSW = *mut WAVEINCAPSW;
179pub const WAVE_INVALIDFORMAT: DWORD = 0x00000000;
180pub const WAVE_FORMAT_1M08: DWORD = 0x00000001;
181pub const WAVE_FORMAT_1S08: DWORD = 0x00000002;
182pub const WAVE_FORMAT_1M16: DWORD = 0x00000004;
183pub const WAVE_FORMAT_1S16: DWORD = 0x00000008;
184pub const WAVE_FORMAT_2M08: DWORD = 0x00000010;
185pub const WAVE_FORMAT_2S08: DWORD = 0x00000020;
186pub const WAVE_FORMAT_2M16: DWORD = 0x00000040;
187pub const WAVE_FORMAT_2S16: DWORD = 0x00000080;
188pub const WAVE_FORMAT_4M08: DWORD = 0x00000100;
189pub const WAVE_FORMAT_4S08: DWORD = 0x00000200;
190pub const WAVE_FORMAT_4M16: DWORD = 0x00000400;
191pub const WAVE_FORMAT_4S16: DWORD = 0x00000800;
192pub const WAVE_FORMAT_44M08: DWORD = 0x00000100;
193pub const WAVE_FORMAT_44S08: DWORD = 0x00000200;
194pub const WAVE_FORMAT_44M16: DWORD = 0x00000400;
195pub const WAVE_FORMAT_44S16: DWORD = 0x00000800;
196pub const WAVE_FORMAT_48M08: DWORD = 0x00001000;
197pub const WAVE_FORMAT_48S08: DWORD = 0x00002000;
198pub const WAVE_FORMAT_48M16: DWORD = 0x00004000;
199pub const WAVE_FORMAT_48S16: DWORD = 0x00008000;
200pub const WAVE_FORMAT_96M08: DWORD = 0x00010000;
201pub const WAVE_FORMAT_96S08: DWORD = 0x00020000;
202pub const WAVE_FORMAT_96M16: DWORD = 0x00040000;
203pub const WAVE_FORMAT_96S16: DWORD = 0x00080000;
204//782 (Win 7 SDK)
205pub type PWAVEFORMATEX = *mut WAVEFORMATEX;
206pub type NPWAVEFORMATEX = *mut WAVEFORMATEX;
207pub type LPWAVEFORMATEX = *mut WAVEFORMATEX;
208pub type LPCWAVEFORMATEX = *const WAVEFORMATEX;
209//2170 (Win 7 SDK)
210pub const TIMERR_NOERROR: MMRESULT = 0;
211pub const TIMERR_NOCANDO: MMRESULT = TIMERR_BASE + 1;
212pub const TIMERR_STRUCT: MMRESULT = TIMERR_BASE + 33;
213//2198 (Win 7 SDK)
8faf50e0 214STRUCT!{#[repr(packed)] struct TIMECAPS {
ff7c6d11
XL
215 wPeriodMin: UINT,
216 wPeriodMax: UINT,
217}}
218pub type PTIMECAPS = *mut TIMECAPS;
219pub type NPTIMECAPS = *mut TIMECAPS;
220pub type LPTIMECAPS = *mut TIMECAPS;
8faf50e0 221STRUCT!{#[repr(packed)] struct MIDIHDR {
ff7c6d11
XL
222 lpData: LPSTR,
223 dwBufferLength: DWORD,
224 dwBytesRecorded: DWORD,
225 dwUser: DWORD_PTR,
226 dwFlags: DWORD,
227 lpNext: *mut MIDIHDR,
228 reserved: DWORD_PTR,
229 dwOffset: DWORD,
8faf50e0 230 dwReserved: [DWORD_PTR; 8],
ff7c6d11
XL
231}}
232pub type PMIDIHDR = *mut MIDIHDR;
233pub type NPMIDIHDR = *mut MIDIHDR;
234pub type LPMIDIHDR = *mut MIDIHDR;
8faf50e0 235STRUCT!{#[repr(packed)] struct MIDIINCAPSW {
ff7c6d11
XL
236 wMid: WORD,
237 wPid: WORD,
238 vDriverVersion: MMVERSION,
239 szPname: [WCHAR; 32],
240 dwSupport: DWORD,
241}}
242pub type PMIDIINCAPSW = *mut MIDIINCAPSW;
243pub type NPMIDIINCAPSW = *mut MIDIINCAPSW;
244pub type LPMIDIINCAPSW = *mut MIDIINCAPSW;
8faf50e0 245STRUCT!{#[repr(packed)] struct MIDIOUTCAPSW {
ff7c6d11
XL
246 wMid: WORD,
247 wPid: WORD,
248 vDriverVersion: MMVERSION,
249 szPname: [WCHAR; 32],
250 wTechnology: WORD,
251 wVoices: WORD,
252 wNotes: WORD,
253 wChannelMask: WORD,
254 dwSupport: DWORD,
255}}
256pub type PMIDIOUTCAPSW = *mut MIDIOUTCAPSW;
257pub type NPMIDIOUTCAPSW = *mut MIDIOUTCAPSW;
258pub type LPMIDIOUTCAPSW = *mut MIDIOUTCAPSW;
0bf4aa26
XL
259DECLARE_HANDLE!{HMIDIIN, HMIDIIN__}
260DECLARE_HANDLE!{HMIDIOUT, HMIDIOUT__}
ff7c6d11
XL
261pub type LPHMIDIIN = *mut HMIDIIN;
262pub type LPHMIDIOUT = *mut HMIDIOUT;
0bf4aa26
XL
263DECLARE_HANDLE!{HMIDISTRM, HMIDISTRM__}
264DECLARE_HANDLE!{HMIDI, HMIDI__}
ff7c6d11
XL
265pub type LPHMIDISTRM = *mut HMIDISTRM;
266pub type LPHMIDI = *mut HMIDI;