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 --- apps/hosted/android/notification.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/hosted/android') diff --git a/apps/hosted/android/notification.c b/apps/hosted/android/notification.c index 4bb8d0a528..874cd3bcef 100644 --- a/apps/hosted/android/notification.c +++ b/apps/hosted/android/notification.c @@ -46,7 +46,7 @@ static const struct dim dim = { .width = 200, .height = 200 }; * notify about track change, and show track info */ static void track_changed_callback(void *param) { - struct mp3entry* id3 = (struct mp3entry*)param; + struct mp3entry* id3 = ((struct track_event *)param)->id3; JNIEnv e = *env_ptr; if (id3) { @@ -108,7 +108,9 @@ static void track_changed_callback(void *param) * notify about track finishing */ static void track_finished_callback(void *param) { - (void)param; + if (((struct track_event *)param)->flags & TEF_REWIND) + return; /* Not a true track end */ + JNIEnv e = *env_ptr; e->CallVoidMethod(env_ptr, NotificationManager_instance, finishNotification); -- cgit v1.2.3