I am about to write a program for a friend that plays an MP3
or WAV file using mciSendString. I *want* to use a MODAL
Dialog that will be used for my friend to select which song
to play. Selecting the songs, and playing them, quitting the
program, etc. aren't a problem. My problem is how to use
the Dialog's Callback Function to process an action ON DEMAND.
The on-demand action is the mci function that checks to see if
the soundfile is finished being played. I can't simply put
a loop in in the Callback Function to do this because then
loop would preclude the ability (maybe?) to react to the user
selecting a different song while a song is currently being
played. Or does selecting a control in a Modal Dialog override
any currently running code? Is it possible to use a thread
from within the Callback to monitor the status of the song
currently playing? But, maybe the thread would create contention
with a new song being selected while one is currently playing?
I need the on-demand processing so it CLOSEs the open mci-playing
I know how to close it if a song is currently playing, and a new
song is selected. That'd be easy to code in the %WM_COMMAND.
What I need to be able to do is close the mci function if a song
has finished playing and a new song has NOT been selected.
In a nutshell, the program has to be able to monitor any
currently playing files, and close the mci if it finishes.
I already know how to do this using a MODELESS Dialog. For that,
I could put the monitoring inside the WINMAIN's DOEVENTS loop.
But, that seems kind of kludgey to me. Also, I'm interested in
doing it with a MODAL Dialog so I can learn some new programming
techniques, for future uses.
Any ideas?
Thanks in advance!
------------------
Clay C. Clear
http://www.v3space.com/a/a39/202/
[email protected]
[email protected]
or WAV file using mciSendString. I *want* to use a MODAL
Dialog that will be used for my friend to select which song
to play. Selecting the songs, and playing them, quitting the
program, etc. aren't a problem. My problem is how to use
the Dialog's Callback Function to process an action ON DEMAND.
The on-demand action is the mci function that checks to see if
the soundfile is finished being played. I can't simply put
a loop in in the Callback Function to do this because then
loop would preclude the ability (maybe?) to react to the user
selecting a different song while a song is currently being
played. Or does selecting a control in a Modal Dialog override
any currently running code? Is it possible to use a thread
from within the Callback to monitor the status of the song
currently playing? But, maybe the thread would create contention
with a new song being selected while one is currently playing?
I need the on-demand processing so it CLOSEs the open mci-playing
I know how to close it if a song is currently playing, and a new
song is selected. That'd be easy to code in the %WM_COMMAND.
What I need to be able to do is close the mci function if a song
has finished playing and a new song has NOT been selected.
In a nutshell, the program has to be able to monitor any
currently playing files, and close the mci if it finishes.
I already know how to do this using a MODELESS Dialog. For that,
I could put the monitoring inside the WINMAIN's DOEVENTS loop.
But, that seems kind of kludgey to me. Also, I'm interested in
doing it with a MODAL Dialog so I can learn some new programming
techniques, for future uses.
Any ideas?
Thanks in advance!

------------------
Clay C. Clear
http://www.v3space.com/a/a39/202/
[email protected]
[email protected]
Comment