PDA

View Full Version : Question on callback function after playlist command



Tom Weilenmann
2003-11-12, 10:30
Hi
Can somebody explain me a detail on the callback function of the SliMP3::Command::execute.

I'm calling the above function with the following line of code:
SliMP3::Command::execute($client, ['playlist','play',$filename],\&afterMsgPlay, [$client]);

My problem is now that the callback function is executed immediately after the MP3-file starts playing. Is this normal?

I need a callback function which is only executed when the player reaches the end of the MP3-file. Is there a nice way to achieve this goal?

Thanks

Tom

dean
2003-11-12, 11:08
That callback function is executed when the command is completed (i.e.
when the play command is completed) as opposed to when the song ends
playing.

There's no built-in callback mechanism yet, but it's a good idea. In
the mean time, you may have to poll on the song time or playback
status.

-dean

On Nov 12, 2003, at 9:30 AM, Tom Weilenmann wrote:

> Hi
> Can somebody explain me a detail on the callback function of the
> SliMP3::Command::execute.
>
> I'm calling the above function with the following line of code:
> SliMP3::Command::execute($client,
> ['playlist','play',$filename],\&afterMsgPlay, [$client]);
>
> My problem is now that the callback function is executed immediately
> after the MP3-file starts playing. Is this normal?
>
> I need a callback function which is only executed when the player
> reaches the end of the MP3-file. Is there a nice way to achieve this
> goal?
>
> Thanks
>
> Tom
>