source: titan/titan/adjust.h @ 32262

Last change on this file since 32262 was 32262, checked in by obi, 9 years ago

fix

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