Responding to the MCI_SET Message

An application uses the MCI_SET command message to set device information. An application will supply a pointer to a MCI_SET data structure. This structure has the following fields:

typedef struct {

DWORDdwCallback;

DWORDdwTimeFormat;

DWORDdwAudio;

} MCI_SET_PARMS;

The MCI_SET_TIME_FORMAT flag sent by the application validates the dwTimeFormat field of this data structure. The contents of dwTimeFormat specify the time format or position indicator the device wants to use with your device. If possible, your device driver should support the MCI_FORMAT_MILLISECONDS format in addition to any format that is conventionally used with the device. Constants for the time formats include:

MCI Constant Description

MCI_FORMAT_BYTES Bytes
MCI_FORMAT_FRAMES Frames
MCI_FORMAT_HMS Hours, Minutes, Seconds
MCI_FORMAT_MILLISECONDS Milliseconds
MCI_FORMAT_MSF Minutes, Seconds, Frames
MCI_FORMAT_SAMPLES Samples
MCI_FORMAT_TMSF Tracks, Minutes, Seconds, Frames

When a time format is not specified, your device driver should assume a default time format. The following table lists the default formats for MCI device drivers:

MCI Device Type Default Time Format

cdaudio MSF
mmmovie Frames
overlay Not applicable
sequencer Specified by the MIDI file element
videodisc HMS for CLV, Frames for CAV
waveaudio Milliseconds

The MCI_SET_AUDIO flag sent by the application validates the dwAudio field of this data structure. The contents of this field identify the audio channel affected by the MCI_SET_ON or MCI_SET_OFF flags. Constants defined for dwAudio include MCI_SET_AUDIO_ALL, MCI_SET_AUDIO_LEFT, and MCI_SET_AUDIO_RIGHT to indicate both channels, the left channel, and the right channel. Your device driver can use other values for additional channels.