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