Verifica del dispositivo di output
[La funzionalità associata a questa pagina, MCI, è una funzionalità legacy. È stato sostituito da MediaPlayer. MediaPlayer è stato ottimizzato per Windows 10 e Windows 11. Microsoft consiglia vivamente che il nuovo codice usi MediaPlayer invece di MCI, quando possibile. Microsoft suggerisce che il codice esistente che usa le API legacy venga riscritto per usare le nuove API, se possibile.
Dopo aver aperto il sequencer, è necessario verificare se il mapper MIDI era disponibile e selezionato come dispositivo di output. Nell'esempio seguente viene usato il comandoMCI_ STATUS per verificare che il mapper MIDI sia il dispositivo di output per il sequencer MCI.
UINT wDeviceID; // valid MCI sequencer ID
DWORD dwReturn;
MCI_STATUS_PARMS mciStatusParms;
// Make sure the opened device is the MIDI mapper.
mciStatusParms.dwItem = MCI_SEQ_STATUS_PORT;
if (dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM,
(DWORD)(LPVOID) &mciStatusParms))
{
// Error sending MCI_STATUS command.
return;
}
if (LOWORD(mciStatusParms.dwReturn) == MIDI_MAPPER)
{
// The MIDI mapper is the output device.
}
Else
{
// The MIDI mapper is not the output device.
}