Using Script-Channel Commands

Movie files can include textual script commands. Script statements are entered in a movie file and referenced in the script channel. The Movie Player recognizes two script-channel commands that allow a movie to send command strings to MCI. For example, a movie can use MCI to play a MIDI file during a specific range of frames.

MacroMind Director includes a script language, Lingo, that allows authors to create interactive movies. The Movie Player does not support Lingo and ignores any Lingo statements in the script channel. Contact MacroMind for information on licensing a version of the Movie Player that supports Lingo.

The Movie Player can pass script commands to a movie player application for processing. This allows you to define and process your own set of script commands.

Script Commands for Controlling MCI Devices

The following commands allow you to control MCI devices from a movie (these commands are not case sensitive):

Command Description

mci <MCI command string> Sends the specified command string to MCI for processing. The <MCI command string> consists of an MCI command string, optionally enclosed in single or double quotation marks.
mciWait <DeviceName> Pauses frame advancement until the previous MCI command sent to the device is complete. If no command is outstanding, the movie continues to play. The <Device Name> is a valid MCI device name opened in a previous frame.

You most open the MCI device before sending commands to it. See Chapter 2, “The Media Control Interface (MCI),” for information on using MCI command strings.

Multiple MCI commands can be called from one script-channel command; just separate each MCI command with a semicolon (;). However, a series of MCI commands called from one script-channel command will not necessarily execute sequentially. If the commands need to be processed in a specific order, place them in separate frames.

Note:

Before the playback application ends, the Movie Player automatically closes any open MCI devices.

For example, a movie can open a waveform audio file at frame number 25 and start playback at frame 26. At frame 30, it could pause the frame advance until MCI finishes playing the audio file. The following script-channel commands would accomplish this:

Frame Script-Channel Text

25 mci open firetruk.wav type waveaudio alias truck
26 mci play truck
30 mciWait truck
31 mci close truck

For more detailed examples on using the MCI script-channel commands, see the Multimedia Authoring Guide.

Application-Specific Script Commands

The Movie Player can pass the contents of the script channel to an application. The application assigns a callback function that the Movie Player executes at the following times:

After the Movie Player completes frame and subframe updates

Before the Movie Player processes the script-channel text for the frame

Chapter 7, “Using the Movie Player Functions,” describes how you might create a simple script-channel command processor using this capability.