source: titan/titan/adjust.h @ 27756

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

add dualboot to adjust

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