Re: [madplay]:audio_win32.c::struct buffer.event_handle: Can not find the time that sets the event object to the signaled state

Rob Leslie <[email protected]> Fri, 19 Aug 2005 11:39:24 -0700
Newsgroups gmane.comp.audio.mad.devel
Message-ID <[email protected]>
On Aug 18, 2005, at 10:26 PM, cnmmd wrote:
> why the event_handle is signaled state?
>
> I only find this time to setevent:
> void CALLBACK callback(HWAVEOUT handle, UINT message, DWORD data,
>                DWORD param1, DWORD param2)
> {
>   WAVEHDR *header;
>   struct buffer *buffer;
>
>   switch (message) {
>   case WOM_DONE:
>     header = (WAVEHDR *) param1;
>     buffer = (struct buffer *) header->dwUser;
>     if (SetEvent(buffer->event_handle) == 0) {
>
> ...
> }

That's it. This callback routine is passed to waveOutOpen(), which  
allows it to be called asynchronously after each data block sent via  
waveOutWrite() has finished playing.

-- 
Rob Leslie
[email protected]