Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 2 of 2
  1. #1
    Tom Weilenmann
    Guest

    Question on callback function after playlist command

    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

  2. #2
    Gadfly, Former Founder Slim Devices dean's Avatar
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    4,427

    Re: Question on callback function after playlist command

    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
    >

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •