source: titan/titan/infobar.h @ 32310

Last change on this file since 32310 was 32310, checked in by tobayer, 8 years ago

[titan] add infobar selection, step 3, fix

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