status

status command

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.

Device TypeRequest Flags
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
alignmentReturns the block alignment of data, in bytes.
assemble recordReturns 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 alignmentReturns the alignment of data blocks relative to the start of input waveform-audio data.
audio bitspersampleReturns the number of bits per sample the device uses for recording. This flag applies only to devices supporting the "pcm" algorithm.
audio breaksReturns 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 bytespersecReturns 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 numberReturns TRUE if the VCR is set to record audio. If no track number is given, the default value of 1 is assumed.
audio samplespersecReturns the number of samples per second recorded.
audio sourceReturns 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 streamReturns the current audio-stream number.
bassReturns the current audio-bass level.
bitsperpelReturns the number of bits per pixel for saving captured or recorded data.
bitspersampleReturns the bits per sample.
brightnessReturns the current video-brightness level.
bytespersecReturns the average number of bytes per second played or recorded.
cdaudio type track numberReturns the type of the specified track number. This can be "audio" or "other."
channelReturns 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.
channelsReturns 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 idReturns a unique integer identifying the clock.
colorReturns the current color level.
contrastReturns the current contrast level.
counterReturns 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 resolutionReturns "frames" or "seconds", indicating the counter's resolution. This is not the same as accuracy.
current trackReturns the current track. The MCISEQ sequencer returns 1.
disc sizeReturns 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
  • SMPTE 24 frame
  • SMPTE 25 frame
  • SMPTE 30 drop frame
  • SMPTE 30 frame

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 modeReturns "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 tagReturns the format tag.
forwardReturns TRUE if the play direction is forward or if the device is not playing.
frame rateReturns the number of frames per second that the device will use by default. NTSC devices return 30, PAL 25, and so on.
frames skippedReturns 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.
gammaReturns the value set with setvideo "gamma to" value.
indexReturns the current index display. For more information, see the set "index" command.
index onReturns TRUE if the index is on.
inputReturns 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 volumeReturns the volume set for the left audio channel.
lengthReturns 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 numberReturns 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.

levelReturns the current PCM audio sample value.
masterReturns "midi", "none", or "smpte" depending on the type of synchronization set.
media presentReturns TRUE if the media is inserted in the device or FALSE otherwise. Sequencer, video-overlay, digital-video, and waveform-audio devices return TRUE.
media typeReturns 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.
modeReturns 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.
monitorReturns "file" or "input". The returned value indicates the current presentation source.
monitor methodReturns "pre", "post", or "direct". The returned value indicates the method used for input monitoring.
nominalThe 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 rateReturns the nominal frame rate associated with the file. The units are in frames per second multiplied by 1000.
nominal record frame rateReturns the nominal frame rate associated with the input video signal. The units are in frames per second multiplied by 1000.
number of audio tracksReturns the number of audio tracks on the media.
number of tracksReturns 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 tracksReturns the number of video tracks on the media.
offsetReturns 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.
outputReturns 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 modeReturns "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 timeoutReturns the maximum duration, in milliseconds, of a pause command.
play formatReturns 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 speedReturns 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.
portReturns the MIDI port number assigned to the sequence.
positionReturns 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 startReturns the position of the start of the usable media.
position track numberReturns 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 durationReturns the length of videotape, in the current time format, needed to brake the VCR transport when a stop or pause command is issued.
power onReturns TRUE if the VCR's power is on.
preroll durationReturns the length of videotape, in the current time format, needed to stabilize the VCR output.
readyReturns TRUE if the device is ready to accept another command.
record formatReturns 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 rateReturns the frame rate, in frames per second multiplied by 1000, used for compression.
reference frameReturns the frame number for the nearest key frame image that precedes the specified frame.
reserved sizeReturns 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 volumeReturns the volume set for the right audio channel.
samplespersecReturns the number of samples per second played or recorded.
seek exactlyReturns "on" or "off", indicating whether or not the "seek exactly" flag is set.
sharpnessReturns the current sharpness level of the device.
sideReturns 1 or 2 to indicate which side of the videodisc is loaded.
slaveReturns "file" , "midi", "none", or "smpte" depending on the type of synchronization set.
smpteReturns 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.
speedReturns 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 positionReturns the starting position of the media.
still file formatReturns the current file format for the capture command.
stretchReturns TRUE if stretching is enabled.
tempoReturns 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 formatReturns the current time format. For more information, see the time formats in the set command.
time modeReturns the current position time mode. It can be "detect", "timecode", or "counter".
time typeReturns the current position time in use: "timecode" or "counter".
timecode presentReturns 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 recordReturns TRUE if the VCR is set to record timecode.
timecode typeReturns "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.
tintReturns the current video-tint level.
trebleReturns the current audio-treble level.
tuner numberReturns the current logical-tuner number.
unsavedReturns 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.
videoReturns "on" or "off", reflecting the state set by the setvideo command.
video key colorReturns the value for the key color.
video key indexReturns the value for the key index.
video monitorReturns "output" or one of the valid source-input types. For more information, see the setvideo "monitor" command.
video monitor numberReturns the monitored-video number of the type returned by status "video monitor". For more information, see the setvideo command.
video recordReturns "on" or "off", reflecting the current state set by setvideo "record".
video record track numberReturn TRUE if the VCR is set to record video. If no track number is given, the default value of 1 is assumed.
video sourceReturns the video-source type. For more information, see the setvideo command.
video source numberReturns 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 streamReturns the current video-stream number.
volumeReturns 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 handleReturns the ASCII decimal value for the window handle in the low-order word of the return value.
window maximizedReturns TRUE if the window is maximized.
window minimizedReturns TRUE if the window is minimized.
window visibleReturns TRUE if the window is not hidden.
write protectedReturns 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 Value

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.

Examples

The following command returns the current mode of the "mysound" device.

status mysound mode

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

See also

MCI
MCI Command Strings
capability
capture
close
cut
delete
load
pause
paste
record
reserve
save
set
setaudio
setvideo
stop
undo

 

 

Community Additions

ADD
Show:
© 2016 Microsoft