-
Notifications
You must be signed in to change notification settings - Fork 1
/
submenu.c
303 lines (249 loc) · 11.1 KB
/
submenu.c
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
/**
* pvrinput plugin for the Video Disk Recorder
*
* submenu.c - submenu of the plugin configuration
*
* (c) 2010 Rainer Blickle <rblickle AT gmx.de>
**/
/***************************************************************************
* *
* 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., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
* *
***************************************************************************/
#include "common.h"
static const char *aspectRatios[] = {
"1:1",
"4:3",
"16:9",
"2.21:1"
};
static const char * audioBitrateValues[] = {
"32",
"48",
"56",
"64",
"80",
"96",
"112",
"128",
"160",
"192",
"224",
"256",
"320",
"384"
};
static const char *bitrateModes[] = {
"VBR",
"CBR"
};
/* order must match the 'audmode' values in videodev2.h */
static const char *tunerAudioModes[] = {
"mono",
"stereo",
"lang2",
"lang1",
"bilingual"
};
static const char *useOnlyCard[] = {
"/dev/video0",
"/dev/video1",
"/dev/video2",
"/dev/video3",
"/dev/video4",
"/dev/video5",
"/dev/video6",
"/dev/video7",
"all", // 8
"PVR150", // 9
"PVR250", //10
"PVR350", //11
"PVR500#1", //12
"PVR500#2", //13
"HVR1300", //14
"HVR1600", //15
"HVR1900", //16
"HVR1950", //17
"PVRUSB2", //18
"HDPVR" //19
};
static const char *streamType[] = {
"MPEG2 PS",
"MPEG2 DVD"
};
static const char *exceptionVolumeForCard[] = {
"/dev/video0",
"/dev/video1",
"/dev/video2",
"/dev/video3",
"/dev/video4",
"/dev/video5",
"/dev/video6",
"/dev/video7",
"-", // 8
"PVR150", // 9
"PVR250", //10
"PVR350", //11
"PVR500#1", //12
"PVR500#2", //13
"HVR1300", //14
"HVR1600", //15
"HVR1900", //16
"HVR1950", //17
"PVRUSB2" //18
};
cPvrMenuGeneral::cPvrMenuGeneral(cPvrSetup *setupObject) :
cPvrSubMenu(tr("Setup.pvrinput$General Parameters")),
setup(setupObject)
{
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Log level"), &setup->LogLevel, 0, 4));
Add(new cMenuEditBoolItem(tr("Setup.pvrinput$Slice VBI Teletext"), &setup->SliceVBI));
Add(new cMenuEditBoolItem(tr("Setup.pvrinput$Hide main menu entry"), &setup->HideMainMenuEntry));
}
cPvrMenuVideo::cPvrMenuVideo(cPvrSetup *setupObject) :
cPvrSubMenu(tr("Setup.pvrinput$Video Parameters")),
setup(setupObject)
{
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Brightness"), &setup->Brightness.value, 0, 100));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Contrast"), &setup->Contrast.value, 0, 100));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Saturation"), &setup->Saturation.value, 0, 100));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Hue"), &setup->Hue.value, 0, 100));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Bitrate mode"),
&setup->BitrateMode.value,
setup->BitrateMode.queryctrl.maximum + 1,
bitrateModes));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Video bitrate TV (kbit/s)"),
&setup->VideoBitrateTV.value,
setup->VideoBitrateTV.queryctrl.minimum,
setup->VideoBitrateTV.queryctrl.maximum));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Aspect ratio"),
&setup->AspectRatio.value,
setup->AspectRatio.queryctrl.maximum + 1,
aspectRatios));
}
cPvrMenuAudio::cPvrMenuAudio(cPvrSetup *setupObject) :
cPvrSubMenu(tr("Setup.pvrinput$Audio Parameters")),
setup(setupObject)
{
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Common Audio volume (TV)"), &setup->AudioVolumeTVCommon.value, 0, 100));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Exception Audio volume (TV)"), &setup->AudioVolumeTVException.value, 0, 100));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Exception TV Volume for Card"), &setup->AudioVolumeTVExceptionCard, 19, exceptionVolumeForCard));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Tuner Audio Mode"), &setup->TunerAudioMode, 5, tunerAudioModes));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Audio radio volume"), &setup->AudioVolumeFM.value, 0, 100));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Audio bitrate (kbit/s)"),
&setup->AudioBitrate.value,
setup->AudioBitrate.queryctrl.maximum + 1,
audioBitrateValues));
static const char *SamplingFreqs[3];
SamplingFreqs[0] = tr("Setup.pvrinput$44.1 kHz");
SamplingFreqs[1] = tr("Setup.pvrinput$48 kHz");
SamplingFreqs[2] = tr("Setup.pvrinput$32 kHz");
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Audio sampling rate"),
&setup->AudioSampling.value,
setup->AudioSampling.queryctrl.maximum + 1,
SamplingFreqs));
}
cPvrMenuMpegFilter::cPvrMenuMpegFilter(cPvrSetup *setupObject) :
cPvrSubMenu(tr("Setup.pvrinput$MPEG Filter Parameters")),
setup(setupObject)
{
static const char *FilterModes[2];
FilterModes[0] = tr("Setup.pvrinput$manual");
FilterModes[1] = tr("Setup.pvrinput$auto");
static const char *SpatialTypes[5];
SpatialTypes[0] = tr("Setup.pvrinput$off");
SpatialTypes[1] = tr("Setup.pvrinput$1D horizontal");
SpatialTypes[2] = tr("Setup.pvrinput$1D vertical");
SpatialTypes[3] = tr("Setup.pvrinput$2D hv separable");
SpatialTypes[4] = tr("Setup.pvrinput$2D sym non separable");
static const char *MedianTypes[5];
MedianTypes[0] = tr("Setup.pvrinput$off");
MedianTypes[1] = tr("Setup.pvrinput$horizontal");
MedianTypes[2] = tr("Setup.pvrinput$vertical");
MedianTypes[3] = tr("Setup.pvrinput$horizontal + vertical");
MedianTypes[4] = tr("Setup.pvrinput$diagonal");
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Mode Spatial Video Filter"),
&setup->FilterSpatialMode.value,
setup->FilterSpatialMode.queryctrl.maximum + 1,
FilterModes));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Strength Spatial Video Filter"),
&setup->FilterSpatial.value,
setup->FilterSpatial.queryctrl.minimum,
setup->FilterSpatial.queryctrl.maximum));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Luma Spatial Filter Type"),
&setup->FilterLumaSpatialType.value,
setup->FilterLumaSpatialType.queryctrl.maximum + 1,
SpatialTypes));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Chroma Spatial Filter Type"),
&setup->FilterChromaSpatialType.value,
setup->FilterChromaSpatialType.queryctrl.maximum + 1,
SpatialTypes));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Mode Temporal Video Filter"),
&setup->FilterTemporalMode.value,
setup->FilterTemporalMode.queryctrl.maximum + 1,
FilterModes));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Strength Temporal Video Filter"),
&setup->FilterTemporal.value,
setup->FilterTemporal.queryctrl.minimum,
setup->FilterTemporal.queryctrl.maximum));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Median Filter Type"),
&setup->FilterMedianType.value,
setup->FilterMedianType.queryctrl.maximum + 1,
MedianTypes));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Luma Median Filter Bottom"),
&setup->FilterLumaMedianBottom.value,
setup->FilterLumaMedianBottom.queryctrl.minimum,
setup->FilterLumaMedianBottom.queryctrl.maximum));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Luma Median Filter Top"),
&setup->FilterLumaMedianTop.value,
setup->FilterLumaMedianTop.queryctrl.minimum,
setup->FilterLumaMedianTop.queryctrl.maximum));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Chroma Median Filter Bottom"),
&setup->FilterChromaMedianBottom.value,
setup->FilterChromaMedianBottom.queryctrl.minimum,
setup->FilterChromaMedianBottom.queryctrl.maximum));
Add(new cMenuEditIntItem(tr("Setup.pvrinput$Chroma Median Filter Top"),
&setup->FilterChromaMedianTop.value,
setup->FilterChromaMedianTop.queryctrl.minimum,
setup->FilterChromaMedianTop.queryctrl.maximum));
}
cPvrMenuExperts::cPvrMenuExperts(cPvrSetup *setupObject) :
cPvrSubMenu(tr("Setup.pvrinput$Expert Parameters")),
setup(setupObject)
{
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Stream type"), &setup->StreamType.value, 2, streamType));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$Use only card"), &setup->UseOnlyCard, 20, useOnlyCard));
Add(new cMenuEditBoolItem(tr("Setup.pvrinput$use externchannelswitch.sh"), &setup->UseExternChannelSwitchScript));
}
cPvrMenuHdPvr::cPvrMenuHdPvr(cPvrSetup *setupObject) :
cPvrSubMenu(tr("Setup.pvrinput$HDPVR Parameters")),
setup(setupObject) {
static const char *HDPVR_AudioEncodings[2];
HDPVR_AudioEncodings[0] = tr("Setup.pvrinput$AAC");
HDPVR_AudioEncodings[1] = tr("Setup.pvrinput$AC3");
static const char *HDPVR_AudioInputs[3];
HDPVR_AudioInputs[0] = tr("Setup.pvrinput$RCA back");
HDPVR_AudioInputs[1] = tr("Setup.pvrinput$RCA front");
HDPVR_AudioInputs[2] = tr("Setup.pvrinput$SPDIF");
Add(new cMenuEditStraItem(tr("Setup.pvrinput$HDPVR audio encoding"), &setup->HDPVR_AudioEncoding.value, 2, HDPVR_AudioEncodings));
Add(new cMenuEditStraItem(tr("Setup.pvrinput$HDPVR audio input"), &setup->HDPVR_AudioInput, 3, HDPVR_AudioInputs));
}
eOSState cPvrSubMenu::ProcessKey(eKeys Key) {
if (Key == kOk) {
return osBack;
}
return cOsdMenu::ProcessKey(Key);
}