Michael Stefaniuc a écrit :
Hello,
am I right that HMIDI and HMIDIIN, HMIDIOUT shouldn't be interchangeable? Would save some conversions.
License: LGPL, X11 Changelog: Michael Stefaniuc mstefani@redhat.com Convert HMIDI to a void*
I just modified a bit Michael's patch: - better fix for midimap file - changed all HMIDI????
Alexandre, use this version instead.
A+
Name: mm_midih ChangeLog: HMIDI??? handles are no long OLD_HANDLE License: X11 GenDate: 2002/08/01 07:11:07 UTC ModifiedFiles: dlls/winmm/lolvldrv.c dlls/winmm/mmsystem.c dlls/winmm/mciseq/mcimidi.c dlls/winmm/midimap/midimap.c include/mmsystem.h AddedFiles: =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/lolvldrv.c,v retrieving revision 1.29 diff -u -u -r1.29 lolvldrv.c --- dlls/winmm/lolvldrv.c 3 Jul 2002 21:10:44 -0000 1.29 +++ dlls/winmm/lolvldrv.c 1 Aug 2002 06:51:25 -0000 @@ -693,7 +693,7 @@ *(LPDWORD)((char*)ptr + sizeof(LPMIDIOPENDESC)) = *lpdwUser; mod16 = (LPMIDIOPENDESC16)((LPSTR)ptr + sizeof(LPMIDIOPENDESC) + 2*sizeof(DWORD));
- mod16->hMidi = mod32->hMidi; + mod16->hMidi = LOWORD(mod32->hMidi); mod16->dwCallback = mod32->dwCallback; mod16->dwInstance = mod32->dwInstance; mod16->dnDevNode = mod32->dnDevNode; Index: dlls/winmm/mmsystem.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/mmsystem.c,v retrieving revision 1.63 diff -u -u -r1.63 mmsystem.c --- dlls/winmm/mmsystem.c 29 Jul 2002 23:29:23 -0000 1.63 +++ dlls/winmm/mmsystem.c 1 Aug 2002 06:51:25 -0000 @@ -2188,7 +2188,7 @@ *lphMidiOut = hMidiOut;
if (lpwm) { - lpwm->mod.hMidi = hMidiOut; + lpwm->mod.hMidi = (HMIDI) hMidiOut; lpwm->mod.dwCallback = *lpdwCallback; lpwm->mod.dwInstance = *lpdwInstance; lpwm->mod.dnDevNode = 0; @@ -2739,7 +2739,7 @@ if (lpwm == NULL) return MMSYSERR_NOMEM;
- lpwm->mod.hMidi = hMidiIn; + lpwm->mod.hMidi = (HMIDI) hMidiIn; lpwm->mod.dwCallback = dwCallback; lpwm->mod.dwInstance = dwInstance;
Index: dlls/winmm/mciseq/mcimidi.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/mciseq/mcimidi.c,v retrieving revision 1.16 diff -u -u -r1.16 mcimidi.c --- dlls/winmm/mciseq/mcimidi.c 31 May 2002 23:40:57 -0000 1.16 +++ dlls/winmm/mciseq/mcimidi.c 1 Aug 2002 06:51:25 -0000 @@ -817,7 +817,7 @@
wmm->dwStatus = MCI_MODE_NOT_READY; if (oldstat == MCI_MODE_PAUSE) - dwRet = midiOutReset(wmm->hMidi); + dwRet = midiOutReset((HMIDIOUT)wmm->hMidi);
while (wmm->dwStatus != MCI_MODE_STOP) Sleep(10); @@ -962,7 +962,7 @@ MIDI_mciReadNextEvent(wmm, mmt); /* FIXME == 0 */ }
- dwRet = midiOutOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL); + dwRet = midiOutOpen((LPHMIDIOUT)&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL); /* dwRet = midiInOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);*/ if (dwRet != MMSYSERR_NOERROR) { return dwRet; @@ -1142,7 +1142,7 @@ break; default: if (doPlay) { - dwRet = midiOutShortMsg(wmm->hMidi, mmt->dwEventData); + dwRet = midiOutShortMsg((HMIDIOUT)wmm->hMidi, mmt->dwEventData); } else { switch (LOBYTE(LOWORD(mmt->dwEventData)) & 0xF0) { case MIDI_NOTEON: @@ -1150,7 +1150,7 @@ dwRet = 0; break; default: - dwRet = midiOutShortMsg(wmm->hMidi, mmt->dwEventData); + dwRet = midiOutShortMsg((HMIDIOUT)wmm->hMidi, mmt->dwEventData); } } } @@ -1163,9 +1163,9 @@ } }
- midiOutReset(wmm->hMidi); + midiOutReset((HMIDIOUT)wmm->hMidi);
- dwRet = midiOutClose(wmm->hMidi); + dwRet = midiOutClose((HMIDIOUT)wmm->hMidi); /* to restart playing at beginning when it's over */ wmm->dwPositionMS = 0;
@@ -1212,7 +1212,7 @@ midiHdr.dwBufferLength = 1024; midiHdr.dwUser = 0L; midiHdr.dwFlags = 0L; - dwRet = midiInPrepareHeader(wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); + dwRet = midiInPrepareHeader((HMIDIIN)wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); TRACE("After MIDM_PREPARE \n"); wmm->dwStatus = MCI_MODE_RECORD; /* FIXME: there is no buffer added */ @@ -1220,12 +1220,12 @@ TRACE("wmm->dwStatus=%p %d\n", &wmm->dwStatus, wmm->dwStatus); midiHdr.dwBytesRecorded = 0; - dwRet = midiInStart(wmm->hMidi); + dwRet = midiInStart((HMIDIIN)wmm->hMidi); TRACE("midiInStart => dwBytesRecorded=%lu\n", midiHdr.dwBytesRecorded); if (midiHdr.dwBytesRecorded == 0) break; } TRACE("Before MIDM_UNPREPARE \n"); - dwRet = midiInUnprepareHeader(wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); + dwRet = midiInUnprepareHeader((HMIDIIN)wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); TRACE("After MIDM_UNPREPARE \n"); if (midiHdr.lpData != NULL) { HeapFree(GetProcessHeap(), 0, midiHdr.lpData); @@ -1255,7 +1255,7 @@ /* stop all notes */ unsigned chn; for (chn = 0; chn < 16; chn++) - midiOutShortMsg(wmm->hMidi, 0x78B0 | chn); + midiOutShortMsg((HMIDIOUT)(wmm->hMidi), 0x78B0 | chn); wmm->dwStatus = MCI_MODE_PAUSE; } if (lpParms && (dwFlags & MCI_NOTIFY)) { Index: dlls/winmm/midimap/midimap.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/midimap/midimap.c,v retrieving revision 1.13 diff -u -u -r1.13 midimap.c --- dlls/winmm/midimap/midimap.c 31 May 2002 23:40:57 -0000 1.13 +++ dlls/winmm/midimap/midimap.c 1 Aug 2002 06:46:12 -0000 @@ -81,7 +81,7 @@ { char name[MAXPNAMELEN]; int loaded; - HMIDI hMidi; + HMIDIOUT hMidi; unsigned short uDevID; LPBYTE lpbPatch; unsigned int aChn[16]; Index: include/mmsystem.h =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/include/mmsystem.h,v retrieving revision 1.51 diff -u -u -r1.51 mmsystem.h --- include/mmsystem.h 31 May 2002 23:06:48 -0000 1.51 +++ include/mmsystem.h 1 Aug 2002 06:52:49 -0000 @@ -34,10 +34,10 @@ DECLARE_OLD_HANDLE(HWAVE); DECLARE_OLD_HANDLE(HWAVEIN); DECLARE_OLD_HANDLE(HWAVEOUT); -DECLARE_OLD_HANDLE(HMIDI); -DECLARE_OLD_HANDLE(HMIDIIN); -DECLARE_OLD_HANDLE(HMIDIOUT); -DECLARE_OLD_HANDLE(HMIDISTRM); +DECLARE_HANDLE(HMIDI); +DECLARE_HANDLE(HMIDIIN); +DECLARE_HANDLE(HMIDIOUT); +DECLARE_HANDLE(HMIDISTRM); DECLARE_OLD_HANDLE(HMIXER); DECLARE_OLD_HANDLE(HMIXEROBJ); DECLARE_OLD_HANDLE(HMMIO);
On Thu, Aug 01, 2002 at 09:13:40AM +0200, Eric Pouech wrote:
Michael Stefaniuc a écrit :
Hello,
am I right that HMIDI and HMIDIIN, HMIDIOUT shouldn't be interchangeable? Would save some conversions.
License: LGPL, X11 Changelog: Michael Stefaniuc mstefani@redhat.com Convert HMIDI to a void*
I just modified a bit Michael's patch:
- better fix for midimap file
- changed all HMIDI????
Alexandre, use this version instead.
No, use my version instead ;) (it's attached). It proper handles HMIDI*16 <-> HMIDI* conversions. The patch is based on Eric patch which is based on my patch ...
License: LGPL, X11 Changelog: Eric Pouech eric.pouech@wanadoo.fr Michael Stefaniuc mstefani@redhat.com - Convert HMIDI, HMIDIIN, HMIDIOUT, HMIDISTRM to void*
bye michael
Michael Stefaniuc mstefani@redhat.de writes:
No, use my version instead ;) (it's attached). It proper handles HMIDI*16 <-> HMIDI* conversions.
It would be better to add HMIDIIN_16 etc. macros to do the 32->16 conversion, just like you did for the 16->32 one. This way if we need a more complex conversion one day it's easy to change; if you just use LOWORD everywhere we have no way of spotting places that need to be changed.