Command Message and Command String Interfaces

When a user activates a PM control to use a multimedia device function, the OS/2 multimedia application window procedure sends a command to the media control interface. Depending on the needs of the application, the window procedure can use the command message interface or the command string interface to implement these device commands. Messages for the command message interface (also referred to as procedural interface) are sent with mciSendCommand. Strings for the command string interface are sent to the Media Device Manager for parsing, using the mciSendString function. See the following figure.

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|         mciSendCommand                     mciSendString                  |
|                │                                 │                        |
|                │                                 │                        |
|                                                                         |
|   ┌───────────────────────────────────────────────────────────┐           |
|   │          Media Device Manager Interface Layer             │           |
M   └──┬───────────────────────┬────────────────────────────────┘           |
D      │                       │                                            |
M      │                       │                           Default Tables   |
|      │                       │                            ┌──────────────┐|
|      │          ┌────────────┴──────────────┐         ┌───┤    System    │|
|      │          │    Table-Driven Parser    │────────┤   ├──────────────┤|
|      │          └────────────┬──────────────┘         │   │   waveaudio  │|
|      └─────────────┬─────────┘                       │   ├──────────────┤|
|                    │                      │           │   │   sequencer  │|
|                                          │           │   ├──────────────┤|
|    ┌───────────────────────────┐          │           │   │    cdaudio   │|
|    │    Media Device Manager   │          │           │   ├──────────────┤|
|    └──┬────────┬────────┬──────┘          │           │   │     cdxa     │|
|_ _ _ _│ _ _ _ _│ _ _ _ _│_ _ _ _ _ _ _ _ _│_ _ _      │   ├──────────────┤|
        │        │        │                 │    |      │   │    ampmix    │|
     ┌──┴───┐ ┌──┴───┐ ┌──┴───┐             │    |      │   ├──────────────┤|
     │Media │ │Media │ │Media │             │    |      │   │   videodisc  │|
     │Driver│ │Driver│ │Driver│             │    |      │   ├──────────────┤|
     └──────┘ └──────┘ └──────┘             │    |      │   │ digitalvideo │|
                       ┌──────┐             │    |      │   ├──────────────┤|
                       │Custom├─────────────┘    |      └───┤     other    │|
                       │Table │                  |          └──────────────┘|
                       └──────┘                  | _ _ _ _ _ _ _ _ _ _ _ _ _|

The string interface provides access to most functions of the message interface. However, operations that involve identifying multiple devices (for example, for the purpose of establishing connections), or operations that return complex data structures (such as a CD table of contents) are available only through the message interface.

Each time a message is sent to the Media Device Manager with mciSendCommand, flags are set and a pointer to a data structure is passed. Each time a string is passed with mciSendString, it must be converted to the message format understood by the media driver. The Media Device Manager calls the multimedia string parser, which is case insensitive, to interpret the strings. The time required for this conversion process makes the string method of control slightly slower than the message method. However, the string interface generally requires less application code than the command message interface. The string interface also lets users interactively control devices with a command line or PM interface. See Command Strings.


[Back: Media Control Interface]
[Next: Command Messages]