From 9d860e19d2aedc9dc672a037b7c2de728dd6477e Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Fri, 11 Apr 2003 00:29:15 +0000 Subject: Better handling of next/prev git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3528 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 8 ++++++++ apps/playlist.h | 1 + apps/wps.c | 2 -- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/playlist.c b/apps/playlist.c index 165c13847b..ebe82cc457 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -378,6 +378,14 @@ int playlist_next(int steps) return index; } +/* Returns false if 'steps' is out of bounds, else true */ +bool playlist_check(int steps) +{ + bool queue; + int index = get_next_index(steps, &queue); + return (index >= 0); +} + char* playlist_peek(int steps) { int seek; diff --git a/apps/playlist.h b/apps/playlist.h index 57a23f2a8f..ea77886bb7 100644 --- a/apps/playlist.h +++ b/apps/playlist.h @@ -55,6 +55,7 @@ int play_list(char *dir, char *file, int start_index, char* playlist_peek(int steps); char* playlist_name(char *name, int name_size); int playlist_next(int steps); +bool playlist_check(int steps); void randomise_playlist( unsigned int seed ); void sort_playlist(bool start_current); void add_indices_to_playlist(void); diff --git a/apps/wps.c b/apps/wps.c index fded51fe13..0fbe8d713e 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -915,7 +915,6 @@ int wps_show(void) break; #endif if (!id3 || (id3->elapsed < 3*1000)) { - mpeg_stop(); mpeg_prev(); } else { @@ -935,7 +934,6 @@ int wps_show(void) if ( lastbutton != BUTTON_RIGHT ) break; #endif - mpeg_stop(); mpeg_next(); break; -- cgit v1.2.3