summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-08-08 16:44:20 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-08-08 16:44:20 +0000
commit66b7ade58ddcd7991a51fbcb3c4ba87596d4511a (patch)
treec11fb279fbc55fd65f8fc55ab203e33d88c55fe7
parent03894b810ebf6a23d8eb7ea4a700b2b5291444b2 (diff)
Added mpeg_is_playing support for simulators
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1620 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/mpeg.c20
1 files 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