A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Kevin Ferrare
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _GUI_STATUSBAR_H_
23#define _GUI_STATUSBAR_H_
24
25#include "config.h"
26#include "button.h"
27#include "status.h"
28#include "screen_access.h"
29#include "events.h"
30
31struct status_info {
32 int battlevel;
33 int batt_charge_step;
34 int volume;
35 int playmode;
36 int repeat;
37#if CONFIG_CHARGING
38 bool inserted;
39#endif
40#ifdef HAVE_USB_POWER
41 bool usb_inserted;
42#endif
43 bool battery_state;
44 bool shuffle;
45 bool keylock;
46#ifdef HAS_REMOTE_BUTTON_HOLD
47 bool keylockremote;
48#endif
49#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
50 bool led; /* disk LED simulation in the status bar */
51#endif
52
53};
54
55/* statusbar visibility/position, used for settings also */
56enum statusbar_values { STATUSBAR_OFF = 0, STATUSBAR_TOP, STATUSBAR_BOTTOM };
57
58struct gui_statusbar
59{
60 struct status_info info;
61 struct status_info lastinfo;
62
63 bool redraw_volume; /* true if the volume gauge needs updating */
64 int last_volume;
65 long volume_icon_switch_tick;
66
67 long battery_icon_switch_tick;
68
69#if CONFIG_RTC
70 struct tm *time;
71 int last_tm_min;
72#endif
73 struct screen * display;
74};
75
76
77extern struct gui_syncstatusbar statusbars;
78
79/*
80 * Attach the status bar to a screen
81 * (The previous screen attachement is lost)
82 * - bar : the statusbar structure
83 * - display : the screen to attach
84 */
85#define gui_statusbar_set_screen(gui_statusbar, _display) \
86 (gui_statusbar)->display = (_display);
87
88
89/*
90 * Draws the status bar on the attached screen
91 * - bar : the statusbar structure
92 */
93extern void gui_statusbar_draw(struct gui_statusbar * bar,
94 bool force_redraw, struct viewport *vp);
95
96
97struct gui_syncstatusbar
98{
99 struct gui_statusbar statusbars[NB_SCREENS];
100};
101
102extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars) INIT_ATTR;
103
104#if !defined(HAVE_REMOTE_LCD) || defined(__PCTOOL__)
105#include "settings.h"
106#define statusbar_position(a) ((enum statusbar_values)global_settings.statusbar)
107#else
108enum statusbar_values statusbar_position(int screen);
109#endif
110
111#endif /*_GUI_STATUSBAR_H_*/