summaryrefslogtreecommitdiff
path: root/apps/bookmark.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-07-26 16:06:59 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-07-26 16:06:59 +0000
commitade5d7b848bf9c0d46bb14c85528453f969c9429 (patch)
tree197aa919b9a3c2a89f77d12b01cc1c2c23f7e37f /apps/bookmark.c
parent3d91885718a1fb9d6d55f07f67a9a1942a352c5e (diff)
downloadrockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.tar.gz
rockbox-ade5d7b848bf9c0d46bb14c85528453f969c9429.zip
First step in revamping the USB event handling, paving the way for the upcoming SYS_POWER_OFF event
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4951 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 993ea7e0ca..8d60de28fe 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -45,6 +45,7 @@
45#include "kernel.h" 45#include "kernel.h"
46#include "sprintf.h" 46#include "sprintf.h"
47#include "talk.h" 47#include "talk.h"
48#include "misc.h"
48 49
49#define MAX_BOOKMARKS 10 50#define MAX_BOOKMARKS 10
50#define MAX_BOOKMARK_SIZE 350 51#define MAX_BOOKMARK_SIZE 350
@@ -277,12 +278,10 @@ bool bookmark_autobookmark(void)
277 done = true; 278 done = true;
278 break; 279 break;
279 280
280 case SYS_USB_CONNECTED: 281 default:
281 usb_screen(); 282 if(default_event_handler(key) == SYS_USB_CONNECTED)
282#ifdef HAVE_LCD_CHARCELLS 283 return false;
283 status_set_param(true); 284 break;
284#endif
285 return false;
286 } 285 }
287 } 286 }
288 return true; 287 return true;
@@ -511,25 +510,23 @@ bool bookmark_autoload(char* file)
511 510
512 while(!done) 511 while(!done)
513 { 512 {
513 button_clear_queue();
514
514 /* Wait for a key to be pushed */ 515 /* Wait for a key to be pushed */
515 while (button_get(false)); /* clear button queue */
516 key = button_get(true); 516 key = button_get(true);
517 switch(key) 517 switch(key)
518 { 518 {
519 default:
520 return false;
521#ifdef HAVE_LCD_BITMAP 519#ifdef HAVE_LCD_BITMAP
522 case BUTTON_DOWN: 520 case BUTTON_DOWN:
523 return bookmark_load(global_bookmark_file_name, false); 521 return bookmark_load(global_bookmark_file_name, false);
524#endif 522#endif
525 case BUTTON_PLAY: 523 case BUTTON_PLAY:
526 return bookmark_load(global_bookmark_file_name, true); 524 return bookmark_load(global_bookmark_file_name, true);
527 case SYS_USB_CONNECTED: 525
528 usb_screen(); 526 default:
529#ifdef HAVE_LCD_CHARCELLS 527 if(default_event_handler(key) == SYS_USB_CONNECTED)
530 status_set_param(true); 528 return true;
531#endif 529 return false;
532 return true;
533 } 530 }
534 } 531 }
535 return true; 532 return true;
@@ -690,12 +687,6 @@ static char* select_bookmark(char* bookmark_file_name)
690 while (button_get(false)); /* clear button queue */ 687 while (button_get(false)); /* clear button queue */
691 break; 688 break;
692 689
693 case SYS_USB_CONNECTED:
694 usb_screen();
695#ifdef HAVE_LCD_CHARCELLS
696 status_set_param(true);
697#endif
698 return NULL;
699#ifdef HAVE_RECORDER_KEYPAD 690#ifdef HAVE_RECORDER_KEYPAD
700 case BUTTON_UP: 691 case BUTTON_UP:
701 bookmark_id--; 692 bookmark_id--;
@@ -726,6 +717,10 @@ static char* select_bookmark(char* bookmark_file_name)
726 case BUTTON_STOP: 717 case BUTTON_STOP:
727 return NULL; 718 return NULL;
728#endif 719#endif
720 default:
721 if(default_event_handler(key) == SYS_USB_CONNECTED)
722 return NULL;
723 break;
729 } 724 }
730 } 725 }
731 726