diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-02-11 15:03:28 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-02-11 15:03:28 +0000 |
commit | 39f7b66ca40e8f0a147a43a903121153b84a890e (patch) | |
tree | 830919ce13cdf02c38bc6ab6959a8786cb6d0427 /apps | |
parent | 5b1644336c790d7a6b171f95302a7e09c396fd00 (diff) | |
download | rockbox-39f7b66ca40e8f0a147a43a903121153b84a890e.tar.gz rockbox-39f7b66ca40e8f0a147a43a903121153b84a890e.zip |
Added Genre+Year to ID3 viewer, and added the viewer to the main menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3234 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 20 | ||||
-rw-r--r-- | apps/main_menu.c | 4 | ||||
-rw-r--r-- | apps/wps-display.c | 6 | ||||
-rw-r--r-- | apps/wps-display.h | 1 | ||||
-rw-r--r-- | apps/wps.c | 55 | ||||
-rw-r--r-- | apps/wps.h | 1 |
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 | |||
1346 | desc: Abort alternative in player keyboard interaction | 1346 | desc: Abort alternative in player keyboard interaction |
1347 | eng: "Abort" | 1347 | eng: "Abort" |
1348 | new: | 1348 | new: |
1349 | |||
1350 | id: LANG_MENU_SHOW_ID3_INFO | ||
1351 | desc: Menu option to start id3 viewer | ||
1352 | eng: "Show ID3 Info" | ||
1353 | new: | ||
1354 | |||
1355 | id: LANG_ID3_GENRE | ||
1356 | desc: ID3 frame 'genre' | ||
1357 | eng: "[Genre]" | ||
1358 | new: | ||
1359 | |||
1360 | id: LANG_ID3_YEAR | ||
1361 | desc: ID3 info 'year' | ||
1362 | eng: "[Year]" | ||
1363 | new: | ||
1364 | |||
1365 | id: LANG_ID3_NO_INFO | ||
1366 | desc: ID3 info is missing | ||
1367 | eng: "<no info>" | ||
1368 | new: | ||
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 | ||
98 | char* 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 */ |
100 | static void wps_format(char* fmt) | 106 | static 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 | |||
37 | bool wps_display(struct mp3entry* id3); | 37 | bool wps_display(struct mp3entry* id3); |
38 | bool wps_load(char* file, bool display); | 38 | bool wps_load(char* file, bool display); |
39 | void wps_reset(void); | 39 | void wps_reset(void); |
40 | char* 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 | ||
151 | static int browse_id3(void) | 151 | bool 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 | ||
289 | static bool ffwd_rew(int button) | 302 | static 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; | |||
27 | int wps_show(void); | 27 | int wps_show(void); |
28 | bool refresh_wps(bool refresh_scroll); | 28 | bool refresh_wps(bool refresh_scroll); |
29 | void handle_usb(void); | 29 | void handle_usb(void); |
30 | bool browse_id3(void); | ||
30 | 31 | ||
31 | #ifdef HAVE_RECORDER_KEYPAD | 32 | #ifdef HAVE_RECORDER_KEYPAD |
32 | bool f2_screen(void); | 33 | bool f2_screen(void); |