summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-01-15 15:32:49 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-01-15 15:32:49 +0000
commitd815ad60355558eddbfc338c481aa83fdf0a1e43 (patch)
tree25bb49940c354fc6ba9d50cb4505933646d1cd81
parentce1c93d628280dcbbbaac7a43f43dbb81008ea03 (diff)
downloadrockbox-d815ad60355558eddbfc338c481aa83fdf0a1e43.tar.gz
rockbox-d815ad60355558eddbfc338c481aa83fdf0a1e43.zip
Added mpeg_next_track(), which returns a pointer to the id3 struct of the
upcoming song (if available). Now we just need a WPS patch to make it possibly to display info based on this! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4240 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/mpeg.h1
-rw-r--r--firmware/mpeg.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/firmware/export/mpeg.h b/firmware/export/mpeg.h
index ff003e62f5..5625b03464 100644
--- a/firmware/export/mpeg.h
+++ b/firmware/export/mpeg.h
@@ -71,6 +71,7 @@ void mpeg_prev(void);
void mpeg_ff_rewind(int newtime);
void mpeg_flush_and_reload_tracks(void);
struct mp3entry* mpeg_current_track(void);
+struct mp3entry* mpeg_next_track(void);
bool mpeg_has_changed_track(void);
int mpeg_status(void);
#if defined(HAVE_MAS3587F) || defined(SIMULATOR)
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index ad4b75ea42..645e60fdcd 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -1960,6 +1960,18 @@ struct mp3entry* mpeg_current_track()
#endif /* #ifdef SIMULATOR */
}
+struct mp3entry* mpeg_next_track()
+{
+#ifdef SIMULATOR
+ return &taginfo;
+#else
+ if(num_tracks_in_memory() > 1)
+ return &(id3tags[(tag_read_idx+1) & MAX_ID3_TAGS_MASK]->id3);
+ else
+ return NULL;
+#endif /* #ifdef SIMULATOR */
+}
+
bool mpeg_has_changed_track(void)
{
if(last_track_counter != current_track_counter)