From: Larry on
"ScottMcP [MVP]" <scottmcp(a)mvps.org> ha scritto nel messaggio
news:b62210f2-5aec-4c9a-80c7-d76a7549d3f2(a)u20g2000vbq.googlegroups.com...

> It seems fine to do it that way. I think you could get by just fine
> without the checks though, because the buffers will be filled in the
> same order you output them. So a counter variable would be needed,
> like

Oh my, I never thought of it like that!

do you think the following would be good?

int k = 0;
while(1)
{
if(stop_thread_flag)
break;
// CALLBACK EVENT
WaitForSingleObject(hevent, INFINITE);

if(buff[k].dwFlags & WHDR_DONE)
{
save_buffer(&buff[k]);
waveInAddBuffer(hwi, &buff[k], sizeof(WAVEHDR));
}

if(k == num_buffers -1)
k = 0;
else
k++;

}
for (int u = 0; u<num_buffers; u++)
{
waveInUnprepareHeader(hwi, &buff[u], sizeof(WAVEHDR));
}
waveInClose(hwi);
return 0;

I tried the code and it seems I am experiencing some sort of delay so maybe
that's proove it is working!

thanks

From: Larry on
"Larry" <dontmewithme(a)got.it> ha scritto nel messaggio
news:4b395e13$0$814$4fafbaef(a)reader5.news.tin.it...
> "ScottMcP [MVP]" <scottmcp(a)mvps.org> ha scritto nel messaggio

> I tried the code and it seems I am experiencing some sort of delay so
> maybe that's proove it is working!

By the way the whole code is avaible here: http://theartofweb.net/cpp/