1 | #ifndef AVSETTINGS_H |
---|
2 | #define AVSETTINGS_H |
---|
3 | |
---|
4 | //flag 0: whithout vfd output |
---|
5 | //flag 1: whith vfd output |
---|
6 | void screenavsettings(int flag) |
---|
7 | { |
---|
8 | int rcret = 0; |
---|
9 | char* ret = NULL; |
---|
10 | struct skin* avsettings = getscreen("avsettings"); |
---|
11 | struct skin* listbox = getscreennode(avsettings, "listbox"); |
---|
12 | struct skin* resolution = getscreennode(avsettings, "resolution"); |
---|
13 | struct skin* aktresolution = getscreennode(avsettings, "aktresolution"); |
---|
14 | struct skin* autoresolution = getscreennode(avsettings, "autoresolution"); |
---|
15 | struct skin* autoressd = getscreennode(avsettings, "autoressd"); |
---|
16 | struct skin* autorests = getscreennode(avsettings, "autorests"); |
---|
17 | struct skin* stepmute = getscreennode(avsettings, "stepmute"); |
---|
18 | struct skin* policy = getscreennode(avsettings, "policy"); |
---|
19 | struct skin* aspect = getscreennode(avsettings, "aspect"); |
---|
20 | struct skin* colformat = getscreennode(avsettings, "colformat"); |
---|
21 | struct skin* colformatscart = getscreennode(avsettings, "colformatscart"); |
---|
22 | struct skin* audiosource = getscreennode(avsettings, "audiosource"); |
---|
23 | struct skin* ac3default = getscreennode(avsettings, "ac3default"); |
---|
24 | struct skin* ac3mode = getscreennode(avsettings, "ac3mode"); |
---|
25 | struct skin* volautochangevalue = getscreennode(avsettings, "volautochangevalue"); |
---|
26 | struct skin* mode3d = getscreennode(avsettings, "mode3d"); |
---|
27 | struct skin* autosubtitle = getscreennode(avsettings, "autosubtitle"); |
---|
28 | struct skin* audiodelaybitstream = getscreennode(avsettings, "audiodelaybitstream"); |
---|
29 | struct skin* playerstart = getscreennode(avsettings, "playerstart"); |
---|
30 | struct skin* playerstop = getscreennode(avsettings, "playerstop"); |
---|
31 | |
---|
32 | struct skin* tmp = NULL; |
---|
33 | |
---|
34 | ret = getvideomodechoices(); |
---|
35 | changeinput(resolution, ret); |
---|
36 | free(ret); ret = NULL; |
---|
37 | |
---|
38 | ret = getconfig("av_videomode", NULL); |
---|
39 | if(ret == NULL) |
---|
40 | { |
---|
41 | ret = getvideomode(); |
---|
42 | setchoiceboxselection(resolution, ret); |
---|
43 | free(ret); ret = NULL; |
---|
44 | } |
---|
45 | else |
---|
46 | setchoiceboxselection(resolution, ret); |
---|
47 | |
---|
48 | ret = getvideomode(); |
---|
49 | changeinput(aktresolution, ret); |
---|
50 | free(ret); ret = NULL; |
---|
51 | |
---|
52 | autoressd->hidden=YES; |
---|
53 | autorests->hidden=YES; |
---|
54 | if(getconfig("av_videomode_autores", NULL) != NULL) |
---|
55 | { |
---|
56 | if(ostrcmp(getconfig("av_videomode_autores", NULL), "off") != 0) |
---|
57 | { |
---|
58 | if(ostrcmp(getconfig("av_videomode_autores", NULL), "auto") != 0) |
---|
59 | autoressd->hidden=NO; |
---|
60 | else { |
---|
61 | autoressd->hidden=NO; |
---|
62 | autorests->hidden=NO; |
---|
63 | } |
---|
64 | } |
---|
65 | } |
---|
66 | int setlr=0; |
---|
67 | addchoicebox(autoresolution, "off", _("off")); |
---|
68 | addchoicebox(autoresolution, "auto", _("auto")); |
---|
69 | addchoicebox(autoresolution, "key", _("redKey")); |
---|
70 | setchoiceboxselection(autoresolution, getconfig("av_videomode_autores", NULL)); |
---|
71 | |
---|
72 | ret = getvideomodechoices(); |
---|
73 | changeinput(autoressd, ret); |
---|
74 | free(ret); ret = NULL; |
---|
75 | setchoiceboxselection(autoressd, getconfig("av_videomode_autores_sd", NULL)); |
---|
76 | |
---|
77 | addchoicebox(autorests, "2", _("2 sec")); |
---|
78 | addchoicebox(autorests, "4", _("4 sec")); |
---|
79 | addchoicebox(autorests, "6", _("6 sec")); |
---|
80 | addchoicebox(autorests, "8", _("8 sec")); |
---|
81 | addchoicebox(autorests, "10", _("10 sec")); |
---|
82 | setchoiceboxselection(autorests, getconfig("av_videomode_autores_ts", NULL)); |
---|
83 | addchoicebox(stepmute, "0", _("off")); |
---|
84 | addchoicebox(stepmute, "1", _("on")); |
---|
85 | setchoiceboxselection(stepmute, getconfig("stepmute", NULL)); |
---|
86 | |
---|
87 | changeinput(playerstart, "30\n40\n50\n60\n70\n80\n90\n100\n10\n20"); |
---|
88 | setchoiceboxselection(playerstart, getconfig("vol_playerstart", NULL)); |
---|
89 | |
---|
90 | changeinput(playerstop, "70\n80\n90\n100\n10\n20\n30\n40\n50\n60"); |
---|
91 | setchoiceboxselection(playerstop, getconfig("vol_playerstop", NULL)); |
---|
92 | |
---|
93 | ret = getpolicychoices(); |
---|
94 | changeinput(policy, ret); |
---|
95 | free(ret); ret = NULL; |
---|
96 | ret = getpolicy(); |
---|
97 | setchoiceboxselection(policy, ret); |
---|
98 | free(ret); ret = NULL; |
---|
99 | |
---|
100 | ret = getaspectchoices(); |
---|
101 | changeinput(aspect, ret); |
---|
102 | free(ret); ret = NULL; |
---|
103 | ret = getaspect(); |
---|
104 | setchoiceboxselection(aspect, ret); |
---|
105 | free(ret); ret = NULL; |
---|
106 | |
---|
107 | ret = getcolorformat(2); |
---|
108 | if(ret == NULL || strlen(ret) == 0) |
---|
109 | { |
---|
110 | free(ret); ret = NULL; |
---|
111 | colformatscart->hidden = YES; |
---|
112 | |
---|
113 | ret = getcolorformatchoices(0); |
---|
114 | changeinput(colformat, ret); |
---|
115 | free(ret); ret = NULL; |
---|
116 | ret = getcolorformat(1); |
---|
117 | setchoiceboxselection(colformat, ret); |
---|
118 | free(ret); ret = NULL; |
---|
119 | } |
---|
120 | else |
---|
121 | { |
---|
122 | free(ret); ret = NULL; |
---|
123 | colformatscart->hidden = NO; |
---|
124 | |
---|
125 | ret = getcolorformatchoices(1); |
---|
126 | changeinput(colformat, ret); |
---|
127 | free(ret); ret = NULL; |
---|
128 | ret = getcolorformat(1); |
---|
129 | setchoiceboxselection(colformat, ret); |
---|
130 | free(ret); ret = NULL; |
---|
131 | |
---|
132 | ret = getcolorformatchoices(2); |
---|
133 | changeinput(colformatscart, ret); |
---|
134 | free(ret); ret = NULL; |
---|
135 | ret = getcolorformat(2); |
---|
136 | setchoiceboxselection(colformatscart, ret); |
---|
137 | free(ret); ret = NULL; |
---|
138 | } |
---|
139 | |
---|
140 | ret = getaudiosourcechoices(); |
---|
141 | changeinput(audiosource, ret); |
---|
142 | free(ret); ret = NULL; |
---|
143 | ret = getaudiosource(); |
---|
144 | setchoiceboxselection(audiosource, ret); |
---|
145 | free(ret); ret = NULL; |
---|
146 | |
---|
147 | addchoicebox(ac3default, "0", _("no")); |
---|
148 | addchoicebox(ac3default, "1", _("yes")); |
---|
149 | setchoiceboxselection(ac3default, getconfig("av_ac3default", NULL)); |
---|
150 | |
---|
151 | ret = getac3choices(); |
---|
152 | changeinput(ac3mode, ret); |
---|
153 | free(ret); ret = NULL; |
---|
154 | ret = getac3(); |
---|
155 | setchoiceboxselection(ac3mode, ret); |
---|
156 | free(ret); ret = NULL; |
---|
157 | |
---|
158 | changeinput(volautochangevalue, "0\n5\n10\n15\n20\n25\n30\n35\n40\n45\n50\n55\n60\n65\n70\n75"); |
---|
159 | setchoiceboxselection(volautochangevalue, getconfig("volautochangevalue", NULL)); |
---|
160 | |
---|
161 | ret = getmode3dchoices(); |
---|
162 | changeinput(mode3d, ret); |
---|
163 | free(ret); ret = NULL; |
---|
164 | ret = getmode3d(); |
---|
165 | setchoiceboxselection(mode3d, ret); |
---|
166 | free(ret); ret = NULL; |
---|
167 | |
---|
168 | addchoicebox(autosubtitle, "0", _("no")); |
---|
169 | addchoicebox(autosubtitle, "1", _("yes")); |
---|
170 | setchoiceboxselection(autosubtitle, getconfig("autosubtitle", NULL)); |
---|
171 | |
---|
172 | addchoicebox(audiodelaybitstream, "0", _("no")); |
---|
173 | addchoicebox(audiodelaybitstream, "350", "10ms"); |
---|
174 | addchoicebox(audiodelaybitstream, "700", "20ms"); |
---|
175 | addchoicebox(audiodelaybitstream, "1050", "30ms"); |
---|
176 | addchoicebox(audiodelaybitstream, "1400", "40ms"); |
---|
177 | addchoicebox(audiodelaybitstream, "1750", "50ms"); |
---|
178 | addchoicebox(audiodelaybitstream, "2100", "60ms"); |
---|
179 | addchoicebox(audiodelaybitstream, "2450", "70ms"); |
---|
180 | addchoicebox(audiodelaybitstream, "2800", "80ms"); |
---|
181 | addchoicebox(audiodelaybitstream, "3150", "90ms"); |
---|
182 | addchoicebox(audiodelaybitstream, "3500", "100ms"); |
---|
183 | setchoiceboxselection(audiodelaybitstream, getconfig("audiodelaybitstream", NULL)); |
---|
184 | |
---|
185 | drawscreen(avsettings, 0, 0); |
---|
186 | addscreenrc(avsettings, listbox); |
---|
187 | |
---|
188 | // if(flag == 1 && listbox->select != NULL) |
---|
189 | if(listbox->select != NULL) |
---|
190 | writevfdmenu(listbox->select->text); |
---|
191 | |
---|
192 | tmp = listbox->select; |
---|
193 | while(1) |
---|
194 | { |
---|
195 | addscreenrc(avsettings, tmp); |
---|
196 | rcret = waitrc(avsettings, 0, 0); |
---|
197 | tmp = listbox->select; |
---|
198 | |
---|
199 | // if(flag == 1 && listbox->select != NULL) |
---|
200 | // { |
---|
201 | if(rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rcdown", NULL)) |
---|
202 | writevfdmenu(listbox->select->text); |
---|
203 | if(rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) |
---|
204 | { |
---|
205 | setlr = 1; |
---|
206 | writevfdmenu(listbox->select->ret); |
---|
207 | } |
---|
208 | // } |
---|
209 | // else |
---|
210 | // { |
---|
211 | // if(listbox->select != NULL) |
---|
212 | // { |
---|
213 | // if(rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) |
---|
214 | // setlr = 1; |
---|
215 | // } |
---|
216 | // } |
---|
217 | if(setlr == 1 && ostrcmp(listbox->select->name, "autoresolution") == 0) |
---|
218 | { |
---|
219 | autoressd->hidden=YES; |
---|
220 | autorests->hidden=YES; |
---|
221 | if(ostrcmp(autoresolution->ret, "off") != 0) |
---|
222 | { |
---|
223 | if(ostrcmp(autoresolution->ret, "key") == 0) |
---|
224 | autoressd->hidden=NO; |
---|
225 | else if(ostrcmp(autoresolution->ret, "auto") == 0) |
---|
226 | { |
---|
227 | autoressd->hidden=NO; |
---|
228 | autorests->hidden=NO; |
---|
229 | } |
---|
230 | } |
---|
231 | drawscreen(avsettings, 0, 0); |
---|
232 | } |
---|
233 | setlr = 0; |
---|
234 | |
---|
235 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
236 | if(flag == 1 || rcret == getrcconfigint("rcok", NULL)) |
---|
237 | { |
---|
238 | if(resolution->ret != NULL) |
---|
239 | { |
---|
240 | ret = getvideomode(); |
---|
241 | if(ostrcmp(ret, resolution->ret) != 0) |
---|
242 | { |
---|
243 | setvideomode(resolution->ret, 0); |
---|
244 | changefbresolution(resolution->ret, 0); |
---|
245 | if(flag == 0) |
---|
246 | { |
---|
247 | int tret = textbox(_("Message"), _("Is this Videomode ok ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0); |
---|
248 | if(tret == 0 || tret == 2) |
---|
249 | { |
---|
250 | setvideomode(ret, 0); |
---|
251 | changefbresolution(ret, 0); |
---|
252 | } |
---|
253 | else |
---|
254 | { |
---|
255 | writeallconfig(1); |
---|
256 | debug(10, "resolution->ret: %s", resolution->ret); |
---|
257 | if(ostrncmp("576", resolution->ret, 3) == 0 || ostrncmp("pal", resolution->ret, 3) == 0) |
---|
258 | { |
---|
259 | debug(10, "create /var/etc/.scart"); |
---|
260 | writesys("/var/etc/.scart", "0", 0); |
---|
261 | } |
---|
262 | else |
---|
263 | { |
---|
264 | debug(10, "unlink /var/etc/.scart"); |
---|
265 | unlink("/var/etc/.scart"); |
---|
266 | } |
---|
267 | } |
---|
268 | } |
---|
269 | if(flag == 1) drawscreen(avsettings, 0, 0); |
---|
270 | } |
---|
271 | free(ret); ret = NULL; |
---|
272 | } |
---|
273 | if(autoresolution->ret != NULL) |
---|
274 | { |
---|
275 | addconfig("av_videomode_autores", autoresolution->ret); |
---|
276 | addconfig("av_videomode_autores_sd", autoressd->ret); |
---|
277 | addconfig("av_videomode_autores_ts", autorests->ret); |
---|
278 | } |
---|
279 | |
---|
280 | if(stepmute->ret != NULL) |
---|
281 | addconfig("stepmute", stepmute->ret); |
---|
282 | |
---|
283 | if(policy->ret != NULL) |
---|
284 | { |
---|
285 | ret = getpolicy(); |
---|
286 | if(ostrcmp(ret, policy->ret) != 0) |
---|
287 | setpolicy(policy->ret); |
---|
288 | free(ret); ret = NULL; |
---|
289 | } |
---|
290 | if(aspect->ret != NULL) |
---|
291 | { |
---|
292 | ret = getaspect(); |
---|
293 | if(ostrcmp(ret, aspect->ret) != 0) |
---|
294 | setaspect(aspect->ret); |
---|
295 | free(ret); ret = NULL; |
---|
296 | } |
---|
297 | if(colformat->ret != NULL) |
---|
298 | { |
---|
299 | setcolorformat(colformat->ret, 0); |
---|
300 | ret = getcolorformat(1); |
---|
301 | changeinput(colformat, ret); |
---|
302 | free(ret); ret = NULL; |
---|
303 | drawscreen(avsettings, 0, 0); |
---|
304 | } |
---|
305 | if(colformatscart->ret != NULL) |
---|
306 | { |
---|
307 | setcolorformat(colformatscart->ret, 1); |
---|
308 | ret = getcolorformat(2); |
---|
309 | changeinput(colformatscart, ret); |
---|
310 | free(ret); ret = NULL; |
---|
311 | drawscreen(avsettings, 0, 0); |
---|
312 | } |
---|
313 | if(audiosource->ret != NULL) |
---|
314 | { |
---|
315 | ret = getaudiosource(); |
---|
316 | if(ostrcmp(ret, audiosource->ret) != 0) |
---|
317 | setaudiosource(audiosource->ret); |
---|
318 | free(ret); ret = NULL; |
---|
319 | } |
---|
320 | if(ac3mode->ret != NULL) |
---|
321 | { |
---|
322 | ret = getac3(); |
---|
323 | if(ostrcmp(ret, ac3mode->ret) != 0) |
---|
324 | setac3(ac3mode->ret); |
---|
325 | free(ret); ret = NULL; |
---|
326 | } |
---|
327 | if(mode3d->ret != NULL) |
---|
328 | { |
---|
329 | ret = getmode3d(); |
---|
330 | if(ostrcmp(ret, mode3d->ret) != 0) |
---|
331 | { |
---|
332 | clearscreen(avsettings); |
---|
333 | blitfb(0); |
---|
334 | setmode3d(mode3d->ret); |
---|
335 | drawscreen(avsettings, 0, 0); |
---|
336 | } |
---|
337 | free(ret); ret = NULL; |
---|
338 | } |
---|
339 | if(audiodelaybitstream->ret != NULL) |
---|
340 | { |
---|
341 | ret = getaudiodelaybitstream(); |
---|
342 | if(ostrcmp(ret, audiodelaybitstream->ret) != 0) |
---|
343 | setaudiodelaybitstream(audiodelaybitstream->ret); |
---|
344 | free(ret); ret = NULL; |
---|
345 | } |
---|
346 | |
---|
347 | addconfigscreencheck("volautochangevalue", volautochangevalue, 0); |
---|
348 | status.volautochangevalue = getconfigint("volautochangevalue", NULL); |
---|
349 | addconfigscreencheck("av_ac3default", ac3default, 0); |
---|
350 | addconfigscreencheck("autosubtitle", autosubtitle, 0); |
---|
351 | status.autosubtitle = getconfigint("autosubtitle", NULL); |
---|
352 | addconfigscreen("vol_playerstart", playerstart); |
---|
353 | addconfigscreen("vol_playerstop", playerstop); |
---|
354 | |
---|
355 | if(rcret == getrcconfigint("rcok", NULL)) break; |
---|
356 | } |
---|
357 | } |
---|
358 | |
---|
359 | delownerrc(avsettings); |
---|
360 | clearscreen(avsettings); |
---|
361 | } |
---|
362 | |
---|
363 | #endif |
---|