1 | #ifndef CHANNELBYNR_H |
---|
2 | #define CHANNELBYNR_H |
---|
3 | |
---|
4 | void 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); |
---|
12 | } |
---|
13 | |
---|
14 | void 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); |
---|
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 | bouquetnode = getbouquetbynr(atoi(channelbynr->text)); |
---|
57 | if(bouquetnode != NULL && bouquetnode->channel != NULL && bouquetnode->channel->servicetype == status.servicetype && channelnottunable(bouquetnode->channel) == 0) |
---|
58 | { |
---|
59 | clearscreen(channelbynr); |
---|
60 | drawscreen(skin, 0); |
---|
61 | |
---|
62 | mainbouquetnode = getmainbouquetbybouquetpointer(bouquetnode); |
---|
63 | if(mainbouquetnode != NULL) |
---|
64 | { |
---|
65 | tmpstr = ostrcat(tmpstr, "(BOUQUET)-", 0, 0); |
---|
66 | tmpstr = ostrcat(tmpstr, mainbouquetnode->name, 1, 0); |
---|
67 | } |
---|
68 | |
---|
69 | ret = servicestart(bouquetnode->channel, tmpstr, NULL, 0); |
---|
70 | servicecheckret(ret, 0); |
---|
71 | free(tmpstr); tmpstr = NULL; |
---|
72 | } |
---|
73 | break; |
---|
74 | } |
---|
75 | } |
---|
76 | |
---|
77 | changetext(channelbynr, NULL); |
---|
78 | delownerrc(channelbynr); |
---|
79 | clearscreen(channelbynr); |
---|
80 | status.channelswitch = 0; |
---|
81 | } |
---|
82 | |
---|
83 | #endif |
---|