summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-05-20 12:44:36 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-05-20 12:44:36 +0000
commit1fb579c1feebea0a288060236638310beb2a0281 (patch)
tree5f45b97e70c77aafde553e191c16b0ce86413683 /apps
parent8190b5d3476f986ebf59374319feae3bc6c68904 (diff)
downloadrockbox-1fb579c1feebea0a288060236638310beb2a0281.tar.gz
rockbox-1fb579c1feebea0a288060236638310beb2a0281.zip
Finally, remote control now works while keys are locked.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3689 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/wps.c110
1 files changed, 16 insertions, 94 deletions
diff --git a/apps/wps.c b/apps/wps.c
index ef8b59fea8..7a22e1cc35 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -110,22 +110,20 @@ void player_change_volume(int button)
110 110
111void display_keylock_text(bool locked) 111void display_keylock_text(bool locked)
112{ 112{
113 lcd_clear_display(); 113 char* s;
114 114 lcd_stop_scroll();
115#ifdef HAVE_LCD_CHARCELLS 115#ifdef HAVE_LCD_CHARCELLS
116 if(locked) 116 if(locked)
117 lcd_puts(0, 0, str(LANG_KEYLOCK_ON_PLAYER)); 117 s = str(LANG_KEYLOCK_ON_PLAYER);
118 else 118 else
119 lcd_puts(0, 0, str(LANG_KEYLOCK_OFF_PLAYER)); 119 s = str(LANG_KEYLOCK_OFF_PLAYER);
120#else 120#else
121 if(locked) 121 if(locked)
122 lcd_puts(2, 3, str(LANG_KEYLOCK_ON_RECORDER)); 122 s = str(LANG_KEYLOCK_ON_RECORDER);
123 else 123 else
124 lcd_puts(2, 3, str(LANG_KEYLOCK_OFF_RECORDER)); 124 s = str(LANG_KEYLOCK_OFF_RECORDER);
125 lcd_update();
126#endif 125#endif
127 126 splash(HZ, 0, true, s);
128 sleep(HZ);
129} 127}
130 128
131void display_mute_text(bool muted) 129void display_mute_text(bool muted)
@@ -469,89 +467,6 @@ static bool update(void)
469 return retcode; 467 return retcode;
470} 468}
471 469
472
473static bool keylock(void)
474{
475 bool exit = false;
476
477#ifdef HAVE_LCD_CHARCELLS
478 status_set_record(true);
479 status_set_param(false);
480#endif
481 display_keylock_text(true);
482 keys_locked = true;
483 wps_refresh(id3, 0, WPS_REFRESH_ALL);
484 if (wps_display(id3)) {
485 keys_locked = false;
486#ifdef HAVE_LCD_CHARCELLS
487 status_set_record(false);
488#endif
489 return false;
490 }
491 status_draw(false);
492 while (button_get(false)); /* clear button queue */
493
494 while (!exit) {
495 switch ( button_get_w_tmo(HZ/5) ) {
496#ifdef HAVE_RECORDER_KEYPAD
497 case BUTTON_F1 | BUTTON_DOWN:
498 case BUTTON_F1 | BUTTON_REPEAT | BUTTON_DOWN:
499#else
500 case BUTTON_MENU | BUTTON_STOP:
501 case BUTTON_MENU | BUTTON_REPEAT | BUTTON_STOP:
502#endif
503#ifdef HAVE_LCD_CHARCELLS
504 status_set_record(false);
505#endif
506 display_keylock_text(false);
507 keys_locked = false;
508 exit = true;
509 while (button_get(false)); /* clear button queue */
510 break;
511
512 case SYS_USB_CONNECTED:
513 status_set_playmode(STATUS_STOP);
514 usb_screen();
515 return true;
516
517 case BUTTON_NONE:
518 if(update()) {
519 keys_locked = false;
520#ifdef HAVE_LCD_CHARCELLS
521 status_set_record(false);
522#endif
523 exit = true;
524 }
525 break;
526
527#ifdef HAVE_RECORDER_KEYPAD
528 case BUTTON_F1:
529 case BUTTON_F1 | BUTTON_REPEAT:
530#else
531 case BUTTON_MENU:
532 case BUTTON_MENU | BUTTON_REPEAT:
533#endif
534 /* ignore menu key, to avoid displaying "Keylock ON"
535 every time we unlock the keys */
536 break;
537
538 default:
539 display_keylock_text(true);
540 while (button_get(false)); /* clear button queue */
541 wps_refresh(id3, 0, WPS_REFRESH_ALL);
542 if (wps_display(id3)) {
543 keys_locked = false;
544#ifdef HAVE_LCD_CHARCELLS
545 status_set_record(false);
546#endif
547 exit = true;
548 }
549 break;
550 }
551 }
552 return false;
553}
554
555static bool menu(void) 470static bool menu(void)
556{ 471{
557 static bool muted = false; 472 static bool muted = false;
@@ -611,9 +526,10 @@ static bool menu(void)
611#else 526#else
612 case BUTTON_MENU | BUTTON_STOP: 527 case BUTTON_MENU | BUTTON_STOP:
613#endif 528#endif
614 if (keylock()) 529 keys_locked = !keys_locked;
615 return true; 530 display_keylock_text(keys_locked);
616 exit = true; 531 exit = true;
532 while (button_get(false)); /* clear button queue */
617 break; 533 break;
618 534
619#ifdef HAVE_PLAYER_KEYPAD 535#ifdef HAVE_PLAYER_KEYPAD
@@ -814,9 +730,15 @@ int wps_show(void)
814#else 730#else
815 ! ((button & BUTTON_MENU) || 731 ! ((button & BUTTON_MENU) ||
816#endif 732#endif
733 (button == BUTTON_NONE) ||
817 (button == SYS_USB_CONNECTED) || 734 (button == SYS_USB_CONNECTED) ||
818 (button & BUTTON_REMOTE))) 735 (button & BUTTON_REMOTE)))
736 {
737 while (button_get(false)); /* clear button queue */
738 display_keylock_text(true);
739 restore = true;
819 continue; 740 continue;
741 }
820 742
821 switch(button) 743 switch(button)
822 { 744 {