source: titan/titan/avsettings.h @ 15272

Last change on this file since 15272 was 14186, checked in by nit, 12 years ago

[titan] add vol audio increase

File size: 7.9 KB
Line 
1#ifndef AVSETTINGS_H
2#define AVSETTINGS_H
3
4//flag 0: whithout vfd output
5//flag 1: whith vfd output
6void 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* tmp = NULL;
28
29        ret = getvideomodechoices();
30        changeinput(resolution, ret);
31        free(ret); ret = NULL;
32
33        ret = getconfig("av_videomode", NULL);
34        if(ret == NULL)
35        {
36                ret = getvideomode();
37                setchoiceboxselection(resolution, ret);
38                free(ret); ret = NULL;
39        }
40        else
41                setchoiceboxselection(resolution, ret);
42               
43        ret = getvideomode();
44        changeinput(aktresolution, ret);
45        free(ret); ret = NULL;
46       
47        autoressd->hidden=YES;
48        autorests->hidden=YES;
49        if(getconfig("av_videomode_autores", NULL) != NULL)
50        {
51                if(ostrcmp(getconfig("av_videomode_autores", NULL), "off") != 0)
52                {
53                        if(ostrcmp(getconfig("av_videomode_autores", NULL), "auto") != 0)
54                                autoressd->hidden=NO;
55                        else {
56                                autoressd->hidden=NO;
57                                autorests->hidden=NO;
58                        }
59                }
60        }
61        int setlr=0;
62        addchoicebox(autoresolution, "off", _("off"));
63        addchoicebox(autoresolution, "auto", _("auto"));
64        addchoicebox(autoresolution, "blue", _("blueKey"));
65        setchoiceboxselection(autoresolution, getconfig("av_videomode_autores", NULL));
66        addchoicebox(autoressd, "576i", _("576i"));
67        addchoicebox(autoressd, "576p", _("576p"));
68        addchoicebox(autoressd, "720p", _("720p"));
69        addchoicebox(autoressd, "1080i", _("1080i"));
70        setchoiceboxselection(autoressd, getconfig("av_videomode_autores_sd", NULL));
71        addchoicebox(autorests, "2", _("2 sec"));
72        addchoicebox(autorests, "4", _("4 sec"));
73        addchoicebox(autorests, "6", _("6 sec"));
74        addchoicebox(autorests, "8", _("8 sec"));
75        addchoicebox(autorests, "10", _("10 sec"));
76        setchoiceboxselection(autorests, getconfig("av_videomode_autores_ts", NULL));
77        addchoicebox(stepmute, "0", _("off"));
78        addchoicebox(stepmute, "1", _("on"));
79        setchoiceboxselection(stepmute, getconfig("stepmute", NULL));
80
81        ret = getpolicychoices();
82        changeinput(policy, ret);
83        free(ret); ret = NULL;
84        ret = getpolicy();
85        setchoiceboxselection(policy, ret);
86        free(ret); ret = NULL;
87
88        ret = getaspectchoices();
89        changeinput(aspect, ret);
90        free(ret); ret = NULL;
91        ret = getaspect();
92        setchoiceboxselection(aspect, ret);
93        free(ret); ret = NULL;
94
95        ret = getcolorformatchoices();
96        changeinput(colformat, ret);
97        free(ret); ret = NULL;
98        ret = getcolorformat(1);
99        setchoiceboxselection(colformat, ret);
100        free(ret); ret = NULL;
101
102        ret = getcolorformat(2);
103        if(ret == NULL || strlen(ret) == 0)
104                colformatscart->hidden = YES;
105        else
106        {
107                colformatscart->hidden = NO;
108                changeinput(colformatscart, ret);
109        }
110        free(ret); ret = NULL;
111
112        ret = getaudiosourcechoices();
113        changeinput(audiosource, ret);
114        free(ret); ret = NULL;
115        ret = getaudiosource();
116        setchoiceboxselection(audiosource, ret);
117        free(ret); ret = NULL;
118
119        addchoicebox(ac3default, "0", _("no"));
120        addchoicebox(ac3default, "1", _("yes"));
121        setchoiceboxselection(ac3default, getconfig("av_ac3default", NULL));
122
123        ret = getac3choices();
124        changeinput(ac3mode, ret);
125        free(ret); ret = NULL;
126        ret = getac3();
127        setchoiceboxselection(ac3mode, ret);
128        free(ret); ret = NULL;
129       
130        changeinput(volautochangevalue, "0\n5\n10\n15\n20\n25\n30\n35\n40\n45\n50\n55\n60\n65\n70\n75\n80\n85\n90\n95\n100");
131        setchoiceboxselection(volautochangevalue, getconfig("volautochangevalue", NULL));
132
133        ret = getmode3dchoices();
134        changeinput(mode3d, ret);
135        free(ret); ret = NULL;
136        ret = getmode3d();
137        setchoiceboxselection(mode3d, ret);
138        free(ret); ret = NULL;
139
140        drawscreen(avsettings, 0);
141        addscreenrc(avsettings, listbox);
142
143        if(flag == 1 && listbox->select != NULL)
144                writevfd(listbox->select->text);
145
146        tmp = listbox->select;
147        while(1)
148        {
149                addscreenrc(avsettings, tmp);
150                rcret = waitrc(avsettings, 0, 0);
151                tmp = listbox->select;
152
153                if(flag == 1 && listbox->select != NULL)
154                {
155                        if(rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rcdown", NULL))
156                                writevfd(listbox->select->text);
157                        if(rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL))
158                        {
159                                setlr = 1;
160                                writevfd(listbox->select->ret);
161                        }       
162                } else {
163                        if(listbox->select != NULL)
164                        {       
165                                if(rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL))
166                                        setlr = 1;
167                        }
168                }
169                if(setlr ==1 && ostrcmp(listbox->select->name, "autoresolution") == 0)
170                {       
171                        autoressd->hidden=YES;
172                        autorests->hidden=YES;
173                        if(ostrcmp(autoresolution->ret, "off") != 0)
174                        {
175                                if(ostrcmp(autoresolution->ret, "blue") == 0)
176                                        autoressd->hidden=NO;
177                                else if(ostrcmp(autoresolution->ret, "auto") == 0)
178                                {       
179                                        autoressd->hidden=NO;
180                                        autorests->hidden=NO;
181                                }
182                        }
183                        drawscreen(avsettings, 0);
184                }
185                setlr = 0;
186       
187                if(rcret == getrcconfigint("rcexit", NULL)) break;
188                if(flag == 1 || rcret == getrcconfigint("rcok", NULL))
189                {
190                        if(resolution->ret != NULL)
191                        {
192                                ret = getvideomode();
193                                if(ostrcmp(ret, resolution->ret) != 0)
194                                {
195                                        setvideomode(resolution->ret, 0);
196                                        changefbresolution(resolution->ret);
197                                        if(flag == 0)
198                                        {
199                                                int tret = textbox(_("Message"), _("Is this Videomode ok ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0);
200                                                if(tret == 0 || tret == 2)
201                                                {
202                                                        setvideomode(ret, 0);
203                                                        changefbresolution(ret);
204                                                }
205
206                                        }
207                                        if(flag == 1) drawscreen(avsettings, 0);
208                                }
209                                free(ret); ret = NULL;
210                        }
211                        if(autoresolution->ret != NULL)
212                        {
213                                addconfig("av_videomode_autores", autoresolution->ret);
214                                addconfig("av_videomode_autores_sd", autoressd->ret);
215                                addconfig("av_videomode_autores_ts", autorests->ret);
216                        }
217                       
218                        if(stepmute->ret != NULL)
219                                addconfig("stepmute", stepmute->ret);
220                               
221                        if(policy->ret != NULL)
222                        {
223                                ret = getpolicy();
224                                if(ostrcmp(ret, policy->ret) != 0)
225                                        setpolicy(policy->ret);
226                                free(ret); ret = NULL;
227                        }
228                        if(aspect->ret != NULL)
229                        {
230                                ret = getaspect();
231                                if(ostrcmp(ret, aspect->ret) != 0)
232                                        setaspect(aspect->ret);
233                                free(ret); ret = NULL;
234                        }
235                        if(colformat->ret != NULL)
236                        {
237                                setcolorformat(colformat->ret);
238                                ret = getcolorformat(2);
239                                changeinput(colformatscart, ret);
240                                free(ret); ret = NULL;
241                                drawscreen(avsettings, 0);
242                        }
243                        if(audiosource->ret != NULL)
244                        {
245                                ret = getaudiosource();
246                                if(ostrcmp(ret, audiosource->ret) != 0)
247                                        setaudiosource(audiosource->ret);
248                                free(ret); ret = NULL;
249                        }
250                        if(ac3mode->ret != NULL)
251                        {
252                                ret = getac3();
253                                if(ostrcmp(ret, ac3mode->ret) != 0)
254                                        setac3(ac3mode->ret);
255                                free(ret); ret = NULL;
256                        }
257                        if(mode3d->ret != NULL)
258                        {
259                                ret = getmode3d();
260                                if(ostrcmp(ret, mode3d->ret) != 0)
261                                        setmode3d(mode3d->ret);
262                                free(ret); ret = NULL;
263                        }
264                        addconfigscreencheck("volautochangevalue", volautochangevalue, 0);
265                        status.volautochangevalue = getconfigint("volautochangevalue", NULL);
266                        addconfigscreencheck("av_ac3default", ac3default, 0);
267                        if(rcret == getrcconfigint("rcok", NULL)) break;
268                }
269        }
270
271        delownerrc(avsettings);
272        clearscreen(avsettings);
273}
274
275#endif
Note: See TracBrowser for help on using the repository browser.