Impostazione del formato dell'ora
[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.
Usare il messaggio di comando MCI_SET insieme alla struttura MCI_SET_PARMS per impostare il formato dell'ora per un dispositivo aperto. Impostare il membro dwTimeFormat su una delle costanti seguenti.
Costante | Formato orario |
---|---|
MCI_FORMAT_BYTES | Byte (in formato file a codice modulato a impulsi [PCM]) |
MCI_FORMAT_MILLISECONDS | Millisecondi |
MCI_FORMAT_MSF | Minuto/secondo/fotogramma |
MCI_FORMAT_SAMPLES | Campioni |
MCI_FORMAT_SMPTE_24 | SMPTE, 24 fotogrammi |
MCI_FORMAT_SMPTE_25 | SMPTE, 25 frame |
MCI_FORMAT_SMPTE_30 | SMPTE, 30 fotogrammi |
MCI_FORMAT_SMPTE_30DROP | SMPTE, 30 fotogrammi drop |
MCI_FORMAT_TMSF | Traccia/minuto/secondo/frame |
MCI_SEQ_FORMAT_SONGPTR | Puntatore alla canzone MIDI |
Nell'esempio seguente il formato dell'ora viene impostato su millisecondi nel dispositivo specificato dalla variabile wDeviceID usando la funzionemciSendCommand.
UINT wDeviceID;
MCI_SET_PARMS mciSetParms;
// Set time format to milliseconds.
mciSetParms.dwTimeFormat = MCI_FORMAT_MILLISECONDS;
if( mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT,
(DWORD) &mciSetParms))
{
// Error, unable to set time format.
return FALSE;
}
else
{
// Time format set successfully.
return TRUE;
}