status
The status command requests status information from a device. All devices recognize this command.
To send this command, call the mciSendString function with the lpszCommand parameter set as follows.
_stprintf_s(
lpszCommand,
TEXT("status %s %s %s"),
lpszDeviceID,
lpszRequest,
lpszFlags
);
Parameters
lpszDeviceID
Identifier of an MCI device. This identifier or alias is assigned when the device is opened.
lpszRequest
Flag for requesting status information. The following table lists device types that recognize the status command and the flags used by each type.
Value | Meaning | Meaning |
cdaudio | cdaudio type track number current track length length track number media present mode |
number of tracks position position track number ready start position time format |
digitalvideo | audio audio alignment audio bitspersample audio breaks audio bytespersec audio input audio record audio source audio samplespersec audio stream bass bitsperpel brightness color contrast current track disk space drive file completion file format file mode forward frames skipped gamma input left volume length length track number media present mode monitor monitor method nominal nominal frame rate nominal record frame rate number of tracks |
output palette handle pause mode play speed position position track number ready record frame rate reference frame reserved size right volume seek exactly sharpness smpte speed start position still file format time format tint treble unsaved video video key index video key color video record video source video source number video stream volume window handle window visible window minimized window maximized |
overlay | media present mode number of tracks |
ready stretch window handle |
sequencer | current track division type length length track number master media present mode number of tracks offset |
port position position track number ready slave start position tempo time format |
vcr | assemble record audio monitor audio monitor number audio record audio record track number audio source audio source number channel channel tuner number clock clock id counter counter format counter resolution current track frame rate index index on length length track number media present media type mode number of audio tracks number of tracks number of video tracks |
pause timeout play format position position start position track number postroll duration power on preroll duration ready record format speed time format time mode time type timecode present timecode record timecode type tuner number video monitor video monitor number video record video record track number video source video source number write protected |
videodisc | current track disc size forward length length track number media present media type mode |
number of tracks position position track number ready side speed start position time format |
waveaudio | alignment bitspersample bytespersec channels current track format tag input length length track number level |
media present mode number of tracks output position position track number ready samplespersec start position time format |
The following table lists the flags that can be specified in the lpszRequest parameter and their meanings.
Value | Meaning |
alignment | Returns the block alignment of data, in bytes. |
assemble record | Returns TRUE if the device is set to assemble mode recording. |
audio | Returns "on" or "off" depending on the most recent setaudio "on" or "off" command. It returns "on" if either or both speakers are enabled, and "off" otherwise. |
audio alignment | Returns the alignment of data blocks relative to the start of input waveform-audio data. |
audio bitspersample | Returns the number of bits per sample the device uses for recording. This flag applies only to devices supporting the "pcm" algorithm. |
audio breaks | Returns the number of times the audio portion of the last AVI sequence broke up. The system counts an audio break whenever it attempts to write audio data to the device driver and discovers that the driver has already played all of the available data. This flag is recognized only by the MCIAVI digital-video driver. It is meant for performance evaluation only; the return value is difficult to interpret. |
audio bytespersec | Returns the average number of bytes per second used for recording. |
audio input | Returns the approximate instantaneous audio level of the analog input audio signal. A value greater than 1000 implies clipping distortion. Some devices can return this value only while recording audio. The value has no associated set or setaudio command. |
audio monitor | Returns "output", or one of the valid source-input types. For more information, see the setaudio "monitor" command. |
audio monitor number | Returns the monitored-video number of the type specified by status "audio monitor". For more information, see the setaudio command. |
audio record | Returns "on" or "off", reflecting the state set by setaudio "record". |
audio record track number | Returns TRUE if the VCR is set to record audio. If no track number is given, the default value of 1 is assumed. |
audio samplespersec | Returns the number of samples per second recorded. |
audio source | Returns the current audio digitizer source: "left", "right", "average", or "stereo". |
audio source number | Returns the audio-source number of the type returned by status "audio source". For more information, see the setaudio command. |
audio stream | Returns the current audio-stream number. |
bass | Returns the current audio-bass level. |
bitsperpel | Returns the number of bits per pixel for saving captured or recorded data. |
bitspersample | Returns the bits per sample. |
brightness | Returns the current video-brightness level. |
bytespersec | Returns the average number of bytes per second played or recorded. |
cdaudio type track number | Returns the type of the specified track number. This can be "audio" or "other." |
channel | Returns the integer value of the channel set on the tuner. |
channel tuner number | If "tuner" number is given, then the currently selected channel on the logical tuner number will be returned. Note that there can be several logical tuners. |
channels | Returns the number of channels set (1 for mono, 2 for stereo). |
clock | Returns the external time. The time must be an unsigned long integer expressing total increments. For more information, see the capability "clock increment rate" command. |
clock id | Returns a unique integer identifying the clock. |
color | Returns the current color level. |
contrast | Returns the current contrast level. |
counter | Returns the counter position, in the current counter format. |
counter format | Returns the current counter format. For more information, see the set "counter format" command. |
counter resolution | Returns "frames" or "seconds", indicating the counter's resolution. This is not the same as accuracy. |
current track | Returns the current track. The MCISEQ sequencer returns 1. |
disc size | Returns either 8 or 12, indicating the size of the loaded disc in inches. |
disk space drive | Returns the approximate disk space, in the current time format, that can be obtained by a reserve command for the specified disk drive. The drive is usually specified as a single letter or a single letter followed by a colon (:). Some devices, however, might use a path. |
division type | Returns one of the following file division types:
PPQN Use this information to determine the format of the MIDI file and the meaning of tempo and position information. |
file completion | Returns the estimated percentage a load, save, capture, cut, copy, delete, paste, or undo operation has progressed. (Applications can use this to provide a visual indicator of progress.) |
file format | Returns the current file format for record or save commands. |
file mode | Returns "loading", "saving", "editing", or "idle". During a load operation, it returns "loading". During save and capture operations, it returns "saving". During cut, copy, delete, paste, or undo operations, it returns "editing". |
format tag | Returns the format tag. |
forward | Returns TRUE if the play direction is forward or if the device is not playing. |
frame rate | Returns the number of frames per second that the device will use by default. NTSC devices return 30, PAL 25, and so on. |
frames skipped | Returns the number of frames that were not drawn when the last AVI sequence was played. This flag is recognized only by the MCIAVI digital-video driver. It is meant for performance evaluation only; the return value is difficult to interpret. |
gamma | Returns the value set with setvideo "gamma to" value. |
index | Returns the current index display. For more information, see the set "index" command. |
index on | Returns TRUE if the index is on. |
input | Returns the input set. If one is not set, the error returned indicates that any device can be used.
For digital-video devices, modifies the "bass", "treble", "volume", "brightness", "color", "contrast", "gamma", "sharpness", or "tint" flag so that it applies only to the input. This is the default when monitoring the input. |
left volume | Returns the volume set for the left audio channel. |
length | Returns the total length of the media, in the current time format.
For PPQN files, the length is returned in song pointer units. For SMPTE files, it is returned as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. For VCR devices, the length is 2 hours (unless the length has been explicitly changed using the set command). |
length track number | Returns the length of the track, in time or frames, specified by number.
For PPQN files, the length is returned in song pointer units. For SMPTE files, it is returned as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. |
level | Returns the current PCM audio sample value. |
master | Returns "midi", "none", or "smpte" depending on the type of synchronization set. |
media present | Returns TRUE if the media is inserted in the device or FALSE otherwise. Sequencer, video-overlay, digital-video, and waveform-audio devices return TRUE. |
media type | Returns the type of the media. For VCRS, this is "8mm", "vhs", "svhs", "beta", "Hi8", "edbeta", or "other". For videodiscs, this is "CAV", "CLV", or "other", depending on the type of videodisc. |
mode | Returns the current mode of the device. All devices can return the "not ready", "paused", "playing", and "stopped" values. Some devices can return the additional "open", "parked", "recording", and "seeking" values. |
monitor | Returns "file" or "input". The returned value indicates the current presentation source. |
monitor method | Returns "pre", "post", or "direct". The returned value indicates the method used for input monitoring. |
nominal | The item modifies the "bass", "brightness", "color", "contrast", "gamma", "sharpness", "tint", "treble," and "volume" flags to return the nominal value instead of the current setting. |
nominal frame rate | Returns the nominal frame rate associated with the file. The units are in frames per second multiplied by 1000. |
nominal record frame rate | Returns the nominal frame rate associated with the input video signal. The units are in frames per second multiplied by 1000. |
number of audio tracks | Returns the number of audio tracks on the media. |
number of tracks | Returns the number of tracks on the media. The MCISEQ and MCIWAVE devices return 1, as do most VCR devices. The MCIPIONR device does not support this flag. |
number of video tracks | Returns the number of video tracks on the media. |
offset | Returns the offset of a SMPTE-based file. The offset is the start time of a SMPTE-based sequence. The time is returned as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. |
output | Returns the currently set output. If no output is set, the error returned indicates that any device can be used.
For digital-video devices, modifies the "bass", "treble", "volume", "brightness", "color", "contrast", "gamma", "sharpness", or "tint" flag so that it applies only to the output. This is the default when monitoring a file. |
pause mode | Returns "recording" if the device is paused while recording. It returns "playing" if the device is paused while playing. It returns the error "Action not applicable in current mode" if the device is not paused. |
pause timeout | Returns the maximum duration, in milliseconds, of a pause command. |
play format | Returns a code indicating the format that the videotape will be played back in, if detectable: "lp", "ep", "sp", or "other". For more information, see the "record format" flag. |
play speed | Returns a value representing how closely the actual playing time of the last AVI sequence matched the target playing time. The value 1000 indicates that the target time and the actual time were the same. A value of 2000, for example, would indicate that the AVI sequence took twice as long to play as it should have. This flag is recognized only by the MCIAVI digital-video driver. It is meant for performance evaluation only; the return value is difficult to interpret. |
port | Returns the MIDI port number assigned to the sequence. |
position | Returns the current position.
For PPQN files, the position is returned in song pointer units. For SMPTE files, it is returned as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. |
position start | Returns the position of the start of the usable media. |
position track number | Returns the position of the start of the track specified by number.
For PPQN files, the time format is returned in song pointer units. For SMPTE files, it is returned as hh:mm:ss:ff, where hh is hours, mm is minutes, ss is seconds, and ff is frames. The MCISEQ sequencer returns zero. The MCIPIONR device does not support this flag. The MCIWAVE device returns zero. |
postroll duration | Returns the length of videotape, in the current time format, needed to brake the VCR transport when a stop or pause command is issued. |
power on | Returns TRUE if the VCR's power is on. |
preroll duration | Returns the length of videotape, in the current time format, needed to stabilize the VCR output. |
ready | Returns TRUE if the device is ready to accept another command. |
record format | Returns a code indicating the format that the videotape will be recorded in. The current return types are "lp", "ep", "sp", or "other". These formats are not VHS specific and can be applied to any VCR that has multiple selectable recording formats. The "sp" type is the fastest, highest quality recording format and is used as default on single format VCRs. |
record frame rate | Returns the frame rate, in frames per second multiplied by 1000, used for compression. |
reference frame | Returns the frame number for the nearest key frame image that precedes the specified frame. |
reserved size | Returns the size, in the current time format, of the reserved workspace. The size corresponds to the approximate time it would take to play the compressed data from a full workspace. It returns zero if there is no reserved disk space. This flag returns the approximate size because the precise disk space for compressed data cannot, in general, be predicted until after the data has been compressed. |
right volume | Returns the volume set for the right audio channel. |
samplespersec | Returns the number of samples per second played or recorded. |
seek exactly | Returns "on" or "off", indicating whether or not the "seek exactly" flag is set. |
sharpness | Returns the current sharpness level of the device. |
side | Returns 1 or 2 to indicate which side of the videodisc is loaded. |
slave | Returns "file", "midi", "none", or "smpte" depending on the type of synchronization set. |
smpte | Returns the SMPTE timecode associated with the current position in the workspace. This is a string with the form dd:dd:dd:dd, where each d denotes a digit from 0 to 9. If the workspace data does not include timecode data, then this flag returns 00:00:00:00. |
speed | Returns the current speed of the device in frames per second (or in the same format used by the set "speed" command). The MCIPIONR videodisc player does not support this flag. |
start position | Returns the starting position of the media. |
still file format | Returns the current file format for the capture command. |
stretch | Returns TRUE if stretching is enabled. |
tempo | Returns the current tempo of a MIDI sequence in the current time format. For files with PPQN format, the tempo is in beats per minute. For files with SMPTE format, the tempo is in frames per second. |
time format | Returns the current time format. For more information, see the time formats in the set command. |
time mode | Returns the current position time mode. It can be "detect", "timecode", or "counter". |
time type | Returns the current position time in use: "timecode" or "counter". |
timecode present | Returns TRUE if timecode has been recorded at the current position on the tape. The timecode must advance from the current position. A VCR might need to be played to check this condition. |
timecode record | Returns TRUE if the VCR is set to record timecode. |
timecode type | Returns "smpte", "smpte drop", "other", or "none". Note the frames per second can be obtained from the status "frame rate" command, and the accuracy of the device can be returned by the capability "seek accuracy" command. |
tint | Returns the current video-tint level. |
treble | Returns the current audio-treble level. |
tuner number | Returns the current logical-tuner number. |
unsaved | Returns TRUE if there is recorded data in the workspace that might be lost as a result of a close, load, record, reserve, cut, delete, or paste command. Returns FALSE otherwise. |
video | Returns "on" or "off", reflecting the state set by the setvideo command. |
video key color | Returns the value for the key color. |
video key index | Returns the value for the key index. |
video monitor | Returns "output" or one of the valid source-input types. For more information, see the setvideo "monitor" command. |
video monitor number | Returns the monitored-video number of the type returned by status "video monitor". For more information, see the setvideo command. |
video record | Returns "on" or "off", reflecting the current state set by setvideo "record". |
video record track number | Return TRUE if the VCR is set to record video. If no track number is given, the default value of 1 is assumed. |
video source | Returns the video-source type. For more information, see the setvideo command. |
video source number | Returns a number corresponding to the video source of the type in use. For example, it returns 2 if the second NTSC video source input is being used. |
video stream | Returns the current video-stream number. |
volume | Returns the average volume to the left and right speaker. This returns an error if the device has not been played or volume has not been set. |
window handle | Returns ASCII decimal value for the window handle in the low-order word of the return value. |
window maximized | Returns TRUE if the window is maximized. |
window minimized | Returns TRUE if the window is minimized. |
window visible | Returns TRUE if the window is not hidden. |
write protected | Returns TRUE if the device detects that it cannot record (that is, if the write protect is on). If it can record, or if it is unable to determine whether or not it can record (without actually writing), the driver returns FALSE. |
lpszFlags
Can be "wait", "notify", or both. For digital-video and VCR devices, "test" can also be specified. For more information about these flags, see The Wait, Notify, and Test Flags.
Return Values
Returns information in the lpszReturnString parameter of mciSendString. The information is dependent on the request type.
Remarks
Before issuing any commands that use position values, you should set the desired time format by using the set command.
The following command returns the current mode of the "mysound" device:
status mysound mode
Requirements
** Windows NT/2000/XP:** Included in Windows NT 3.1 and later.
** Windows 95/98/Me:** Included in Windows 95 and later.
See Also
MCI, MCI Command Strings, capability, capture, close, cut, delete, load, mciSendString, pause, paste, record, reserve, save, set, setaudio, setvideo, stop, undo