summaryrefslogtreecommitdiffstats
path: root/third_party/rust/winapi/src/um/mmeapi.rs
blob: cc5153b3b367f1f02bc4af429a056134ce5fee33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
use shared::basetsd::{DWORD_PTR, UINT_PTR};
use shared::minwindef::{DWORD, LPBYTE, LPDWORD, LPWORD, PDWORD, UINT};
use um::imm::LPUINT;
use um::mmsystem::{
    HMIDI, HMIDIIN, HMIDIOUT, HMIDISTRM, HWAVEIN, HWAVEOUT, LPCWAVEFORMATEX, LPHMIDIIN, LPHMIDIOUT,
    LPHMIDISTRM, LPHWAVEIN, LPHWAVEOUT, LPMIDIHDR, LPMIDIINCAPSW, LPMIDIOUTCAPSW, LPMMTIME,
    LPWAVEHDR, LPWAVEINCAPSW, LPWAVEOUTCAPSW, MMRESULT
};
use um::winnt::{LPWSTR, PVOID};
extern "system" {
    pub fn waveOutGetNumDevs() -> UINT;
    // pub fn waveOutGetDevCapsA();
    pub fn waveOutGetDevCapsW(
        uDeviceID: UINT_PTR,
        pwoc: LPWAVEOUTCAPSW,
        cbwoc: UINT,
    ) -> MMRESULT;
    pub fn waveOutGetVolume(
        hwo: HWAVEOUT,
        pdwVolume: LPDWORD,
    ) -> MMRESULT;
    pub fn waveOutSetVolume(
        hwo: HWAVEOUT,
        dwVolume: DWORD,
    ) -> MMRESULT;
    // pub fn waveOutGetErrorTextA();
    pub fn waveOutGetErrorTextW(
        mmrError: MMRESULT,
        pszText: LPWSTR,
        cchText: UINT,
    ) -> MMRESULT;
    pub fn waveOutOpen(
        phwo: LPHWAVEOUT,
        uDeviceID: UINT,
        pwfx: LPCWAVEFORMATEX,
        dwCallback: DWORD_PTR,
        dwInstance: DWORD_PTR,
        fdwOpen: DWORD,
    ) -> MMRESULT;
    pub fn waveOutClose(
        hwo: HWAVEOUT,
    ) -> MMRESULT;
    pub fn waveOutPrepareHeader(
        hwo: HWAVEOUT,
        pwh: LPWAVEHDR,
        cbwh: UINT,
    ) -> MMRESULT;
    pub fn waveOutUnprepareHeader(
        hwo: HWAVEOUT,
        pwh: LPWAVEHDR,
        cbwh: UINT,
    ) -> MMRESULT;
    pub fn waveOutWrite(
        hwo: HWAVEOUT,
        pwh: LPWAVEHDR,
        cbwh: UINT,
    ) -> MMRESULT;
    pub fn waveOutPause(
        hwo: HWAVEOUT,
    ) -> MMRESULT;
    pub fn waveOutRestart(
        hwo: HWAVEOUT,
    ) -> MMRESULT;
    pub fn waveOutReset(
        hwo: HWAVEOUT,
    ) -> MMRESULT;
    pub fn waveOutBreakLoop(
        hwo: HWAVEOUT,
    ) -> MMRESULT;
    pub fn waveOutGetPosition(
        hwo: HWAVEOUT,
        pmmt: LPMMTIME,
        cbmmt: UINT,
    ) -> MMRESULT;
    pub fn waveOutGetPitch(
        hwo: HWAVEOUT,
        pdwPitch: LPDWORD,
    ) -> MMRESULT;
    pub fn waveOutSetPitch(
        hwo: HWAVEOUT,
        dwPitch: DWORD,
    ) -> MMRESULT;
    pub fn waveOutGetPlaybackRate(
        hwo: HWAVEOUT,
        pdwRate: LPDWORD,
    ) -> MMRESULT;
    pub fn waveOutSetPlaybackRate(
        hwo: HWAVEOUT,
        dwRate: DWORD,
    ) -> MMRESULT;
    // pub fn waveOutGetID();
    pub fn waveOutMessage(
        hwo: HWAVEOUT,
        uMsg: UINT,
        dw1: DWORD_PTR,
        dw2: DWORD_PTR,
    ) -> MMRESULT;
    pub fn waveInGetNumDevs() -> UINT;
    // pub fn waveInGetDevCapsA();
    pub fn waveInGetDevCapsW(
        uDeviceID: UINT_PTR,
        pwic: LPWAVEINCAPSW,
        cbwic: UINT,
    ) -> MMRESULT;
    // pub fn waveInGetErrorTextA();
    pub fn waveInGetErrorTextW(
        mmrError: MMRESULT,
        pszText: LPWSTR,
        cchText: UINT,
    ) -> MMRESULT;
    pub fn waveInOpen(
        phwi: LPHWAVEIN,
        uDeviceID: UINT,
        pwfx: LPCWAVEFORMATEX,
        dwCallback: DWORD_PTR,
        dwInstance: DWORD_PTR,
        fdwOpen: DWORD,
    ) -> MMRESULT;
    pub fn waveInClose(
        hwi: HWAVEIN,
    ) -> MMRESULT;
    pub fn waveInPrepareHeader(
        hwi: HWAVEIN,
        pwh: LPWAVEHDR,
        cbwh: UINT,
    ) -> MMRESULT;
    pub fn waveInUnprepareHeader(
        hwi: HWAVEIN,
        pwh: LPWAVEHDR,
        cbwh: UINT,
    ) -> MMRESULT;
    pub fn waveInAddBuffer(
        hwi: HWAVEIN,
        pwh: LPWAVEHDR,
        cbwh: UINT,
    ) -> MMRESULT;
    pub fn waveInStart(
        hwi: HWAVEIN,
    ) -> MMRESULT;
    pub fn waveInStop(
        hwi: HWAVEIN,
    ) -> MMRESULT;
    pub fn waveInReset(
        hwi: HWAVEIN,
    ) -> MMRESULT;
    pub fn waveInGetPosition(
        hwi: HWAVEIN,
        pmmt: LPMMTIME,
        cbmmt: UINT,
    ) -> MMRESULT;
    // pub fn waveInGetID();
    pub fn waveInMessage(
        hwi: HWAVEIN,
        uMsg: UINT,
        dw1: DWORD_PTR,
        dw2: DWORD_PTR,
    ) -> MMRESULT;
    pub fn midiOutGetNumDevs() -> UINT;
    pub fn midiStreamOpen(
        lphStream: LPHMIDISTRM,
        puDeviceID: LPUINT,
        cMidi: DWORD,
        dwCallback: DWORD_PTR,
        dwInstance: DWORD_PTR,
        fdwOpen: DWORD,
    ) -> MMRESULT;
    pub fn midiStreamClose(
        hStream: HMIDISTRM,
    ) -> MMRESULT;
    pub fn midiStreamProperty(
        hm: HMIDISTRM,
        lppropdata: LPBYTE,
        dwProperty: DWORD,
    ) -> MMRESULT;
    pub fn midiStreamPosition(
        hms: HMIDISTRM,
        pmmt: LPMMTIME,
        cbmmt: UINT,
    ) -> MMRESULT;
    pub fn midiStreamOut(
        hMidiStream: HMIDISTRM,
        lpMidiHdr: LPMIDIHDR,
        cbMidiHdr: UINT,
    ) -> MMRESULT;
    pub fn midiStreamPause(
        hms: HMIDISTRM,
    ) -> MMRESULT;
    pub fn midiStreamRestart(
        hms: HMIDISTRM,
    ) -> MMRESULT;
    pub fn midiStreamStop(
        hms: HMIDISTRM,
    ) -> MMRESULT;
    pub fn midiConnect(
        hMidi: HMIDI,
        hmo: HMIDIOUT,
        pReserved: PVOID,
    ) -> MMRESULT;
    pub fn midiDisconnect(
        hMidi: HMIDI,
        hmo: HMIDIOUT,
        pReserved: PVOID,
    ) -> MMRESULT;
    pub fn midiOutGetDevCapsW(
        uDeviceID: UINT_PTR,
        lpMidiOutCaps: LPMIDIOUTCAPSW,
        cbMidiOutCaps: UINT,
    ) -> MMRESULT;
    pub fn midiOutGetVolume(
        hmo: HMIDIOUT,
        lpdwVolume: PDWORD,
    ) -> MMRESULT;
    pub fn midiOutSetVolume(
        hmo: HMIDIOUT,
        dwVolume: DWORD,
    ) -> MMRESULT;
    pub fn midiOutGetErrorTextW(
        mmrError: MMRESULT,
        lpText: LPWSTR,
        cchText: UINT,
    ) -> MMRESULT;
    pub fn midiOutOpen(
        lphmo: LPHMIDIOUT,
        uDeviceID: UINT,
        dwCallback: DWORD_PTR,
        dwCallbackInstance: DWORD_PTR,
        dwFlags: DWORD,
    ) -> MMRESULT;
    pub fn midiOutClose(
        hmo: HMIDIOUT,
    ) -> MMRESULT;
    pub fn midiOutPrepareHeader(
        hmo: HMIDIOUT,
        lpMidiOutHdr: LPMIDIHDR,
        cbMidiOutHdr: UINT,
    ) -> MMRESULT;
    pub fn midiOutUnprepareHeader(
        hmo: HMIDIOUT,
        lpMidiOutHdr: LPMIDIHDR,
        cbMidiOutHdr: UINT,
    ) -> MMRESULT;
    pub fn midiOutShortMsg(
        hmo: HMIDIOUT,
        dwMsg: DWORD,
    ) -> MMRESULT;
    pub fn midiOutLongMsg(
        hmo: HMIDIOUT,
        lpMidiOutHdr: LPMIDIHDR,
        cbMidiOutHdr: UINT,
    ) -> MMRESULT;
    pub fn midiOutReset(
        hmo: HMIDIOUT,
    ) -> MMRESULT;
    pub fn midiOutCachePatches(
        hmo: HMIDIOUT,
        wBank: UINT,
        lpPatchArray: LPWORD,
        wFlags: UINT,
    ) -> MMRESULT;
    pub fn midiOutCacheDrumPatches(
        hmo: HMIDIOUT,
        wPatch: UINT,
        lpKeyArray: LPWORD,
        wFlags: UINT,
    ) -> MMRESULT;
    pub fn midiOutGetID(
        hmo: HMIDIOUT,
        puDeviceID: LPUINT,
    ) -> MMRESULT;
    pub fn midiOutMessage(
        deviceID: HMIDIOUT,
        msg: UINT,
        dw1: DWORD_PTR,
        dw2: DWORD_PTR,
    ) -> MMRESULT;
    pub fn midiInGetNumDevs() -> UINT;
    pub fn midiInGetDevCapsW(
        uDeviceID: UINT_PTR,
        lpMidiInCaps: LPMIDIINCAPSW,
        cbMidiInCaps: UINT,
    ) -> MMRESULT;
    pub fn midiInGetErrorTextW(
        wError: MMRESULT,
        lpText: LPWSTR,
        cchText: UINT,
    ) -> MMRESULT;
    pub fn midiInOpen(
        lphMidiIn: LPHMIDIIN,
        uDeviceID: UINT,
        dwCallback: DWORD_PTR,
        dwCallbackInstance: DWORD_PTR,
        dwFlags: DWORD,
    ) -> MMRESULT;
    pub fn midiInClose(
        hMidiIn: HMIDIIN,
    ) -> MMRESULT;
    pub fn midiInPrepareHeader(
        hMidiIn: HMIDIIN,
        lpMidiInHdr: LPMIDIHDR,
        cbMidiInHdr: UINT,
    ) -> MMRESULT;
    pub fn midiInUnprepareHeader(
        hMidiIn: HMIDIIN,
        lpMidiInHdr: LPMIDIHDR,
        cbMidiInHdr: UINT,
    ) -> MMRESULT;
    pub fn midiInAddBuffer(
        hMidiIn: HMIDIIN,
        lpMidiInHdr: LPMIDIHDR,
        cbMidiInHdr: UINT,
    ) -> MMRESULT;
    pub fn midiInStart(
        hMidiIn: HMIDIIN,
    ) -> MMRESULT;
    pub fn midiInStop(
        hMidiIn: HMIDIIN,
    ) -> MMRESULT;
    pub fn midiInReset(
        hMidiIn: HMIDIIN,
    ) -> MMRESULT;
    pub fn midiInGetID(
        hmi: HMIDIIN,
        puDeviceID: LPUINT,
    ) -> MMRESULT;
    pub fn midiInMessage(
        deviceID: HMIDIIN,
        msg: UINT,
        dw1: DWORD_PTR,
        dw2: DWORD_PTR,
    ) -> MMRESULT;
}