Discussion:
[Audiere-users] callbacks: a way to notify users
Jonathan McDougall
2005-05-18 04:51:57 UTC
Permalink
It could be intersting if users were notified of some events, such as
when a stream is done playing. For example:

void foo(audiere::Event e)
{
// done playing
}

audiere::OutputStreamPtr stream(audiere::OpenSound(device, "file"));
stream->on_done_playing = audiere::Handler(&foo);

If I understand correctly, the only way now to be notified when a
stream has finished its playback is to check regularly whether
isPlaying() returns true or false and to interpret that as being the
end of the file.


Jonathan
R.F. Schaaf
2005-05-18 05:42:10 UTC
Permalink
Jonathan,

the latest (CVS) version implements a callback when the sound stopped
playing. The idea is a bit like the one you're proposing but the deta=
ils
are different. So, please get the latest CVS version instead of doing=
the
polling yourself.

I think we should get together and try to abduct Chad away from his
studies so he can prepare the next official release so that callbacks=
are
in a normal release.

Hey Chad, let's get real, what's more important: Audiere or Gradschoo=
l :)

Regards,
Richard Schaaf
It could be intersting if users were notified of some events, such =
as
void foo(audiere::Event e)
{
// done playing
}
audiere::OutputStreamPtr stream(audiere::OpenSound(device, "file"))=
;
stream->on_done_playing =3D audiere::Handler(&foo);
If I understand correctly, the only way now to be notified when a
stream has finished its playback is to check regularly whether
isPlaying() returns true or false and to interpret that as being th=
e
end of the file.
Jonathan
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id=16344&op=CCk
_______________________________________________
Audiere-users mailing list
https://lists.sourceforge.net/lists/listinfo/audiere-users
Jonathan McDougall
2005-05-18 09:42:07 UTC
Permalink
Post by R.F. Schaaf
Post by Jonathan McDougall
It could be intersting if users were notified of some events, such as
the latest (CVS) version implements a callback when the sound stopped
playing.
Oh, sorry for wasting your time.
Post by R.F. Schaaf
The idea is a bit like the one you're proposing but the details
are different. So, please get the latest CVS version instead of doing the
polling yourself.
Looks good, except that using something like loki's functor library
would have saved your time and made it more convinient, but I guess
that will do the job.

Thank you,

Jonathan
R.F. Schaaf
2005-05-18 10:40:54 UTC
Permalink
:) you're not wasting my time :)

As to using a different callback mechanism, well I guess we could have used
something else. As a matter of fact I proposed a different scheme but Chad
elected to go for this one, and you're right, it does its job.

Good luck!

Richard

-----Original Message-----
From: audiere-users-***@lists.sourceforge.net
[mailto:audiere-users-***@lists.sourceforge.net] On Behalf Of Jonathan
McDougall
Sent: Wednesday 18 May 2005 13:38
To: audiere-***@lists.sourceforge.net
Subject: Re: [Audiere-users] callbacks: a way to notify users
Post by R.F. Schaaf
Post by Jonathan McDougall
It could be intersting if users were notified of some events, such
the latest (CVS) version implements a callback when the sound stopped
playing.
Oh, sorry for wasting your time.
Post by R.F. Schaaf
The idea is a bit like the one you're proposing but the details are
different. So, please get the latest CVS version instead of doing the
polling yourself.
Looks good, except that using something like loki's functor library would
have saved your time and made it more convinient, but I guess that will do
the job.

Thank you,

Jonathan


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the
first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&opÌk

Loading...