diff options
Diffstat (limited to 'apps/gui/statusbar.h')
-rw-r--r-- | apps/gui/statusbar.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h new file mode 100644 index 0000000000..434d679e29 --- /dev/null +++ b/apps/gui/statusbar.h | |||
@@ -0,0 +1,107 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Kévin 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_STATUSBAR_H_ | ||
21 | #define _GUI_STATUSBAR_H_ | ||
22 | |||
23 | #include "config.h" | ||
24 | #include "status.h" | ||
25 | |||
26 | struct status_info { | ||
27 | int battlevel; | ||
28 | int volume; | ||
29 | int hour; | ||
30 | int minute; | ||
31 | int playmode; | ||
32 | int repeat; | ||
33 | bool inserted; | ||
34 | bool shuffle; | ||
35 | bool keylock; | ||
36 | bool battery_safe; | ||
37 | bool redraw_volume; /* true if the volume gauge needs updating */ | ||
38 | #if CONFIG_LED == LED_VIRTUAL | ||
39 | bool led; /* disk LED simulation in the status bar */ | ||
40 | #endif | ||
41 | #ifdef HAVE_USB_POWER | ||
42 | bool usb_power; | ||
43 | #endif | ||
44 | }; | ||
45 | |||
46 | struct gui_statusbar | ||
47 | { | ||
48 | /* Volume icon stuffs */ | ||
49 | long volume_icon_switch_tick; | ||
50 | int last_volume; | ||
51 | |||
52 | long battery_icon_switch_tick; | ||
53 | |||
54 | #ifdef HAVE_CHARGING | ||
55 | int battery_charge_step; | ||
56 | #endif | ||
57 | |||
58 | struct status_info info; | ||
59 | struct status_info lastinfo; | ||
60 | |||
61 | struct screen * display; | ||
62 | }; | ||
63 | |||
64 | /* | ||
65 | * Initializes a status bar | ||
66 | * - bar : the bar to initialize | ||
67 | */ | ||
68 | extern void gui_statusbar_init(struct gui_statusbar * bar); | ||
69 | |||
70 | /* | ||
71 | * Attach the status bar to a screen | ||
72 | * (The previous screen attachement is lost) | ||
73 | * - bar : the statusbar structure | ||
74 | * - display : the screen to attach | ||
75 | */ | ||
76 | extern void gui_statusbar_set_screen(struct gui_statusbar * bar, struct screen * display); | ||
77 | |||
78 | /* | ||
79 | * Draws the status bar on the attached screen | ||
80 | * - bar : the statusbar structure | ||
81 | */ | ||
82 | extern void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw); | ||
83 | |||
84 | void gui_statusbar_icon_battery(struct screen * display, int percent); | ||
85 | bool gui_statusbar_icon_volume(struct gui_statusbar * bar, int percent); | ||
86 | void gui_statusbar_icon_play_state(struct screen * display, int state); | ||
87 | void gui_statusbar_icon_play_mode(struct screen * display, int mode); | ||
88 | void gui_statusbar_icon_shuffle(struct screen * display); | ||
89 | void gui_statusbar_icon_lock(struct screen * display); | ||
90 | #if CONFIG_LED == LED_VIRTUAL | ||
91 | void gui_statusbar_led(struct screen * display); | ||
92 | #endif | ||
93 | |||
94 | #ifdef HAVE_RTC | ||
95 | void gui_statusbar_time(struct screen * display, int hour, int minute); | ||
96 | #endif | ||
97 | |||
98 | |||
99 | struct gui_syncstatusbar | ||
100 | { | ||
101 | struct gui_statusbar statusbars[NB_SCREENS]; | ||
102 | }; | ||
103 | |||
104 | extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars); | ||
105 | extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw); | ||
106 | |||
107 | #endif /*_GUI_STATUSBAR_H_*/ | ||