source: titan/titan/infobar.h @ 40399

Last change on this file since 40399 was 40127, checked in by gost, 7 years ago

[titan] fix hdmiin dm900

File size: 33.1 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        struct channel* pipchannel = NULL;
8        struct skin* playinfobarpic = getscreen("playinfobarpic");
9
10        char* infobar_sel = getskinconfig("infobar_selection", NULL);
11        char* infobar2_sel = getskinconfig("infobar2_selection", NULL);
12        debug(10, "get initial infobar1=%s", infobar_sel);
13        debug(10, "get initial infobar2=%s", infobar2_sel);
14
15        if(infobar_sel == NULL) {
16                infobar_sel = ostrcat(infobar_sel, "infobar", 1, 0); // fallback to default
17                debug(10, "fallback to default, set infobar1=%s", infobar_sel);
18        }
19
20        if(infobar2_sel == NULL) {
21                infobar2_sel = ostrcat(infobar2_sel, "infobar2", 1, 0); // fallback to default
22                debug(10, "fallback to default, set infobar2=%s", infobar2_sel);
23        }
24
25        struct skin* infobar1 = getscreen(infobar_sel);
26        debug(10, "final infobar1=%s", infobar_sel);
27        struct skin* infobar2 = getscreen(infobar2_sel);
28        debug(10, "final infobar2=%s", infobar2_sel);
29        struct skin* infobar = infobar1;
30        struct skin* infobarm = infobar1;
31
32// dynamic default skin infobar start
33        struct skin* infobar1_bottombar = getscreennode(infobar1, "bottombar");
34        status.getepgaktstart = 0;
35        status.getepgaktend = 0;
36        status.getepgakttitle = 0;
37        status.getepgakttimeremaining = 0;
38        status.getepgnextstart = 0;
39        status.getepgnextend = 0;
40        status.getepgnexttitle = 0;
41        status.getepgnexttimeremaining = 0;
42
43        if(status.fontsizeadjust > 0)
44        {
45                infobar1->height += (status.fontsizeadjust * 2);
46                infobar1->posy -= (status.fontsizeadjust * 2);
47                infobar1_bottombar->posy += (status.fontsizeadjust * 2);
48
49//              infobar2->height += (status.fontsizeadjust * 2);
50//              infobar2->posy -= (status.fontsizeadjust * 4);
51                infobar2->posy -= (status.fontsizeadjust * 2);
52        }
53// dynamic default skin infobar end
54
55        struct skin* standbymenu = NULL;
56        char* tmpstr = NULL; char* tmpnr = NULL;
57        struct skin* pluginnode = NULL;
58        void (*startplugin)(void);
59        time_t lasttime = 0;
60        int mark = 0;
61        int playstop = 1;
62
63        status.mute = 0;
64        status.infobar = 2;
65
66        addrc(getrcconfigint("rcvolup", NULL), screenvolumeup, NULL, NULL);
67        addrc(getrcconfigint("rcvoldown", NULL), screenvolumedown, NULL, NULL);
68        addrc(getrcconfigint("rcmute", NULL), screenmute, NULL, NULL);
69
70        status.infobaraktiv = 1;
71        status.mcaktiv = 0;
72       
73        int playinfobarcount = 0, playinfobarstatus = 0;
74       
75        if(file_exist("/etc/.mipsel") || ((checkbox("ATEMIO520") == 1 || checkbox("ATEMIO530") == 1 || checkbox("DM7020HD") == 1 || checkbox("DM7020HDV2") == 1 || checkbox("DM900") == 1) && ostrcmp(getconfig("remotecontrol", NULL), "1") != 1))
76                playstop = 0;
77        else
78                playstop = 1;
79       
80        while(1)
81        {
82                mark = 0;
83
84                if(status.crosscontrol > 0 && status.play == 0 && status.pause == 0 && rcret == getrcconfigint("rcright", NULL))
85                        writerc(getrcconfigint("rcvolup", NULL));
86                if(status.crosscontrol > 0 && status.play == 0 && status.pause == 0 && rcret == getrcconfigint("rcleft", NULL))
87                        writerc(getrcconfigint("rcvoldown", NULL));
88
89                //check if mediadb can freed
90                if(status.mediadbthread == NULL)
91                {
92                        if(status.writemediadb == 1)
93                                writemediadb(getconfig("mediadbfile", NULL), NULL);
94                        freemediadb(0);
95                }
96                //check if picmem times out and must freed
97                if(time(NULL) > status.picmemtimeout + 60)
98                {
99                        checkpictimeout();
100                        status.picmemtimeout = time(NULL);
101                }
102
103                if(status.standby == 1)
104                        screenstandby();
105                if(status.infobar == 1 )
106                {
107                        rcret = waitrc(infobar, 1000, 0);
108                        infobartimeout++;
109                }
110                else if(status.infobar == 0 && status.timeshift == 1)
111                {
112                        rcret = waitrc(infobar, 1000, 0);
113                        if(rcret == RCTIMEOUT)
114                        {
115                                if(status.playpic == 1)
116                                {
117                                        clearscreen(playinfobarpic);
118                                        drawscreen(playinfobarpic, 0, 0);
119                                }
120                                else
121                                        timeshiftinfobar(&playinfobarstatus, &playinfobarcount);
122                                continue;
123                        }
124                }
125                else if(status.infobar == 2)
126                {
127                        if(getconfigint("infobarsleep", NULL) > 0)
128                                rcret = waitrc(infobar, getconfigint("infobarsleep", NULL) * 1000, 0);
129                        else if(first == 1) //only on first start wait a little for epg
130                        {
131                                first = 0;
132                                rcret = waitrc(infobar, 1000, 0);
133                        }
134                        else
135                                rcret = RCTIMEOUT;
136
137                        if(rcret == RCTIMEOUT)
138                        {
139                                status.infobar = 1;
140                                infobar = infobar1;
141                                drawscreen(infobar, 0, 4);
142                                continue;
143                        }
144                        else
145                                status.infobar = 0;
146                }
147                else
148                {
149                        int screensaver_delay = getconfigint("screensaver_delay", NULL);
150                        rcret = 0; count = 0; rcwait = 1000;
151                        if(status.servicetype == 1 && getconfigint("screensaver", NULL) == 1)
152                        {
153                                initscreensaver();
154                                if(screensaver != NULL) screensaver->flag = 1;
155                        }
156                        if(screensaver == NULL)
157                        {
158                                if(status.infobarprogram == 1) rcwait = 2000;
159                                else rcwait = 0;
160                        }
161                        while(rcret == 0 || rcret == RCTIMEOUT)
162                        {
163                                rcret = waitrc(infobar, rcwait, 0);
164                                count++;
165                                if(screensaver == NULL && status.infobarprogram == 1 && (rcret == 0 || rcret == RCTIMEOUT))
166                                {
167                                        infobartimeout = 99999;
168                                        mark = 1;
169                                        break;
170                                }
171                                if(rcret == RCTIMEOUT && screensaver != NULL && count > screensaver_delay)
172                                {
173                                        if(status.aktservice->channel != NULL)
174                                                screensaver->value = ostrcat(status.aktservice->channel->name, NULL, 0, 0);
175                                        else
176                                                screensaver->value = ostrcat("Radio", NULL, 0, 0);
177                                        showscreensaver();
178                                        free(screensaver->value);
179                                        rcwait = screensaver->speed;
180                                }
181                        }
182                        if(screensaver != NULL) screensaver->flag = 0;
183                        deinitscreensaver();
184                        if(mark == 0)
185                        {
186                                drawscreen(skin, 0, 0);
187                                infobartimeout = 0;
188                        }
189                }
190
191                if(status.pipservice->videodev != NULL)
192                {
193                        if(rcret == getrcconfigint("rcpip", NULL))
194                        {
195                                if(getconfigint("pip_screen", NULL) == 1)
196                                {
197                                        pipstop(status.pipservice, 0);
198                                        continue;
199                                }
200                                else
201                                {
202                                        pipmenu();
203                                        drawscreen(skin, 0, 0);
204                                        clearscreen(infobar);
205                                        continue;
206                                }
207                        }
208                        if(rcret == getrcconfigint("rc0", NULL))
209                        {
210                                if(getconfigint("pip_swap", NULL) == 1)
211                                {
212                                        pipswap(status.pipservice);
213                                        continue;
214                                }
215                        }
216                }
217                //Plugin von aussen aufrufen
218                //if(rcret == RCTIMEOUT && status.extplugin != NULL)
219                if(status.extplugin != NULL)
220                {
221                        subtitlepause(1);
222                        status.infobar = 0;
223                        clearscreen(infobar);
224
225                        pluginnode = getplugin(status.extplugin);
226                        free(status.extplugin); status.extplugin = NULL;
227                        if(pluginnode != NULL)
228                        {
229                                startplugin = dlsym(pluginnode->pluginhandle, "start");
230                                if(startplugin != NULL)
231                                        startplugin();
232                        }
233                        status.updatevfd = START;
234                        drawscreen(skin, 0, 0);
235                        subtitlepause(0);
236                        continue;
237                }
238                       
239               
240                if(status.pvr == 1 && (rcret == getrcconfigint("rcpause", NULL) || ((checkbox("DM7020HD") == 1 || checkbox("DM7020HDV2") == 1 || checkbox("DM900") == 1 || 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)))
241                {
242                        //timeshift
243                        if(status.playpic == 1)
244                        {
245                                clearscreen(playinfobarpic);
246                                status.playpic = 0;
247                        }
248                        if(status.timeshift == 1 && (status.playing == 0 || status.slowspeed != 0 || status.playspeed != 0 || status.pause != 0))
249                        {
250                                if(status.timeshifttype == 1 && status.timeshiftpos == 0)
251                                {
252                                        timeshiftpause(0);
253                                        timeshiftinfobar(&playinfobarstatus, &playinfobarcount);
254                                        if(status.playpic == 0)
255                                        {
256                                                drawscreen(playinfobarpic, 0, 0);
257                                                status.playpic = 1;
258                                        }
259                                }
260                                else
261                                        timeshiftplay(&playinfobarstatus, &playinfobarcount);
262                        }
263                        else
264                        {
265                                if(status.timeshift == 1)
266                                        status.playpic = 2;
267                                else
268                                        status.playpic = 0;
269
270                                timeshiftpause(0);
271                                timeshiftinfobar(&playinfobarstatus, &playinfobarcount);
272                                if(status.playpic == 0)
273                                {
274                                        drawscreen(playinfobarpic, 0, 0);
275                                        status.playpic = 1;
276                                }
277                        }
278
279                        continue;
280                }
281                if(status.timeshift == 1)
282                {
283                        if(rcret == getrcconfigint("rcstop", NULL))
284                        {
285                                if(status.playpic == 1)
286                                {
287                                        clearscreen(playinfobarpic);
288                                        status.playpic = 0;
289                                }               
290                                timeshiftstop(0);
291                                continue;
292                        }
293                        if(rcret == getrcconfigint("rcplay", NULL))
294                        {
295                                if(status.playpic == 1)
296                                {
297                                        clearscreen(playinfobarpic);
298                                        status.playpic = 0;
299                                }               
300                                if(playstop == 1 && status.timeshifttype == 1)
301                                {
302                                        if(status.playing == 0 || (status.playspeed == 0 && status.slowspeed == 0 && status.pause == 0))
303                                        {
304                                                subtitlepause(1);
305                                                status.infobar = 0;
306                                                status.infobaraktiv = 0;
307                                                clearscreen(infobar);
308                                                screenplay(NULL, NULL, 1, 0);
309                                                status.infobaraktiv = 1;
310                                                status.updatevfd = START;
311                                                drawscreen(skin, 0, 0);
312                                                subtitlepause(0);
313                                                continue;
314                                        }
315                                }
316                                timeshiftplay(&playinfobarstatus, &playinfobarcount);
317                                continue;
318                        }
319                        if(status.timeshifttype == 1 && status.playing == 0)
320                        {
321                                if(rcret == getrcconfigint("rcff", NULL) || (getconfig("timeshiftnumkeys", NULL) == 0 && (rcret == getrcconfigint("rc3", NULL) || rcret == getrcconfigint("rc6", NULL) || rcret == getrcconfigint("rc9", NULL) || rcret == getrcconfigint("rcright", NULL) || rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rc2", NULL))))
322                                {
323                                        struct service* snode = getservice(RECORDTIMESHIFT, 0);
324                                        if(snode != NULL)
325                                        {
326                                                status.playercan = 0x7FFF;
327                                                playinfobarstatus = 1;
328                                                playinfobarcount = 0;
329                                                screenplayinfobar(snode->recname, NULL, 0, 1, 5);
330                                        }
331                                        continue;
332                                }
333                                if(rcret == getrcconfigint("rcfr", NULL))
334                                {
335                                        timeshiftposplay(&playinfobarstatus, &playinfobarcount);
336                                        if(status.playing == 1)
337                                                playrcfr(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
338                                        continue;
339                                }
340                                if(getconfig("timeshiftnumkeys", NULL) == 0)
341                                {
342                                        if(rcret == getrcconfigint("rcleft", NULL))
343                                        {
344                                                timeshiftposplay(&playinfobarstatus, &playinfobarcount);
345                                                if(status.playing == 1)
346                                                        playrcjumpr(status.playfile, NULL, 60, &playinfobarstatus, &playinfobarcount, 1, 4);
347                                                continue;
348                                        }
349                                        if(rcret == getrcconfigint("rcdown", NULL))
350                                        {
351                                                timeshiftposplay(&playinfobarstatus, &playinfobarcount);
352                                                if(status.playing == 1)
353                                                        playrcjumpr(status.playfile, NULL, 300, &playinfobarstatus, &playinfobarcount, 1, 4);
354                                                continue;
355                                        }
356                                        if(rcret == getrcconfigint("rc1", NULL))
357                                        {
358                                                timeshiftposplay(&playinfobarstatus, &playinfobarcount);
359                                                if(status.playing == 1)
360                                                        playrcjumpr(status.playfile, NULL, getconfigint("skip13", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
361                                                continue;
362                                        }
363                                        if(rcret == getrcconfigint("rc4", NULL))
364                                        {
365                                                timeshiftposplay(&playinfobarstatus, &playinfobarcount);
366                                                if(status.playing == 1)
367                                                        playrcjumpr(status.playfile, NULL, getconfigint("skip46", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
368                                                continue;
369                                        }
370                                        if(rcret == getrcconfigint("rc7", NULL))
371                                        {
372                                                timeshiftposplay(&playinfobarstatus, &playinfobarcount);
373                                                if(status.playing == 1)
374                                                        playrcjumpr(status.playfile, NULL, getconfigint("skip79", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
375                                                continue;
376                                        }
377                                }
378                        }
379                        if(status.playing == 1)
380                        {
381                                if(rcret == getrcconfigint("rcff", NULL))
382                                {
383                                        playrcff(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
384                                        continue;
385                                }
386                                if(rcret == getrcconfigint("rcfr", NULL))
387                                {
388                                        playrcfr(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
389                                        continue;
390                                }
391                                if(rcret == getrcconfigint("rc3", NULL))
392                                {
393                                        playrcjumpf(status.playfile, NULL, getconfigint("skip13", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
394                                        continue;
395                                }
396                                if(rcret == getrcconfigint("rc6", NULL))
397                                {
398                                        playrcjumpf(status.playfile, NULL, getconfigint("skip46", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
399                                        continue;
400                                }
401                                if(rcret == getrcconfigint("rc9", NULL))
402                                {                               
403                                        playrcjumpf(status.playfile, NULL, getconfigint("skip79", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
404                                        continue;
405                                }
406                                if(rcret == getrcconfigint("rcdown", NULL))
407                                {
408                                        playrcjumpr(status.playfile, NULL, 300, &playinfobarstatus, &playinfobarcount, 1, 4);
409                                        continue;
410                                }
411                                if(rcret == getrcconfigint("rcup", NULL))
412                                {
413                                        playrcjumpf(status.playfile, NULL, 300, &playinfobarstatus, &playinfobarcount, 1, 4);
414#ifdef MIPSEL
415// workaround fixes image flicker when jumping over the border also
416                                        playrcjumpr(status.playfile, NULL, 10, &playinfobarstatus, &playinfobarcount, 1, 4);
417#endif
418                                        continue;
419                                }
420                                if(rcret == getrcconfigint("rcleft", NULL))
421                                {
422                                        playrcjumpr(status.playfile, NULL, 60, &playinfobarstatus, &playinfobarcount, 1, 4);
423                                        continue;
424                                }
425                                if(rcret == getrcconfigint("rcright", NULL))
426                                {
427                                        playrcjumpf(status.playfile, NULL, 60, &playinfobarstatus, &playinfobarcount, 1, 4);
428#ifdef MIPSEL
429// workaround fixes image flicker when jumping over the border also
430                                        playrcjumpr(status.playfile, NULL, 10, &playinfobarstatus, &playinfobarcount, 1, 4);
431#endif
432                                        continue;
433                                }
434                                if(rcret == getrcconfigint("rc1", NULL))
435                                {
436                                        playrcjumpr(status.playfile, NULL, getconfigint("skip13", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
437                                        continue;
438                                }
439                                if(rcret == getrcconfigint("rc4", NULL))
440                                {
441                                        playrcjumpr(status.playfile, NULL, getconfigint("skip46", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
442                                        continue;
443                                }
444                                if(rcret == getrcconfigint("rc7", NULL))
445                                {
446                                        playrcjumpr(status.playfile, NULL, getconfigint("skip79", NULL), &playinfobarstatus, &playinfobarcount, 1, 4);
447                                        continue;
448                                }
449                                if(rcret == getrcconfigint("rc2", NULL))
450                                {
451                                        playrcjumpto(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
452                                        continue;
453                                }
454                                if(rcret == getrcconfigint("rc0", NULL))
455                                {
456                                        setmarker();
457                                        continue;
458                                }
459                                if(rcret == getrcconfigint("rc5", NULL))
460                                {
461                                        screenmarker(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
462                                        continue;
463                                }       
464                                if(rcret == getrcconfigint("rc8", NULL))
465                                {
466                                        continue;
467                                }
468                                if(status.timeshifttype == 0 && rcret == getrcconfigint("rcinfo", NULL))
469                                {
470                                        playrcinfo(status.playfile, NULL, &playinfobarstatus, &playinfobarcount, 1, 4);
471                                        continue;       
472                                }
473                        }
474                }
475                if(rcret == getrcconfigint("rcstop", NULL) && status.recording > 0)
476                {
477                        subtitlepause(1);
478                        status.infobar = 0;
479                        clearscreen(infobar);
480                        screenrecordstop();
481                        status.updatevfd = START;
482                        drawscreen(skin, 0, 0);
483                        subtitlepause(0);
484                        continue;
485                }
486                if(rcret == getrcconfigint("rcblue", NULL) && getconfig("bluekey", NULL) == NULL)
487                {
488                        if(checkbox("DM7020HD") == 0 && checkbox("DM7020HDV2") == 0 && checkbox("DM900") == 0)
489                                rcret = getrcconfigint("rctvradio", NULL);
490                        else
491                                rcret = getrcconfigint("rcepg", NULL);
492                }
493                if(rcret == getrcconfigint("rcok", NULL) || rcret == getrcconfigint("rctvradio", NULL) || rcret == getrcconfigint("rcfav", NULL) || rcret == getrcconfigint("rctv", NULL) || rcret == getrcconfigint("rcradio", 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))))
494                {
495                        int tmpservicetype = status.servicetype;
496                        status.infobaraktiv = 0;
497                        subtitlepause(1);
498                        clearscreen(infobar);
499                        if(rcret == getrcconfigint("rctvradio", NULL))
500                        {
501                                if(status.servicetype == 0)
502                                        status.servicetype = 1;
503                                else
504                                        status.servicetype = 0;
505                        }
506
507                        if(rcret == getrcconfigint("rctv", NULL))
508                        {
509#ifdef MIPSEL
510                                if(checkchipset("BCM7424") == 1 && status.servicetype == 0)
511                                {
512                                        if(status.aktservice->type == CHANNEL)
513                                                servicefullHDMIin_start();
514                                        else if(status.aktservice->type == HDMIIN)
515                                        {
516                                                if(status.lastservice->channel != NULL)
517                                                {
518                                                        tmpstr = ostrcat(status.lastservice->channellist, NULL, 0, 0);
519                                                        servicecheckret(servicestart(status.lastservice->channel, tmpstr, NULL, 0), 0);
520                                                        free(tmpstr); tmpstr = NULL;
521                                                }
522                                        }
523                                        infobartimeout = 0;
524                                        infobar = infobar1;
525                                        if(status.infobar == 0)
526                                                drawscreen(infobar, 0, 4);
527                                        else
528                                                drawscreen(infobar, 0, 0);
529                                        status.infobar = 1;
530                                        continue;
531                                }
532#endif                         
533                                status.servicetype = 0;
534                        }
535                        if(rcret == getrcconfigint("rcradio", NULL))
536                                status.servicetype = 1;
537
538                        drawscreen(skin, 0, 0);
539                        if(rcret == getrcconfigint("rcfav", NULL))     
540                                ret = screenchannellist(NULL, NULL, 2);
541                        else
542                                ret = screenchannellist(NULL, NULL, 0);
543                        if(ret >= 20 || ret < 0)
544                                status.servicetype = tmpservicetype;
545                        drawscreen(skin, 0, 0);
546                        status.infobaraktiv = 1;
547                        status.infobar = 2;
548                        infobartimeout = 0;
549                        continue;
550                }
551                if(rcret == getrcconfigint("rcexit", NULL) && status.infobar == 1)
552                {
553                        if(status.timeshift == 1 && status.playing == 1)
554                                screenplayinfobar(NULL, NULL, 1, 1, 4);
555                        subtitlepause(1);
556                        status.infobar = 0;
557                        clearscreen(infobar);
558                        if(infobarm != infobar) {
559                                infobar = infobarm;
560                                clearscreen(infobar);
561                        }
562                        drawscreen(skin, 0, 0);
563                        subtitlepause(0);
564                        continue;
565                }
566                if(rcret == getrcconfigint("rctext", NULL))
567                {
568                        if(status.aktservice->channel != NULL && status.aktservice->channel->txtpid > 0)
569                        {
570                                subtitlepause(1);
571                                status.infobar = 0;
572                                status.sec = 0;
573                                clearscreen(infobar);
574                                tmpstr = ostrcat(getconfig("tuxtxtfile", NULL), " ", 0, 0);
575                                tmpnr = oitoa(status.aktservice->channel->txtpid);
576                                tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
577       
578                                if(status.aktservice->fedev != NULL)
579                                {
580                                        tmpnr = oitoa(status.aktservice->fedev->devnr);
581                                        tmpstr = ostrcat(tmpstr, " ", 1, 0);
582                                        tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
583                                }
584       
585                                drawscreen(skin, 0, 0);
586                                status.tuxtxt = 1;
587#ifdef MIPSEL
588                                disablemanualblit();
589                                int tmprcret = -1;
590                                delrc(getrcconfigint("rcvolup", NULL), NULL, NULL);
591                                delrc(getrcconfigint("rcvoldown", NULL), NULL, NULL);
592
593                                tmpstr = ostrcat(tmpstr, " &", 1, 0);
594                                system(tmpstr);
595
596                                while(1)
597                                {
598                                        rcret = waitrc(infobar, 0, 0);
599                                        if(rcret == getrcconfigint("rc0", NULL)) tmprcret = 0x00;
600                                        else if(rcret == getrcconfigint("rc1", NULL)) tmprcret = 0x01;
601                                        else if(rcret == getrcconfigint("rc2", NULL)) tmprcret = 0x02;
602                                        else if(rcret == getrcconfigint("rc3", NULL)) tmprcret = 0x03;
603                                        else if(rcret == getrcconfigint("rc4", NULL)) tmprcret = 0x04;
604                                        else if(rcret == getrcconfigint("rc5", NULL)) tmprcret = 0x05;
605                                        else if(rcret == getrcconfigint("rc6", NULL)) tmprcret = 0x06;
606                                        else if(rcret == getrcconfigint("rc7", NULL)) tmprcret = 0x07;
607                                        else if(rcret == getrcconfigint("rc8", NULL)) tmprcret = 0x08;
608                                        else if(rcret == getrcconfigint("rc9", NULL)) tmprcret = 0x09; 
609                                        else if(rcret == getrcconfigint("rcright", NULL)) tmprcret = 0x0A;
610                                        else if(rcret == getrcconfigint("rcleft", NULL)) tmprcret = 0x0B;
611                                        else if(rcret == getrcconfigint("rcup", NULL)) tmprcret = 0x0C;
612                                        else if(rcret == getrcconfigint("rcdown", NULL)) tmprcret = 0x0D;
613                                        else if(rcret == getrcconfigint("rcok", NULL)) tmprcret = 0x0E;
614                                        else if(rcret == getrcconfigint("rcmute", NULL)) tmprcret = 0x0F;       
615                                        else if(rcret == getrcconfigint("rcpower", NULL)) tmprcret = 0x10;
616                                        else if(rcret == getrcconfigint("rcgreen", NULL)) tmprcret = 0x11;
617                                        else if(rcret == getrcconfigint("rcyellow", NULL)) tmprcret = 0x12;
618                                        else if(rcret == getrcconfigint("rcred", NULL)) tmprcret = 0x13;               
619                                        else if(rcret == getrcconfigint("rcblue", NULL)) tmprcret = 0x14;
620                                        else if(rcret == getrcconfigint("rcchup", NULL)) tmprcret = 0x15;
621                                        else if(rcret == getrcconfigint("rcchdown", NULL)) tmprcret = 0x16;
622                                        else if(rcret == getrcconfigint("rchelp", NULL)) tmprcret = 0x17;
623                                        //else if(rcret == getrcconfigint("rcdbox", NULL)) tmprcret = 0x18;
624                                        else if(rcret == getrcconfigint("rctext", NULL)) tmprcret = 0x1F;
625                                        else if(rcret == getrcconfigint("rcexit", NULL)) tmprcret = 0x1F;
626                                       
627                                        sendtuxtxt(tmprcret);
628                                       
629                                        if(rcret == getrcconfigint("rcexit", NULL)) break;
630                                        if(rcret == getrcconfigint("rctext", NULL)) break;
631                                }
632                               
633                                addrc(getrcconfigint("rcvolup", NULL), screenvolumeup, NULL, NULL);
634                                addrc(getrcconfigint("rcvoldown", NULL), screenvolumedown, NULL, NULL);
635
636                                if(status.fdrctxt != -1)
637                                {
638                                        close(status.fdrctxt);
639                                        status.fdrctxt = -1;
640                                }
641                                system("resetfb.sh");
642                                enablemanualblit();
643#else
644                                system(tmpstr);
645#endif
646#ifdef MIPSEL
647
648                                if(status.aktservice != NULL)
649                                        resetvmpeg(status.aktservice->videodev);
650#endif
651                                status.tuxtxt = 0;
652                                free(tmpstr); tmpstr = NULL; tmpnr = NULL;
653                                drawscreen(skin, 0, 0);
654                                subtitlepause(0);
655                        }
656                        continue;
657                }
658//      if(rcret == getrcconfigint("rcrecord", NULL))
659                if(rcret == getrcconfigint("rcrecord", NULL) && status.pvr == 1)
660                {
661                        subtitlepause(1);
662                        status.infobar = 0;
663                        clearscreen(infobar);
664                        screenrecorddirect();
665                        status.updatevfd = START;
666                        drawscreen(skin, 0, 0);
667                        subtitlepause(0);
668                        continue;
669                }
670                if((status.pvr == 1 && ((status.timeshift == 0 && rcret == getrcconfigint("rcplay", NULL)) || rcret == getrcconfigint("rcarchive", NULL) || rcret == getrcconfigint("rcwebplay", NULL))))
671                {
672                        subtitlepause(1);
673                        status.infobar = 0;
674                        status.infobaraktiv = 0;
675                        clearscreen(infobar);
676                        screenplay(NULL, NULL, 1, 0);
677                        status.infobaraktiv = 1;
678                        status.updatevfd = START;
679                        drawscreen(skin, 0, 0);
680                        subtitlepause(0);
681                        continue;
682                }
683                if(rcret == getrcconfigint("rcshoot", NULL))
684                {
685                        subtitlepause(1);
686                        status.infobar = 0;
687                        status.infobaraktiv = 0;
688                        clearscreen(infobar);
689                        screenshoot(0);
690                        status.infobaraktiv = 1;
691                        status.updatevfd = START;
692                        drawscreen(skin, 0, 0);
693                        subtitlepause(0);
694                        textbox(_("Message"), _("Shooting Background done !\nSave Screenshoot Path: /tmp/screenshot.jpg"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 0, 0);
695                        continue;
696                }
697
698                if(rcret == getrcconfigint("rcplugin", NULL))
699                {
700                        subtitlepause(1);
701                        status.infobar = 0;
702                        clearscreen(infobar);
703                        status.updatevfd = PAUSE;
704                        screenkeyactions(2, 0);
705                        status.updatevfd = START;
706                        drawscreen(skin, 0, 0);
707                        subtitlepause(0);
708                        continue;
709                }
710                if(rcret == getrcconfigint("rcred", NULL))
711                {
712                        subtitlepause(1);
713                        status.infobar = 0;
714                        status.infobaraktiv = 0;
715                        clearscreen(infobar);
716                        status.updatevfd = PAUSE;
717                        screenkeyactions(1, 0);
718                        status.infobaraktiv = 1;
719                        status.updatevfd = START;
720                        drawscreen(skin, 0, 0);
721                        subtitlepause(0);
722                        continue;
723                }
724                if(rcret == getrcconfigint("rcgreen", NULL))
725                {
726                        subtitlepause(1);
727                        status.infobar = 0;
728                        clearscreen(infobar);
729                        screenvideomode(0);
730                        drawscreen(skin, 0, 0);
731                        subtitlepause(0);
732                        continue;
733                }
734                if(rcret == getrcconfigint("rcsubchannel", NULL))
735                {
736                        subtitlepause(1);
737                        status.infobar = 0;
738                        clearscreen(infobar);
739                        screenlinkedchannel();
740                        drawscreen(skin, 0, 0);
741                        subtitlepause(0);
742                        continue;
743                }
744                if(rcret == getrcconfigint("rcsleep", NULL))
745                {
746                        subtitlepause(1);
747                        status.infobar = 0;
748                        clearscreen(infobar);
749                        screenpowerofftimer();
750                        drawscreen(skin, 0, 0);
751                        subtitlepause(0);
752                        continue;
753                }
754                if(rcret == getrcconfigint("rcsubtitel", NULL))
755                {
756                        subtitlepause(1);
757                        status.infobar = 0;
758                        clearscreen(infobar);
759                        screensubtitle();
760                        drawscreen(skin, 0, 0);
761                        subtitlepause(0);
762                        continue;
763                }
764                if(rcret == getrcconfigint("rcyellow", NULL) || rcret == getrcconfigint("rcaudio", NULL))
765                {
766                        subtitlepause(1);
767                        status.infobar = 0;
768                        clearscreen(infobar);
769                        screenaudiotrack();
770                        drawscreen(skin, 0, 0);
771                        subtitlepause(0);
772                        continue;
773                }
774                if(rcret == getrcconfigint("rcblue", NULL))
775                {
776                        subtitlepause(1);
777                        status.infobar = 0;
778                        clearscreen(infobar);
779                        screenkeyactions(0, 0);
780                        status.updatevfd = START;
781                        drawscreen(skin, 0, 0);
782                        subtitlepause(0);
783                        continue;
784                }
785                if(rcret == getrcconfigint("rchbbtv", NULL) && status.aktservice->channel != NULL && status.aktservice->channel->hbbtvurl != NULL)
786                {
787                        subtitlepause(1);
788                        status.infobar = 0;
789                        clearscreen(infobar);
790
791                        pluginnode = getplugin("hbbtv Browser");
792                        if(pluginnode != NULL)
793                        {
794                                startplugin = dlsym(pluginnode->pluginhandle, "starturl");
795                                if(startplugin != NULL)
796                                        startplugin();
797                        }
798
799                        status.updatevfd = START;
800                        drawscreen(skin, 0, 0);
801                        subtitlepause(0);
802                        continue;
803                }
804                if(rcret == getrcconfigint("rcwww", NULL))
805                {
806                        subtitlepause(1);
807                        status.infobar = 0;
808                        clearscreen(infobar);
809                       
810                        pluginnode = getplugin("Internet Browser");
811                        if(pluginnode != NULL)
812                        {
813                                startplugin = dlsym(pluginnode->pluginhandle, "screenbrowser");
814                                if(startplugin != NULL)
815                                        startplugin();
816                        }
817                        else
818                                textbox(_("Message"), _("Internet Browser Plugin not installed !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0);
819                }
820                if(rcret == getrcconfigint("rcmedia", NULL))
821                {
822/*
823                        struct skin* pluginnode = getplugin("Media Center");
824                        void (*startplugin)(void);
825                        status.infobaraktiv = 0;
826                        subtitlepause(1);
827                        status.infobar = 0;
828                        clearscreen(infobar);
829                        if(pluginnode != NULL)
830                        {
831                                startplugin = dlsym(pluginnode->pluginhandle, "start");
832                                if(startplugin != NULL)
833                                startplugin();
834                        }
835                        status.infobaraktiv = 1;
836                        drawscreen(skin, 0, 0);
837                        subtitlepause(0);
838                        continue;
839*/
840                        subtitlepause(1);
841                        status.infobar = 0;
842                        clearscreen(infobar);
843                        status.updatevfd = PAUSE;
844                        screenkeyactions(3, 0);
845                        status.updatevfd = START;
846                        drawscreen(skin, 0, 0);
847                        subtitlepause(0);
848                        resettvpic();
849                        continue;
850                }
851                if(rcret == getrcconfigint("rcmenu", NULL))
852                {
853                        subtitlepause(1);
854                        status.infobar = 0;
855                        status.infobaraktiv = 0;
856                        clearscreen(infobar);
857                        menu(getscreen("mainmenu"), 1);
858                        status.menurelease = 0;
859                        status.updatevfd = START;
860                        status.infobaraktiv = 1;
861                        drawscreen(skin, 0, 0);
862                        subtitlepause(0);
863                        continue;
864                }
865                if(rcret == getrcconfigint("rctimer", NULL))
866                {
867                        subtitlepause(1);
868                        status.infobar = 0;
869                        status.infobaraktiv = 0;
870                        clearscreen(infobar);
871                        screenrectimer();
872                        drawscreen(skin, 0, 0);
873                        status.infobaraktiv = 1;
874                        subtitlepause(0);
875                        resettvpic();
876                        continue;
877                }
878                if(rcret == getrcconfigint("rcepg", NULL))
879                {
880                        subtitlepause(1);
881                        status.infobar = 0;
882                        status.infobaraktiv = 0;
883                        clearscreen(infobar);
884                        epgchoice(NULL);
885                        drawscreen(skin, 0, 0);
886                        status.infobaraktiv = 1;
887                        subtitlepause(0);
888                        continue;
889                }
890                if(rcret == getrcconfigint("rcresolution", NULL) || rcret == getrcconfigint("rcresolution1", NULL))
891                {
892                        subtitlepause(1);
893                        status.infobar = 0;
894                        clearscreen(infobar);
895                        switchvideomode();
896                        drawscreen(skin, 0, 0);
897                        subtitlepause(0);
898                        continue;
899                }
900                if(rcret == getrcconfigint("rcinfo", NULL))
901                {
902                        if(status.infobar == 1)
903                        {
904                                if(getconfigint("secondinfobar", NULL) == 2)
905                                {
906                                        clearscreen(infobar);
907                                        epgchoice(NULL);
908                                        status.infobar = 0;
909                                        drawscreen(skin, 0, 0);
910                                        subtitlepause(0);
911                                }
912                                else if(getconfigint("secondinfobar", NULL) == 3)
913                                {
914                                        clearscreen(infobar);
915                                        screenepg(NULL, NULL, 0);
916                                        status.infobar = 0;
917                                        drawscreen(skin, 0, 0);
918                                        subtitlepause(0);
919                                }
920                                else if(getconfigint("secondinfobar", NULL) == 0 || infobar2 == status.skinerr || infobar == infobar2)
921                                {
922                                        if(infobarm != infobar) {
923                                                clearscreen(infobar);
924                                                infobar = infobarm;
925                                        }
926                                        clearscreen(infobar);
927                                        status.infobar = 0;
928                                        drawscreen(skin, 0, 0);
929                                        subtitlepause(0);
930                                }
931                                else
932                                {
933                                        infobar = infobar2;
934                                        drawscreen(infobar, 0, 0);
935                                }
936                        }
937                        else
938                        {
939                                subtitlepause(1);
940                                status.infobar = 1;
941                                infobar = infobar1;
942                                drawscreen(infobar, 0, 4);
943                        }
944                        continue;
945                }
946                if(rcret == getrcconfigint("rcpower", NULL))
947                {
948                        subtitlepause(1);
949                        status.infobar = 0;
950                        status.infobaraktiv = 0;
951                        clearscreen(infobar);
952                        drawscreen(skin, 0, 0);
953                        switch(getconfigint("poweraktion", NULL))
954                        {
955                                case 1: //power off
956                                        oshutdown(1, 1);
957                                        break;
958                                case 2: //standby
959                                        status.standby = 1;
960                                        break;
961                                case 3: //restart
962                                        oshutdown(2, 1);
963                                        break;
964                                case 4: //Gui restart
965                                        oshutdown(3, 1);
966                                        break;
967                                default:
968                                        standbymenu = getscreen("standbymenu");
969                                        menu(standbymenu, 1);
970                                        break;
971                        }
972                        status.updatevfd = START;
973                        drawscreen(skin, 0, 0);
974                        status.infobaraktiv = 1;
975                        subtitlepause(0);
976                        continue;
977                }
978                if(rcret == getrcconfigint("rcfrontpower", NULL))
979                {
980                        subtitlepause(1);
981                        status.infobar = 0;
982                        status.infobaraktiv = 0;
983                        clearscreen(infobar);
984                        drawscreen(skin, 0, 0);
985                        switch(getconfigint("frontpoweraktion", NULL))
986                        {
987                                case 1: //power off
988                                        oshutdown(1, 1);
989                                        break;
990                                case 2: //standby
991                                        status.standby = 1;
992                                        break;
993                                case 3: //restart
994                                        oshutdown(2, 1);
995                                        break;
996                                case 4: //Gui restart
997                                        oshutdown(3, 1);
998                                        break;
999                                default:
1000                                        status.standby = 1;
1001                                        break;
1002                        }
1003                        status.updatevfd = START;
1004                        drawscreen(skin, 0, 0);
1005                        status.infobaraktiv = 1;
1006                        subtitlepause(0);
1007                        continue;
1008                }
1009                if(rcret == getrcconfigint("rcrecall", NULL) || rcret == getrcconfigint("rcexit", NULL))
1010                {
1011                        subtitlepause(1);
1012                        clearscreen(infobar);
1013                        drawscreen(skin, 0, 0);
1014                        screenchannelhistory();
1015                        infobartimeout = 0;
1016                        infobar = infobar1;
1017                        if(status.infobar == 0)
1018                                drawscreen(infobar, 0, 4);
1019                        else
1020                                drawscreen(infobar, 0, 0);
1021                        status.infobar = 1;
1022                        continue;
1023                }
1024                if(rcret == getrcconfigint("rc0", NULL))
1025                {
1026                        subtitlepause(1);
1027                        clearscreen(infobar);
1028                        drawscreen(skin, 0, 0);
1029                        if(status.lastservice->channel != NULL)
1030                        {
1031                                tmpstr = ostrcat(status.lastservice->channellist, NULL, 0, 0);
1032                                servicecheckret(servicestart(status.lastservice->channel, tmpstr, NULL, 0), 0);
1033                                free(tmpstr); tmpstr = NULL;
1034                        }
1035                        infobartimeout = 0;
1036                        infobar = infobar1;
1037                        if(status.infobar == 0)
1038                                drawscreen(infobar, 0, 4);
1039                        else
1040                                drawscreen(infobar, 0, 0);
1041                        status.infobar = 1;
1042                        continue;
1043                }
1044                if(rcret == getrcconfigint("rcchup", NULL) || (status.crosscontrol > 0 && status.play == 0 && status.pause == 0 && rcret == getrcconfigint("rcdown", NULL)))
1045                {
1046                        subtitlepause(1);
1047                        if(status.crosscontrol > 1 && status.virtualzap == 0 && rcret == getrcconfigint("rcdown", NULL))
1048                        {
1049                                status.virtualzap = status.crosscontrol - 1;
1050                                zapup();
1051                                status.virtualzap = 0;
1052                        }
1053                        else
1054                                zapup();
1055                        clearscreen(infobar);
1056                        drawscreen(skin, 0, 0);
1057                        if(status.pipzap == 0)
1058                        {       
1059                                infobartimeout = 0;
1060                                status.infobar = 2;
1061                        }
1062                        continue;
1063                }
1064                if(rcret == getrcconfigint("rcchdown", NULL) || (status.crosscontrol > 0 && status.play == 0 && status.pause == 0 && rcret == getrcconfigint("rcup", NULL)))
1065                {
1066                        subtitlepause(1);
1067                        if(status.crosscontrol > 1 && status.virtualzap == 0 && rcret == getrcconfigint("rcup", NULL))
1068                        {
1069                                status.virtualzap = status.crosscontrol - 1;
1070                                zapdown();
1071                                status.virtualzap = 0;
1072                        }
1073                        else
1074                                zapdown();
1075                        clearscreen(infobar);
1076                        drawscreen(skin, 0, 0);
1077                        if(status.pipzap == 0)
1078                        {       
1079                                infobartimeout = 0;
1080                                status.infobar = 2;
1081                        }
1082                        continue;
1083                }
1084                if(rcret == rcnumber(rcret))
1085                {
1086                        subtitlepause(1);
1087                        clearscreen(infobar);
1088                        screenchannelbynr(rcret);
1089                        status.infobar = 2;
1090                        continue;
1091                }
1092                //show infobar on program switch (only tv)
1093                if(status.infobarprogram == 1 && status.infobar == 0 && status.servicetype == 0)
1094                {
1095                        time_t akttime = time(NULL);
1096                        //show infobar only all 60 sec
1097                        if(lasttime < akttime)
1098                        {
1099                                struct epg* tmpepg = getepgakt(status.aktservice->channel);
1100                                if(tmpepg != NULL && akttime - 1 <= tmpepg->starttime && akttime + 1 >= tmpepg->starttime)
1101                                {
1102                                        lasttime = akttime + 10;
1103                                        infobartimeout = 0;
1104                                        subtitlepause(1);
1105                                        status.infobar = 1;
1106                                        infobar = infobar1;
1107                                        drawscreen(infobar, 0, 4);
1108                                        continue;
1109                                }
1110                        }
1111                }
1112                // pip atemio7600 ??
1113                if((rcret == getrcconfigint("rcpip", NULL) || rcret == getrcconfigint("rcpiprec", NULL)) && (checkchipset("BCM7424") == 1 || checkbox("ATEMIO6200") == 1 || checkbox("UFS922") == 1 || checkbox("UFS913") == 1 || checkbox("DM900") == 1))
1114                {
1115                        if(status.pipservice->videodev == NULL)
1116                        {
1117                                printf("---------> %i\n",rcret);
1118                                if(status.recording > 0 && rcret == getrcconfigint("rcpiprec", NULL))
1119                                {
1120                                        int i;
1121                                        for(i = 0; i < 9; i++)
1122                                        {
1123                                                if(status.recchnode[i] != NULL)
1124                                                {
1125                                                        pipchannel = status.recchnode[i];
1126                                                        break;
1127                                                }
1128                                        }
1129                                }
1130                                else if(rcret == getrcconfigint("rcpiprec", NULL))
1131                                        textbox(_("Message"), _("no record channel found"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 0, 0);
1132                                else   
1133                                        pipchannel = status.aktservice->channel;
1134                                printf("++++ RC: %i\n",pipstart(pipchannel, NULL, 0));
1135                                pipchannel = NULL;
1136                        }
1137                }
1138       
1139                if(rcret == getrcconfigint("rchdmi", NULL))
1140                {
1141                        char *value = NULL;
1142                        value = readsys("/proc/stb/hdmi-rx/0/hdmi_rx_monitor", 1);
1143                        if(value != NULL)
1144                        {
1145                                if(ostrstr(value, "off") != NULL)
1146                                {
1147                                        writesys("/proc/stb/video/videomode", "720p", 1);
1148                                        writesys("/proc/stb/audio/hdmi_rx_monitor", "on", 1);
1149                                        writesys("/proc/stb/hdmi-rx/0/hdmi_rx_monitor", "on", 1);
1150                                }
1151                                else
1152                                {
1153                                        writesys("/proc/stb/audio/hdmi_rx_monitor", "off", 1);
1154                                        writesys("/proc/stb/hdmi-rx/0/hdmi_rx_monitor", "off", 1);
1155                                        setvideomode(getconfig("av_videomode", NULL), 0);
1156                                }
1157                        }
1158                        free(value); value=NULL;
1159                }
1160               
1161                if(rcret == RCTIMEOUT && mark == 0)
1162                {
1163                        if(getconfigint("infobartimeout", NULL) > infobartimeout)
1164                        {
1165                                //clearscreen(infobar);
1166                                drawscreen(infobar, 0, 0);
1167                        }
1168                        else
1169                        {
1170                                clearscreen(infobar);
1171                                if(infobarm != infobar) {
1172                                        infobar = infobarm;
1173                                        clearscreen(infobar);
1174                                }
1175                                status.infobar = 0;
1176                                drawscreen(skin, 0, 0);
1177                                subtitlepause(0);
1178                        }
1179                }
1180        }
1181}
1182
1183#endif
Note: See TracBrowser for help on using the repository browser.