Default and Device Context Connections

Device connections are usually automatically established by the media device when the device is opened. The choice of connection is determined by a default established during installation of the media driver, and can be re-established using the MCI_DEFAULT_CONNECTION message.

Once opened, the media device may open and connect to another media device to provide the complete function of the originally opened device to the application. This is transparent to the calling application. One example is the waveaudio device, which uses a connected amplifier-mixer device to actually produce sound from the digital audio stream. The waveaudio device also uses the services of the amplifier-mixer device to set the volume.

While some services of the connected device can be surfaced in the definition of the originally opened device, the connected device can also provide some extended features beyond those required by the original device. If the application wishes to access these extended features, it can get the handle to the particular device context or instance of the connected device, using the MCI_CONNECTION message.

Note the subtle difference between a default connection and a device context connection. A default connection is the name of a connected device, whereas a device context connection is the actual handle to a particular instance of an opened device. An example of this is a waveaudio01 device that has a default connection to an ampmix01 device. When the waveaudio01 device is opened, it automatically opens the ampmix01 device, creating an instance of each device. Because devices may be shared in OS/2 multimedia, the waveaudio01 device can be opened again by another application and two new instances will be created. Although the default connection is the same in both cases, the device context connections are different.


[Back: Establishing Connections between Devices]
[Next: Connectors Supported by Media Drivers]