diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2013-07-12 12:06:38 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-07-13 00:08:51 -0400 |
commit | 023f6b6efd5407dc77c1253789f61baabb6607d6 (patch) | |
tree | 40d43117a7651715a2ce983eedff56b27962881a /firmware/export/audio.h | |
parent | ffa8626b0c93f8a65e0e17190917f7f173160842 (diff) | |
download | rockbox-023f6b6efd5407dc77c1253789f61baabb6607d6.tar.gz rockbox-023f6b6efd5407dc77c1253789f61baabb6607d6.zip |
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
Diffstat (limited to 'firmware/export/audio.h')
-rw-r--r-- | firmware/export/audio.h | 20 |
1 files changed, 17 insertions, 3 deletions
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 */ |