diff options
Diffstat (limited to 'firmware/mpeg.c')
-rw-r--r-- | firmware/mpeg.c | 20 |
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 |
230 | static bool playing = false; | ||
231 | static bool play_pending = false; | ||
232 | #else | ||
230 | static int last_dma_tick = 0; | 233 | static int last_dma_tick = 0; |
231 | static int pause_tick = 0; | 234 | static 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 | ||
1093 | bool mpeg_is_playing(void) | 1107 | bool 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 |