summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/lang/english.lang20
-rw-r--r--apps/main_menu.c4
-rw-r--r--apps/wps-display.c6
-rw-r--r--apps/wps-display.h1
-rw-r--r--apps/wps.c55
-rw-r--r--apps/wps.h1
6 files changed, 68 insertions, 19 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index a520ec64bc..7ab205f9f7 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -1346,3 +1346,23 @@ id: LANG_PLAYER_KEYBOARD_ABORT
1346desc: Abort alternative in player keyboard interaction 1346desc: Abort alternative in player keyboard interaction
1347eng: "Abort" 1347eng: "Abort"
1348new: 1348new:
1349
1350id: LANG_MENU_SHOW_ID3_INFO
1351desc: Menu option to start id3 viewer
1352eng: "Show ID3 Info"
1353new:
1354
1355id: LANG_ID3_GENRE
1356desc: ID3 frame 'genre'
1357eng: "[Genre]"
1358new:
1359
1360id: LANG_ID3_YEAR
1361desc: ID3 info 'year'
1362eng: "[Year]"
1363new:
1364
1365id: LANG_ID3_NO_INFO
1366desc: ID3 info is missing
1367eng: "<no info>"
1368new:
diff --git a/apps/main_menu.c b/apps/main_menu.c
index 0b71d1d98a..9f4aa8f812 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -40,6 +40,7 @@
40#include "status.h" 40#include "status.h"
41#include "fat.h" 41#include "fat.h"
42#include "sleeptimer.h" 42#include "sleeptimer.h"
43#include "wps.h"
43 44
44#include "lang.h" 45#include "lang.h"
45 46
@@ -261,7 +262,8 @@ bool main_menu(void)
261 { str(LANG_RECORDING), recording_screen }, 262 { str(LANG_RECORDING), recording_screen },
262 { str(LANG_RECORDING_SETTINGS), recording_menu }, 263 { str(LANG_RECORDING_SETTINGS), recording_menu },
263#endif 264#endif
264 { str(LANG_CREATE_PLAYLIST), create_playlist }, 265 { str(LANG_CREATE_PLAYLIST), create_playlist },
266 { str(LANG_MENU_SHOW_ID3_INFO), browse_id3 },
265 { str(LANG_SLEEP_TIMER), sleeptimer_screen }, 267 { str(LANG_SLEEP_TIMER), sleeptimer_screen },
266#ifdef HAVE_ALARM_MOD 268#ifdef HAVE_ALARM_MOD
267 { str(LANG_ALARM_MOD_ALARM_MENU), alarm_screen }, 269 { str(LANG_ALARM_MOD_ALARM_MENU), alarm_screen },
diff --git a/apps/wps-display.c b/apps/wps-display.c
index 263c0a78b6..5c43d510e1 100644
--- a/apps/wps-display.c
+++ b/apps/wps-display.c
@@ -95,6 +95,12 @@ static const char* const genres[] = {
95 "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall" 95 "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House", "Dance Hall"
96}; 96};
97 97
98char* wps_get_genre(unsigned int genre)
99{
100 if (genre < sizeof(genres)/sizeof(char*))
101 return (char*)genres[genre];
102 return NULL;
103}
98 104
99/* Set format string to use for WPS, splitting it into lines */ 105/* Set format string to use for WPS, splitting it into lines */
100static void wps_format(char* fmt) 106static void wps_format(char* fmt)
diff --git a/apps/wps-display.h b/apps/wps-display.h
index 7054343b5e..99330453c0 100644
--- a/apps/wps-display.h
+++ b/apps/wps-display.h
@@ -37,5 +37,6 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, unsigned char refresh_mo
37bool wps_display(struct mp3entry* id3); 37bool wps_display(struct mp3entry* id3);
38bool wps_load(char* file, bool display); 38bool wps_load(char* file, bool display);
39void wps_reset(void); 39void wps_reset(void);
40char* wps_get_genre(unsigned int genre);
40 41
41#endif 42#endif
diff --git a/apps/wps.c b/apps/wps.c
index 4e552c7faa..f52ec234ca 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -148,7 +148,7 @@ void display_mute_text(bool muted)
148 sleep(HZ); 148 sleep(HZ);
149} 149}
150 150
151static int browse_id3(void) 151bool browse_id3(void)
152{ 152{
153 int button; 153 int button;
154 int menu_pos = 0; 154 int menu_pos = 0;
@@ -156,12 +156,9 @@ static int browse_id3(void)
156 bool exit = false; 156 bool exit = false;
157 char scroll_text[MAX_PATH]; 157 char scroll_text[MAX_PATH];
158 158
159 lcd_clear_display(); 159 if (!(mpeg_status() & MPEG_STATUS_PLAY))
160 lcd_puts(0, 0, str(LANG_ID3_INFO)); 160 return false;
161 lcd_puts(0, 1, str(LANG_ID3_SCREEN)); 161
162 lcd_update();
163 sleep(HZ);
164
165 while (!exit) 162 while (!exit)
166 { 163 {
167 lcd_clear_display(); 164 lcd_clear_display();
@@ -190,19 +187,35 @@ static int browse_id3(void)
190 case 3: 187 case 3:
191 lcd_puts(0, 0, str(LANG_ID3_TRACKNUM)); 188 lcd_puts(0, 0, str(LANG_ID3_TRACKNUM));
192 189
193 if (id3->tracknum) 190 if (id3->tracknum) {
194 {
195 snprintf(scroll_text,sizeof(scroll_text), "%d", 191 snprintf(scroll_text,sizeof(scroll_text), "%d",
196 id3->tracknum); 192 id3->tracknum);
197 lcd_puts_scroll(0, 1, scroll_text); 193 lcd_puts_scroll(0, 1, scroll_text);
198 } 194 }
199 else 195 else
200 {
201 lcd_puts_scroll(0, 1, str(LANG_ID3_NO_TRACKNUM)); 196 lcd_puts_scroll(0, 1, str(LANG_ID3_NO_TRACKNUM));
202 }
203 break; 197 break;
204 198
205 case 4: 199 case 4:
200 lcd_puts(0, 0, str(LANG_ID3_GENRE));
201 lcd_puts_scroll(0, 1,
202 wps_get_genre(id3->genre) ?
203 wps_get_genre(id3->genre) :
204 (char*)str(LANG_ID3_NO_INFO));
205 break;
206
207 case 5:
208 lcd_puts(0, 0, str(LANG_ID3_YEAR));
209 if (id3->year) {
210 snprintf(scroll_text,sizeof(scroll_text), "%d",
211 id3->year);
212 lcd_puts_scroll(0, 1, scroll_text);
213 }
214 else
215 lcd_puts_scroll(0, 1, str(LANG_ID3_NO_INFO));
216 break;
217
218 case 6:
206 lcd_puts(0, 0, str(LANG_ID3_LENGHT)); 219 lcd_puts(0, 0, str(LANG_ID3_LENGHT));
207 snprintf(scroll_text,sizeof(scroll_text), "%d:%02d", 220 snprintf(scroll_text,sizeof(scroll_text), "%d:%02d",
208 id3->length / 60000, 221 id3->length / 60000,
@@ -210,7 +223,7 @@ static int browse_id3(void)
210 lcd_puts(0, 1, scroll_text); 223 lcd_puts(0, 1, scroll_text);
211 break; 224 break;
212 225
213 case 5: 226 case 7:
214 lcd_puts(0, 0, str(LANG_ID3_PLAYLIST)); 227 lcd_puts(0, 0, str(LANG_ID3_PLAYLIST));
215 snprintf(scroll_text,sizeof(scroll_text), "%d/%d", 228 snprintf(scroll_text,sizeof(scroll_text), "%d/%d",
216 id3->index + 1, playlist_amount()); 229 id3->index + 1, playlist_amount());
@@ -218,21 +231,21 @@ static int browse_id3(void)
218 break; 231 break;
219 232
220 233
221 case 6: 234 case 8:
222 lcd_puts(0, 0, str(LANG_ID3_BITRATE)); 235 lcd_puts(0, 0, str(LANG_ID3_BITRATE));
223 snprintf(scroll_text,sizeof(scroll_text), "%d kbps", 236 snprintf(scroll_text,sizeof(scroll_text), "%d kbps",
224 id3->bitrate); 237 id3->bitrate);
225 lcd_puts(0, 1, scroll_text); 238 lcd_puts(0, 1, scroll_text);
226 break; 239 break;
227 240
228 case 7: 241 case 9:
229 lcd_puts(0, 0, str(LANG_ID3_FRECUENCY)); 242 lcd_puts(0, 0, str(LANG_ID3_FRECUENCY));
230 snprintf(scroll_text,sizeof(scroll_text), "%d Hz", 243 snprintf(scroll_text,sizeof(scroll_text), "%d Hz",
231 id3->frequency); 244 id3->frequency);
232 lcd_puts(0, 1, scroll_text); 245 lcd_puts(0, 1, scroll_text);
233 break; 246 break;
234 247
235 case 8: 248 case 10:
236 lcd_puts(0, 0, str(LANG_ID3_PATH)); 249 lcd_puts(0, 0, str(LANG_ID3_PATH));
237 lcd_puts_scroll(0, 1, id3->path); 250 lcd_puts_scroll(0, 1, id3->path);
238 break; 251 break;
@@ -279,11 +292,11 @@ static int browse_id3(void)
279 case SYS_USB_CONNECTED: 292 case SYS_USB_CONNECTED:
280 status_set_playmode(STATUS_STOP); 293 status_set_playmode(STATUS_STOP);
281 usb_screen(); 294 usb_screen();
282 return SYS_USB_CONNECTED; 295 return true;
283 break; 296 break;
284 } 297 }
285 } 298 }
286 return 0; 299 return false;
287} 300}
288 301
289static bool ffwd_rew(int button) 302static bool ffwd_rew(int button)
@@ -618,7 +631,13 @@ static bool menu(void)
618#else 631#else
619 case BUTTON_F1 | BUTTON_ON: 632 case BUTTON_F1 | BUTTON_ON:
620#endif 633#endif
621 if(browse_id3() == SYS_USB_CONNECTED) 634 lcd_clear_display();
635 lcd_puts(0, 0, str(LANG_ID3_INFO));
636 lcd_puts(0, 1, str(LANG_ID3_SCREEN));
637 lcd_update();
638 sleep(HZ);
639
640 if(browse_id3())
622 return true; 641 return true;
623#ifdef HAVE_PLAYER_KEYPAD 642#ifdef HAVE_PLAYER_KEYPAD
624 status_set_param(false); 643 status_set_param(false);
diff --git a/apps/wps.h b/apps/wps.h
index c6cec3fdce..3680515951 100644
--- a/apps/wps.h
+++ b/apps/wps.h
@@ -27,6 +27,7 @@ extern bool wps_time_countup;
27int wps_show(void); 27int wps_show(void);
28bool refresh_wps(bool refresh_scroll); 28bool refresh_wps(bool refresh_scroll);
29void handle_usb(void); 29void handle_usb(void);
30bool browse_id3(void);
30 31
31#ifdef HAVE_RECORDER_KEYPAD 32#ifdef HAVE_RECORDER_KEYPAD
32bool f2_screen(void); 33bool f2_screen(void);