source: titan/titan/infobar.h @ 10994

Last change on this file since 10994 was 10849, checked in by nit, 12 years ago

[titan] add channelswitch to epg witch rcok

File size: 8.0 KB
Line 
1#ifndef INFOBAR_H
2#define INFOBAR_H
3
4void screeninfobar()
5{
6        int rcret = 0, ret = 0, infobartimeout = 0;
7        struct skin* infobar1 = getscreen("infobar");
8        struct skin* infobar2 = getscreen("infobar2");
9        struct skin* infobar = infobar1;
10        struct skin* standbymenu = NULL;
11        char* tmpstr = NULL; char* tmpnr = NULL;
12
13        status.mute = 0;
14        status.infobar = 2;
15
16        addrc(getrcconfigint("rcvolup", NULL), screenvolumeup, NULL, NULL);
17        addrc(getrcconfigint("rcvoldown", NULL), screenvolumedown, NULL, NULL);
18        addrc(getrcconfigint("rcmute", NULL), screenmute, NULL, NULL);
19
20        while(1)
21        {
22                if(status.standby == 1)
23                        screenstandby();
24                if(status.infobar == 1)
25                {
26                        rcret = waitrc(infobar, 1000, 0);
27                        infobartimeout++;
28                }
29                else if(status.infobar == 2)
30                {
31                        if(getconfigint("infobarsleep", NULL) > 0)
32                                rcret = waitrc(infobar, getconfigint("infobarsleep", NULL) * 1000, 0);
33                        else
34                                rcret = RCTIMEOUT;
35                        if(rcret == RCTIMEOUT)
36                        {
37                                status.infobar = 1;
38                                infobar = infobar1;
39                                drawscreen(infobar, 0);
40                                continue;
41                        }
42                        else
43                                status.infobar = 0;
44                }
45                else
46                {
47                        rcret = waitrc(infobar, 0, 0);
48                        infobartimeout = 0;
49                }
50
51                if(rcret == getrcconfigint("rcpause", NULL))
52                {
53                        //timeshift
54                        timeshiftpause();
55                        continue;
56                }
57                if(status.timeshift == 1)
58                {
59                        if(rcret == getrcconfigint("rcstop", NULL))
60                        {
61                                timeshiftstop(0);
62                                continue;
63                        }
64                        if(rcret == getrcconfigint("rcplay", NULL))
65                        {
66                                timeshiftplay();
67                                continue;
68                        }
69                        //TODO: ff, fr, seek
70                        if(rcret == getrcconfigint("rcff", NULL))
71                        {
72                                continue;
73                        }
74                        if(rcret == getrcconfigint("rcfr", NULL))
75                        {
76                                continue;
77                        }
78                }
79                if(rcret == getrcconfigint("rcblue", NULL) && ostrcmp(getconfig("bluekey", NULL), "TV / Radio Switch") == 0)
80                        rcret = getrcconfigint("rctvradio", NULL);
81                if(rcret == getrcconfigint("rcok", NULL) || rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rcdown", NULL) || rcret == getrcconfigint("rctvradio", NULL) || rcret == getrcconfigint("rcfav", NULL))
82                {
83                        int tmpservicetype = status.servicetype;
84                        subtitlepause(1);
85                        clearscreen(infobar);
86                        if(rcret == getrcconfigint("rctvradio", NULL))
87                        {
88                                if(status.servicetype == 0)
89                                        status.servicetype = 1;
90                                else
91                                        status.servicetype = 0;
92
93                        }
94                        drawscreen(skin, 0);
95                        if(rcret == getrcconfigint("rcfav", NULL))     
96                                ret = screenchannellist(NULL, NULL, 2);
97                        else
98                                ret = screenchannellist(NULL, NULL, 0);
99                        if(ret >= 20 || ret < 0)
100                                status.servicetype = tmpservicetype;
101                        drawscreen(skin, 0);
102                        status.infobar = 2;
103                        continue;
104                }
105                if(rcret == getrcconfigint("rcexit", NULL))
106                {
107                        subtitlepause(1);
108                        status.infobar = 0;
109                        clearscreen(infobar);
110                        drawscreen(skin, 0);
111                        subtitlepause(0);
112                        continue;
113                }
114                if(rcret == getrcconfigint("rctext", NULL))
115                {
116                        if(status.aktservice->channel != NULL && status.aktservice->channel->txtpid > 0)
117                        {
118                                subtitlepause(1);
119                                status.infobar = 0;
120                                status.sec = 0;
121                                clearscreen(infobar);
122                                tmpstr = ostrcat(getconfig("tuxtxtfile", NULL), " ", 0, 0);
123                                tmpnr = oitoa(status.aktservice->channel->txtpid);
124                                tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
125                                drawscreen(skin, 0);
126                                system(tmpstr);
127                                free(tmpstr); tmpstr = NULL; tmpnr = NULL;
128                                drawscreen(skin, 0);
129                                subtitlepause(0);
130                        }
131                        continue;
132                }
133                if(rcret == getrcconfigint("rcrecord", NULL))
134                {
135                        subtitlepause(1);
136                        status.infobar = 0;
137                        clearscreen(infobar);
138                        screenrecorddirect();
139                        status.updatevfd = START;
140                        drawscreen(skin, 0);
141                        subtitlepause(0);
142                        continue;
143                }
144                if(status.timeshift == 0 && (rcret == getrcconfigint("rcplay", NULL) || rcret == getrcconfigint("rcarchive", NULL)))
145                {
146                        subtitlepause(1);
147                        status.infobar = 0;
148                        clearscreen(infobar);
149                        screenplay(0);
150                        status.updatevfd = START;
151                        drawscreen(skin, 0);
152                        subtitlepause(0);
153                        continue;
154                }
155                if(rcret == getrcconfigint("rcred", NULL))
156                {
157                        subtitlepause(1);
158                        status.infobar = 0;
159                        clearscreen(infobar);
160                        screenredkeyactions();
161                        status.updatevfd = START;
162                        drawscreen(skin, 0);
163                        subtitlepause(0);
164                        continue;
165                }
166                if(rcret == getrcconfigint("rcgreen", NULL))
167                {
168                        subtitlepause(1);
169                        status.infobar = 0;
170                        clearscreen(infobar);
171                        screenvideomode();
172                        drawscreen(skin, 0);
173                        subtitlepause(0);
174                        continue;
175                }
176                if(rcret == getrcconfigint("rcyellow", NULL))
177                {
178                        subtitlepause(1);
179                        status.infobar = 0;
180                        clearscreen(infobar);
181                        screenaudiotrack();
182                        drawscreen(skin, 0);
183                        subtitlepause(0);
184                        continue;
185                }
186                if(rcret == getrcconfigint("rcblue", NULL))
187                {
188                        subtitlepause(1);
189                        status.infobar = 0;
190                        clearscreen(infobar);
191                        screenbluekeyactions();
192                        status.updatevfd = START;
193                        drawscreen(skin, 0);
194                        subtitlepause(0);
195                        continue;
196                }
197                if(rcret == getrcconfigint("rcmedia", NULL))
198                {
199                        struct skin* pluginnode = getplugin("Media Center");
200                        void (*startplugin)(void);
201                        subtitlepause(1);
202                        status.infobar = 0;
203                        clearscreen(infobar);
204                        if(pluginnode != NULL)
205                        {
206                                startplugin = dlsym(pluginnode->pluginhandle, "start");
207                                if(startplugin != NULL)
208                                startplugin();
209                        }
210                        drawscreen(skin, 0);
211                        subtitlepause(0);
212                        continue;
213                }
214                if(rcret == getrcconfigint("rcmenu", NULL))
215                {
216                        subtitlepause(1);
217                        status.infobar = 0;
218                        clearscreen(infobar);
219                        menu(getscreen("mainmenu"));
220                        status.menurelease = 0;
221                        status.updatevfd = START;
222                        drawscreen(skin, 0);
223                        subtitlepause(0);
224                        continue;
225                }
226                if(rcret == getrcconfigint("rcepg", NULL))
227                {
228                        subtitlepause(1);
229                        status.infobar = 0;
230                        clearscreen(infobar);
231                        epgchoice(NULL);
232                        drawscreen(skin, 0);
233                        subtitlepause(0);
234                        continue;
235                }
236                if(rcret == getrcconfigint("rcinfo", NULL))
237                {
238                        if(status.infobar == 1)
239                        {
240                                if(getconfigint("secondinfobar", NULL) == 2)
241                                {
242                                        clearscreen(infobar);
243                                        epgchoice(NULL);
244                                        status.infobar = 0;
245                                        drawscreen(skin, 0);
246                                        subtitlepause(0);
247                                }
248                                else if(getconfigint("secondinfobar", NULL) == 0 || infobar2 == status.skinerr || infobar == infobar2)
249                                {
250                                        status.infobar = 0;
251                                        drawscreen(skin, 0);
252                                        subtitlepause(0);
253                                }
254                                else
255                                {
256                                        infobar = infobar2;
257                                        drawscreen(infobar, 0);
258                                }
259                        }
260                        else
261                        {
262                                subtitlepause(1);
263                                status.infobar = 1;
264                                infobar = infobar1;
265                                drawscreen(infobar, 0);
266                        }
267                        continue;
268                }
269                if(rcret == getrcconfigint("rcpower", NULL))
270                {
271                        subtitlepause(1);
272                        status.infobar = 0;
273                        clearscreen(infobar);
274                        drawscreen(skin, 0);
275                        switch(getconfigint("poweraktion", NULL))
276                        {
277                                case 1: //power off
278                                        oshutdown(1, 1);
279                                        break;
280                                case 2: //standby
281                                        status.standby = 1;
282                                        break;
283                                case 3: //restart
284                                        oshutdown(2, 1);
285                                        break;
286                                case 4: //Gui restart
287                                        oshutdown(3, 1);
288                                        break;
289                                default:
290                                        standbymenu = getscreen("standbymenu");
291                                        menu(standbymenu);
292                                        break;
293                        }
294                        status.updatevfd = START;
295                        drawscreen(skin, 0);
296                        subtitlepause(0);
297                        continue;
298                }
299                if(rcret == getrcconfigint("rcrecall", NULL) || rcret == getrcconfigint("rc0", NULL))
300                {
301                        subtitlepause(1);
302                        clearscreen(infobar);
303                        drawscreen(skin, 0);
304                        if(status.lastservice->channel != NULL)
305                        {
306                                tmpstr = ostrcat(status.lastservice->channellist, NULL, 0, 0);
307                                servicecheckret(servicestart(status.lastservice->channel, tmpstr, NULL, 0), 0);
308                                free(tmpstr); tmpstr = NULL;
309                        }
310                        infobartimeout = 0;
311                        status.infobar = 1;
312                        infobar = infobar1;
313                        drawscreen(infobar, 0);
314                        continue;
315                }
316                if(rcret == getrcconfigint("rcchup", NULL))
317                {
318                        subtitlepause(1);
319                        zapup();
320                        clearscreen(infobar);
321                        drawscreen(skin, 0);
322                        infobartimeout = 0;
323                        status.infobar = 2;
324                        continue;
325                }
326                if(rcret == getrcconfigint("rcchdown", NULL))
327                {
328                        subtitlepause(1);
329                        zapdown();
330                        clearscreen(infobar);
331                        drawscreen(skin, 0);
332                        infobartimeout = 0;
333                        status.infobar = 2;
334                        continue;
335                }
336                if(rcret == rcnumber(rcret))
337                {
338                        subtitlepause(1);
339                        clearscreen(infobar);
340                        screenchannelbynr(rcret);
341                        status.infobar = 2;
342                        continue;
343                }
344                if(rcret == RCTIMEOUT)
345                {
346                        if(getconfigint("infobartimeout", NULL) > infobartimeout)
347                        {
348                                clearscreen(infobar);
349                                drawscreen(infobar, 0);
350                        }
351                        else
352                        {
353                                status.infobar = 0;
354                                drawscreen(skin, 0);
355                                subtitlepause(0);
356                        }
357                }
358        }
359}
360
361#endif
Note: See TracBrowser for help on using the repository browser.