source: titan/plugins/hbbtv/hbbtv.h @ 23348

Last change on this file since 23348 was 23348, checked in by nit, 11 years ago

fix

File size: 17.4 KB
Line 
1#ifndef OPERA_H
2#define OPERA_H
3
4struct hbbtvfav
5{
6        char* name;
7        char* addr;
8        struct hbbtvfav* next;
9};
10
11struct hbbtvfav *hbbtvfav = NULL;
12
13#define NAME "YWNATIVE"
14#define CONTROL_PIPE_W "/tmp/"NAME"_control_w"
15#define CONTROL_PIPE_R "/tmp/"NAME"_control_r"
16#define RC_TITAN "/tmp/rc_enigma2"
17
18extern struct skin* skin;
19
20void operareceivercb(char* cmd);
21
22int operarcsockfd = -1;
23int operarcconnfd = -1;
24int opera_control_r_fd = -1;
25int operarcthread_ok = 0;
26int operareceiverthread_ok = 0;
27//100 = live play
28//0 = pause
29//1 = play
30//2 = stop
31int operaservicestate = 100;
32char* operaplayurl = NULL;
33
34struct hbbtvfav* addhbbtvfav(char *line, int count, struct hbbtvfav* last)
35{
36        //debug(1000, "in");
37        struct hbbtvfav *newnode = NULL, *prev = NULL, *node = hbbtvfav;
38        int ret = 0;
39
40        newnode = (struct hbbtvfav*)calloc(1, sizeof(struct hbbtvfav));
41        if(newnode == NULL)
42        {
43                err("no memory");
44                return NULL;
45        }
46
47        newnode->name = malloc(1024);
48        if(newnode->name == NULL)
49        {
50                err("no mem");
51                free(newnode);
52                return NULL;
53        }
54
55        newnode->addr = malloc(1024);
56        if(newnode->addr == NULL)
57        {
58                err("no mem");
59                free(newnode->name);
60                free(newnode);
61                return NULL;
62        }
63
64        ret = sscanf(line, "%[^#]#%s", newnode->name, newnode->addr);
65        if(ret != 2)
66        {
67                if(count > 0)
68                {
69                        err("hbbtvfav line %d not ok", count);
70                }
71                else
72                {
73                        err("add hbbtvfav");
74                }
75                free(newnode->name);
76                free(newnode->addr);
77                free(newnode);
78                return NULL;
79        }
80
81        newnode->name = ostrshrink(newnode->name);
82        newnode->addr = ostrshrink(newnode->addr);
83
84        if(last == NULL)
85        {
86                while(node != NULL)
87                {
88                        prev = node;
89                        node = node->next;
90                }
91        }
92        else
93        {
94                prev = last;
95                node = last->next;
96        }
97
98        if(prev == NULL)
99                hbbtvfav = newnode;
100        else
101                prev->next = newnode;
102        newnode->next = node;
103
104        //debug(1000, "out");
105        return newnode;
106}
107
108int readhbbtvfav(const char* filename)
109{
110        debug(1000, "in");
111        FILE *fd = NULL;
112        char *fileline = NULL;
113        int linecount = 0, len = 0;
114        struct hbbtvfav* last = NULL, *tmplast = NULL;
115
116        fileline = malloc(MINMALLOC);
117        if(fileline == NULL)
118        {
119                err("no memory");
120                return 1;
121        }
122
123        fd = fopen(filename, "r");
124        if(fd == NULL)
125        {
126                perr("can't open %s", filename);
127                free(fileline);
128                return 1;
129        }
130
131        while(fgets(fileline, MINMALLOC, fd) != NULL)
132        {
133                if(fileline[0] == '#' || fileline[0] == '\n')
134                        continue;
135                len = strlen(fileline) - 1;
136                if(len >= 0 && fileline[len] == '\n')
137                        fileline[len] = '\0';
138                len--;
139                if(len >= 0 && fileline[len] == '\r')
140                        fileline[len] = '\0';
141
142                linecount++;
143
144                if(last == NULL) last = tmplast;
145                last = addhbbtvfav(fileline, linecount, last);
146                if(last != NULL) tmplast = last;
147        }
148
149        free(fileline);
150        fclose(fd);
151        return 0;
152}
153
154int delhbbtvfav(char* name)
155{
156        debug(1000, "in");
157        int ret = 1;
158        struct hbbtvfav *node = hbbtvfav, *prev = hbbtvfav;
159
160        while(node != NULL)
161        {
162                if(ostrcmp(node->name, name) == 0)
163                {
164                        if(node == hbbtvfav)
165                                hbbtvfav = node->next;
166                        else
167                                prev->next = node->next;
168
169                        free(node);
170                        node = NULL;
171                        ret = 0;
172                        break;
173                }
174
175                prev = node;
176                node = node->next;
177        }
178        debug(1000, "out");
179        return ret;
180}
181
182void freehbbtvfav()
183{
184        debug(1000, "in");
185        struct hbbtvfav *node = hbbtvfav, *prev = hbbtvfav;
186
187        while(node != NULL)
188        {
189                prev = node;
190                node = node->next;
191                if(prev != NULL)
192                        delhbbtvfav(prev->name);
193        }
194        debug(1000, "out");
195}
196
197void operarcthread()
198{
199        int ret = 0;
200
201        debug(788, "opera create rc socket");
202
203        ret = sockcreate(&operarcsockfd, RC_TITAN, 1);
204        if(ret != 0) return;
205
206        //closeonexec(operarcsockfd);
207
208        debug(788, "opera wait for rc accept");
209        operarcthread_ok = 1;
210        operarcconnfd = sockaccept(&operarcsockfd, 0);
211        debug(788, "opera got rc accept");
212}
213
214void operareceiverthread(struct stimerthread* self)
215{
216        int ret = 0, control_w_fd = -1;
217        fd_set rfds;
218        struct timeval tv;
219        unsigned char* buf = NULL;
220
221        if(self == NULL) return;
222
223        control_w_fd = open(CONTROL_PIPE_W, O_RDONLY);
224        if(control_w_fd < 0)
225        {
226                perr("open or create %s", CONTROL_PIPE_W);
227                return;
228        }
229
230        fcntl(control_w_fd, F_SETFL, fcntl(control_w_fd, F_GETFL) | O_NONBLOCK);
231        //closeonexec(control_w_fd);
232
233        buf = malloc(MINMALLOC);
234        if(buf == NULL)
235        {
236                close(control_w_fd);
237                err("no mem");
238                return;
239        }
240
241        debug(788, "opera receive thread start");
242
243        operareceiverthread_ok = 1;
244        while(self->aktion != STOP)
245        {
246                tv.tv_sec = 1;
247                tv.tv_usec = 0;
248                FD_ZERO(&rfds);
249                FD_SET(control_w_fd, &rfds);
250
251                ret = TEMP_FAILURE_RETRY(select(control_w_fd + 1, &rfds, NULL, NULL, &tv));
252
253                if(ret > 0)
254                {
255                        memset(buf, 0, MINMALLOC);
256                        unsigned char* pbuf = buf;
257                        while(pbuf - buf < MINMALLOC)
258                        {
259                                unsigned char c;
260
261                                ret = read(control_w_fd, &c, 1);
262                                if(ret == 1)
263                                {
264                                        if(c == '\n') break;
265                                        *pbuf = c;
266                                        pbuf++;
267                                }
268                        }
269                        if(pbuf != buf)
270                                operareceivercb((char*)buf);
271                }
272                else if(ret == 0) //timeout
273                        continue;
274                else //error
275                {
276                        perr("select failed");
277                        usleep(10000);
278                }
279         }
280
281         close(control_w_fd); control_w_fd = -1;
282         free(buf); buf = NULL;
283         debug(788, "opera receive thread end");
284}
285
286void operasendkey(char* rckey)
287{
288        if(operarcconnfd > -1 && rckey != NULL)
289                socksend(&operarcconnfd, (unsigned char*)rckey, strlen(rckey), -1);
290        else
291        {
292                err("no opera rc context sockfd=%d", operarcconnfd);
293        }
294}
295
296//flag 0: stop live tv and start play service
297//flag 1: stop play and start live service
298//flag 2: stop play
299int operaservice(char* url, int flag)
300{
301        char* tmpstr = NULL;
302
303        //stop live tv service and start play
304        if(flag == 0)
305        {
306                if(operaservicestate == 100)
307                {
308                        int ret = servicestop(status.aktservice, 1, 1);
309                        if(ret == 1) return 1;
310                }
311
312                free(operaplayurl); operaplayurl = NULL;
313                operaplayurl = ostrcat(url, NULL, 0, 0);
314                playerstop();
315                playerafterend();
316                playerstart(operaplayurl);
317                operaservicestate = 1;
318        }
319
320        //stop play and start live service
321        if(flag == 1 && operaservicestate != 100)
322        {
323                //stop player if running
324                playerstop();
325                playerafterend();
326                free(operaplayurl); operaplayurl = NULL;
327
328                if(status.aktservice->channel != NULL)
329                {
330                        tmpstr = ostrcat(status.aktservice->channellist, NULL, 0, 0);
331                        servicestart(status.aktservice->channel, tmpstr, NULL, 3);
332                }
333                else
334                {
335                        tmpstr = ostrcat(status.lastservice->channellist, NULL, 0, 0);
336                        servicestart(status.lastservice->channel, tmpstr, NULL, 0);
337                }
338                free(tmpstr); tmpstr = NULL;
339                operaservicestate = 100;
340        }
341
342        //stop play
343        if(flag == 2 && operaservicestate != 100)
344        {
345                playerstop();
346                playerafterend();
347                free(operaplayurl); operaplayurl = NULL;
348                operaservicestate = 2;
349        }
350
351        return 0;
352}
353
354void screenopera(char* url)
355{
356        int rcret = 0, i = 0;
357        char* tmpstr = NULL, *savedir = NULL, *dirbuf = NULL;;
358        struct stimerthread* operareceiver = NULL;
359        char* opera_root, *opera_bin = NULL, *opera_dir = NULL;
360        char* opera_home = NULL, *opera_fonts = NULL, *opera_widgets = NULL;
361
362        if(isdir("/var/titanplugins/hbbtv/opera"))
363                opera_root = ostrcat("/var/titanplugins/hbbtv/opera", NULL, 0, 0);
364        else if(isdir("/var/swap/titanplugins/hbbtv/opera"))
365                opera_root = ostrcat("/var/swap/titanplugins/hbbtv/opera", NULL, 0, 0);
366        else
367                opera_root = ostrcat("/mnt/swapextensions/titanplugins/hbbtv/opera", NULL, 0, 0);
368
369        opera_bin = ostrcat(opera_root, "/bin/opera", 0, 0);
370        opera_dir = ostrcat(opera_root, "/opera_dir", 0, 0);
371        opera_home = ostrcat(opera_root, "/opera_home/", 0, 0);
372        opera_fonts = ostrcat(opera_root, "/fonts", 0, 0);
373        opera_widgets = ostrcat(opera_root, "/widgets", 0, 0);
374
375        resettvpic();
376        drawscreen(skin, 0, 0);
377
378        debug(788, "step 1, set env");
379        //setenv("DFBARGS", "pixelformat=ARGB,no-cursor,bg-none,no-linux-input-grab,no-vt", 1);
380        setenv("OPERA_MULTITAP", "NO", 1);
381        setenv("OPERA_SHOW_STATUSWINDOW", "NO", 1);
382        setenv("OPERA_FB_BORDERWIDTH", "0", 1);
383        setenv("OPERA_SHOW_IMEWINDOW", "NO", 1);
384        setenv("OPERA_SHOW_NAVIGATIONWINDOW", "NO", 1);
385        setenv("OPERA_SHOW_MOUSEPOINTER", "NO", 1);
386        setenv("OPERA_SHOW_HIGHLIGHT", "NO", 1);
387        setenv("OPERA_ESC_EXIT", "YES", 1);
388        setenv("FREETYPE_FONT_SET", "YES", 1);
389        setenv("OPERA_ROOT", opera_root, 1);
390        setenv("OPERA_FB_SIZE", "1280x720", 1);
391        setenv("OPERA_DIR", opera_dir, 1);
392        setenv("OPERA_HOME", opera_home, 1);
393        setenv("OPERA_FONTS", opera_fonts, 1);
394        setenv("OPERA_WIDGETS", opera_widgets, 1);
395        setenv("LD_LIBRARY_PATH", opera_root, 1); // + ":" + os.environ["LD_LIBRARY_PATH"]
396
397        unlink(CONTROL_PIPE_W);
398        unlink(CONTROL_PIPE_R);
399        unlink(RC_TITAN);
400
401        mkfifo(CONTROL_PIPE_W, 0666);
402        mkfifo(CONTROL_PIPE_R, 0666);
403        //mkfifo(RC_TITAN, 0666);
404
405        debug(788, "step 2, start opera");
406        //writesys("/proc/cpu/alignment", "0", 0);
407
408        operarcthread_ok = 0;
409        operareceiverthread_ok = 0;
410        addtimer(&operarcthread, START, 10, 1, NULL, NULL, NULL);
411        operareceiver = addtimer(&operareceiverthread, START, 10, 1, NULL, NULL, NULL);
412
413        //wait for threads
414        int count = 0;
415        while(operarcthread_ok == 0 || operareceiverthread_ok == 0)
416        {
417                usleep(100000);
418                count++;
419                if(count > 20) break;
420        }
421
422        //save working dir
423        dirbuf = malloc(PATH_MAX);
424        if(dirbuf != NULL)
425        {
426                savedir = getcwd(dirbuf, PATH_MAX);
427                chdir(opera_root);
428        }
429
430        fbsave();
431
432        tmpstr = ostrcat(tmpstr, opera_bin, 1, 0);
433        tmpstr = ostrcat(tmpstr, " -u ", 1, 0);
434        tmpstr = ostrcat(tmpstr, url, 1, 0);
435        tmpstr = ostrcat(tmpstr, " --dfb:mode=1280x720,no-debug,no-vt,no-vt-switch &", 1, 0);
436        system(tmpstr);
437        free(tmpstr); tmpstr = NULL;
438
439        //free all opera vars
440        free(opera_root); opera_root = NULL;
441        free(opera_bin); opera_bin = NULL;
442        free(opera_dir); opera_dir = NULL;
443        free(opera_home); opera_home = NULL;
444        free(opera_fonts); opera_fonts = NULL;
445        free(opera_widgets); opera_widgets = NULL;
446
447        //reset working dir
448        if(savedir != NULL)
449                chdir(dirbuf);
450        free(dirbuf); dirbuf = NULL;
451
452        while(1)
453        {
454                rcret = waitrc(NULL, 1000, 0);
455
456                //check for player EOF
457                if(operaservicestate < 2 && !playerisplaying())
458                        operaservice(NULL, 1);
459
460                if(rcret == getrcconfigint("rchbbtv", NULL) || rcret == getrcconfigint("rcrecord", NULL))
461                {
462                        //operasendkey("ESC\n");
463                        break;
464                }
465                else if(rcret == getrcconfigint("rcexit", NULL))
466                        operasendkey("BACK\n");
467                else if(rcret == getrcconfigint("rcred", NULL))
468                        operasendkey("RED\n");
469                else if(rcret == getrcconfigint("rcgreen", NULL))
470                        operasendkey("GREEN\n");
471                else if(rcret == getrcconfigint("rcyellow", NULL))
472                        operasendkey("YELLOW\n");
473                else if(rcret == getrcconfigint("rcblue", NULL))
474                        operasendkey("BLUE\n");
475                else if(rcret == getrcconfigint("rcok", NULL))
476                {
477                        operasendkey("OK\n");
478                        operasendkey("ENTER\n");
479                }
480                else if(rcret == getrcconfigint("rcup", NULL))
481                        operasendkey("UP\n");
482                else if(rcret == getrcconfigint("rcdown", NULL))
483                        operasendkey("DOWN\n");
484                else if(rcret == getrcconfigint("rcleft", NULL))
485                        operasendkey("LEFT\n");
486                else if(rcret == getrcconfigint("rcright", NULL))
487                        operasendkey("RIGHT\n");
488                else if(rcret == getrcconfigint("rc1", NULL))
489                        operasendkey("1\n");
490                else if(rcret == getrcconfigint("rc2", NULL))
491                        operasendkey("2\n");
492                else if(rcret == getrcconfigint("rc3", NULL))
493                        operasendkey("3\n");
494                else if(rcret == getrcconfigint("rc4", NULL))
495                        operasendkey("4\n");
496                else if(rcret == getrcconfigint("rc5", NULL))
497                        operasendkey("5\n");
498                else if(rcret == getrcconfigint("rc6", NULL))
499                        operasendkey("6\n");
500                else if(rcret == getrcconfigint("rc7", NULL))
501                        operasendkey("7\n");
502                else if(rcret == getrcconfigint("rc8", NULL))
503                        operasendkey("8\n");
504                else if(rcret == getrcconfigint("rc9", NULL))
505                        operasendkey("9\n");
506                else if(rcret == getrcconfigint("rc0", NULL))
507                        operasendkey("0\n");
508        }
509
510        if(operareceiver != NULL)
511        {
512                operareceiver->aktion = STOP;
513                while(operareceiver != NULL && operareceiver->status != DEACTIVE)
514                {
515                        usleep(100000);
516                        i++; if(i > 20) break;
517                }
518
519                if(i > 20)
520                {
521                        err("detect hanging timer sub thread (operareceiver)");
522                }
523        }
524
525        sockclose(&operarcsockfd);
526        sockclose(&operarcconnfd);
527        close(opera_control_r_fd);
528
529        debug(788, "killall -9 opera");
530        tmpstr = ostrcat(tmpstr, "killall -9 opera", 1, 0);
531        system(tmpstr);
532        free(tmpstr); tmpstr = NULL;
533
534        free(operaplayurl); operaplayurl = NULL;
535
536        //writesys("/proc/cpu/alignment", "3", 0);
537
538        //setvideomode("720p50", 0);
539        //changefbresolution("720p50");
540        //sleep(3);
541        fbrestore();
542
543        operaservice(NULL, 1); //stop play, start live tv
544
545        //reset tv pic size
546        status.tvpic = 1;
547        resettvpic();
548        clearfball();
549}
550
551void operareceivercb(char* cmd)
552{
553        int count = 0;
554        char* tmpstr = NULL;
555        struct splitstr* ret = NULL;
556
557        debug(788, "cmd=%s", cmd);
558
559        tmpstr = ostrcat(cmd, NULL, 0, 0);
560        ret = strsplit(tmpstr, " ", &count);
561
562        if(ret != NULL && count > 0)
563        {
564                if(ostrcmp("HELLO", (&ret[0])->part) == 0)
565                {
566                        opera_control_r_fd = open(CONTROL_PIPE_R, O_WRONLY);
567                        if(opera_control_r_fd < 0)
568                        {
569                                perr("open or create "CONTROL_PIPE_R);
570                        }
571                }
572                else if(ostrcmp("AvSetWin", (&ret[0])->part) == 0)
573                {
574                        int x = 0, y = 0, w = 0, h = 0;
575                        float xw = 720.0 / 1280.0;
576                        float yh = 576.0 / 720.0;
577                        char* position = NULL;
578
579                        if(count > 1) x = atoi((&ret[1])->part) * xw;
580                        if(count > 2) y = atoi((&ret[2])->part) * yh;
581                        if(count > 3) w = atoi((&ret[3])->part) * xw;
582                        if(count > 4) h = atoi((&ret[4])->part) * yh;
583
584                        if(w == 0 && h == 0)
585                        {
586                                w = 720;
587                                h = 576;
588                        }
589
590                        position = ostrcat(position, oitoax(x), 1, 1);
591                        position = ostrcat(position, " ", 1, 0);
592                        position = ostrcat(position, oitoax(y), 1, 1);
593                        position = ostrcat(position, " ", 1, 0);
594                        position = ostrcat(position, oitoax(w), 1, 1);
595                        position = ostrcat(position, " ", 1, 0);
596                        position = ostrcat(position, oitoax(h), 1, 1);
597
598                        debug(788, "change tv pic to: %s", position);
599                        writesys("/proc/stb/vmpeg/0/dst_all", position, 0);
600                }
601                else if(ostrcmp("AvGetFullScreen", (&ret[0])->part) == 0)
602                {
603                        char* w = NULL, *h = NULL;
604
605                        w = readsys("/proc/stb/vmpeg/0/dst_width", 1);
606                        h = readsys("/proc/stb/vmpeg/0/dst_height", 1);
607
608                        if(ostrcmp(w, "2d0") == 0 && ostrcmp(h, "240") == 0)
609                                write(opera_control_r_fd, "AvGetFullScreen 1\n", 18);
610                        else
611                                write(opera_control_r_fd, "AvGetFullScreen 0\n", 18);
612
613                        free(w); w = NULL;
614                        free(h); h = NULL;
615                }
616                else if(ostrcmp("AvGetVisible", (&ret[0])->part) == 0)
617                {
618                        unsigned long val = readsysul("/proc/stb/video/alpha", 1);
619
620                        if(val == 0)
621                                write(opera_control_r_fd, "AvGetVisible 1\n", 15);
622                        else
623                                write(opera_control_r_fd, "AvGetVisible 0\n", 15);
624                }
625                /*
626                else if(ostrncmp("AvSetVisible", (&ret[0])->part) == 0)
627                {
628                        //if(count > 1 && ostrcmp("1", (&ret[1])->part) == 0)
629                        //{
630                        //      writesys("/proc/stb/video/alpha", "255", 0);
631                        //else
632                        //      writesys("/proc/stb/video/alpha", "0", 0);
633                        //}
634                }
635                */
636                else if(ostrcmp("AvPlay", (&ret[0])->part) == 0)
637                {
638                        if(count > 2)
639                        {
640                                if(ostrcmp("100", (&ret[2])->part) == 0) //play or continue
641                                {
642                                        if(ostrcmp(operaplayurl, (&ret[1])->part) != 0) //different url, so play
643                                        {
644                                                operaservice((&ret[1])->part, 0); //stop live tv and play
645                                        }
646                                        else
647                                        {
648                                                playercontinue();
649                                                operaservicestate = 1;
650                                        }
651                                }
652                                else if(ostrcmp("0", (&ret[2])->part) == 0) //pause
653                                {
654                                        playerpause();
655                                        operaservicestate = 0;
656                                }
657                        }
658                }
659                else if(ostrcmp("AvStop", (&ret[0])->part) == 0)
660                {
661                        operaservice(NULL, 2); //stop play
662                }
663                else if(ostrcmp("AvGetPos", (&ret[0])->part) == 0)
664                {
665                        char* tmppos = NULL;
666                        unsigned long pos = 0;
667
668                        pos = playergetpts() / 90000;
669
670                        tmppos = ostrcat(tmppos, "AvGetPos ", 1, 0);
671                        tmppos = ostrcat(tmppos, olutoa(pos), 1, 1);
672                        tmppos = ostrcat(tmppos, "\n", 1, 0);
673
674                        if(tmppos != NULL)
675                                write(opera_control_r_fd, tmppos, strlen(tmppos));
676
677                        free(tmppos); tmppos = NULL;
678                }
679                else if(ostrcmp("AvGetDuration", (&ret[0])->part) == 0)
680                {
681                        char* tmplen = NULL;
682                        unsigned long len = 0;
683
684                        len = playergetlength();
685
686                        tmplen = ostrcat(tmplen, "AvGetDuration ", 1, 0);
687                        tmplen = ostrcat(tmplen, olutoa(len), 1, 1);
688                        tmplen = ostrcat(tmplen, "\n", 1, 0);
689
690                        if(tmplen != NULL)
691                                write(opera_control_r_fd, tmplen, strlen(tmplen));
692
693                        free(tmplen); tmplen = NULL;
694                }
695                else if(ostrcmp("AvGetState", (&ret[0])->part) == 0)
696                {
697                        char* tmpstate = NULL;
698
699                        tmpstate = ostrcat(tmpstate, "AvGetState ", 1, 0);
700                        if(operaservicestate == 1)
701                                tmpstate = ostrcat(tmpstate, "1", 1, 0);
702                        else
703                                tmpstate = ostrcat(tmpstate, "0", 1, 0);
704                        tmpstate = ostrcat(tmpstate, "\n", 1, 0);
705
706                        if(tmpstate != NULL)
707                                write(opera_control_r_fd, tmpstate, strlen(tmpstate));
708
709                        free(tmpstate); tmpstate = NULL;
710                }
711                else if(ostrcmp("ReleaseHandle", (&ret[0])->part) == 0)
712                {
713                        if(count > 1 && ostrcmp("1", (&ret[1])->part) == 0) //VOD
714                        {
715                                operaservice(NULL, 1); //stop play, start live tv
716                        }
717                }
718        }
719
720        free(tmpstr); tmpstr = NULL;
721        free(ret); ret = NULL;
722}
723
724void screenoperafav()
725{
726        //int ret = 0;
727        struct menulist* mlist = NULL, *mbox = NULL, *tmpmbox = NULL;
728        struct hbbtvfav *node = NULL;
729
730        //ret = servicestop(status.aktservice, 1, 0);
731        //if(ret == 1) return;
732        //setfbtransparent(255);
733
734        readhbbtvfav(getconfig("hbbtvfavfile", NULL));
735        node = hbbtvfav;
736
737        if(status.aktservice->channel != NULL && status.aktservice->channel->hbbtvurl != NULL)
738        {
739                debug(788, "hbbtvurl=%s", status.aktservice->channel->hbbtvurl);
740                tmpmbox = addmenulist(&mlist, "Channel HBBTV", NULL, NULL, 0, 0);
741                if(tmpmbox != NULL)
742                        tmpmbox->param = ostrcat(status.aktservice->channel->hbbtvurl, NULL, 0, 0);
743        }
744
745        while(node != NULL)
746        {
747                tmpmbox = addmenulist(&mlist, node->name, NULL, NULL, 0, 0);
748                if(tmpmbox != NULL)
749                        tmpmbox->param = ostrcat(node->addr, NULL, 0, 0);
750
751                node = node->next;
752        }
753
754start:
755        drawscreen(skin, 0, 0);
756        mbox = menulistbox(mlist, "menulist", "HBBTV Favoriten", NULL, NULL, 0, 0);
757        if(mbox != NULL)
758        {
759                if(mbox->param != NULL)
760                {
761                        drawscreen(skin, 0, 0);
762                        screenopera(mbox->param);
763                }
764                goto start;
765        }
766
767        freemenulist(mlist, 1);
768        freehbbtvfav();
769        //setosdtransparent(getskinconfigint("osdtransparent", NULL));
770        //if(status.lastservice != NULL)
771        //      servicestart(status.lastservice->channel, NULL, NULL, 0);
772        //flushrc(500);
773}
774
775#endif
Note: See TracBrowser for help on using the repository browser.