Program Flow
The following figure illustrates the interaction between the captioning
components and the media control interface layer. Source code for the Caption
Sample Application and Caption DLL are located respectively in the \TOOLKIT\SAMPLES\MM\CAPSAMP
and \TOOLKIT\SAMPLES\MM\CAPDLL subdirectories.
┌───────────────────┐
│ Caption │
│ Sample ├───(2D)──────┐
│ Application │ │
└┬──┬──┬──┬──┬──┬──┬┘ │
(2)(3)(4)(1)(2)(4)(5) │
│ │ │ │
│ │ │ ┌───────────────┐ ┌──┴────┐
│ │ │ │ Caption DLL │(2D) │Caption│
│ │ │ │ │ │ File │
│ │ │ └┬──────────────┘ └───────┘
│ │ │ (2B)
│ │ │ │ (2C)
----------│-----------------------------------
┌───────────────────────────┐ OS/2 Multimedia
│ Media Control Interface │
└───────────────────────────┘
- As part of its initialization and termination
routines, the Caption Sample Application issues ccInitialize
and ccTerminate, respectively,
to notify the Caption DLL to begin and end captioning. As part of the termination
process, the Caption DLL releases any resources previously allocated for
captioning.
- When you select Play, the Caption Sample
Application opens the audio file, obtains a device ID, and plays the audio
file. The Caption Sample Application queries the captioning flag. (You can
set this flag by selecting the Captioning check box on the System page of
the Multimedia Setup.) If this flag is set, the application issues ccSendCommand
with a CC_START message to the Caption DLL. The Caption DLL then begins
to provide captioning for the application.
- 2B)
When the Caption DLL receives the request
to begin captioning, it issues a set position advise message to the multimedia
system for every 1500 time units.
(2C)
When
the device moves 1500 time units, the Caption DLL receives an MM_MCIPOSITIONCHANGE
message from the multimedia system.
(2D)
Whenever
the Caption DLL receives the MM_MCIPOSITIONCHANGE message, it checks the
caption file for the appropriate line to display, based on the current position
of the audio file. The Caption DLL then scrolls the caption window in the
application, to display the appropriate line.
(3)
If you pause the audio file, change the volume, or
move the audio slider position, the Caption Sample Application does not
have to perform any additional processing to manage the caption window.
This processing is managed by the Caption DLL.
(4)
When you select Stop, the Caption Sample Application
sends an MCI_STOP message to the audio device. The application then issues
ccSendCommand with a CC_STOP message,
informing the Caption DLL to stop displaying the caption window in the application.
(5)
You can change several
properties of the caption window by selecting Settings from the Options
menu of the Caption Sample Application. The application issues ccSendCommand
with a CC_STATUS message to query the current properties of the caption
window. When you select OK to save the desired properties, the Caption
Sample Application issues the ccSendCommand
with a CC_SET message to the Caption DLL. The Caption DLL handles changing
and displaying the new properties of the caption window.
[Back: CAPSAMP and CAPDLL]
[Next: CLOCK - Memory Playlist Sample]