diff options
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 339964182b..5a6ccb0532 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include "sprintf.h" | 27 | #include "sprintf.h" |
28 | #include "debug.h" | 28 | #include "debug.h" |
29 | #include "mpeg.h" | 29 | #include "mpeg.h" |
30 | #include "lcd.h" | ||
31 | #include "kernel.h" | ||
30 | 32 | ||
31 | playlist_info_t playlist; | 33 | playlist_info_t playlist; |
32 | 34 | ||
@@ -70,6 +72,10 @@ char* playlist_next(int type) | |||
70 | void play_list(char *dir, char *file) | 72 | void play_list(char *dir, char *file) |
71 | { | 73 | { |
72 | char *sep=""; | 74 | char *sep=""; |
75 | |||
76 | lcd_clear_display(); | ||
77 | lcd_puts(0,0,"Loading..."); | ||
78 | lcd_update(); | ||
73 | empty_playlist(&playlist); | 79 | empty_playlist(&playlist); |
74 | 80 | ||
75 | /* If the dir does not end in trailing new line, we use a separator. | 81 | /* If the dir does not end in trailing new line, we use a separator. |
@@ -86,9 +92,11 @@ void play_list(char *dir, char *file) | |||
86 | 92 | ||
87 | /* if shuffle is wanted, this is where to do that */ | 93 | /* if shuffle is wanted, this is where to do that */ |
88 | 94 | ||
95 | lcd_puts(0,0,"Playing..."); | ||
96 | lcd_update(); | ||
89 | /* also make the first song get playing */ | 97 | /* also make the first song get playing */ |
90 | mpeg_play(playlist_next(0)); | 98 | mpeg_play(playlist_next(0)); |
91 | 99 | sleep(HZ); | |
92 | } | 100 | } |
93 | 101 | ||
94 | /* | 102 | /* |
@@ -113,8 +121,8 @@ void add_indices_to_playlist( playlist_info_t *playlist ) | |||
113 | int count = 0; | 121 | int count = 0; |
114 | 122 | ||
115 | unsigned char *p; | 123 | unsigned char *p; |
116 | unsigned char buf[255]; | 124 | unsigned char buf[512]; |
117 | 125 | char line[16]; | |
118 | 126 | ||
119 | fd = open(playlist->filename, O_RDONLY); | 127 | fd = open(playlist->filename, O_RDONLY); |
120 | if(-1 == fd) | 128 | if(-1 == fd) |
@@ -144,12 +152,19 @@ void add_indices_to_playlist( playlist_info_t *playlist ) | |||
144 | } | 152 | } |
145 | 153 | ||
146 | store_index = 0; | 154 | store_index = 0; |
155 | if ( playlist->amount % 200 == 0 ) { | ||
156 | snprintf(line, sizeof line, "%d", playlist->amount); | ||
157 | lcd_puts(0,1,line); | ||
158 | lcd_update(); | ||
159 | } | ||
147 | } | 160 | } |
148 | } | 161 | } |
149 | 162 | ||
150 | i+= count; | 163 | i+= count; |
151 | } | 164 | } |
152 | 165 | snprintf(line, sizeof line, "%d", playlist->amount); | |
166 | lcd_puts(0,1,line); | ||
167 | lcd_update(); | ||
153 | 168 | ||
154 | close(fd); | 169 | close(fd); |
155 | } | 170 | } |