source: titan/titan/infobar.h @ 26408

Last change on this file since 26408 was 26408, checked in by gost, 10 years ago

fix

File size: 20.7 KB
Line 
1#ifndef INFOBAR_H
2#define INFOBAR_H
3
4void screeninfobar()
5{
6        int rcret = 0, ret = 0, infobartimeout = 0, rcwait = 1000, count = 0, first = 1;
7        int playpic = 0;
8        struct skin* playinfobarpic = getscreen("playinfobarpic");
9        struct skin* infobar1 = getscreen("infobar");
10        struct skin* infobar2 = getscreen("infobar2");
11        struct skin* infobar = infobar1;
12        struct skin* infobarm = infobar1;
13        struct skin* standbymenu = NULL;
14        char* tmpstr = NULL; char* tmpnr = NULL;
15        struct skin* pluginnode = NULL;
16        void (*startplugin)(void);
17        time_t lasttime = 0;
18        int mark = 0;
19
20        status.mute = 0;
21        status.infobar = 2;
22
23        addrc(getrcconfigint("rcvolup", NULL), screenvolumeup, NULL, NULL);
24        addrc(getrcconfigint("rcvoldown", NULL), screenvolumedown, NULL, NULL);
25        addrc(getrcconfigint("rcmute", NULL), screenmute, NULL, NULL);
26
27        status.infobaraktiv = 1;
28        status.mcaktiv = 0;
29       
30        int playinfobarcount = 0, playinfobarstatus = 0;
31       
32        while(1)
33        {
34                mark = 0;
35
36                if(status.crosscontrol > 0 && status.play == 0 && status.pause == 0 && rcret == getrcconfigint("rcright", NULL))
37                        writerc(getrcconfigint("rcvolup", NULL));
38                if(status.crosscontrol > 0 && status.play == 0 && status.pause == 0 && rcret == getrcconfigint("rcleft", NULL))
39                        writerc(getrcconfigint("rcvoldown", NULL));
40
41                //check if mediadb can freed
42                if(status.mediadbthread == NULL)
43                {
44                        if(status.writemediadb == 1)
45                                writemediadb(getconfig("mediadbfile", NULL), NULL);
46                        freemediadb(0);
47                }
48                //check if picmem times out and must freed
49                if(time(NULL) > status.picmemtimeout + 60)
50                {
51                        checkpictimeout();
52                        status.picmemtimeout = time(NULL);
53                }
54
55                if(status.standby == 1)
56                        screenstandby();
57                if(status.infobar == 1 )
58                {
59                        rcret = waitrc(infobar, 1000, 0);
60                        infobartimeout++;
61                }
62                else if(status.infobar == 0 && status.timeshift == 1)
63                {
64                        rcret = waitrc(infobar, 1000, 0);
65                        if(rcret == RCTIMEOUT)
66                        {
67                                if(playpic == 1) {
68                                        clearscreen(playinfobarpic);
69                                        drawscreen(playinfobarpic, 0, 0);
70                                }
71                                else
72                                        timeshiftinfobar(&playinfobarstatus, &playinfobarcount);
73                                continue;
74                        }
75                }
76                else if(status.infobar == 2)
77                {
78                        if(getconfigint("infobarsleep", NULL) > 0)
79                                rcret = waitrc(infobar, getconfigint("infobarsleep", NULL) * 1000, 0);
80                        else if(first == 1) //only on first start wait a little for epg
81                        {
82                                first = 0;
83                                rcret = waitrc(infobar, 1000, 0);
84                        }
85                        else
86                                rcret = RCTIMEOUT;
87
88                        if(rcret == RCTIMEOUT)
89                        {
90                                status.infobar = 1;
91                                infobar = infobar1;
92                                drawscreen(infobar, 0, 4);
93                                continue;
94                        }
95                        else
96                                status.infobar = 0;
97                }
98                else
99                {
100                        int screensaver_delay = getconfigint("screensaver_delay", NULL);
101                        rcret = 0; count = 0; rcwait = 1000;
102                        if(status.servicetype == 1 && getconfigint("screensaver", NULL) == 1)
103                        {
104                                initscreensaver();
105                                if(screensaver != NULL) screensaver->flag = 1;
106                        }
107                        if(screensaver == NULL)
108                        {
109                                if(status.infobarprogram == 1) rcwait = 2000;
110                                else rcwait = 0;
111                        }
112                        while(rcret == 0 || rcret == RCTIMEOUT)
113                        {
114                                rcret = waitrc(infobar, rcwait, 0);
115                                count++;
116                                if(screensaver == NULL && status.infobarprogram == 1 && (rcret == 0 || rcret == RCTIMEOUT))
117                                {
118                                        infobartimeout = 99999;
119                                        mark = 1;
120                                        break;
121                                }
122                                if(rcret == RCTIMEOUT && screensaver != NULL && count > screensaver_delay)
123                                {
124                                        if(status.aktservice->channel != NULL)
125                                                screensaver->value = ostrcat(status.aktservice->channel->name, NULL, 0, 0);
126                                        else
127                                                screensaver->value = ostrcat("Radio", NULL, 0, 0);
128                                        showscreensaver();
129                                        free(screensaver->value);
130                                        rcwait = screensaver->speed;
131                                }
132                        }
133                        if(screensaver != NULL) screensaver->flag = 0;
134                        deinitscreensaver();
135                        if(mark == 0)
136                        {
137                                drawscreen(skin, 0, 0);
138                                infobartimeout = 0;
139                        }
140                }
141
142                if(rcret == getrcconfigint("rcpause", NULL) || ((checkbox("ATEMIO520") == 1 || checkbox("ATEMIO530") == 1) && rcret == getrcconfigint("rcplay", NULL) && status.pause == 0 && status.slowspeed == 0 && status.playspeed == 0 && ostrcmp(getconfig("remotecontrol", NULL), "0") == 0))
143                {
144                        //timeshift
145                        if(playpic == 1) {
146                                clearscreen(playinfobarpic);
147                                playpic = 0;
148                        }
149                        if(status.timeshift == 1 && (status.playing == 0 || status.slowspeed != 0 || status.playspeed != 0 || status.pause != 0))
150                        {
151                                if(status.timeshifttype == 1 && status.timeshiftpos == 0)
152                                {
153                                        timeshiftpause(0);
154                                        timeshiftinfobar(&playinfobarstatus, &playinfobarcount);
155                                }
156                                else
157                                        timeshiftplay(&playinfobarstatus, &playinfobarcount);
158                        }
159                        else
160                        {
161                                if(status.timeshift == 1)
162                                        playpic = 2;
163                                else
164                                        playpic = 0;
165                                timeshiftpause(0);
166                                timeshiftinfobar(&playinfobarstatus, &playinfobarcount);
167                                if(playpic == 0) {
168                                        drawscreen(playinfobarpic, 0, 0);
169                                        playpic = 1;
170                                }
171                        }
172                       
173                        continue;
174                }
175                if(status.timeshift == 1)
176                {
177                        if(rcret == getrcconfigint("rcstop", NULL))
178                        {
179                                if(playpic == 1) {
180                                        clearscreen(playinfobarpic);
181                                        playpic = 0;
182                                }               
183                                timeshiftstop(0);
184                                continue;
185                        }
186                        if(rcret == getrcconfigint("rcplay", NULL))
187                        {
188                                if(playpic == 1) {
189                                        clearscreen(playinfobarpic);
190                                        playpic = 0;
191                                }               
192                                if(((checkbox("ATEMIO520") != 1 && checkbox("ATEMIO530") != 1) || ostrcmp(getconfig("remotecontrol", NULL), "1") == 1)  && status.timeshifttype == 1)
193                                {
194                                        if(status.playing == 0 || (status.playspeed == 0 && status.slowspeed == 0 && status.pause == 0))
195                                        {
196                                                subtitlepause(1);
197                                                status.infobar = 0;
198                                                status.infobaraktiv = 0;
199                                                clearscreen(infobar);
200                                                screenplay(NULL, NULL, 1, 0);
201                                                status.infobaraktiv = 1;
202                                                status.updatevfd = START;
203                                                drawscreen(skin, 0, 0);
204                                                subtitlepause(0);
205                                                continue;
206                                        }
207                                }
208                                timeshiftplay(&playinfobarstatus, &playinfobarcount);
209                                continue;
210                        }
211                        if(status.timeshifttype == 1 && status.playing == 0)
212                        {
213                                if(rcret == getrcconfigint("rcff", NULL) || (getconfig("timeshiftnumkeys", NULL) == 0 && (rcret == getrcconfigint("rc3", NULL) || rcret == getrcconfigint("rc6", NULL) || rcret == getrcconfigint("rc9", NULL))))
214                                {
215                                        struct service* snode = getservice(RECORDTIMESHIFT, 0);
216                                        if(snode != NULL)
217                                        {
218                                                status.playercan = 0x7FFF;
219                                                playinfobarstatus = 1;
220                                                playinfobarcount = 0;
221                                                screenplayinfobar(snode->recname, NULL, 0, 1, 5);
222                                        }
223                                        continue;
224                                }
225                                if(rcret == getrcconfigint("rcfr", NULL))
226                                {
227                                        timeshiftposplay(&playinfobarstatus, &playinfobarcount);
228                                        if(status.playing == 1)
229                                                playrcfr(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
230                                        continue;
231                                }
232                                if(getconfig("timeshiftnumkeys", NULL) == 0)
233                                {
234                                        if(rcret == getrcconfigint("rc1", NULL))
235                                        {
236                                                timeshiftposplay(&playinfobarstatus, &playinfobarcount);
237                                                if(status.playing == 1)
238                                                        playrcjumpr(status.playfile, NULL, getconfigint("skip13", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
239                                                continue;
240                                        }
241                                        if(rcret == getrcconfigint("rc4", NULL))
242                                        {
243                                                timeshiftposplay(&playinfobarstatus, &playinfobarcount);
244                                                if(status.playing == 1)
245                                                        playrcjumpr(status.playfile, NULL, getconfigint("skip46", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
246                                                continue;
247                                        }
248                                        if(rcret == getrcconfigint("rc7", NULL))
249                                        {
250                                                timeshiftposplay(&playinfobarstatus, &playinfobarcount);
251                                                if(status.playing == 1)
252                                                        playrcjumpr(status.playfile, NULL, getconfigint("skip79", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
253                                                continue;
254                                        }
255                                }
256                        }
257                        if(status.playing == 1)
258                        {
259                                if(rcret == getrcconfigint("rcff", NULL))
260                                {
261                                        playrcff(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
262                                        continue;
263                                }
264                                if(rcret == getrcconfigint("rcfr", NULL))
265                                {
266                                        playrcfr(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
267                                        continue;
268                                }
269                                if(rcret == getrcconfigint("rc3", NULL))
270                                {
271                                        playrcjumpf(status.playfile, NULL, getconfigint("skip13", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
272                                        continue;
273                                }
274                                if(rcret == getrcconfigint("rc6", NULL))
275                                {
276                                        playrcjumpf(status.playfile, NULL, getconfigint("skip46", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
277                                        continue;
278                                }
279                                if(rcret == getrcconfigint("rc9", NULL))
280                                {                               
281                                        playrcjumpf(status.playfile, NULL, getconfigint("skip79", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
282                                        continue;
283                                }       
284                                if(rcret == getrcconfigint("rc1", NULL))
285                                {
286                                        playrcjumpr(status.playfile, NULL, getconfigint("skip13", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
287                                        continue;
288                                }
289                                if(rcret == getrcconfigint("rc4", NULL))
290                                {
291                                        playrcjumpr(status.playfile, NULL, getconfigint("skip46", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
292                                        continue;
293                                }
294                                if(rcret == getrcconfigint("rc7", NULL))
295                                {
296                                        playrcjumpr(status.playfile, NULL, getconfigint("skip79", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
297                                        continue;
298                                }
299                                if(status.timeshifttype == 0 && rcret == getrcconfigint("rcinfo", NULL))
300                                {
301                                        playrcinfo(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
302                                        continue;       
303                                }
304                        }
305                }
306                if(rcret == getrcconfigint("rcstop", NULL) && status.recording > 0)
307                {
308                        subtitlepause(1);
309                        status.infobar = 0;
310                        clearscreen(infobar);
311                        screenrecordstop();
312                        status.updatevfd = START;
313                        drawscreen(skin, 0, 0);
314                        subtitlepause(0);
315                        continue;
316                }
317                if(rcret == getrcconfigint("rcblue", NULL) && getconfig("bluekey", NULL) == NULL)
318                        rcret = getrcconfigint("rctvradio", NULL);
319                if(rcret == getrcconfigint("rcok", NULL) || rcret == getrcconfigint("rctvradio", NULL) || rcret == getrcconfigint("rcfav", NULL) || (status.crosscontrol == 0 && status.play == 0 && status.pause == 0 && (rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rcdown", NULL) || rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL))))
320                {
321                        int tmpservicetype = status.servicetype;
322                        status.infobaraktiv = 0;
323                        subtitlepause(1);
324                        clearscreen(infobar);
325                        if(rcret == getrcconfigint("rctvradio", NULL))
326                        {
327                                if(status.servicetype == 0)
328                                        status.servicetype = 1;
329                                else
330                                        status.servicetype = 0;
331                        }
332                        drawscreen(skin, 0, 0);
333                        if(rcret == getrcconfigint("rcfav", NULL))     
334                                ret = screenchannellist(NULL, NULL, 2);
335                        else
336                                ret = screenchannellist(NULL, NULL, 0);
337                        if(ret >= 20 || ret < 0)
338                                status.servicetype = tmpservicetype;
339                        drawscreen(skin, 0, 0);
340                        status.infobaraktiv = 1;
341                        status.infobar = 2;
342                        infobartimeout = 0;
343                        continue;
344                }
345                if(rcret == getrcconfigint("rcexit", NULL))
346                {
347                        if(status.timeshift == 1 && status.playing == 1)
348                                screenplayinfobar(NULL, NULL, 1, 1, 4);
349                        subtitlepause(1);
350                        status.infobar = 0;
351                        clearscreen(infobar);
352                        if(infobarm != infobar) {
353                                infobar = infobarm;
354                                clearscreen(infobar);
355                        }
356                        drawscreen(skin, 0, 0);
357                        subtitlepause(0);
358                        continue;
359                }
360                if(rcret == getrcconfigint("rctext", NULL))
361                {
362                        if(status.aktservice->channel != NULL && status.aktservice->channel->txtpid > 0)
363                        {
364                                subtitlepause(1);
365                                status.infobar = 0;
366                                status.sec = 0;
367                                clearscreen(infobar);
368                                tmpstr = ostrcat(getconfig("tuxtxtfile", NULL), " ", 0, 0);
369                                tmpnr = oitoa(status.aktservice->channel->txtpid);
370                                tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
371       
372                                if(status.aktservice->fedev != NULL)
373                                {
374                                        tmpnr = oitoa(status.aktservice->fedev->devnr);
375                                        tmpstr = ostrcat(tmpstr, " ", 1, 0);
376                                        tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
377                                }
378       
379                                drawscreen(skin, 0, 0);
380                                status.tuxtxt = 1;
381                                system(tmpstr);
382                                status.tuxtxt = 0;
383                                free(tmpstr); tmpstr = NULL; tmpnr = NULL;
384                                drawscreen(skin, 0, 0);
385                                subtitlepause(0);
386                        }
387                        continue;
388                }
389                if(rcret == getrcconfigint("rcrecord", NULL))
390                {
391                        subtitlepause(1);
392                        status.infobar = 0;
393                        clearscreen(infobar);
394                        screenrecorddirect();
395                        status.updatevfd = START;
396                        drawscreen(skin, 0, 0);
397                        subtitlepause(0);
398                        continue;
399                }
400                if((status.timeshift == 0 && rcret == getrcconfigint("rcplay", NULL)) || rcret == getrcconfigint("rcarchive", NULL) || rcret == getrcconfigint("rcwebplay", NULL))
401                {
402                        subtitlepause(1);
403                        status.infobar = 0;
404                        status.infobaraktiv = 0;
405                        clearscreen(infobar);
406                        screenplay(NULL, NULL, 1, 0);
407                        status.infobaraktiv = 1;
408                        status.updatevfd = START;
409                        drawscreen(skin, 0, 0);
410                        subtitlepause(0);
411                        continue;
412                }
413                if(rcret == getrcconfigint("rcshoot", NULL))
414                {
415                        subtitlepause(1);
416                        status.infobar = 0;
417                        status.infobaraktiv = 0;
418                        clearscreen(infobar);
419                        screenshoot(0);
420                        status.infobaraktiv = 1;
421                        status.updatevfd = START;
422                        drawscreen(skin, 0, 0);
423                        subtitlepause(0);
424                        continue;
425                }
426
427                if(rcret == getrcconfigint("rcplugin", NULL))
428                {
429                        subtitlepause(1);
430                        status.infobar = 0;
431                        status.infobaraktiv = 0;
432                        clearscreen(infobar);
433                        screenkeyactions(2, 0);
434                        status.infobaraktiv = 1;
435                        status.updatevfd = START;
436                        drawscreen(skin, 0, 0);
437                        subtitlepause(0);
438                        continue;
439                }
440                if(rcret == getrcconfigint("rcred", NULL))
441                {
442                        subtitlepause(1);
443                        status.infobar = 0;
444                        status.infobaraktiv = 0;
445                        clearscreen(infobar);
446                        screenkeyactions(1, 0);
447                        status.infobaraktiv = 1;
448                        status.updatevfd = START;
449                        drawscreen(skin, 0, 0);
450                        subtitlepause(0);
451                        continue;
452                }
453                if(rcret == getrcconfigint("rcgreen", NULL))
454                {
455                        subtitlepause(1);
456                        status.infobar = 0;
457                        clearscreen(infobar);
458                        screenvideomode(0);
459                        drawscreen(skin, 0, 0);
460                        subtitlepause(0);
461                        continue;
462                }
463                if(rcret == getrcconfigint("rcsubchannel", NULL))
464                {
465                        subtitlepause(1);
466                        status.infobar = 0;
467                        clearscreen(infobar);
468                        screenlinkedchannel();
469                        drawscreen(skin, 0, 0);
470                        subtitlepause(0);
471                        continue;
472                }
473                if(rcret == getrcconfigint("rcsleep", NULL))
474                {
475                        subtitlepause(1);
476                        status.infobar = 0;
477                        clearscreen(infobar);
478                        screenpowerofftimer();
479                        drawscreen(skin, 0, 0);
480                        subtitlepause(0);
481                        continue;
482                }
483                if(rcret == getrcconfigint("rcsubtitel", NULL))
484                {
485                        subtitlepause(1);
486                        status.infobar = 0;
487                        clearscreen(infobar);
488                        screensubtitle();
489                        drawscreen(skin, 0, 0);
490                        subtitlepause(0);
491                        continue;
492                }
493                if(rcret == getrcconfigint("rcyellow", NULL))
494                {
495                        subtitlepause(1);
496                        status.infobar = 0;
497                        clearscreen(infobar);
498                        screenaudiotrack();
499                        drawscreen(skin, 0, 0);
500                        subtitlepause(0);
501                        continue;
502                }
503                if(rcret == getrcconfigint("rcblue", NULL))
504                {
505                        subtitlepause(1);
506                        status.infobar = 0;
507                        clearscreen(infobar);
508                        screenkeyactions(0, 0);
509                        status.updatevfd = START;
510                        drawscreen(skin, 0, 0);
511                        subtitlepause(0);
512                        continue;
513                }
514                if(rcret == getrcconfigint("rchbbtv", NULL) && status.aktservice->channel != NULL && status.aktservice->channel->hbbtvurl != NULL)
515                {
516                        subtitlepause(1);
517                        status.infobar = 0;
518                        clearscreen(infobar);
519
520                        pluginnode = getplugin("hbbtv Browser");
521                        if(pluginnode != NULL)
522                        {
523                                startplugin = dlsym(pluginnode->pluginhandle, "starturl");
524                                if(startplugin != NULL)
525                                        startplugin();
526                        }
527
528                        status.updatevfd = START;
529                        drawscreen(skin, 0, 0);
530                        subtitlepause(0);
531                        continue;
532                }
533                if(rcret == getrcconfigint("rcmedia", NULL))
534                {
535                        struct skin* pluginnode = getplugin("Media Center");
536                        void (*startplugin)(void);
537                        status.infobaraktiv = 0;
538                        subtitlepause(1);
539                        status.infobar = 0;
540                        clearscreen(infobar);
541                        if(pluginnode != NULL)
542                        {
543                                startplugin = dlsym(pluginnode->pluginhandle, "start");
544                                if(startplugin != NULL)
545                                startplugin();
546                        }
547                        status.infobaraktiv = 1;
548                        drawscreen(skin, 0, 0);
549                        subtitlepause(0);
550                        continue;
551                }
552                if(rcret == getrcconfigint("rcmenu", NULL))
553                {
554                        subtitlepause(1);
555                        status.infobar = 0;
556                        status.infobaraktiv = 0;
557                        clearscreen(infobar);
558                        menu(getscreen("mainmenu"), 1);
559                        status.menurelease = 0;
560                        status.updatevfd = START;
561                        status.infobaraktiv = 1;
562                        drawscreen(skin, 0, 0);
563                        subtitlepause(0);
564                        continue;
565                }
566                if(rcret == getrcconfigint("rcepg", NULL))
567                {
568                        subtitlepause(1);
569                        status.infobar = 0;
570                        status.infobaraktiv = 0;
571                        clearscreen(infobar);
572                        epgchoice(NULL);
573                        drawscreen(skin, 0, 0);
574                        status.infobaraktiv = 1;
575                        subtitlepause(0);
576                        continue;
577                }
578                if(rcret == getrcconfigint("rcresolution", NULL))
579                {
580                        subtitlepause(1);
581                        status.infobar = 0;
582                        clearscreen(infobar);
583                        switchvideomode();
584                        drawscreen(skin, 0, 0);
585                        subtitlepause(0);
586                        continue;
587                }
588                if(rcret == getrcconfigint("rcinfo", NULL))
589                {
590                        if(status.infobar == 1)
591                        {
592                                if(getconfigint("secondinfobar", NULL) == 2)
593                                {
594                                        clearscreen(infobar);
595                                        epgchoice(NULL);
596                                        status.infobar = 0;
597                                        drawscreen(skin, 0, 0);
598                                        subtitlepause(0);
599                                }
600                                else if(getconfigint("secondinfobar", NULL) == 3)
601                                {
602                                        clearscreen(infobar);
603                                        screenepg(NULL, NULL, 0);
604                                        status.infobar = 0;
605                                        drawscreen(skin, 0, 0);
606                                        subtitlepause(0);
607                                }
608                                else if(getconfigint("secondinfobar", NULL) == 0 || infobar2 == status.skinerr || infobar == infobar2)
609                                {
610                                        status.infobar = 0;
611                                        drawscreen(skin, 0, 0);
612                                        subtitlepause(0);
613                                }
614                                else
615                                {
616                                        if(infobarm != infobar) {
617                                                clearscreen(infobar);
618                                                infobar = infobarm;
619                                        }
620                                        else {
621                                                infobar = infobar2;
622                                                drawscreen(infobar, 0, 0);
623                                        }
624                                }
625                        }
626                        else
627                        {
628                                subtitlepause(1);
629                                status.infobar = 1;
630                                infobar = infobar1;
631                                drawscreen(infobar, 0, 4);
632                        }
633                        continue;
634                }
635                if(rcret == getrcconfigint("rcpower", NULL))
636                {
637                        subtitlepause(1);
638                        status.infobar = 0;
639                        status.infobaraktiv = 0;
640                        clearscreen(infobar);
641                        drawscreen(skin, 0, 0);
642                        switch(getconfigint("poweraktion", NULL))
643                        {
644                                case 1: //power off
645                                        oshutdown(1, 1);
646                                        break;
647                                case 2: //standby
648                                        status.standby = 1;
649                                        break;
650                                case 3: //restart
651                                        oshutdown(2, 1);
652                                        break;
653                                case 4: //Gui restart
654                                        oshutdown(3, 1);
655                                        break;
656                                default:
657                                        standbymenu = getscreen("standbymenu");
658                                        menu(standbymenu, 1);
659                                        break;
660                        }
661                        status.updatevfd = START;
662                        drawscreen(skin, 0, 0);
663                        status.infobaraktiv = 1;
664                        subtitlepause(0);
665                        continue;
666                }
667                if(rcret == getrcconfigint("rcrecall", NULL))
668                {
669                        subtitlepause(1);
670                        clearscreen(infobar);
671                        drawscreen(skin, 0, 0);
672                        screenchannelhistory();
673                        infobartimeout = 0;
674                        infobar = infobar1;
675                        if(status.infobar == 0)
676                                drawscreen(infobar, 0, 4);
677                        else
678                                drawscreen(infobar, 0, 0);
679                        status.infobar = 1;
680                        continue;
681                }
682                if(rcret == getrcconfigint("rc0", NULL))
683                {
684                        subtitlepause(1);
685                        clearscreen(infobar);
686                        drawscreen(skin, 0, 0);
687                        if(status.lastservice->channel != NULL)
688                        {
689                                tmpstr = ostrcat(status.lastservice->channellist, NULL, 0, 0);
690                                servicecheckret(servicestart(status.lastservice->channel, tmpstr, NULL, 0), 0);
691                                free(tmpstr); tmpstr = NULL;
692                        }
693                        infobartimeout = 0;
694                        infobar = infobar1;
695                        if(status.infobar == 0)
696                                drawscreen(infobar, 0, 4);
697                        else
698                                drawscreen(infobar, 0, 0);
699                        status.infobar = 1;
700                        continue;
701                }
702                if(rcret == getrcconfigint("rcchup", NULL) || (status.crosscontrol > 0 && status.play == 0 && status.pause == 0 && rcret == getrcconfigint("rcdown", NULL)))
703                {
704                        subtitlepause(1);
705                        if(status.crosscontrol > 1 && status.virtualzap == 0 && rcret == getrcconfigint("rcdown", NULL))
706                        {
707                                status.virtualzap = status.crosscontrol - 1;
708                                zapup();
709                                status.virtualzap = 0;
710                        }
711                        else
712                                zapup();
713                        clearscreen(infobar);
714                        drawscreen(skin, 0, 0);
715                        infobartimeout = 0;
716                        status.infobar = 2;
717                        continue;
718                }
719                if(rcret == getrcconfigint("rcchdown", NULL) || (status.crosscontrol > 0 && status.play == 0 && status.pause == 0 && rcret == getrcconfigint("rcup", NULL)))
720                {
721                        subtitlepause(1);
722                        if(status.crosscontrol > 1 && status.virtualzap == 0 && rcret == getrcconfigint("rcup", NULL))
723                        {
724                                status.virtualzap = status.crosscontrol - 1;
725                                zapdown();
726                                status.virtualzap = 0;
727                        }
728                        else
729                                zapdown();
730                        clearscreen(infobar);
731                        drawscreen(skin, 0, 0);
732                        infobartimeout = 0;
733                        status.infobar = 2;
734                        continue;
735                }
736                if(rcret == rcnumber(rcret))
737                {
738                        subtitlepause(1);
739                        clearscreen(infobar);
740                        screenchannelbynr(rcret);
741                        status.infobar = 2;
742                        continue;
743                }
744                //show infobar on program switch (only tv)
745                if(status.infobarprogram == 1 && status.infobar == 0 && status.servicetype == 0)
746                {
747                        time_t akttime = time(NULL);
748                        //show infobar only all 60 sec
749                        if(lasttime < akttime)
750                        {
751                                struct epg* tmpepg = getepgakt(status.aktservice->channel);
752                                if(tmpepg != NULL && akttime - 1 <= tmpepg->starttime && akttime + 1 >= tmpepg->starttime)
753                                {
754                                        lasttime = akttime + 10;
755                                        infobartimeout = 0;
756                                        subtitlepause(1);
757                                        status.infobar = 1;
758                                        infobar = infobar1;
759                                        drawscreen(infobar, 0, 4);
760                                        continue;
761                                }
762                        }
763                }
764    /*
765                if(rcret == getrcconfigint("rcpip", NULL))
766                {
767                        struct channel* tmp = getchannel(12003, 66625); //for test RTL Television
768                        pipstart(tmp, NULL, 0);
769                }
770    */
771                if(rcret == RCTIMEOUT && mark == 0)
772                {
773                        if(getconfigint("infobartimeout", NULL) > infobartimeout)
774                        {
775                                //clearscreen(infobar);
776                                drawscreen(infobar, 0, 0);
777                        }
778                        else
779                        {
780                                clearscreen(infobar);
781                                if(infobarm != infobar) {
782                                        infobar = infobarm;
783                                        clearscreen(infobar);
784                                }
785                                status.infobar = 0;
786                                drawscreen(skin, 0, 0);
787                                subtitlepause(0);
788                        }
789                }
790        }
791}
792
793#endif
Note: See TracBrowser for help on using the repository browser.