source: titan/titan/infobar.h @ 33130

Last change on this file since 33130 was 32944, checked in by obi, 9 years ago

switch rcup / rcdown on crosscontrol

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