-
Notifications
You must be signed in to change notification settings - Fork 2
/
fzscreencommon.cpp
113 lines (104 loc) · 3.77 KB
/
fzscreencommon.cpp
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
* Bookr: document reader for the Sony PSP
* Copyright (C) 2005 Carlos Carrasco Martinez (carloscm at gmail dot com)
* 2009 Nguyen Chi Tam (nguyenchitam at gmail dot com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "fzscreen.h"
const char* FZScreen::nameForButton(int mask) {
if (mask & FZ_CTRL_SELECT ) return "Select";
if (mask & FZ_CTRL_START ) return "Start";
if (mask & FZ_CTRL_UP ) return "Up";
if (mask & FZ_CTRL_RIGHT ) return "Right";
if (mask & FZ_CTRL_DOWN ) return "Down";
if (mask & FZ_CTRL_LEFT ) return "Left";
if (mask & FZ_CTRL_LTRIGGER) return "Left trigger";
if (mask & FZ_CTRL_RTRIGGER) return "Right trigger";
if (mask & FZ_CTRL_TRIANGLE) return "Triangle";
if (mask & FZ_CTRL_CIRCLE ) return "Circle";
if (mask & FZ_CTRL_CROSS ) return "Cross";
if (mask & FZ_CTRL_SQUARE ) return "Square";
if (mask & FZ_CTRL_HOME ) return "Home";
if (mask & FZ_CTRL_HOLD ) return "Hold";
if (mask & FZ_CTRL_NOTE ) return "Note";
return "Unknown button";
}
const char* FZScreen::nameForButtonReps(int button) {
if (button == FZ_REPS_SELECT ) return "Select";
if (button == FZ_REPS_START ) return "Start";
if (button == FZ_REPS_UP ) return "Up";
if (button == FZ_REPS_RIGHT ) return "Right";
if (button == FZ_REPS_DOWN ) return "Down";
if (button == FZ_REPS_LEFT ) return "Left";
if (button == FZ_REPS_LTRIGGER) return "Left trigger";
if (button == FZ_REPS_RTRIGGER) return "Right trigger";
if (button == FZ_REPS_TRIANGLE) return "Triangle";
if (button == FZ_REPS_CIRCLE ) return "Circle";
if (button == FZ_REPS_CROSS ) return "Cross";
if (button == FZ_REPS_SQUARE ) return "Square";
if (button == FZ_REPS_HOME ) return "Home";
if (button == FZ_REPS_HOLD ) return "Hold";
if (button == FZ_REPS_NOTE ) return "Note";
return "Unknown button";
}
int FZScreen::repsForButtonMask(int mask) {
if (mask & FZ_CTRL_SELECT ) return FZ_REPS_SELECT;
if (mask & FZ_CTRL_START ) return FZ_REPS_START;
if (mask & FZ_CTRL_UP ) return FZ_REPS_UP;
if (mask & FZ_CTRL_RIGHT ) return FZ_REPS_RIGHT;
if (mask & FZ_CTRL_DOWN ) return FZ_REPS_DOWN;
if (mask & FZ_CTRL_LEFT ) return FZ_REPS_LEFT;
if (mask & FZ_CTRL_LTRIGGER) return FZ_REPS_LTRIGGER;
if (mask & FZ_CTRL_RTRIGGER) return FZ_REPS_RTRIGGER;
if (mask & FZ_CTRL_TRIANGLE) return FZ_REPS_TRIANGLE;
if (mask & FZ_CTRL_CIRCLE ) return FZ_REPS_CIRCLE;
if (mask & FZ_CTRL_CROSS ) return FZ_REPS_CROSS;
if (mask & FZ_CTRL_SQUARE ) return FZ_REPS_SQUARE;
if (mask & FZ_CTRL_HOME ) return FZ_REPS_HOME;
if (mask & FZ_CTRL_HOLD ) return FZ_REPS_HOLD;
if (mask & FZ_CTRL_NOTE ) return FZ_REPS_NOTE;
return 0;
}
char* FZScreen::speedLabels[7] = {
"Default",
"10Mhz/5Mhz",
"25Mhz/12Mhz",
"50Mhz/25Mhz",
"111Mhz/55Mhz",
"222Mhz/111Mhz",
"333Mhz/166Mhz"
};
int FZScreen::speedValues[14] = {
0, 0,
10, 5,
25, 12,
50, 25,
111, 55,
222, 111,
333, 166
};
char* FZScreen::browserTextSizes[3] =
{
"Large", "Normal", "Small"
};
char* FZScreen::browserDisplayModes[3] =
{
"Normal", "Fit", "Smart-Fit"
};
char* FZScreen::browserInterfaceModes[3] =
{
"Full", "Limited", "None"
};