From 66b7ade58ddcd7991a51fbcb3c4ba87596d4511a Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Thu, 8 Aug 2002 16:44:20 +0000 Subject: Added mpeg_is_playing support for simulators git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1620 a1c6a512-1295-4272-9138-f99709370657 --- firmware/mpeg.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 23af9d480b..565fb5d075 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -226,7 +226,10 @@ static void remove_all_tags(void) } #endif -#ifndef SIMULATOR +#ifdef SIMULATOR +static bool playing = false; +static bool play_pending = false; +#else static int last_dma_tick = 0; static int pause_tick = 0; @@ -1050,6 +1053,7 @@ void mpeg_play(char* trackname) { #ifdef SIMULATOR mp3info(&taginfo, trackname); + playing = true; #else queue_post(&mpeg_queue, MPEG_PLAY, trackname); #endif @@ -1059,6 +1063,8 @@ void mpeg_stop(void) { #ifndef SIMULATOR queue_post(&mpeg_queue, MPEG_STOP, NULL); +#else + playing = false; #endif } @@ -1066,6 +1072,8 @@ void mpeg_pause(void) { #ifndef SIMULATOR queue_post(&mpeg_queue, MPEG_PAUSE, NULL); +#else + playing = false; #endif } @@ -1073,6 +1081,8 @@ void mpeg_resume(void) { #ifndef SIMULATOR queue_post(&mpeg_queue, MPEG_RESUME, NULL); +#else + playing = true; #endif } @@ -1080,6 +1090,8 @@ void mpeg_next(void) { #ifndef SIMULATOR queue_post(&mpeg_queue, MPEG_NEXT, NULL); +#else + playing = true; #endif } @@ -1087,16 +1099,14 @@ void mpeg_prev(void) { #ifndef SIMULATOR queue_post(&mpeg_queue, MPEG_PREV, NULL); +#else + playing = true; #endif } bool mpeg_is_playing(void) { -#ifndef SIMULATOR return playing || play_pending; -#else - return false; -#endif } #ifndef SIMULATOR -- cgit v1.2.3