The following figure illustrates how the DUET1 sample program interfaces with the Media Device Manager (MDM) to handle the concept of grouping. Source code for DUET1 is located in the \TOOLKIT\SAMPLES\MM\DUET1 subdirectory.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ DUET1 ³ ³ Sample ³ ³ Program ³ ÀÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÙ ÚÄÄÙ (1) ÀÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Waveform ³ ³ Waveform ³ ³ Audio ³ ³ Audio ³ ³Device Context 1³ (2) ³Device Context 2³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÙ ÀÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄ¿ ÚÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Media Device ³ ³ Manager ³ ³ ³ ÀÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÙ ³ ÚÄÄÄÄ¿ ³WAVE³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³File³¿ ³ Waveform ³ ÀÄÄÄÄÙ ³ ÚÄ¿ ³ Audio Media ³ ÀijM³ ³ Driver ³ ³M³ ÀÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÙ ÚijI³ (3) ³ ³ ³O³ ÚÄÄÄÄ¿ ³ ÀÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³WAVE³Ù ³ Sync/Stream ³ ³File³ ³ ³ Manager ³ ÀÄÄÄÄÙ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ÚÄÄÄÄÄÁÄÄÄÄÄÄÄÄ¿ (4) ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ File System ³ ÚÄÂÄÂÄÂÄÂÄ¿ ³ Audio ³ ³Stream HandlerÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³ ³ ³ ÃÄÄÄÄÄÄÄ´Stream Handler³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÁÄÁÄÁÄÁÄÙ ÀÄÄÄÄÄÄÂÄÄÄÄÄÄÄÙ (5) ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Audio DD ³ ³ ³ ÀÄÄÄÄÄÄÂÄÄÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Audio HW ³ ³ ³ ÀÄÄÄÄÄÄÄÄ¿ ÚÙ ÀÄÄÄÄÙ
Each part of the duet is played through the OS/2 multimedia system using a separate instance of a logical media device. In this case, it uses two instances of the logical waveform device, the Waveform Audio Media Driver. When the Duet Player is ready to play a song, it issues the MCI_GROUP command to the MDM to set up a group of two logical waveform devices. The MDM returns a group handle to the application, so that the application can refer to that group as a single unit (instead of having to manage each logical device separately). The MDM handles the management of the logical media devices for the application.
When you select Play, Pause, or Stop, the application issues an MCI_PLAY, MCI_PAUSE, or MCI_STOP message to the MDM. The MDM then passes this message to the appropriate media devices in the group.