source: titan/titan/channelbynr.h @ 40904

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

[titan] revert

File size: 2.5 KB
Line 
1#ifndef CHANNELBYNR_H
2#define CHANNELBYNR_H
3
4void setchannelkeycode(struct skin* channelbynr, char* value)
5{
6        char* tmpstr = NULL;
7
8        tmpstr = ostrcat(channelbynr->text, value, 0, 0);
9        changetext(channelbynr, tmpstr);
10        free(tmpstr); tmpstr = NULL;
11        drawscreen(channelbynr, 0, 0);
12}
13
14void screenchannelbynr(int rcret)
15{
16        struct skin* channelbynr = getscreen("channelbynr");
17        struct bouquet* bouquetnode = NULL;
18        struct mainbouquet* mainbouquetnode = NULL;
19        int count = 0, ret = 0;
20        char* tmpstr = NULL;
21       
22        status.channelswitch = 1;
23
24        status.rckey = rcret;
25        drawscreen(channelbynr, 0, 0);
26
27        while(1)
28        {
29                rcret = waitrc(channelbynr, 1000, 0);
30                count++;
31
32                if(rcret == getrcconfigint("rc0", NULL))
33                        setchannelkeycode(channelbynr, "0");
34                if(rcret == getrcconfigint("rc1", NULL))
35                        setchannelkeycode(channelbynr, "1");
36                if(rcret == getrcconfigint("rc2", NULL))
37                        setchannelkeycode(channelbynr, "2");
38                if(rcret == getrcconfigint("rc3", NULL))
39                        setchannelkeycode(channelbynr, "3");
40                if(rcret == getrcconfigint("rc4", NULL))
41                        setchannelkeycode(channelbynr, "4");
42                if(rcret == getrcconfigint("rc5", NULL))
43                        setchannelkeycode(channelbynr, "5");
44                if(rcret == getrcconfigint("rc6", NULL))
45                        setchannelkeycode(channelbynr, "6");
46                if(rcret == getrcconfigint("rc7", NULL))
47                        setchannelkeycode(channelbynr, "7");
48                if(rcret == getrcconfigint("rc8", NULL))
49                        setchannelkeycode(channelbynr, "8");
50                if(rcret == getrcconfigint("rc9", NULL))
51                        setchannelkeycode(channelbynr, "9");
52                if(rcret == getrcconfigint("rcexit", NULL)) break;
53                if(rcret == RCTIMEOUT || count > 5 || rcret == getrcconfigint("rcok", NULL))
54                {
55                        if(channelbynr->text != NULL)
56                        {
57                                if(ostrcmp(channelbynr->text, "9898") == 0)
58                                {
59                                        screenhwtest();
60                                        break;
61                                }
62                                bouquetnode = getbouquetbynr(atoi(channelbynr->text));
63                        }
64                        if(bouquetnode != NULL && bouquetnode->channel != NULL && bouquetnode->channel->servicetype == status.servicetype && channelnottunable(bouquetnode->channel) == 0)
65                        {
66                                clearscreen(channelbynr);
67                                drawscreen(skin, 0, 0);
68
69                                mainbouquetnode = getmainbouquetbybouquetpointer(bouquetnode);
70                                if(mainbouquetnode != NULL)
71                                {
72                                        tmpstr = ostrcat(tmpstr, "(BOUQUET)-", 0, 0);
73                                        tmpstr = ostrcat(tmpstr, mainbouquetnode->name, 1, 0);
74                                }
75
76                                ret = servicestart(bouquetnode->channel, tmpstr, NULL, 0);
77                                servicecheckret(ret, 0);
78                                free(tmpstr); tmpstr = NULL;
79                        }
80                        break;
81                }
82        }
83
84        changetext(channelbynr, NULL);
85        delownerrc(channelbynr);
86        clearscreen(channelbynr);
87        status.channelswitch = 0;
88}
89
90#endif
Note: See TracBrowser for help on using the repository browser.