source: titan/titan/infobar.h @ 27036

Last change on this file since 27036 was 27036, checked in by obi, 10 years ago

atemio5200 fix play/pause

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