Animation and Movie Player Commands

The animation and movie player devices share a common command set for operation. This command set provides a common method for displaying animation sequences and movies in the Windows environment. The MCIMMP.DRV device driver for the multimedia movie player uses this command set for operation. Animation and movie player devices use the following command set:

Animation and Movie Player Commands

Command Description  

capability item Requests information about the capabilities of the graphics driver. The item is one of the following:  
  can eject Returns true if the device can eject the media. The MCIMMP movie player returns false.  
  can play Returns true if the device can play. The MCIMMP movie player returns true.  
  can record Returns false. Animation and movie player devices cannot record.  
  can reverse Returns true if the animation or movie player device can play in reverse.  
  can save Returns false. Animation and movie player devices cannot save data.  
  can stretch Returns true if the device can stretch frames to fill a given display rectangle. The MCIMMP movie player returns false.  
  compound device Returns true if the device requires an element name.  
  device type Animation and movie player devices return animation.  
  fast play rate Returns fast play rate in frames per second.  
  has audio Returns true if the device supports audio playback. The MCIMMP movie player has audio.  
  has video Returns true. Animation and movie devices are video devices.  
  normal play rate Returns normal play rate in frames per second.  
  slow play rate Returns the slow play rate in frames per second.  
  uses files Returns true if the element of a compound device is a file pathname.  
  uses palettes Returns true if the device uses palettes. The MCIMMP movie player returns true.  
  windows Returns the number of windows the device can support. The MCIMMP movie player returns 8.  
close Closes a device element and any resources associated with it.  
info item Fills a user-supplied buffer with information. One of the following optional item modifies info:  
  file Returns the name of the file used by the animation device or movie player in a null-terminated string.  
  product Returns the product name and model of the current device in a null-terminated string. The MCIMMP movie player returns Microsoft Multimedia Movie Player.  
  window text Returns the caption of the window used by the device.  
open items Initializes the animation device. The following optional items modify open:  
  alias device_ alias Specifies an alternate name for the animation or movie player element. If specified, it must also be used for subsequent references.  
  nostatic Indicates that the device should reduce the number of static (system) colors in the palette. Reducing the number of static colors increases the number of colors controlled by the animation. The MCIMMP movie player reduces the static colors to black and white while in the foreground.  
  parent hwnd Specifies the window handle of the parent window.  
  shareable Initializes a device element as shareable. Subsequent attempts to open it fail unless you specify shareable in both the original and subsequent open commands. MCI returns an invalid device error if it is already open and not shareable. The MCIMMP movie player does not allow shared files.  
  style style_type Indicates a window style.  
  style child Opens a window with a child window style.  
  style overlapped Opens a window with an overlapped window style.  
  style popup Opens a window with a popup window style.  
  type device_ type Specifies the device type of the device element. MCI reserves MMMovie for the movie player device type. As an alternative to type, MCI can use the [mci extension] entries in the SYSTEM.INI file to select the controlling device based on the extension used by the device element.  
pause Pauses playback of the animation if it is playing. If the animation is stopped, pause displays the animation if it is not visible and in the foreground.  
play items Starts playing the animation sequence. The following optional items modify play:  
  fast Plays the animation sequence at a fast rate.  
  from position to position Specifies the frame at which to start and/or stop playing. If from is omitted, play starts at the current frame; if to is omitted, play stops at the end frame.  
  reverse Indicates that the play direction is backwards.  
  scan Plays the animation sequence as fast as possible without disabling video.  
  slow Plays the animation sequence at a slow rate.  
  speed fps Plays the animation sequence at the specified speed fps. Speed is specified in frames per second.  
put items Defines the area of the source image and destination window used for display. One of the following items modify put:  
  destination Sets the whole window as the destination window.  
  destination at rectangle Specifies a rectangle for the area of the window used to display the image. The rectangle coordinates are relative to the window origin and are specified as X1 Y1 X2 Y2. The coordinates X1, Y1 specify the top, left corner, and the coordinates X2, Y2 specify the width and height of the rectangle. When an area of the display window is specified, and the device supports stretching, the source image is stretched to the destination offset and extent.  
  source Selects the whole image for display in the destination window.  
  source at rectangle Specifies a rectangle for the image area used for display. The rectangle coordinates are relative to the image origin and are specified as X1 Y1 X2 Y2. The coordinates X1, Y1 specify the top, left corner, and the coordinates X2, Y2 specify the width and height of the rectangle. When an area of the source image is specified, and the device supports stretching, the source image is stretched to the destination offset and extent.  
realize item Tells the device to select and realize its palette into a display context of the displayed window. One of the following items modifies realize:  
  background Realizes the palette as a background palette. The MCIMMP movie player does not support this option.  
  normal Realizes the palette normally. The MCIMMP movie player does not support this option.  
resume Resumes playing. The MCIMMP movie player does not support this option.  
seek item Moves to the specified position and stops. One of the following is required for item:  
  to position Specifies the position to stop the seek.  
  to start Specifies to seek to the start of the device element.  
  to end Specifies to seek to the end of the device element.  
set items Sets the various control items:  
  audio all off, audio all on Enables or disables audio output.  
  audio left off, audio left on Enables or disables output to the left audio channel.  
  audio right off, audio right on Enables or disables output to the right audio channel.  
  time format frames Sets the time format to frames. All position information is specified in frames following this command. When the device is opened, frames is the default mode.  
  time format milliseconds Sets the time format to milliseconds. All position information is this format after this command. You can abbreviate milliseconds as ms. The MCIMMP movie player does not support this option.  
  video off, video on Enables or disables video output. The MCIMMP movie player does not support this option.  
status item Obtains status information for the device. One of the following items modifies status:  
  current track Returns the current track. The MCIMMP movie player returns 1.  
  forward Returns true if the play direction is forward or if the device is not playing.  
  length Returns the total number of frames.  
  length track track_number Returns the total number of frames in the track specified by track_number.  
  media present Returns true if the media is inserted in the device; otherwise it returns false.  
  mode Returns not ready, paused, playing, seeking, or stopped for the current mode.  
  number of tracks Returns the number of tracks on the media. The MCIMMP movie player returns 1.  
  palette handle Returns the handle of the palette used for the animation in the low-order word of the return value.  
  position Returns the current position.  
  position track number Returns the position of the start of the track specified by number.  
  ready Returns true if the device is ready.  
  speed Returns the current speed of the device in frames per second.  
  start position Returns the starting position of the media or device element.  
  time format Returns the current time format.  
  window handle Returns the handle of the window used for the animation in the low-order word of the return value.  
step item Step the play one or more frames forward or reverse. The default action is to step one frame forward. The following items modify step:  
  by frames Indicates the number of frames to step.  
reverse Step the frames in reverse.  
stop Stops playing.  
update item Repaints the current frame into the specified display context. The following items modifies update:  
  at rectangle Specifies the clipping rectangle.  
  hdc hdc Specifies the handle of the display context to paint.  
where Obtains the rectangle specifying the source or destination area. One of the following items modifies where:  
  destination Requests the destination offset and extent.  
  source Requests the source offset and extent.  
window item Tells the animation or movie player to use a given window to display the images instead of the default window created by the driver. By default, these devices should create a window when opened but should not display it until they receive the play command. Applications providing window handles should manage the display issues that result when the window is sized or when the window handle is switched during play. Several flags manipulate the window. Since the status command can obtain the handle to the current display window, you can use the standard window functions instead. The following items modify window:  
  handle window_handle Specifies the handle of the destination window used as an alternate to the default window.  
  handle default Specifies that the animation device or movie player should set the current display window back to the driver's default window.  
  state hide Hides the current display window.  
  state iconic Displays the window as iconic.  
  state maximized Maximizes the current display window.  
  state minimize Minimizes the specified window and activates the top-level window in the window-manager's list.  
  state minimized Minimizes the current display window.  
  state no action Displays a display window in its current state. The window that is currently active remains active.  
  state no activate Displays a display window in its most recent size and state. The window that is currently active remains active.  
  state normal Activates and displays the current display window in its original size and position.  
  state show Shows the current display window.  
  text caption Specifies the caption for the display window.