mirror of
https://github.com/reactos/wine.git
synced 2025-01-19 18:24:48 +00:00
mciseq: MCI Set Port allows to select the MIDI device.
This commit is contained in:
parent
33d1e593aa
commit
a8c252a67d
@ -62,6 +62,7 @@ typedef struct tagWINE_MCIMIDI {
|
|||||||
UINT wDevID; /* the MCI one */
|
UINT wDevID; /* the MCI one */
|
||||||
HMIDI hMidi;
|
HMIDI hMidi;
|
||||||
int nUseCount; /* Incremented for each shared open */
|
int nUseCount; /* Incremented for each shared open */
|
||||||
|
WORD wPort; /* the WINMM device unit */
|
||||||
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
|
WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
|
||||||
HANDLE hCallback; /* Callback handle for pending notification */
|
HANDLE hCallback; /* Callback handle for pending notification */
|
||||||
HMMIO hFile; /* mmio file handle open as Element */
|
HMMIO hFile; /* mmio file handle open as Element */
|
||||||
@ -726,6 +727,7 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpParms)
|
|||||||
|
|
||||||
wmm->hFile = 0;
|
wmm->hFile = 0;
|
||||||
wmm->hMidi = 0;
|
wmm->hMidi = 0;
|
||||||
|
wmm->wPort = MIDI_MAPPER;
|
||||||
wmm->lpstrElementName = NULL;
|
wmm->lpstrElementName = NULL;
|
||||||
dwDeviceID = lpParms->wDeviceID;
|
dwDeviceID = lpParms->wDeviceID;
|
||||||
|
|
||||||
@ -962,8 +964,8 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
|
|||||||
MIDI_mciReadNextEvent(wmm, mmt); /* FIXME == 0 */
|
MIDI_mciReadNextEvent(wmm, mmt); /* FIXME == 0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
dwRet = midiOutOpen((LPHMIDIOUT)&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);
|
dwRet = midiOutOpen((LPHMIDIOUT)&wmm->hMidi, wmm->wPort, 0L, 0L, CALLBACK_NULL);
|
||||||
/* dwRet = midiInOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);*/
|
/* dwRet = midiInOpen(&wmm->hMidi, wmm->wPort, 0L, 0L, CALLBACK_NULL);*/
|
||||||
if (dwRet != MMSYSERR_NOERROR) {
|
if (dwRet != MMSYSERR_NOERROR) {
|
||||||
return dwRet;
|
return dwRet;
|
||||||
}
|
}
|
||||||
@ -1290,7 +1292,7 @@ static DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* MIDI_mciSet [internal]
|
* MIDI_mciSet [internal]
|
||||||
*/
|
*/
|
||||||
static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SEQ_SET_PARMS lpParms)
|
||||||
{
|
{
|
||||||
WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID);
|
WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID);
|
||||||
|
|
||||||
@ -1359,8 +1361,15 @@ static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
|
|||||||
TRACE("MCI_SEQ_SET_SLAVE !\n");
|
TRACE("MCI_SEQ_SET_SLAVE !\n");
|
||||||
if (dwFlags & MCI_SEQ_SET_OFFSET)
|
if (dwFlags & MCI_SEQ_SET_OFFSET)
|
||||||
TRACE("MCI_SEQ_SET_OFFSET !\n");
|
TRACE("MCI_SEQ_SET_OFFSET !\n");
|
||||||
if (dwFlags & MCI_SEQ_SET_PORT)
|
if (dwFlags & MCI_SEQ_SET_PORT) {
|
||||||
TRACE("MCI_SEQ_SET_PORT !\n");
|
TRACE("MCI_SEQ_SET_PORT = %d\n", lpParms->dwPort);
|
||||||
|
if ((UINT16)lpParms->dwPort != (UINT16)MIDI_MAPPER &&
|
||||||
|
(UINT16)lpParms->dwPort >= midiOutGetNumDevs())
|
||||||
|
/* FIXME: input/output port distinction? */
|
||||||
|
return MCIERR_SEQ_PORT_NONEXISTENT;
|
||||||
|
/* FIXME: Native manages to swap the device while playing! */
|
||||||
|
wmm->wPort = lpParms->dwPort;
|
||||||
|
}
|
||||||
if (dwFlags & MCI_SEQ_SET_TEMPO)
|
if (dwFlags & MCI_SEQ_SET_TEMPO)
|
||||||
TRACE("MCI_SEQ_SET_TEMPO !\n");
|
TRACE("MCI_SEQ_SET_TEMPO !\n");
|
||||||
return 0;
|
return 0;
|
||||||
@ -1459,8 +1468,13 @@ static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar
|
|||||||
lpParms->dwReturn = 0;
|
lpParms->dwReturn = 0;
|
||||||
break;
|
break;
|
||||||
case MCI_SEQ_STATUS_PORT:
|
case MCI_SEQ_STATUS_PORT:
|
||||||
TRACE("MCI_SEQ_STATUS_PORT (%u)!\n", wmm->wDevID);
|
if (wmm->wPort != (UINT16)MIDI_MAPPER)
|
||||||
lpParms->dwReturn = MIDI_MAPPER;
|
lpParms->dwReturn = wmm->wPort;
|
||||||
|
else {
|
||||||
|
lpParms->dwReturn = MAKEMCIRESOURCE(MIDI_MAPPER, MCI_SEQ_MAPPER_S);
|
||||||
|
ret = MCI_RESOURCE_RETURNED;
|
||||||
|
}
|
||||||
|
TRACE("MCI_SEQ_STATUS_PORT (%u) => %d\n", wmm->wDevID, wmm->wPort);
|
||||||
break;
|
break;
|
||||||
case MCI_SEQ_STATUS_TEMPO:
|
case MCI_SEQ_STATUS_TEMPO:
|
||||||
TRACE("MCI_SEQ_STATUS_TEMPO !\n");
|
TRACE("MCI_SEQ_STATUS_TEMPO !\n");
|
||||||
@ -1664,7 +1678,7 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
|
|||||||
case MCI_PLAY: return MIDI_mciPlay (dwDevID, dwParam1, (LPMCI_PLAY_PARMS) dwParam2);
|
case MCI_PLAY: return MIDI_mciPlay (dwDevID, dwParam1, (LPMCI_PLAY_PARMS) dwParam2);
|
||||||
case MCI_RECORD: return MIDI_mciRecord (dwDevID, dwParam1, (LPMCI_RECORD_PARMS) dwParam2);
|
case MCI_RECORD: return MIDI_mciRecord (dwDevID, dwParam1, (LPMCI_RECORD_PARMS) dwParam2);
|
||||||
case MCI_STOP: return MIDI_mciStop (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
case MCI_STOP: return MIDI_mciStop (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
||||||
case MCI_SET: return MIDI_mciSet (dwDevID, dwParam1, (LPMCI_SET_PARMS) dwParam2);
|
case MCI_SET: return MIDI_mciSet (dwDevID, dwParam1, (LPMCI_SEQ_SET_PARMS) dwParam2);
|
||||||
case MCI_PAUSE: return MIDI_mciPause (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
case MCI_PAUSE: return MIDI_mciPause (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
||||||
case MCI_RESUME: return MIDI_mciResume (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
case MCI_RESUME: return MIDI_mciResume (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2);
|
||||||
case MCI_STATUS: return MIDI_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2);
|
case MCI_STATUS: return MIDI_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user