Visual Basic: Multimedia MCI Control
The Multimedia MCI control manages the recording and playback of multimedia files on Media Control Interface (MCI) devices. Conceptually, this control is a set of push buttons that issues MCI commands to devices such as audio boards, MIDI sequencers, CD-ROM drives, audio CD players, videodisc players, and videotape recorders and players. The MCI control also supports the playback of Video for Windows (*.avi) files.
When you add the Multimedia MCI control to a form at design time, the control appears on the form as follows:
The buttons are defined as Prev, Next, Play, Pause, Back, Step, Stop, Record, and Eject, respectively.
Your application should already have the MCI device open and the appropriate buttons in the Multimedia MCI control enabled before the user is allowed to choose a button from the Multimedia MCI control. In Visual Basic, place the MCI Open command in the Form_Load event.
When you intend to record audio with the Multimedia MCI control, open a new file. This action ensures that the data file containing the recorded sound will be in a format compatible with your system's recording capabilities. Also, issue the MCI Save command before closing the MCI device to store the recorded data in the file.
The Multimedia MCI control is programmable in several ways:
- The control can be visible or invisible at run time.
- You can augment or completely redefine the functionality of the buttons in the control.
- You can control multiple devices in a form.
If you want to use the buttons in the Multimedia MCI control, set the Visible and Enabled properties to True. If you do not want to use the buttons in the control, but want to use the Multimedia MCI control for its multimedia functionality, set the Visible and Enabled properties to False. An application can control MCI devices with or without user interaction.
The events (button definitions) of the Multimedia MCI control are programmable. You can augment or completely redefine the functionality of these buttons by developing code for the button events.
The MCI extensions support multiple instances of the Multimedia MCI control in a single form to provide concurrent control of several MCI devices. You use one control per device.
Distribution Note When you create and distribute applications that use the Multimedia MCI control, you should install and register the appropriate files in the customer's Microsoft Windows System or System32 directory. The Package and Deployment Wizard included with Visual Basic provides tools to help you write setup programs that install your applications correctly.