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)
downloadrockbox-66b7ade58ddcd7991a51fbcb3c4ba87596d4511a.tar.gz
rockbox-66b7ade58ddcd7991a51fbcb3c4ba87596d4511a.zip
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)
226} 226}
227#endif 227#endif
228 228
229#ifndef SIMULATOR 229#ifdef SIMULATOR
230static bool playing = false;
231static bool play_pending = false;
232#else
230static int last_dma_tick = 0; 233static int last_dma_tick = 0;
231static int pause_tick = 0; 234static int pause_tick = 0;
232 235
@@ -1050,6 +1053,7 @@ void mpeg_play(char* trackname)
1050{ 1053{
1051#ifdef SIMULATOR 1054#ifdef SIMULATOR
1052 mp3info(&taginfo, trackname); 1055 mp3info(&taginfo, trackname);
1056 playing = true;
1053#else 1057#else
1054 queue_post(&mpeg_queue, MPEG_PLAY, trackname); 1058 queue_post(&mpeg_queue, MPEG_PLAY, trackname);
1055#endif 1059#endif
@@ -1059,6 +1063,8 @@ void mpeg_stop(void)
1059{ 1063{
1060#ifndef SIMULATOR 1064#ifndef SIMULATOR
1061 queue_post(&mpeg_queue, MPEG_STOP, NULL); 1065 queue_post(&mpeg_queue, MPEG_STOP, NULL);
1066#else
1067 playing = false;
1062#endif 1068#endif
1063} 1069}
1064 1070
@@ -1066,6 +1072,8 @@ void mpeg_pause(void)
1066{ 1072{
1067#ifndef SIMULATOR 1073#ifndef SIMULATOR
1068 queue_post(&mpeg_queue, MPEG_PAUSE, NULL); 1074 queue_post(&mpeg_queue, MPEG_PAUSE, NULL);
1075#else
1076 playing = false;
1069#endif 1077#endif
1070} 1078}
1071 1079
@@ -1073,6 +1081,8 @@ void mpeg_resume(void)
1073{ 1081{
1074#ifndef SIMULATOR 1082#ifndef SIMULATOR
1075 queue_post(&mpeg_queue, MPEG_RESUME, NULL); 1083 queue_post(&mpeg_queue, MPEG_RESUME, NULL);
1084#else
1085 playing = true;
1076#endif 1086#endif
1077} 1087}
1078 1088
@@ -1080,6 +1090,8 @@ void mpeg_next(void)
1080{ 1090{
1081#ifndef SIMULATOR 1091#ifndef SIMULATOR
1082 queue_post(&mpeg_queue, MPEG_NEXT, NULL); 1092 queue_post(&mpeg_queue, MPEG_NEXT, NULL);
1093#else
1094 playing = true;
1083#endif 1095#endif
1084} 1096}
1085 1097
@@ -1087,16 +1099,14 @@ void mpeg_prev(void)
1087{ 1099{
1088#ifndef SIMULATOR 1100#ifndef SIMULATOR
1089 queue_post(&mpeg_queue, MPEG_PREV, NULL); 1101 queue_post(&mpeg_queue, MPEG_PREV, NULL);
1102#else
1103 playing = true;
1090#endif 1104#endif
1091} 1105}
1092 1106
1093bool mpeg_is_playing(void) 1107bool mpeg_is_playing(void)
1094{ 1108{
1095#ifndef SIMULATOR
1096 return playing || play_pending; 1109 return playing || play_pending;
1097#else
1098 return false;
1099#endif
1100} 1110}
1101 1111
1102#ifndef SIMULATOR 1112#ifndef SIMULATOR