Media devices are categorized as simple or compound devices. A compound device is an internal device that operates on data objects, such as files, within the system. These data objects are referred to as device elements. A simple device is an external device that does not require a device element.
Media device types supported by OS/2 multimedia are shown in the following table.
┌────────────────────┬───────────────┬──────────────────────────────┐ │Logical Device Type │String │Constant │ ├────────────────────┼───────────────┼──────────────────────────────┤ │Amplifier-mixer │ampmix │MCI_DEVTYPE_AUDIO_AMPMIX │ ├────────────────────┼───────────────┼──────────────────────────────┤ │CD-DA player │cdaudio │MCI_DEVTYPE_CD_AUDIO │ ├────────────────────┼───────────────┼──────────────────────────────┤ │CD-XA player │cdxa │MCI_DEVTYPE_CDXA_PLAYER │ ├────────────────────┼───────────────┼──────────────────────────────┤ │Digital video player│digitalvideo │MCI_DEVTYPE_DIGITAL_VIDEO │ ├────────────────────┼───────────────┼──────────────────────────────┤ │MIDI sequencer │sequencer │MCI_DEVTYPE_SEQUENCER │ ├────────────────────┼───────────────┼──────────────────────────────┤ │Waveform audio │waveaudio │MCI_DEVTYPE_WAVEFORM_AUDIO │ │player │ │ │ ├────────────────────┼───────────────┼──────────────────────────────┤ │Videodisc player │videodisc │MCI_DEVTYPE_VIDEODISC │ └────────────────────┴───────────────┴──────────────────────────────┘
Device type constants represent one way of specifying devices in command messages. String names can be specified in either command messages or command strings.
To use the string interface to communicate with a device, an application calls mciSendString and passes the textual command open. Following is the syntax used for the textual command:
open device_name <shareable> <type device_type > <alias alias>
Parameters for the open command are:
┌────────────────────┬────────────────────────────────────────┐ │Parameters │Description │ ├────────────────────┼────────────────────────────────────────┤ │device_name │Specifies the name of a device or device│ │ │element. │ ├────────────────────┼────────────────────────────────────────┤ │shareable │Indicates the device or device element │ │ │may be shared by other applications. │ ├────────────────────┼────────────────────────────────────────┤ │type device_type │Specifies the device type when │ │ │device_name is a device element. │ ├────────────────────┼────────────────────────────────────────┤ │alias alias │Specifies an alternate name for the │ │ │device. │ └────────────────────┴────────────────────────────────────────┘
Here is an example of the syntax for opening a device:
open horns.wav type waveaudio alias sound1
where "horns.wav" is the device element and "waveaudio" is the device type.
The system also supports a shortcut version of the syntax: open device_type!element_name
The shortcut version of the previous example looks like this:
open waveaudio!horns.wav alias sound1