Now using modReset() instead of tweaking MIDI controls.

This commit is contained in:
Eric Pouech 1999-09-22 16:42:03 +00:00 committed by Alexandre Julliard
parent 086883e8dd
commit 644f9a727c
1 changed files with 5 additions and 17 deletions

View File

@ -41,7 +41,7 @@ typedef struct {
} MCI_MIDITRACK; } MCI_MIDITRACK;
typedef struct tagWINE_MCIMIDI { typedef struct tagWINE_MCIMIDI {
UINT wDevID; UINT wDevID; /* the MCI one */
HMIDI hMidi; HMIDI hMidi;
int nUseCount; /* Incremented for each shared open */ int nUseCount; /* Incremented for each shared open */
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */ WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
@ -1016,19 +1016,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
} }
} }
/* stop all notes */ midiOutReset(wmm->hMidi);
/* should be (0x7800 | MIDI_CTL_CHANGE) instead of 0x78B0,
* but MIDI_CTL_CHANGE is defined in OSS's soundcard.h and MCI must compile
* without any reference to OSS
*/
/* FIXME: check if 0x78B0 is channel dependant or not. I coded it so that
* it's channel dependent...
*/
{
unsigned chn;
for (chn = 0; chn < 16; chn++)
midiOutShortMsg(wmm->hMidi, 0x78B0 | chn);
}
dwRet = midiOutClose(wmm->hMidi); dwRet = midiOutClose(wmm->hMidi);
wmm->dwStatus = MCI_MODE_STOP; wmm->dwStatus = MCI_MODE_STOP;
@ -1080,6 +1068,7 @@ static DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar
dwRet = midiInPrepareHeader(wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); dwRet = midiInPrepareHeader(wmm->hMidi, &midiHdr, sizeof(MIDIHDR));
TRACE("After MIDM_PREPARE \n"); TRACE("After MIDM_PREPARE \n");
wmm->dwStatus = MCI_MODE_RECORD; wmm->dwStatus = MCI_MODE_RECORD;
/* FIXME: there is no buffer added */
while (wmm->dwStatus != MCI_MODE_STOP) { while (wmm->dwStatus != MCI_MODE_STOP) {
TRACE("wmm->dwStatus=%p %d\n", TRACE("wmm->dwStatus=%p %d\n",
&wmm->dwStatus, wmm->dwStatus); &wmm->dwStatus, wmm->dwStatus);
@ -1117,7 +1106,6 @@ static DWORD MIDI_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar
if (wmm->dwStatus == MCI_MODE_PLAY) { if (wmm->dwStatus == MCI_MODE_PLAY) {
/* stop all notes */ /* stop all notes */
/* see note in MIDI_mciPlay */
unsigned chn; unsigned chn;
for (chn = 0; chn < 16; chn++) for (chn = 0; chn < 16; chn++)
midiOutShortMsg(wmm->hMidi, 0x78B0 | chn); midiOutShortMsg(wmm->hMidi, 0x78B0 | chn);
@ -1491,7 +1479,7 @@ static DWORD MIDI_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
if (dwFlags & MCI_NOTIFY) { if (dwFlags & MCI_NOTIFY) {
TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback); TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
mciDriverNotify((HWND)LOWORD(lpParms->dwCallback), mciDriverNotify((HWND)LOWORD(lpParms->dwCallback),
wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); wmm->wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
} }
return ret; return ret;
@ -1550,7 +1538,7 @@ LONG CALLBACK MCIMIDI_DriverProc(DWORD dwDevID, HDRVR hDriv, DWORD wMsg,
break; break;
/* commands that should report an error */ /* commands that should report an error */
case MCI_WINDOW: case MCI_WINDOW:
FIXME("Unsupported command=%s\n", MCI_MessageToString(wMsg)); TRACE("Unsupported command=%s\n", MCI_MessageToString(wMsg));
break; break;
case MCI_OPEN: case MCI_OPEN:
case MCI_CLOSE: case MCI_CLOSE: