diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/gwps.c | 4 | ||||
-rw-r--r-- | apps/gui/logo.c | 94 | ||||
-rw-r--r-- | apps/gui/logo.h | 43 | ||||
-rw-r--r-- | apps/gui/quickscreen.c | 28 | ||||
-rw-r--r-- | apps/gui/quickscreen.h | 11 | ||||
-rw-r--r-- | apps/gui/statusbar.c | 61 | ||||
-rw-r--r-- | apps/gui/statusbar.h | 5 |
7 files changed, 213 insertions, 33 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 52340e6547..aec3a1401d 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -509,7 +509,7 @@ long gui_wps_show(void) | |||
509 | #ifdef WPS_RC_QUICK | 509 | #ifdef WPS_RC_QUICK |
510 | case WPS_RC_QUICK: | 510 | case WPS_RC_QUICK: |
511 | #endif | 511 | #endif |
512 | if (quick_screen_quick()) | 512 | if (quick_screen_quick(button)) |
513 | return SYS_USB_CONNECTED; | 513 | return SYS_USB_CONNECTED; |
514 | restore = true; | 514 | restore = true; |
515 | lastbutton = 0; | 515 | lastbutton = 0; |
@@ -518,7 +518,7 @@ long gui_wps_show(void) | |||
518 | /* screen settings */ | 518 | /* screen settings */ |
519 | #ifdef BUTTON_F3 | 519 | #ifdef BUTTON_F3 |
520 | case BUTTON_F3: | 520 | case BUTTON_F3: |
521 | if (quick_screen_f3()) | 521 | if (quick_screen_f3(button)) |
522 | return SYS_USB_CONNECTED; | 522 | return SYS_USB_CONNECTED; |
523 | restore = true; | 523 | restore = true; |
524 | break; | 524 | break; |
diff --git a/apps/gui/logo.c b/apps/gui/logo.c new file mode 100644 index 0000000000..9e2945a216 --- /dev/null +++ b/apps/gui/logo.c | |||
@@ -0,0 +1,94 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Björn Stenberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "logo.h" | ||
21 | |||
22 | #ifdef HAVE_LCD_BITMAP | ||
23 | #define BMPHEIGHT_usb_logo_main 32 | ||
24 | #define BMPWIDTH_usb_logo_main 100 | ||
25 | static const unsigned char usb_logo_main[] = { | ||
26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, | ||
29 | 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, | ||
30 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81, | ||
31 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, | ||
32 | 0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | ||
33 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, | ||
34 | 0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
35 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
36 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, | ||
37 | 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x1c, | ||
38 | 0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, | ||
39 | 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, | ||
40 | 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, | ||
41 | 0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01, | ||
42 | 0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | ||
43 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | ||
44 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, | ||
45 | 0x0f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x0f, | ||
46 | 0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3, | ||
47 | 0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02, | ||
48 | 0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, | ||
49 | 0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00, | ||
50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80, | ||
53 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, | ||
54 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87, | ||
55 | 0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0, | ||
56 | 0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
57 | 0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, | ||
58 | }; | ||
59 | |||
60 | struct logo usb_logos[]= | ||
61 | { | ||
62 | [SCREEN_MAIN]={usb_logo_main, BMPWIDTH_usb_logo_main, BMPHEIGHT_usb_logo_main}, | ||
63 | #if NB_SCREENS==2 | ||
64 | [SCREEN_REMOTE]={usb_logo_main, BMPWIDTH_usb_logo_main, BMPHEIGHT_usb_logo_main} | ||
65 | #endif | ||
66 | |||
67 | }; | ||
68 | #else | ||
69 | struct logo usb_logos[]= | ||
70 | { | ||
71 | [SCREEN_MAIN]={"[USB Mode]"} | ||
72 | }; | ||
73 | #endif | ||
74 | |||
75 | void gui_logo_draw(struct logo * logo, struct screen * display) | ||
76 | { | ||
77 | display->clear_display(); | ||
78 | |||
79 | #ifdef HAVE_LCD_BITMAP | ||
80 | /* Center bitmap on screen */ | ||
81 | display->mono_bitmap(logo->bitmap, | ||
82 | display->width/2-logo->width/2, | ||
83 | display->height/2-logo->height/2, | ||
84 | logo->width, | ||
85 | logo->height); | ||
86 | display->update(); | ||
87 | #else | ||
88 | display->double_height(false); | ||
89 | display->puts_scroll(0, 0, logo->text); | ||
90 | #ifdef SIMULATOR | ||
91 | display->update(); | ||
92 | #endif /* SIMULATOR */ | ||
93 | #endif /* HAVE_LCD_BITMAP */ | ||
94 | } | ||
diff --git a/apps/gui/logo.h b/apps/gui/logo.h new file mode 100644 index 0000000000..38eafeaef2 --- /dev/null +++ b/apps/gui/logo.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Kevin Ferrare | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef _GUI_LOGO_H_ | ||
21 | #define _GUI_LOGO_H_ | ||
22 | #include "screen_access.h" | ||
23 | |||
24 | struct logo{ | ||
25 | #ifdef HAVE_LCD_BITMAP | ||
26 | const unsigned char * bitmap; | ||
27 | int width; | ||
28 | int height; | ||
29 | #else | ||
30 | const char * text; | ||
31 | #endif | ||
32 | }; | ||
33 | |||
34 | extern struct logo usb_logos[]; | ||
35 | |||
36 | /* | ||
37 | * Draws the given logo at the center of the given screen | ||
38 | * - logo : the logo | ||
39 | * - display : the screen to draw on | ||
40 | */ | ||
41 | void gui_logo_draw(struct logo * logo, struct screen * display); | ||
42 | |||
43 | #endif /* _GUI_LOGO_H_ */ | ||
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index a11107cb51..7d94d4a0dc 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c | |||
@@ -51,6 +51,7 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) | |||
51 | display->has_buttonbar=false; | 51 | display->has_buttonbar=false; |
52 | #endif | 52 | #endif |
53 | gui_textarea_clear(display); | 53 | gui_textarea_clear(display); |
54 | display->setfont(FONT_SYSFIXED); | ||
54 | display->getstringsize("M",&w,&h); | 55 | display->getstringsize("M",&w,&h); |
55 | /* Displays the icons */ | 56 | /* Displays the icons */ |
56 | display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], | 57 | display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], |
@@ -62,7 +63,6 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) | |||
62 | display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], | 63 | display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], |
63 | display->width/2 + 8, | 64 | display->width/2 + 8, |
64 | display->height/2 - 4, 7, 8); | 65 | display->height/2 - 4, 7, 8); |
65 | display->setfont(FONT_SYSFIXED); | ||
66 | 66 | ||
67 | /* Displays the left's text */ | 67 | /* Displays the left's text */ |
68 | title=option_select_get_title(qs->left_option); | 68 | title=option_select_get_title(qs->left_option); |
@@ -90,7 +90,7 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) | |||
90 | display->putsxy(display->width - w, display->height/2, option); | 90 | display->putsxy(display->width - w, display->height/2, option); |
91 | 91 | ||
92 | gui_textarea_update(display); | 92 | gui_textarea_update(display); |
93 | lcd_setfont(FONT_UI); | 93 | display->setfont(FONT_UI); |
94 | } | 94 | } |
95 | 95 | ||
96 | void gui_syncquickscreen_draw(struct gui_quickscreen * qs) | 96 | void gui_syncquickscreen_draw(struct gui_quickscreen * qs) |
@@ -102,6 +102,7 @@ void gui_syncquickscreen_draw(struct gui_quickscreen * qs) | |||
102 | 102 | ||
103 | bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) | 103 | bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) |
104 | { | 104 | { |
105 | |||
105 | switch(button) | 106 | switch(button) |
106 | { | 107 | { |
107 | case QUICKSCREEN_LEFT : | 108 | case QUICKSCREEN_LEFT : |
@@ -143,24 +144,32 @@ bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) | |||
143 | return(false); | 144 | return(false); |
144 | } | 145 | } |
145 | 146 | ||
146 | bool gui_syncquickscreen_run(struct gui_quickscreen * qs) | 147 | bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) |
147 | { | 148 | { |
148 | int key; | 149 | int key; |
150 | /* To quit we need either : | ||
151 | * - a second press on the button that made us enter | ||
152 | * - an action taken while pressing the enter button, | ||
153 | * then release the enter button*/ | ||
154 | bool can_quit=false; | ||
149 | gui_syncquickscreen_draw(qs); | 155 | gui_syncquickscreen_draw(qs); |
150 | while (true) { | 156 | while (true) { |
151 | key = button_get(true); | 157 | key = button_get(true); |
152 | if(default_event_handler(key) == SYS_USB_CONNECTED) | 158 | if(default_event_handler(key & ~button_enter) == SYS_USB_CONNECTED) |
153 | return(true); | 159 | return(true); |
154 | if(gui_quickscreen_do_button(qs, key)) | 160 | if(gui_quickscreen_do_button(qs, key & ~button_enter)) |
155 | { | 161 | { |
162 | can_quit=true; | ||
156 | if(qs->callback) | 163 | if(qs->callback) |
157 | qs->callback(qs); | 164 | qs->callback(qs); |
158 | gui_syncquickscreen_draw(qs); | 165 | gui_syncquickscreen_draw(qs); |
159 | } | 166 | } |
160 | else if(key==QUICKSCREEN_QUIT | 167 | else if(key==button_enter) |
168 | can_quit=true; | ||
169 | if(key==(button_enter | BUTTON_REL) && can_quit) | ||
170 | return(false); | ||
161 | #ifdef QUICKSCREEN_QUIT | 171 | #ifdef QUICKSCREEN_QUIT |
162 | || key==QUICKSCREEN_QUIT | 172 | if(key==QUICKSCREEN_QUIT |
163 | #endif | ||
164 | #ifdef QUICKSCREEN_QUIT2 | 173 | #ifdef QUICKSCREEN_QUIT2 |
165 | || key==QUICKSCREEN_QUIT2 | 174 | || key==QUICKSCREEN_QUIT2 |
166 | #endif | 175 | #endif |
@@ -168,9 +177,8 @@ bool gui_syncquickscreen_run(struct gui_quickscreen * qs) | |||
168 | || key==QUICKSCREEN_RC_QUIT | 177 | || key==QUICKSCREEN_RC_QUIT |
169 | #endif | 178 | #endif |
170 | ) | 179 | ) |
171 | { | ||
172 | return(false); | 180 | return(false); |
173 | } | 181 | #endif /* QUICKSCREEN_QUIT */ |
174 | gui_syncstatusbar_draw(&statusbars, false); | 182 | gui_syncstatusbar_draw(&statusbars, false); |
175 | } | 183 | } |
176 | } | 184 | } |
diff --git a/apps/gui/quickscreen.h b/apps/gui/quickscreen.h index 09a0390d93..fdbe4db386 100644 --- a/apps/gui/quickscreen.h +++ b/apps/gui/quickscreen.h | |||
@@ -34,10 +34,8 @@ | |||
34 | #define QUICKSCREEN_BOTTOM_INV BUTTON_UP | 34 | #define QUICKSCREEN_BOTTOM_INV BUTTON_UP |
35 | #define QUICKSCREEN_RIGHT BUTTON_RIGHT | 35 | #define QUICKSCREEN_RIGHT BUTTON_RIGHT |
36 | 36 | ||
37 | #if CONFIG_KEYPAD == RECORDER_PAD | 37 | |
38 | #define QUICKSCREEN_QUIT BUTTON_F2 | 38 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) |
39 | #define QUICKSCREEN_QUIT2 BUTTON_F3 | ||
40 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
41 | #define QUICKSCREEN_QUIT BUTTON_MODE | 39 | #define QUICKSCREEN_QUIT BUTTON_MODE |
42 | #define QUICKSCREEN_QUIT2 BUTTON_OFF | 40 | #define QUICKSCREEN_QUIT2 BUTTON_OFF |
43 | #define QUICKSCREEN_RC_QUIT BUTTON_RC_MODE | 41 | #define QUICKSCREEN_RC_QUIT BUTTON_RC_MODE |
@@ -104,11 +102,12 @@ bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button); | |||
104 | void gui_syncquickscreen_draw(struct gui_quickscreen * qs); | 102 | void gui_syncquickscreen_draw(struct gui_quickscreen * qs); |
105 | 103 | ||
106 | /* | 104 | /* |
107 | * Runs the quickscreen on all available screens | 105 | * Runs the quickscreen on all available screens, if button_enter is released, quits |
108 | * - qs : the quickscreen | 106 | * - qs : the quickscreen |
107 | * - button_enter : button pressed at the same time the quickscreen is displayed | ||
109 | * returns : true if usb was connected, false otherwise | 108 | * returns : true if usb was connected, false otherwise |
110 | */ | 109 | */ |
111 | bool gui_syncquickscreen_run(struct gui_quickscreen * qs); | 110 | bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter); |
112 | 111 | ||
113 | #endif /*_GUI_QUICK_SCREEN_H_*/ | 112 | #endif /*_GUI_QUICK_SCREEN_H_*/ |
114 | #endif /* CONFIG_KEYPAD */ | 113 | #endif /* CONFIG_KEYPAD */ |
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index eec031fa93..945013e4b9 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -40,27 +40,30 @@ | |||
40 | 40 | ||
41 | /* FIXME: should be removed from icon.h to avoid redefinition, | 41 | /* FIXME: should be removed from icon.h to avoid redefinition, |
42 | but still needed for compatibility with old system */ | 42 | but still needed for compatibility with old system */ |
43 | 43 | #define ICONS_SPACING 2 | |
44 | #define STATUSBAR_BATTERY_X_POS 0 | 44 | #define STATUSBAR_BATTERY_X_POS 0*ICONS_SPACING |
45 | #define STATUSBAR_BATTERY_WIDTH 18 | 45 | #define STATUSBAR_BATTERY_WIDTH 18 |
46 | #define STATUSBAR_PLUG_X_POS STATUSBAR_X_POS + \ | 46 | #define STATUSBAR_PLUG_X_POS STATUSBAR_X_POS + \ |
47 | STATUSBAR_BATTERY_WIDTH +2 | 47 | STATUSBAR_BATTERY_WIDTH + \ |
48 | ICONS_SPACING | ||
48 | #define STATUSBAR_PLUG_WIDTH 7 | 49 | #define STATUSBAR_PLUG_WIDTH 7 |
49 | #define STATUSBAR_VOLUME_X_POS STATUSBAR_X_POS + \ | 50 | #define STATUSBAR_VOLUME_X_POS STATUSBAR_X_POS + \ |
50 | STATUSBAR_BATTERY_WIDTH + \ | 51 | STATUSBAR_BATTERY_WIDTH + \ |
51 | STATUSBAR_PLUG_WIDTH +2+2 | 52 | STATUSBAR_PLUG_WIDTH + \ |
53 | 2*ICONS_SPACING | ||
52 | #define STATUSBAR_VOLUME_WIDTH 16 | 54 | #define STATUSBAR_VOLUME_WIDTH 16 |
53 | #define STATUSBAR_PLAY_STATE_X_POS STATUSBAR_X_POS + \ | 55 | #define STATUSBAR_PLAY_STATE_X_POS STATUSBAR_X_POS + \ |
54 | STATUSBAR_BATTERY_WIDTH + \ | 56 | STATUSBAR_BATTERY_WIDTH + \ |
55 | STATUSBAR_PLUG_WIDTH + \ | 57 | STATUSBAR_PLUG_WIDTH + \ |
56 | STATUSBAR_VOLUME_WIDTH+2+2+2 | 58 | STATUSBAR_VOLUME_WIDTH + \ |
59 | 3*ICONS_SPACING | ||
57 | #define STATUSBAR_PLAY_STATE_WIDTH 7 | 60 | #define STATUSBAR_PLAY_STATE_WIDTH 7 |
58 | #define STATUSBAR_PLAY_MODE_X_POS STATUSBAR_X_POS + \ | 61 | #define STATUSBAR_PLAY_MODE_X_POS STATUSBAR_X_POS + \ |
59 | STATUSBAR_BATTERY_WIDTH + \ | 62 | STATUSBAR_BATTERY_WIDTH + \ |
60 | STATUSBAR_PLUG_WIDTH + \ | 63 | STATUSBAR_PLUG_WIDTH + \ |
61 | STATUSBAR_VOLUME_WIDTH + \ | 64 | STATUSBAR_VOLUME_WIDTH + \ |
62 | STATUSBAR_PLAY_STATE_WIDTH + \ | 65 | STATUSBAR_PLAY_STATE_WIDTH + \ |
63 | 2+2+2+2 | 66 | 4*ICONS_SPACING |
64 | #define STATUSBAR_PLAY_MODE_WIDTH 7 | 67 | #define STATUSBAR_PLAY_MODE_WIDTH 7 |
65 | #define STATUSBAR_SHUFFLE_X_POS STATUSBAR_X_POS + \ | 68 | #define STATUSBAR_SHUFFLE_X_POS STATUSBAR_X_POS + \ |
66 | STATUSBAR_BATTERY_WIDTH + \ | 69 | STATUSBAR_BATTERY_WIDTH + \ |
@@ -68,17 +71,28 @@ | |||
68 | STATUSBAR_VOLUME_WIDTH + \ | 71 | STATUSBAR_VOLUME_WIDTH + \ |
69 | STATUSBAR_PLAY_STATE_WIDTH + \ | 72 | STATUSBAR_PLAY_STATE_WIDTH + \ |
70 | STATUSBAR_PLAY_MODE_WIDTH + \ | 73 | STATUSBAR_PLAY_MODE_WIDTH + \ |
71 | 2+2+2+2+2 | 74 | 5*ICONS_SPACING |
72 | #define STATUSBAR_SHUFFLE_WIDTH 7 | 75 | #define STATUSBAR_SHUFFLE_WIDTH 7 |
73 | #define STATUSBAR_LOCK_X_POS STATUSBAR_X_POS + \ | 76 | #define STATUSBAR_LOCKM_X_POS STATUSBAR_X_POS + \ |
77 | STATUSBAR_BATTERY_WIDTH + \ | ||
78 | STATUSBAR_PLUG_WIDTH + \ | ||
79 | STATUSBAR_VOLUME_WIDTH + \ | ||
80 | STATUSBAR_PLAY_STATE_WIDTH + \ | ||
81 | STATUSBAR_PLAY_MODE_WIDTH + \ | ||
82 | STATUSBAR_SHUFFLE_WIDTH + \ | ||
83 | 6*ICONS_SPACING | ||
84 | #define STATUSBAR_LOCKM_WIDTH 5 | ||
85 | #define STATUSBAR_LOCKR_X_POS STATUSBAR_X_POS + \ | ||
74 | STATUSBAR_BATTERY_WIDTH + \ | 86 | STATUSBAR_BATTERY_WIDTH + \ |
75 | STATUSBAR_PLUG_WIDTH + \ | 87 | STATUSBAR_PLUG_WIDTH + \ |
76 | STATUSBAR_VOLUME_WIDTH + \ | 88 | STATUSBAR_VOLUME_WIDTH + \ |
77 | STATUSBAR_PLAY_STATE_WIDTH + \ | 89 | STATUSBAR_PLAY_STATE_WIDTH + \ |
78 | STATUSBAR_PLAY_MODE_WIDTH + \ | 90 | STATUSBAR_PLAY_MODE_WIDTH + \ |
79 | STATUSBAR_SHUFFLE_WIDTH + \ | 91 | STATUSBAR_SHUFFLE_WIDTH + \ |
80 | 2+2+2+2+2+2 | 92 | STATUSBAR_LOCKM_WIDTH + \ |
81 | #define STATUSBAR_LOCK_WIDTH 5 | 93 | 7*ICONS_SPACING |
94 | #define STATUSBAR_LOCKR_WIDTH 5 | ||
95 | |||
82 | #define STATUSBAR_DISK_WIDTH 12 | 96 | #define STATUSBAR_DISK_WIDTH 12 |
83 | #define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \ | 97 | #define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \ |
84 | STATUSBAR_DISK_WIDTH | 98 | STATUSBAR_DISK_WIDTH |
@@ -98,7 +112,6 @@ void gui_statusbar_init(struct gui_statusbar * bar) | |||
98 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | 112 | void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) |
99 | { | 113 | { |
100 | struct screen * display = bar->display; | 114 | struct screen * display = bar->display; |
101 | |||
102 | #ifdef HAVE_RTC | 115 | #ifdef HAVE_RTC |
103 | struct tm* tm; /* For Time */ | 116 | struct tm* tm; /* For Time */ |
104 | #endif /* HAVE_RTC */ | 117 | #endif /* HAVE_RTC */ |
@@ -120,11 +133,14 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
120 | #endif /* HAVE_RTC */ | 133 | #endif /* HAVE_RTC */ |
121 | 134 | ||
122 | bar->info.shuffle = global_settings.playlist_shuffle; | 135 | bar->info.shuffle = global_settings.playlist_shuffle; |
123 | #if CONFIG_KEYPAD == IRIVER_H100_PAD | 136 | #ifdef HAS_BUTTON_HOLD |
124 | bar->info.keylock = button_hold(); | 137 | bar->info.keylock = button_hold(); |
125 | #else | 138 | #else |
126 | bar->info.keylock = keys_locked; | 139 | bar->info.keylock = keys_locked; |
127 | #endif /* CONFIG_KEYPAD == IRIVER_H100_PAD */ | 140 | #endif /* HAS_BUTTON_HOLD */ |
141 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
142 | bar->info.keylockremote = remote_button_hold(); | ||
143 | #endif | ||
128 | bar->info.repeat = global_settings.repeat_mode; | 144 | bar->info.repeat = global_settings.repeat_mode; |
129 | bar->info.playmode = current_playmode(); | 145 | bar->info.playmode = current_playmode(); |
130 | if(!display->has_disk_led) | 146 | if(!display->has_disk_led) |
@@ -235,6 +251,10 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
235 | gui_statusbar_icon_shuffle(display); | 251 | gui_statusbar_icon_shuffle(display); |
236 | if (bar->info.keylock) | 252 | if (bar->info.keylock) |
237 | gui_statusbar_icon_lock(display); | 253 | gui_statusbar_icon_lock(display); |
254 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
255 | if (bar->info.keylockremote) | ||
256 | gui_statusbar_icon_lock_remote(display); | ||
257 | #endif | ||
238 | #ifdef HAVE_RTC | 258 | #ifdef HAVE_RTC |
239 | gui_statusbar_time(display, bar->info.hour, bar->info.minute); | 259 | gui_statusbar_time(display, bar->info.hour, bar->info.minute); |
240 | #endif /* HAVE_RTC */ | 260 | #endif /* HAVE_RTC */ |
@@ -430,8 +450,19 @@ void gui_statusbar_icon_shuffle(struct screen * display) | |||
430 | */ | 450 | */ |
431 | void gui_statusbar_icon_lock(struct screen * display) | 451 | void gui_statusbar_icon_lock(struct screen * display) |
432 | { | 452 | { |
433 | display->mono_bitmap(bitmap_icons_5x8[Icon_Lock], STATUSBAR_LOCK_X_POS, | 453 | display->mono_bitmap(bitmap_icons_5x8[Icon_Lock_Main], |
434 | STATUSBAR_Y_POS, 5, 8); | 454 | STATUSBAR_LOCKM_X_POS, STATUSBAR_Y_POS, |
455 | STATUSBAR_LOCKM_WIDTH, STATUSBAR_HEIGHT); | ||
456 | } | ||
457 | |||
458 | /* | ||
459 | * Print remote lock when remote hold is enabled | ||
460 | */ | ||
461 | void gui_statusbar_icon_lock_remote(struct screen * display) | ||
462 | { | ||
463 | display->mono_bitmap(bitmap_icons_5x8[Icon_Lock_Remote], | ||
464 | STATUSBAR_LOCKR_X_POS, STATUSBAR_Y_POS, | ||
465 | STATUSBAR_LOCKR_WIDTH, STATUSBAR_HEIGHT); | ||
435 | } | 466 | } |
436 | 467 | ||
437 | /* | 468 | /* |
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index 816205e2b4..88dfd4c4a2 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "status.h" | 24 | #include "status.h" |
25 | #include "screen_access.h" | 25 | #include "screen_access.h" |
26 | #include "button.h" | ||
26 | 27 | ||
27 | #define STATUSBAR_X_POS 0 | 28 | #define STATUSBAR_X_POS 0 |
28 | #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ | 29 | #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ |
@@ -40,6 +41,9 @@ struct status_info { | |||
40 | bool inserted; | 41 | bool inserted; |
41 | bool shuffle; | 42 | bool shuffle; |
42 | bool keylock; | 43 | bool keylock; |
44 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
45 | bool keylockremote; | ||
46 | #endif | ||
43 | bool battery_safe; | 47 | bool battery_safe; |
44 | bool redraw_volume; /* true if the volume gauge needs updating */ | 48 | bool redraw_volume; /* true if the volume gauge needs updating */ |
45 | bool led; /* disk LED simulation in the status bar */ | 49 | bool led; /* disk LED simulation in the status bar */ |
@@ -101,6 +105,7 @@ void gui_statusbar_icon_play_state(struct screen * display, int state); | |||
101 | void gui_statusbar_icon_play_mode(struct screen * display, int mode); | 105 | void gui_statusbar_icon_play_mode(struct screen * display, int mode); |
102 | void gui_statusbar_icon_shuffle(struct screen * display); | 106 | void gui_statusbar_icon_shuffle(struct screen * display); |
103 | void gui_statusbar_icon_lock(struct screen * display); | 107 | void gui_statusbar_icon_lock(struct screen * display); |
108 | void gui_statusbar_icon_lock_remote(struct screen * display); | ||
104 | void gui_statusbar_led(struct screen * display); | 109 | void gui_statusbar_led(struct screen * display); |
105 | 110 | ||
106 | 111 | ||