diff options
Diffstat (limited to 'apps/gui/statusbar.c')
-rw-r--r-- | apps/gui/statusbar.c | 61 |
1 files changed, 46 insertions, 15 deletions
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 | /* |