-
Notifications
You must be signed in to change notification settings - Fork 1
/
DisplayManager.h
executable file
·64 lines (57 loc) · 1.8 KB
/
DisplayManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _DISPLAYMANAGER_H__
#define _DISPLAYMANAGER_H__
#define BUFFER_LENGTH 256
#define NAME_LENGTH 48
#define MODE_LENGTH 36
#define TYPE_LENGTH 12
#define MAX_NODE 10
enum {
MAIN_DISPLAY = 0,
AUX_DISPLAY
};
struct displaynode {
char path[BUFFER_LENGTH];
char mode[MODE_LENGTH];
char name[NAME_LENGTH];
int type;
int property;
int enable;
int connect;
struct displaynode *prev;
struct displaynode *next;
};
class DisplayManager {
public:
DisplayManager();
virtual ~DisplayManager() {}
void getIfaceInfo(SocketClient *cli, int display);
void getCurIface(SocketClient *cli, int display);
int enableIface(int display, char* iface, int enable);
void getModeList(SocketClient *cli, int display, char* iface);
void getCurMode(SocketClient *cli, int display, char* iface);
int setMode(int display, char* iface, char *mode);
void setHDMIEnable(int display);
void setHDMIDisable(int display);
void selectNextIface(int display);
void init(void);
void switchFramebuffer(int display, int xres, int yres);
void get3DModes(SocketClient *cli, int display, char* iface);
void get3DMode(SocketClient *cli, int display, char* iface);
int set3DMode(int display, char* iface, char *mode);
private:
struct displaynode *main_display_list;
struct displaynode *aux_display_list;
int powerup;
int readConfig(void);
void saveConfig(void);
int readSysfs(void);
int operateIfaceEnable(struct displaynode *node, int operate);
int readIfaceConnect(struct displaynode *node);
int operateIfaceMode(struct displaynode *node, int type, char *mode);
void display_list_add(struct displaynode *node);
const char* type2string(int type);
int string2type(const char *str);
void led_ctrl(struct displaynode *node);
void updatesinkaudioinfo(struct displaynode *node);
};
#endif