source: titan/titan/adjust.h @ 30760

Last change on this file since 30760 was 30760, checked in by gost, 9 years ago

[titan] mipsel.. activate cec settungs

File size: 17.3 KB
Line 
1#ifndef ADJUST_H
2#define ADJUST_H
3
4void screenadjust()
5{
6        int rcret = 0;
7        char* tmpstr = NULL;
8       
9        struct skin* adjust = getscreen("adjust");
10        struct skin* listbox = getscreennode(adjust, "listbox");
11        struct skin* volbartimeout = getscreennode(adjust, "volbartimeout");
12        struct skin* infobartimeout = getscreennode(adjust, "infobartimeout");
13        struct skin* infobarsleep = getscreennode(adjust, "infobarsleep");
14        struct skin* secondinfobar = getscreennode(adjust, "secondinfobar");
15        struct skin* spinnerspeed = getscreennode(adjust, "spinnerspeed");
16        struct skin* spinnertime = getscreennode(adjust, "spinnertime");
17        struct skin* hangtime = getscreennode(adjust, "hangtime");
18        struct skin* nozapclear = getscreennode(adjust, "nozapclear");
19        struct skin* fastzap = getscreennode(adjust, "fastzap");
20        struct skin* faststop = getscreennode(adjust, "faststop");
21        struct skin* dirsort = getscreennode(adjust, "dirsort");
22        struct skin* poweraktion = getscreennode(adjust, "poweraktion");
23        struct skin* virtualzap = getscreennode(adjust, "virtualzap");
24        struct skin* fasttextrender = getscreennode(adjust, "fasttextrender");
25        struct skin* recsplitsize = getscreennode(adjust, "recsplitsize");
26        struct skin* recforerun = getscreennode(adjust, "recforerun");
27        struct skin* recoverrun = getscreennode(adjust, "recoverrun");
28        struct skin* skip13 = getscreennode(adjust, "skip13");
29        struct skin* skip46 = getscreennode(adjust, "skip46");
30        struct skin* skip79 = getscreennode(adjust, "skip79");
31        struct skin* playertype = getscreennode(adjust, "playertype");
32        struct skin* autochangechannelname = getscreennode(adjust, "autochangechannelname");
33        struct skin* def_rectimer_after = getscreennode(adjust, "def_rectimer_after");
34        struct skin* showchanneltimeline = getscreennode(adjust, "showchanneltimeline");
35        struct skin* screenanim = getscreennode(adjust, "screenanim");
36        struct skin* screenanimspeed = getscreennode(adjust, "screenanimspeed");
37        struct skin* channellistview = getscreennode(adjust, "channellistview");
38        struct skin* showlastpos = getscreennode(adjust, "showlastpos");
39        struct skin* recsync = getscreennode(adjust, "recsync");
40        struct skin* recordnamefmt = getscreennode(adjust, "recordnamefmt");
41        struct skin* newsletter = getscreennode(adjust, "newsletter");
42        struct skin* showhiddenfiles = getscreennode(adjust, "showhiddenfiles");
43        struct skin* expertmodus = getscreennode(adjust, "expertmodus");
44        struct skin* infobarprogram = getscreennode(adjust, "infobarprogram");
45        struct skin* crosscontrol = getscreennode(adjust, "crosscontrol");
46        struct skin* emucontrol = getscreennode(adjust, "emucontrol");
47        struct skin* minitv = getscreennode(adjust, "choiceminitv");
48        struct skin* usecec = getscreennode(adjust, "usecec");
49        struct skin* playerbuffersize = getscreennode(adjust, "playerbuffersize");
50        struct skin* playerbufferseektime = getscreennode(adjust, "playerbufferseektime");
51        struct skin* sataswitch = getscreennode(adjust, "sataswitch");
52        struct skin* dualboot = getscreennode(adjust, "dualboot");
53        struct skin* community_user = getscreennode(adjust, "community_user");
54        struct skin* community_pass = getscreennode(adjust, "community_pass");
55
56        struct skin* tmp = NULL;
57
58        changeinput(volbartimeout, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10");
59        setchoiceboxselection(volbartimeout, getconfig("volbartimeout", NULL));
60
61        changeinput(infobartimeout, "1\n2\n3\n4\n5\n6\n7\n8\n9\n10");
62        setchoiceboxselection(infobartimeout, getconfig("infobartimeout", NULL));
63
64        changeinput(infobarsleep, "0\n1\n2\n3\n4\n5");
65        setchoiceboxselection(infobarsleep, getconfig("infobarsleep", NULL));
66       
67        addchoicebox(secondinfobar, "0", _("no"));
68        addchoicebox(secondinfobar, "1", _("infobar"));
69        addchoicebox(secondinfobar, "2", _("epg"));
70        addchoicebox(secondinfobar, "3", _("Channel EPG"));
71        setchoiceboxselection(secondinfobar, getconfig("secondinfobar", NULL));
72
73        changeinput(spinnerspeed, "1\n3\n9\n12\n15\n18\n21\n24\n27\n30");
74        setchoiceboxselection(spinnerspeed, getconfig("spinnerspeed", NULL));
75
76        changeinput(spinnertime, "1\n2\n3\n4\n5\n6\n7\n8\n10000");
77        setchoiceboxselection(spinnertime, getconfig("spinnertime", NULL));
78
79        changeinput(hangtime, "5\n10\n15\n30\n60\n120\n10000");
80        setchoiceboxselection(hangtime, getconfig("hangtime", NULL));
81
82        addchoicebox(nozapclear, "0", _("no"));
83        addchoicebox(nozapclear, "1", _("yes"));
84        setchoiceboxselection(nozapclear, getconfig("nozapclear", NULL));
85
86        if(checkbox("ATEMIO7600") == 1)
87                fastzap->hidden = YES;
88        else
89                fastzap->hidden = NO;
90       
91        addchoicebox(fastzap, "0", _("no"));
92        addchoicebox(fastzap, "2", _("medium"));
93        addchoicebox(fastzap, "1", _("fast"));
94        setchoiceboxselection(fastzap, getconfig("fastzap", NULL));
95
96        addchoicebox(faststop, "0", _("no"));
97        addchoicebox(faststop, "1", _("yes"));
98        setchoiceboxselection(faststop, getconfig("faststop", NULL));
99
100        addchoicebox(dirsort, "0", _("alpha"));
101        addchoicebox(dirsort, "1", _("reverse alpha"));
102        addchoicebox(dirsort, "2", _("size"));
103        addchoicebox(dirsort, "3", _("reverse size"));
104        addchoicebox(dirsort, "4", _("date"));
105        addchoicebox(dirsort, "5", _("reverse date"));
106        setchoiceboxselection(dirsort, getconfig("dirsort", NULL));
107
108        addchoicebox(poweraktion, "0", _("Power Menu"));
109        addchoicebox(poweraktion, "1", _("Power Off"));
110        addchoicebox(poweraktion, "2", _("Standby"));
111        addchoicebox(poweraktion, "3", _("Restart"));
112        addchoicebox(poweraktion, "4", _("Gui Restart"));
113        setchoiceboxselection(poweraktion, getconfig("poweraktion", NULL));
114       
115        addchoicebox(virtualzap, "0", _("deaktiv"));
116        addchoicebox(virtualzap, "1", _("1 sec"));
117        addchoicebox(virtualzap, "2", _("2 sec"));
118        addchoicebox(virtualzap, "9999", _("endless"));
119        setchoiceboxselection(virtualzap, getconfig("virtualzap", NULL));
120       
121        addchoicebox(fasttextrender, "0", _("no"));
122        addchoicebox(fasttextrender, "1", _("yes"));
123        setchoiceboxselection(fasttextrender, getconfig("fasttextrender", NULL));
124
125        addchoicebox(recsplitsize, "0", _("deaktiv"));
126        addchoicebox(recsplitsize, "1", _("1 GB"));
127        addchoicebox(recsplitsize, "2", _("2 GB"));
128        addchoicebox(recsplitsize, "3", _("3 GB"));
129        addchoicebox(recsplitsize, "4", _("4 GB"));
130        setchoiceboxselection(recsplitsize, getconfig("recsplitsize", NULL));
131
132        changeinput(recforerun, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n15\n20\n25\n30\n35\n40\n45\n50\n55\n60");
133        setchoiceboxselection(recforerun, getconfig("recforerun", NULL));
134
135        changeinput(recoverrun, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n15\n20\n25\n30\n35\n40\n45\n50\n55\n60");
136        setchoiceboxselection(recoverrun, getconfig("recoverrun", NULL));
137
138        changeinput(skip13, "15\n20\n30\n45\n60\n90\n120\n180\n300\n600\n900\n1200");
139        setchoiceboxselection(skip13, getconfig("skip13", NULL));
140
141        changeinput(skip46, "15\n20\n30\n45\n60\n90\n120\n180\n300\n600\n900\n1200");
142        setchoiceboxselection(skip46, getconfig("skip46", NULL));
143
144        changeinput(skip79, "15\n20\n30\n45\n60\n90\n120\n180\n300\n600\n900\n1200");
145        setchoiceboxselection(skip79, getconfig("skip79", NULL));
146       
147        addchoicebox(playertype, "0", _("extern"));
148        addchoicebox(playertype, "1", _("intern"));
149        setchoiceboxselection(playertype, getconfig("playertype", NULL));
150       
151        addchoicebox(autochangechannelname, "0", _("no"));
152        addchoicebox(autochangechannelname, "1", _("yes"));
153        setchoiceboxselection(autochangechannelname, getconfig("autochangechannelname", NULL));
154
155        addchoicebox(def_rectimer_after, "0", _("auto"));
156        addchoicebox(def_rectimer_after, "1", _("nothing"));
157        addchoicebox(def_rectimer_after, "2", _("standby"));
158        addchoicebox(def_rectimer_after, "3", _("power off"));
159        setchoiceboxselection(def_rectimer_after, getconfig("def_rectimer_after", NULL));
160       
161        addchoicebox(showchanneltimeline, "0", _("no"));
162        addchoicebox(showchanneltimeline, "1", _("yes"));
163        setchoiceboxselection(showchanneltimeline, getconfig("showchanneltimeline", NULL));
164       
165        addchoicebox(screenanim, "0", _("no"));
166        addchoicebox(screenanim, "1", _("anim. width"));
167        addchoicebox(screenanim, "2", _("anim. height"));
168        addchoicebox(screenanim, "3", _("anim. both"));
169        setchoiceboxselection(screenanim, getconfig("screenanim", NULL));
170       
171        addchoicebox(screenanimspeed, "1", _("very fast"));
172        addchoicebox(screenanimspeed, "5", _("fast"));
173        addchoicebox(screenanimspeed, "10", _("normal"));
174        addchoicebox(screenanimspeed, "15", _("slow"));
175        addchoicebox(screenanimspeed, "20", _("very slow"));
176        setchoiceboxselection(screenanimspeed, getconfig("screenanimspeed", NULL));
177
178        addchoicebox(channellistview, "0", _("hidden"));
179        addchoicebox(channellistview, "1", _("deaktiv"));
180        setchoiceboxselection(channellistview, getconfig("channellistview", NULL));
181
182        addchoicebox(showlastpos, "0", _("no"));       
183        addchoicebox(showlastpos, "1", _("yes"));
184        setchoiceboxselection(showlastpos, getconfig("showlastpos", NULL));
185
186        addchoicebox(recsync, "0", _("no"));   
187        addchoicebox(recsync, "1", _("yes"));
188        setchoiceboxselection(recsync, getconfig("recsync", NULL));
189
190        addchoicebox(recordnamefmt, "0", _("channel-movie"));
191        addchoicebox(recordnamefmt, "1", _("movie-channel"));
192        setchoiceboxselection(recordnamefmt, getconfig("recordnamefmt", NULL));
193
194        addchoicebox(newsletter, "0", _("no"));
195        addchoicebox(newsletter, "1", _("yes"));
196        setchoiceboxselection(newsletter, getconfig("newsletter", NULL));
197
198        addchoicebox(showhiddenfiles, "0", _("no"));
199        addchoicebox(showhiddenfiles, "1", _("yes"));
200        setchoiceboxselection(showhiddenfiles, getconfig("showhiddenfiles", NULL));
201
202        addchoicebox(expertmodus, "0", _("no"));
203        addchoicebox(expertmodus, "10", _("yes"));
204        if(getconfigint("expertmodus", NULL) == 11)
205                addchoicebox(expertmodus, "11", _("expert (11)"));
206        setchoiceboxselection(expertmodus, getconfig("expertmodus", NULL));
207
208        addchoicebox(infobarprogram, "0", _("no"));
209        addchoicebox(infobarprogram, "1", _("yes"));
210        setchoiceboxselection(infobarprogram, getconfig("infobarprogram", NULL));
211
212        addchoicebox(crosscontrol, "0", _("no"));
213        addchoicebox(crosscontrol, "1", _("yes"));
214        addchoicebox(crosscontrol, "2", _("yes / vzap 1 sec"));
215        addchoicebox(crosscontrol, "3", _("yes / vzap 2 sec"));
216        addchoicebox(crosscontrol, "9999", _("yes / vzap endless"));
217        setchoiceboxselection(crosscontrol, getconfig("crosscontrol", NULL));
218
219        addchoicebox(emucontrol, "0", _("no"));
220        addchoicebox(emucontrol, "1", _("yes"));
221        setchoiceboxselection(emucontrol, getconfig("emucontrol", NULL));
222
223        addchoicebox(minitv, "0", _("no"));
224        addchoicebox(minitv, "1", _("yes"));
225        setchoiceboxselection(minitv, getconfig("minitv", NULL));
226
227        addchoicebox(usecec, "0", _("no"));
228        addchoicebox(usecec, "1", _("yes"));
229        setchoiceboxselection(usecec, getconfig("usecec", NULL));
230
231        if(!file_exist("/mnt/config/dualboot"))
232        {
233                addchoicebox(dualboot, "0", _("no"));
234                addchoicebox(dualboot, "1", _("yes"));
235        }
236        else
237        {
238                addchoicebox(dualboot, "1", _("yes"));
239                addchoicebox(dualboot, "0", _("no"));
240        }
241        setchoiceboxselection(dualboot, getconfig("dualboot", NULL));
242
243        changemask(community_user, "abcdefghijklmnopqrstuvwxyz");
244        changeinput(community_user, getconfig("community_user", NULL));
245
246        changemask(community_pass, "abcdefghijklmnopqrstuvwxyz");
247        changeinput(community_pass, getconfig("community_pass", NULL));
248
249#ifdef MIPSEL
250        dualboot->hidden = NO;
251#endif
252#ifdef SH4
253        dualboot->hidden = YES;
254#endif
255
256        if(status.security == 0 || checkemu() == 0)
257                emucontrol->hidden = YES;
258        else
259                emucontrol->hidden = NO;
260#ifdef MIPSEL
261        if(checkbox("ATEMIO510") == 1 || checkbox("UFS912") == 1 || checkbox("UFS913") == 1 || checkbox("ATEMIO7600") == 1 || checkbox("ATEMIO520") == 1 || checkbox("ATEMIO530") == 1)
262                usecec->hidden = NO;
263        else
264                usecec->hidden = YES;
265#else
266        usecec->hidden = NO;
267#endif
268
269        if(checkbox("ATEMIO7600") == 1)
270        {
271                sataswitch->hidden = NO;
272                addchoicebox(sataswitch, "0", _("extern"));
273                addchoicebox(sataswitch, "1", _("intern"));
274                tmpstr = getsataswitch();
275                setchoiceboxselection(sataswitch, tmpstr);
276                free(tmpstr); tmpstr = NULL;
277        }
278        else
279                sataswitch->hidden = YES;
280       
281        addchoicebox(playerbuffersize, "0", _("no"));
282        addchoicebox(playerbuffersize, "524288", "512KB");
283        addchoicebox(playerbuffersize, "1048576", "1MB");
284        addchoicebox(playerbuffersize, "1572864", "1,5MB");
285        addchoicebox(playerbuffersize, "2097152", "2MB");
286        addchoicebox(playerbuffersize, "2621440", "2,5MB");
287        addchoicebox(playerbuffersize, "3145728", "3MB");
288        addchoicebox(playerbuffersize, "3670016", "3,5MB");
289        addchoicebox(playerbuffersize, "4194304", "4MB");
290        addchoicebox(playerbuffersize, "4718592", "4,5MB");
291        addchoicebox(playerbuffersize, "5242880", "5MB");
292        setchoiceboxselection(playerbuffersize, getconfig("playerbuffersize", NULL));
293       
294        addchoicebox(playerbufferseektime, "0", "0");
295        addchoicebox(playerbufferseektime, "1", "1");
296        addchoicebox(playerbufferseektime, "2", "2");
297        addchoicebox(playerbufferseektime, "3", "3");
298        addchoicebox(playerbufferseektime, "4", "4");
299        addchoicebox(playerbufferseektime, "5", "5");
300        addchoicebox(playerbufferseektime, "6", "6");
301        addchoicebox(playerbufferseektime, "7", "7");
302        addchoicebox(playerbufferseektime, "8", "8");
303        addchoicebox(playerbufferseektime, "9", "9");
304        addchoicebox(playerbufferseektime, "10", "10");
305        setchoiceboxselection(playerbufferseektime, getconfig("playerbufferseektime", NULL));
306       
307        drawscreen(adjust, 0, 0);
308        addscreenrc(adjust, listbox);
309
310        tmp = listbox->select;
311        while(1)
312        {
313                addscreenrc(adjust, tmp);
314                rcret = waitrc(adjust, 0, 0);
315                tmp = listbox->select;
316
317                if(rcret == getrcconfigint("rcexit", NULL)) break;
318                if(rcret == getrcconfigint("rcok", NULL))
319                {
320                        addconfigscreen("volbartimeout", volbartimeout);
321                        addconfigscreen("infobartimeout", infobartimeout);
322                        addconfigscreen("infobarsleep", infobarsleep);
323                        addconfigscreencheck("secondinfobar", secondinfobar, "0");             
324                        addconfigscreen("spinnerspeed", spinnerspeed);
325                        status.spinnerspeed = getconfigint("spinnerspeed", NULL);
326                        addconfigscreen("spinnertime", spinnertime);
327                        status.spinnertime = getconfigint("spinnertime", NULL);
328                        addconfigscreen("hangtime", hangtime);
329                        status.hangtime = getconfigint("hangtime", NULL);
330                        addconfigscreencheck("nozapclear", nozapclear, "0");
331                        addconfigscreencheck("fastzap", fastzap, "0");
332                        addconfigscreencheck("faststop", faststop, "0");
333                        addconfigscreencheck("dirsort", dirsort, "0");
334                        addconfigscreencheck("poweraktion", poweraktion, "0");
335                        addconfigscreencheck("recforerun", recforerun, "0");
336                        addconfigscreencheck("recoverrun", recoverrun, "0");
337                        addconfigscreencheck("virtualzap", virtualzap, "0");
338                        status.virtualzap = getconfigint("virtualzap", NULL);
339                        if(fasttextrender->ret != NULL)
340                        {
341                                addconfigscreencheck("fasttextrender", fasttextrender, "0");
342                                status.fasttextrender = atoi(fasttextrender->ret);
343                        }
344                        if(recsplitsize->ret != NULL)
345                        {
346                                addconfigscreencheck("recsplitsize", recsplitsize, "0");
347                                status.recsplitsize = atoi(recsplitsize->ret);
348                                status.recsplitsize *= 1000 * 1000 * 1000;
349                        }
350                        addconfigscreen("skip13", skip13);
351                        addconfigscreen("skip46", skip46);
352                        addconfigscreen("skip79", skip79);
353                        addconfigscreencheck("playertype", playertype, "1");
354                        addconfigscreencheck("autochangechannelname", autochangechannelname, "0");
355                        status.autochangechannelname = getconfigint("autochangechannelname", NULL);
356                        addconfigscreencheck("def_rectimer_after", def_rectimer_after, "0");
357                        addconfigscreencheck("showchanneltimeline", showchanneltimeline, "0");
358                        status.showchanneltimeline = getconfigint("showchanneltimeline", NULL);
359                        addconfigscreencheck("screenanim", screenanim, "0");
360                        status.screenanim = getconfigint("screenanim", NULL);
361                        addconfigscreencheck("screenanimspeed", screenanimspeed, "1");
362                        status.screenanimspeed = getconfigint("screenanimspeed", NULL);
363                        addconfigscreencheck("channellistview", channellistview, "0");
364                        status.channellistview = getconfigint("channellistview", NULL);
365                        addconfigscreencheck("showlastpos", showlastpos, "0");
366                        addconfigscreencheck("recsync", recsync, "0");
367                        addconfigscreencheck("recordnamefmt", recordnamefmt, "0");
368
369                        addconfigscreen("newsletter", newsletter);
370                        if(newsletter->ret != NULL && ostrcmp(newsletter->ret, "0") == 0)
371                                startnewsletter(0);
372                        else
373                                startnewsletter(1);
374
375                        addconfigscreen("showhiddenfiles", showhiddenfiles);
376                        status.showhiddenfiles = getconfigint("showhiddenfiles", NULL);
377                        addconfigscreencheck("expertmodus", expertmodus, "0");
378                        status.expertmodus = getconfigint("expertmodus", NULL);                                 
379                        addconfigscreencheck("infobarprogram", infobarprogram, "0");
380                        status.infobarprogram = getconfigint("infobarprogram", NULL);
381                        addconfigscreencheck("crosscontrol", crosscontrol, "0");
382                        status.crosscontrol = getconfigint("crosscontrol", NULL);
383                        addconfigscreencheck("emucontrol", emucontrol, "0");
384
385                        if(ostrcmp(minitv->ret, "1") == 0) resettvpic();
386                        addconfigscreencheck("minitv", minitv, "0");
387
388                        if(checkbox("ATEMIO510") == 1 || checkbox("ATEMIO520") == 1 || checkbox("ATEMIO530") == 1 || checkbox("ATEMIO7600") == 1 || checkbox("UFS912") == 1 || checkbox("UFS913") == 1)
389                                addconfigscreencheck("usecec", usecec, "0");
390
391                        if(checkbox("ATEMIO7600") == 1)
392                        {
393                                addconfigscreencheck("usecec", usecec, "0");
394                                if(sataswitch->ret != NULL)
395                                {
396                                        addownconfig("sataswitch", sataswitch->ret);
397                                        setsataswitch(sataswitch->ret);
398                                }
399                        }
400
401#ifdef MIPSEL
402                        addconfigscreen("dualboot", dualboot);
403                        if(dualboot->ret != NULL && ostrcmp(dualboot->ret, "0") == 0)
404                                unlink("/mnt/config/dualboot");
405                        else
406                                system("touch /mnt/config/dualboot");
407#endif
408                        addconfigscreen("playerbuffersize", playerbuffersize);
409                        addconfigscreen("playerbufferseektime", playerbufferseektime);
410
411                        addconfigscreen("community_user", community_user);
412                        addconfigscreen("community_pass", community_pass);
413                               
414                        writeallconfig(1);
415                        break;
416                }
417        }
418
419        delownerrc(adjust);
420        clearscreen(adjust);
421}
422
423#endif
Note: See TracBrowser for help on using the repository browser.