From 023f6b6efd5407dc77c1253789f61baabb6607d6 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 12 Jul 2013 12:06:38 -0400 Subject: Get rid of some superfluous single-purpose functions in playback. * Remove explicit tracking of elapsed time of previous track. * Remove function to obtain auto skip flag. * Most playback events now carry the extra information instead and pass 'struct track_event *' for data. * Tweak scrobbler to use PLAYBACK_EVENT_TRACK_FINISH, which makes it cleaner and removes the struct mp3entry. Change-Id: I500d2abb4056a32646496efc3617406e36811ec5 --- firmware/export/audio.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'firmware/export/audio.h') diff --git a/firmware/export/audio.h b/firmware/export/audio.h index 24e8e9a0e7..8108f50939 100644 --- a/firmware/export/audio.h +++ b/firmware/export/audio.h @@ -236,12 +236,26 @@ int audio_get_spdif_sample_rate(void); void audio_spdif_set_monitor(int monitor_spdif); #endif /* HAVE_SPDIF_IN */ -unsigned long audio_prev_elapsed(void); - -#if CONFIG_CODEC != SWCODEC /***********************************************************************/ /* audio event handling */ +enum track_event_flags +{ + TEF_NONE = 0x0, /* no flags are set */ + TEF_CURRENT = 0x1, /* event is for the current track */ +#if CONFIG_CODEC == SWCODEC + TEF_AUTO_SKIP = 0x2, /* event is sent in context of auto skip */ + TEF_REWIND = 0x4, /* interpret as rewind, id3->elapsed is the + position before the seek back to 0 */ +#endif /* CONFIG_CODEC == SWCODEC */ +}; +struct track_event +{ + unsigned int flags; /* combo of enum track_event_flags values */ + struct mp3entry *id3; /* pointer to mp3entry describing track */ +}; + +#if CONFIG_CODEC != SWCODEC /* subscribe to one or more audio event(s) by OR'ing together the desired */ /* event IDs (defined below); a handler is called with a solitary event ID */ /* (so switch() is okay) and possibly some useful data (depending on the */ -- cgit v1.2.3