From 97bead39e421a97f81f6d0f960c0e3457f502926 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Wed, 28 Aug 2002 10:54:01 +0000 Subject: Simulator fixes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2026 a1c6a512-1295-4272-9138-f99709370657 --- firmware/mpeg.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'firmware') diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 8700745a53..d2aa13b446 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -301,6 +301,7 @@ static void set_elapsed(struct mp3entry* id3) static bool paused; /* playback is paused */ #ifdef SIMULATOR +static bool is_playing = false; static bool playing = false; static bool play_pending = false; #else @@ -1303,7 +1304,7 @@ void mpeg_play(int offset) int steps=0; do { - trackname = playlist_next( steps, NULL ); + trackname = playlist_peek( steps ); if (!trackname) break; if(mp3info(&taginfo, trackname)) { @@ -1311,8 +1312,10 @@ void mpeg_play(int offset) steps++; continue; } + playlist_next(steps); taginfo.offset = offset; set_elapsed(&taginfo); + is_playing = true; playing = true; break; } while(1); @@ -1326,6 +1329,7 @@ void mpeg_stop(void) #ifndef SIMULATOR queue_post(&mpeg_queue, MPEG_STOP, NULL); #else + is_playing = false; playing = false; #endif } @@ -1335,6 +1339,7 @@ void mpeg_pause(void) #ifndef SIMULATOR queue_post(&mpeg_queue, MPEG_PAUSE, NULL); #else + is_playing = false; playing = false; paused = true; #endif @@ -1345,6 +1350,7 @@ void mpeg_resume(void) #ifndef SIMULATOR queue_post(&mpeg_queue, MPEG_RESUME, NULL); #else + is_playing = true; playing = true; paused = false; #endif @@ -1360,15 +1366,17 @@ void mpeg_next(void) int index; do { - file = playlist_next(steps, &index); + file = playlist_peek(steps); if(!file) break; if(mp3info(&taginfo, file)) { steps++; continue; } + index = playlist_next(steps); current_track_counter++; taginfo.index = index; + is_playing = true; playing = true; break; } while(1); @@ -1385,15 +1393,17 @@ void mpeg_prev(void) int index; do { - file = playlist_next(steps, &index); + file = playlist_peek(steps); if(!file) break; if(mp3info(&taginfo, file)) { steps--; continue; } + index = playlist_next(steps); current_track_counter++; taginfo.index = index; + is_playing = true; playing = true; break; } while(1); -- cgit v1.2.3