Jonathan Gordon wrote:
> hey all,
> so, in IRC we somehow got onto the problem that the filebrowser needs
> to know when a track changes (so the follow playlist can work
> properly), and scrobbler and database also need to know when this
> happens.
> playback.c has a few callbacks but only allows one function to be
> registered for each, which causes a bit of a mess in playback.c (and
> is one reason why scrobbler is broken on hwcodec.)
>
> My attached patch addresses this issue, ...

Jonathan,

Just to add some fuel to the fire, I also implemented a callback interface
when I wrote my A/B repeat feature.  It's defined in
firmware/export/audio.h and implemented in firmware/mpeg.c

It uses a bitmask to subscribe to events (with a single callback per
subscription) and a fixed-size array (sized by #define) to hold up to 10
registered callbacks.  It supports track position updates and end-of-track
notification.

(I don't think the latter makes next track info available, so it may not
be useful for filebrowser, etc., unless next track info can be plucked
from somewhere.)

AFAIK, this facility is only used by apps/abrepeat.c.  It's been a while
since I worked on it so there may have been changes that I'm not aware of.
 Also, I implemented this against the Archos chip-based MP3 decoding and
I'm not sure if it works with the SW codecs.  (I've been meaning to port
A/B repeat to the IAudio X5, which would mean updating it to work with SW
codecs and custom WPSs, but I haven't been able to find the time.)

~ray


Reply via email to