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
This commit is contained in:
Michael Sevakis 2013-07-12 12:06:38 -04:00
parent ffa8626b0c
commit 023f6b6efd
14 changed files with 236 additions and 242 deletions

View file

@ -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 */