A
Angus Comber
Hello
This question is relevant to any asynchronous environment whereby a process
may take any length of time to complete.
Anyway, I am developing a C++ wave (in and out) wrapper class. I have for
example a function to play a file. But problem for user of this class is
that if for example, they wanted to play wavfile1 followed by wavfile2 how
do they do it.
When the user calls playfile function it returns immediately. So how do
they know when to call the next function - or to call play file again.
Do I have a notification callback or event which calls their app to tell
them the file has finished?
Do I make the function synchronous, ie only return from the function when
the file has finished playing?
Or some other option?
Your thoughts will be much appreciated.
Angus Comber
(e-mail address removed)
This question is relevant to any asynchronous environment whereby a process
may take any length of time to complete.
Anyway, I am developing a C++ wave (in and out) wrapper class. I have for
example a function to play a file. But problem for user of this class is
that if for example, they wanted to play wavfile1 followed by wavfile2 how
do they do it.
When the user calls playfile function it returns immediately. So how do
they know when to call the next function - or to call play file again.
Do I have a notification callback or event which calls their app to tell
them the file has finished?
Do I make the function synchronous, ie only return from the function when
the file has finished playing?
Or some other option?
Your thoughts will be much appreciated.
Angus Comber
(e-mail address removed)