summaryrefslogtreecommitdiff
path: root/apps/wps.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-02-11 15:03:28 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-02-11 15:03:28 +0000
commit39f7b66ca40e8f0a147a43a903121153b84a890e (patch)
tree830919ce13cdf02c38bc6ab6959a8786cb6d0427 /apps/wps.c
parent5b1644336c790d7a6b171f95302a7e09c396fd00 (diff)
downloadrockbox-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/wps.c')
-rw-r--r--apps/wps.c55
1 files changed, 37 insertions, 18 deletions
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);