#include <stdarg.h>
#include <windef.h>
#include <winuser.h>
#include <mmddk.h>
#include <winreg.h>
#include <wine/unicode.h>
#include <wine/debug.h>
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (msacm) |
|
static BOOL | MIDIMAP_IsBadData (MIDIMAPDATA *mm) |
|
static BOOL | MIDIMAP_FindPort (const WCHAR *name, unsigned *dev) |
|
static BOOL | MIDIMAP_LoadSettingsDefault (MIDIMAPDATA *mom, const WCHAR *port) |
|
static BOOL | MIDIMAP_LoadSettingsScheme (MIDIMAPDATA *mom, const WCHAR *scheme) |
|
static BOOL | MIDIMAP_LoadSettings (MIDIMAPDATA *mom) |
|
static DWORD | modOpen (DWORD_PTR *lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags) |
|
static DWORD | modClose (MIDIMAPDATA *mom) |
|
static DWORD | modLongData (MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2) |
|
static DWORD | modData (MIDIMAPDATA *mom, DWORD_PTR dwParam) |
|
static DWORD | modPrepare (MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2) |
|
static DWORD | modUnprepare (MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2) |
|
static DWORD | modGetDevCaps (UINT wDevID, MIDIMAPDATA *mom, LPMIDIOUTCAPSW lpMidiCaps, DWORD_PTR size) |
|
static DWORD | modReset (MIDIMAPDATA *mom) |
|
DWORD WINAPI | MIDIMAP_modMessage (UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2) |
|
static LRESULT | MIDIMAP_drvOpen (LPSTR str) |
|
static LRESULT | MIDIMAP_drvClose (DWORD_PTR dwDevID) |
|
LRESULT CALLBACK | MIDIMAP_DriverProc (DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2) |
|
◆ MIDIMAPDATA
◆ MIDIOUTPORT
◆ MIDIMAP_DriverProc()
Definition at line 558 of file midimap.c.
560{
561
562
563
564 switch (wMsg)
565 {
576 default:
577 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
578 }
579}
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
static LRESULT MIDIMAP_drvClose(DWORD_PTR dwDevID)
static LRESULT MIDIMAP_drvOpen(LPSTR str)
#define DRV_QUERYCONFIGURE
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
◆ MIDIMAP_drvClose()
Definition at line 544 of file midimap.c.
545{
547 {
550 return 1;
551 }
552 return 0;
553}
#define HeapFree(x, y, z)
static MIDIOUTPORT * midiOutPorts
Referenced by MIDIMAP_DriverProc().
◆ MIDIMAP_drvOpen()
Definition at line 509 of file midimap.c.
510{
513
515 return 0;
516
521 {
523 {
529 for (
i = 0;
i < 16;
i++)
531 }
532 else
533 {
535 }
536 }
537
538 return 1;
539}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static unsigned numMidiOutPorts
WCHAR szPname[MAXPNAMELEN]
UINT WINAPI midiOutGetNumDevs(void)
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
Referenced by MIDIMAP_DriverProc().
◆ MIDIMAP_FindPort()
◆ MIDIMAP_IsBadData()
◆ MIDIMAP_LoadSettings()
Definition at line 203 of file midimap.c.
204{
208
211 {
213 L"Software\\Microsoft\\Windows\\CurrentVersion\\Multimedia\\MIDIMap",
216 }
217
219 {
221 }
222 else
223 {
226
230 {
231 static const WCHAR cs[] = {
'C',
'u',
'r',
'r',
'e',
'n',
't',
'S',
'c',
'h',
'e',
'm',
'e',0};
234 {
237 }
238 else
239 {
240 ERR(
"Wrong registry: UseScheme is active, but no CurrentScheme found\n");
241 }
242 }
244 {
245 static const WCHAR ci[] = {
'C',
'u',
'r',
'r',
'e',
'n',
't',
'I',
'n',
's',
't',
'r',
'u',
'm',
'e',
'n',
't',0};
248 {
250 }
252 {
253
255 }
256 else
257 {
259 }
260 }
261 }
263
265 {
267
268 for (
i = 0;
i < 16;
i++)
269 {
270 TRACE(
"chnMap[%2d] => %d\n",
272 }
273 }
275}
#define RegCloseKey(hKey)
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
GLuint GLuint GLsizei GLenum type
static BOOL MIDIMAP_LoadSettingsScheme(MIDIMAPDATA *mom, const WCHAR *scheme)
static BOOL MIDIMAP_LoadSettingsDefault(MIDIMAPDATA *mom, const WCHAR *port)
MIDIOUTPORT * ChannelMap[16]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Referenced by modOpen().
◆ MIDIMAP_LoadSettingsDefault()
Definition at line 133 of file midimap.c.
134{
136
138 {
141 }
142
143
146
148
150}
static BOOL MIDIMAP_FindPort(const WCHAR *name, unsigned *dev)
Referenced by MIDIMAP_LoadSettings().
◆ MIDIMAP_LoadSettingsScheme()
Definition at line 152 of file midimap.c.
153{
158
160
162 "System\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Midi\\Schemes",
163 &hSchemesKey))
164 {
166 }
168 {
171 }
172
174 {
176
179
181
184 continue;
185
186 for (
i = 0;
i < 16;
i++)
187 {
189 {
191 ERR(
"Quirks in registry, channel %u is mapped twice\n",
i);
193 }
194 }
195 }
196
199
201}
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
#define HKEY_LOCAL_MACHINE
Referenced by MIDIMAP_LoadSettings().
◆ MIDIMAP_modMessage()
Definition at line 468 of file midimap.c.
470{
471 TRACE(
"(%u, %04X, %08lX, %08lX, %08lX);\n",
472 wDevID, wMsg, dwUser, dwParam1, dwParam2);
473
474 switch (wMsg)
475 {
480
481 return 0;
482
485
491
496 default:
497 FIXME(
"unknown message %d!\n", wMsg);
498 }
500}
static DWORD modClose(MIDIMAPDATA *mom)
static DWORD modPrepare(MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
static DWORD modLongData(MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
static DWORD modUnprepare(MIDIMAPDATA *mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwParam2)
static DWORD modData(MIDIMAPDATA *mom, DWORD_PTR dwParam)
static DWORD modOpen(DWORD_PTR *lpdwUser, LPMIDIOPENDESC lpDesc, DWORD dwFlags)
static DWORD modGetDevCaps(UINT wDevID, MIDIMAPDATA *mom, LPMIDIOUTCAPSW lpMidiCaps, DWORD_PTR size)
static DWORD modReset(MIDIMAPDATA *mom)
#define MMSYSERR_NOTSUPPORTED
◆ modClose()
Definition at line 296 of file midimap.c.
297{
300
302
303 for (
i = 0;
i < 16;
i++)
304 {
307 {
310 {
313 }
316 }
317 }
321}
static BOOL MIDIMAP_IsBadData(MIDIMAPDATA *mm)
UINT WINAPI midiOutClose(HMIDIOUT hMidiOut)
Referenced by MIDIMAP_modMessage().
◆ modData()
Definition at line 347 of file midimap.c.
348{
350 WORD chn = lb & 0x0F;
352
355
357
358 switch (lb & 0xF0)
359 {
360 case 0x80:
361 case 0x90:
362 case 0xA0:
363 case 0xB0:
364 case 0xC0:
365 case 0xD0:
366 case 0xE0:
368 {
372 else
374
375
376
377 }
379 {
380
381 dwParam &= ~0x0F;
383
386 {
388
389
390 dwParam &= ~0x0000FF00;
392 }
394 }
395 break;
396 case 0xF0:
397 for (chn = 0; chn < 16; chn++)
398 {
401 }
402 break;
403 default:
404 FIXME(
"ooch %lx\n", dwParam);
405 }
406
408}
UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg)
MMRESULT WINAPI midiOutOpen(LPHMIDIOUT lphMidiOut, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
Referenced by MIDIMAP_modMessage().
◆ modGetDevCaps()
Definition at line 430 of file midimap.c.
431{
432 static const WCHAR name[] = {
'W',
'i',
'n',
'e',
' ',
'm',
'i',
'd',
'i',
' ',
'm',
'a',
'p',
'p',
'e',
'r',0};
433 lpMidiCaps->
wMid = 0x00FF;
434 lpMidiCaps->
wPid = 0x0001;
442
444}
Referenced by MIDIMAP_modMessage().
◆ modLongData()
Definition at line 323 of file midimap.c.
324{
328
331
332 mh = *lpMidiHdr;
333 for (chn = 0; chn < 16; chn++)
334 {
336 {
342 }
343 }
345}
UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
Referenced by MIDIMAP_modMessage().
◆ modOpen()
Definition at line 277 of file midimap.c.
278{
280
282
284
286 {
289
291 }
294}
static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA *mom)
#define MIDIERR_INVALIDSETUP
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Referenced by MIDIMAP_modMessage().
◆ modPrepare()
◆ modReset()
Definition at line 446 of file midimap.c.
447{
450
453
454 for (chn = 0; chn < 16; chn++)
455 {
457 {
460 }
461 }
463}
UINT WINAPI midiOutReset(HMIDIOUT hMidiOut)
Referenced by MIDIMAP_modMessage().
◆ modUnprepare()
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
msacm |
| ) |
|
◆ midiOutPorts
◆ numMidiOutPorts