Commit 3c640b8d authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

mciseq: Fix some MCIERROR_* codes (MCI_STATUS).

parent c3842bc0
...@@ -1331,13 +1331,14 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS ...@@ -1331,13 +1331,14 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS
case MCI_STATUS_LENGTH: case MCI_STATUS_LENGTH:
if ((dwFlags & MCI_TRACK) && wmm->wFormat == 2) { if ((dwFlags & MCI_TRACK) && wmm->wFormat == 2) {
if (lpParms->dwTrack >= wmm->nTracks) if (lpParms->dwTrack >= wmm->nTracks)
return MCIERR_BAD_INTEGER; return MCIERR_OUTOFRANGE;
/* FIXME: this is wrong if there is a tempo change inside the file */ /* FIXME: this is wrong if there is a tempo change inside the file */
lpParms->dwReturn = MIDI_ConvertPulseToMS(wmm, wmm->tracks[lpParms->dwTrack].dwLength); lpParms->dwReturn = MIDI_ConvertPulseToMS(wmm, wmm->tracks[lpParms->dwTrack].dwLength);
} else { } else {
lpParms->dwReturn = MIDI_GetMThdLengthMS(wmm); lpParms->dwReturn = MIDI_GetMThdLengthMS(wmm);
} }
lpParms->dwReturn = MIDI_ConvertMSToTimeFormat(wmm, lpParms->dwReturn); lpParms->dwReturn = MIDI_ConvertMSToTimeFormat(wmm, lpParms->dwReturn);
/* FIXME: ret = MCI_COLONIZED4_RETURN if SMPTE */
TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn); TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn);
break; break;
case MCI_STATUS_MODE: case MCI_STATUS_MODE:
...@@ -1355,9 +1356,10 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS ...@@ -1355,9 +1356,10 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS
TRACE("MCI_STATUS_NUMBER_OF_TRACKS => %lu\n", lpParms->dwReturn); TRACE("MCI_STATUS_NUMBER_OF_TRACKS => %lu\n", lpParms->dwReturn);
break; break;
case MCI_STATUS_POSITION: case MCI_STATUS_POSITION:
/* FIXME: do I need to use MCI_TRACK ? */ /* FIXME: check MCI_TRACK == 1 if set */
lpParms->dwReturn = MIDI_ConvertMSToTimeFormat(wmm, lpParms->dwReturn = MIDI_ConvertMSToTimeFormat(wmm,
(dwFlags & MCI_STATUS_START) ? 0 : wmm->dwPositionMS); (dwFlags & MCI_STATUS_START) ? 0 : wmm->dwPositionMS);
/* FIXME: ret = MCI_COLONIZED4_RETURN if SMPTE */
TRACE("MCI_STATUS_POSITION %s => %lu\n", TRACE("MCI_STATUS_POSITION %s => %lu\n",
(dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn); (dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn);
break; break;
...@@ -1375,7 +1377,7 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS ...@@ -1375,7 +1377,7 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS
case MCI_SEQ_STATUS_DIVTYPE: case MCI_SEQ_STATUS_DIVTYPE:
TRACE("MCI_SEQ_STATUS_DIVTYPE !\n"); TRACE("MCI_SEQ_STATUS_DIVTYPE !\n");
if (wmm->nDivision > 0x8000) { if (wmm->nDivision > 0x8000) {
switch (wmm->nDivision) { switch (HIBYTE(wmm->nDivision)) {
case 0xE8: lpParms->dwReturn = MCI_SEQ_DIV_SMPTE_24; break; /* -24 */ case 0xE8: lpParms->dwReturn = MCI_SEQ_DIV_SMPTE_24; break; /* -24 */
case 0xE7: lpParms->dwReturn = MCI_SEQ_DIV_SMPTE_25; break; /* -25 */ case 0xE7: lpParms->dwReturn = MCI_SEQ_DIV_SMPTE_25; break; /* -25 */
case 0xE3: lpParms->dwReturn = MCI_SEQ_DIV_SMPTE_30DROP; break; /* -29 */ /* is the MCI constant correct ? */ case 0xE3: lpParms->dwReturn = MCI_SEQ_DIV_SMPTE_30DROP; break; /* -29 */ /* is the MCI constant correct ? */
...@@ -1390,11 +1392,13 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS ...@@ -1390,11 +1392,13 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS
break; break;
case MCI_SEQ_STATUS_MASTER: case MCI_SEQ_STATUS_MASTER:
TRACE("MCI_SEQ_STATUS_MASTER !\n"); TRACE("MCI_SEQ_STATUS_MASTER !\n");
lpParms->dwReturn = 0; lpParms->dwReturn = MAKEMCIRESOURCE(MCI_SEQ_NONE, MCI_SEQ_NONE_S);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_SEQ_STATUS_SLAVE: case MCI_SEQ_STATUS_SLAVE:
TRACE("MCI_SEQ_STATUS_SLAVE !\n"); TRACE("MCI_SEQ_STATUS_SLAVE !\n");
lpParms->dwReturn = 0; lpParms->dwReturn = MAKEMCIRESOURCE(MCI_SEQ_FILE, MCI_SEQ_FILE_S);
ret = MCI_RESOURCE_RETURNED;
break; break;
case MCI_SEQ_STATUS_OFFSET: case MCI_SEQ_STATUS_OFFSET:
TRACE("MCI_SEQ_STATUS_OFFSET !\n"); TRACE("MCI_SEQ_STATUS_OFFSET !\n");
...@@ -1415,11 +1419,10 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS ...@@ -1415,11 +1419,10 @@ static DWORD MIDI_mciStatus(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_STATUS_PARMS
break; break;
default: default:
FIXME("Unknown command %08X !\n", lpParms->dwItem); FIXME("Unknown command %08X !\n", lpParms->dwItem);
return MCIERR_UNRECOGNIZED_COMMAND; return MCIERR_UNSUPPORTED_FUNCTION;
} }
} else { } else {
WARN("No Status-Item!\n"); return MCIERR_MISSING_PARAMETER;
return MCIERR_UNRECOGNIZED_COMMAND;
} }
if ((dwFlags & MCI_NOTIFY) && HRESULT_CODE(ret)==0) if ((dwFlags & MCI_NOTIFY) && HRESULT_CODE(ret)==0)
MIDI_mciNotify(lpParms->dwCallback, wmm, MCI_NOTIFY_SUCCESSFUL); MIDI_mciNotify(lpParms->dwCallback, wmm, MCI_NOTIFY_SUCCESSFUL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment