Every time you want to play a chime, open the device you want to play, play
it, and close it. The logic for the Memory Playlist Sample implementation
of the playlist is outlined in in the following figure.
(6)
³
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ "Play Chime" ³ ³Deal with chiming³ ³ MM_MCINOTIFY ³
³ push button ³ ³ (Open) ³ ³ (Play or Open) ³
³ ³ ³ ³ ³ ³
ÀÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÙ
(1) (2)³ (7)
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Find the nearest ³ ³ ³ Chiming is done.³
³chime time and ³ ³ ³ Stop swinging ³
³play it (Open) ³ ³ ³ the bell ³
ÀÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
³
³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ ³ Find and play ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄij the correct ³
³ chime ³
ÀÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÙ
(3)³
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ Open Playlist ³
³ chime device ³
³with MCI_WAIT set³
ÀÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÙ
(4)³
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Set up chime file³
³ information ³
³ ³
ÀÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÙ
(5)³
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ Play Playlist ³
³ with notify set ³
³ ³
ÀÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÙ
³
(6)
- If Play chime is selected, processing
is passed to the FindTheNearestChimeTimeAndPlayIt procedure, which calculates
the next hour so its chime can be played. The procedure calls FindAndPlayTheCorrectChime
to do the actual work required to play the chime.
- If it is a normally scheduled chime time
(if a quarter hour has been reached), processing is passed to FindAndPlayTheCorrectChime.
- FindAndPlayTheCorrectChime calls OpenPlaylistChimeDevice
to do open processing with MCI_WAIT specified.
- When the OPEN command completes, the Waveform
Audio Media Driver needs information about the waveform file. The FindAndPlayTheCorrectChime
procedure calls SetupChimeFileInformation to pass this information to the
driver.
- After calling SetupChimeFileInformation,
the FindAndPlayTheCorrectChime procedure issues the mciSendCommand request
to play the chime with the notify flag set.
- After the chime has finished playing, a notification
message is sent to the MainDialogProc and handled by the MM_MCINOTIFY case
of the switch statement.
- In the MM_MCINOTIFY case of MainDialogProc,
when usMCIUserParameter is set to indicate the chime has stopped
playing, the swinging of the bell is stopped and the device is closed.
[Back]
[Next]