summaryrefslogtreecommitdiff
path: root/apps/gui/statusbar.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/statusbar.c')
-rw-r--r--apps/gui/statusbar.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index dad317e9e2..02c69815a1 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -107,17 +107,17 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
107#ifdef HAVE_LCD_BITMAP 107#ifdef HAVE_LCD_BITMAP
108 if(!global_settings.statusbar) 108 if(!global_settings.statusbar)
109 return; 109 return;
110#endif 110#endif /* HAVE_LCD_BITMAP */
111 111
112 struct screen * display = bar->display; 112 struct screen * display = bar->display;
113 113
114#ifdef HAVE_RTC 114#ifdef HAVE_RTC
115 struct tm* tm; /* For Time */ 115 struct tm* tm; /* For Time */
116#endif 116#endif /* HAVE_RTC */
117 117
118#ifdef HAVE_LCD_CHARCELLS 118#ifdef HAVE_LCD_CHARCELLS
119 (void)force_redraw; /* players always "redraw" */ 119 (void)force_redraw; /* players always "redraw" */
120#endif 120#endif /* HAVE_LCD_CHARCELLS */
121 121
122 bar->info.volume = sound_val2phys(SOUND_VOLUME, global_settings.volume); 122 bar->info.volume = sound_val2phys(SOUND_VOLUME, global_settings.volume);
123 bar->info.inserted = charger_inserted(); 123 bar->info.inserted = charger_inserted();
@@ -129,22 +129,22 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
129 tm = get_time(); 129 tm = get_time();
130 bar->info.hour = tm->tm_hour; 130 bar->info.hour = tm->tm_hour;
131 bar->info.minute = tm->tm_min; 131 bar->info.minute = tm->tm_min;
132#endif 132#endif /* HAVE_RTC */
133 133
134 bar->info.shuffle = global_settings.playlist_shuffle; 134 bar->info.shuffle = global_settings.playlist_shuffle;
135#if CONFIG_KEYPAD == IRIVER_H100_PAD 135#if CONFIG_KEYPAD == IRIVER_H100_PAD
136 bar->info.keylock = button_hold(); 136 bar->info.keylock = button_hold();
137#else 137#else
138 bar->info.keylock = keys_locked; 138 bar->info.keylock = keys_locked;
139#endif 139#endif /* CONFIG_KEYPAD == IRIVER_H100_PAD */
140 bar->info.repeat = global_settings.repeat_mode; 140 bar->info.repeat = global_settings.repeat_mode;
141 bar->info.playmode = current_playmode(); 141 bar->info.playmode = current_playmode();
142#if CONFIG_LED == LED_VIRTUAL 142 if(!display->has_disk_led)
143 bar->info.led = led_read(HZ/2); /* delay should match polling interval */ 143 bar->info.led = led_read(HZ/2); /* delay should match polling interval */
144#endif 144
145#ifdef HAVE_USB_POWER 145#ifdef HAVE_USB_POWER
146 bar->info.usb_power = usb_powered(); 146 bar->info.usb_power = usb_powered();
147#endif 147#endif /* HAVE_USB_POWER */
148 148
149 /* only redraw if forced to, or info has changed */ 149 /* only redraw if forced to, or info has changed */
150 if (force_redraw || 150 if (force_redraw ||
@@ -161,7 +161,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
161 161
162 /* players always "redraw" */ 162 /* players always "redraw" */
163 { 163 {
164#endif 164#endif /* HAVE_LCD_BITMAP */
165 165
166#ifdef HAVE_CHARGING 166#ifdef HAVE_CHARGING
167 if (bar->info.inserted) { 167 if (bar->info.inserted) {
@@ -220,7 +220,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
220 STATUSBAR_PLUG_X_POS, 220 STATUSBAR_PLUG_X_POS,
221 STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH, 221 STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH,
222 STATUSBAR_HEIGHT); 222 STATUSBAR_HEIGHT);
223#endif 223#endif /* HAVE_USB_POWER */
224 224
225 bar->info.redraw_volume = gui_statusbar_icon_volume(bar, 225 bar->info.redraw_volume = gui_statusbar_icon_volume(bar,
226 bar->info.volume); 226 bar->info.volume);
@@ -232,7 +232,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
232 case REPEAT_AB: 232 case REPEAT_AB:
233 gui_statusbar_icon_play_mode(display, Icon_RepeatAB); 233 gui_statusbar_icon_play_mode(display, Icon_RepeatAB);
234 break; 234 break;
235#endif 235#endif /* AB_REPEAT_ENABLE */
236 236
237 case REPEAT_ONE: 237 case REPEAT_ONE:
238 gui_statusbar_icon_play_mode(display, Icon_RepeatOne); 238 gui_statusbar_icon_play_mode(display, Icon_RepeatOne);
@@ -249,14 +249,12 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
249 gui_statusbar_icon_lock(display); 249 gui_statusbar_icon_lock(display);
250#ifdef HAVE_RTC 250#ifdef HAVE_RTC
251 gui_statusbar_time(display, bar->info.hour, bar->info.minute); 251 gui_statusbar_time(display, bar->info.hour, bar->info.minute);
252#endif 252#endif /* HAVE_RTC */
253#if CONFIG_LED == LED_VIRTUAL 253 if(!display->has_disk_led && bar->info.led)
254 if (bar->info.led) 254 gui_statusbar_led(display);
255 statusbar_led();
256#endif
257 display->update_rect(0, 0, display->width, STATUSBAR_HEIGHT); 255 display->update_rect(0, 0, display->width, STATUSBAR_HEIGHT);
258 bar->lastinfo = bar->info; 256 bar->lastinfo = bar->info;
259#endif 257#endif /* HAVE_LCD_BITMAP */
260 } 258 }
261 259
262 260
@@ -284,7 +282,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
284 display->icon(ICON_AUDIO, audio); 282 display->icon(ICON_AUDIO, audio);
285 display->icon(ICON_PARAM, param); 283 display->icon(ICON_PARAM, param);
286 display->icon(ICON_USB, usb); 284 display->icon(ICON_USB, usb);
287#endif 285#endif /* HAVE_LCD_CHARCELLS */
288} 286}
289 287
290#ifdef HAVE_LCD_BITMAP 288#ifdef HAVE_LCD_BITMAP
@@ -448,7 +446,6 @@ void gui_statusbar_icon_lock(struct screen * display)
448 STATUSBAR_Y_POS, 5, 8); 446 STATUSBAR_Y_POS, 5, 8);
449} 447}
450 448
451#if CONFIG_LED == LED_VIRTUAL
452/* 449/*
453 * no real LED: disk activity in status bar 450 * no real LED: disk activity in status bar
454 */ 451 */
@@ -459,8 +456,6 @@ void gui_statusbar_led(struct screen * display)
459 STATUSBAR_Y_POS, STATUSBAR_DISK_WIDTH, 456 STATUSBAR_Y_POS, STATUSBAR_DISK_WIDTH,
460 STATUSBAR_HEIGHT); 457 STATUSBAR_HEIGHT);
461} 458}
462#endif
463
464 459
465#ifdef HAVE_RTC 460#ifdef HAVE_RTC
466/* 461/*