1 | #ifndef MULTIEPG_H |
---|
2 | #define MULTIEPG_H |
---|
3 | |
---|
4 | #define TEXTPOSEPG 250 |
---|
5 | |
---|
6 | struct epg* readepgdesc(struct channel* curchannel, int epgnr) |
---|
7 | { |
---|
8 | int i = 0; |
---|
9 | struct epg* epgnode = NULL; |
---|
10 | |
---|
11 | epgnode = getepgakt(curchannel); |
---|
12 | if(epgnode == NULL) epgnode = getepgnext(curchannel); |
---|
13 | |
---|
14 | while(epgnode != NULL){ |
---|
15 | if(i >= epgnr) break; |
---|
16 | epgnode = epgnode->next; |
---|
17 | i++; |
---|
18 | } |
---|
19 | return epgnode; |
---|
20 | } |
---|
21 | |
---|
22 | int selectchannelmepg(struct skin* listbox) |
---|
23 | { |
---|
24 | struct skin* node = listbox; |
---|
25 | struct channel* chnode = NULL; |
---|
26 | listbox->aktpage = -1; |
---|
27 | listbox->aktline = 1; |
---|
28 | |
---|
29 | listbox->select = NULL; |
---|
30 | |
---|
31 | if(status.servicetype == 0) |
---|
32 | chnode = getchannel(getconfigint("serviceid", NULL), getconfigllu("transponderid", NULL)); |
---|
33 | else |
---|
34 | chnode = getchannel(getconfigint("rserviceid", NULL), getconfigllu("rtransponderid", NULL)); |
---|
35 | |
---|
36 | if(chnode == NULL) |
---|
37 | { |
---|
38 | err("NULL detect"); |
---|
39 | return 1; |
---|
40 | } |
---|
41 | |
---|
42 | while(node != NULL) |
---|
43 | { |
---|
44 | if(node->deaktivcol > -1) |
---|
45 | { |
---|
46 | node = node->next; |
---|
47 | continue; |
---|
48 | } |
---|
49 | if(chnode == (struct channel*) node->handle) |
---|
50 | return 0; |
---|
51 | |
---|
52 | if(node->del == 1) listbox->aktline++; |
---|
53 | node = node->next; |
---|
54 | } |
---|
55 | listbox->aktline = 1; |
---|
56 | return 1; |
---|
57 | } |
---|
58 | |
---|
59 | int showallmepgchannel(struct skin* multiepg, struct skin* listbox, int epgnr) |
---|
60 | { |
---|
61 | int treffer = 0; |
---|
62 | struct skin* chnode = NULL; |
---|
63 | struct channel* tmpchannel = channel; |
---|
64 | struct epg* epgnode = NULL; |
---|
65 | struct tm *loctime = NULL; |
---|
66 | char* tmpstr = NULL, *buf = NULL; |
---|
67 | |
---|
68 | if(multiepg != NULL) |
---|
69 | delmarkedscreennodes(multiepg, 1); |
---|
70 | |
---|
71 | buf = malloc(MINMALLOC); |
---|
72 | if(buf == NULL) |
---|
73 | { |
---|
74 | err("no mem"); |
---|
75 | return 1; |
---|
76 | } |
---|
77 | |
---|
78 | while(tmpchannel != NULL) |
---|
79 | { |
---|
80 | if(tmpchannel->servicetype == status.servicetype) |
---|
81 | { |
---|
82 | chnode = addlistbox(multiepg, listbox, chnode, 1); |
---|
83 | if(chnode != NULL) |
---|
84 | { |
---|
85 | changetext(chnode, tmpchannel->name); |
---|
86 | |
---|
87 | epgnode = readepgdesc(tmpchannel, epgnr); |
---|
88 | if(epgnode != NULL) |
---|
89 | { |
---|
90 | treffer = 1; |
---|
91 | |
---|
92 | chnode->type = MULTIPROGRESSBAR; |
---|
93 | chnode->progresscol = listbox->progresscol; |
---|
94 | chnode->epgrecord = getepgrecord(tmpchannel, epgnode); |
---|
95 | |
---|
96 | loctime = localtime(&epgnode->starttime); |
---|
97 | ostrftime(buf, MINMALLOC, listbox->param1, loctime); |
---|
98 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
99 | loctime = localtime(&epgnode->endtime); |
---|
100 | ostrftime(buf, MINMALLOC, listbox->param2, loctime); |
---|
101 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
102 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
103 | tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0); |
---|
104 | changetext2(chnode, tmpstr); |
---|
105 | free(tmpstr); tmpstr = NULL; |
---|
106 | chnode->textposx2 = TEXTPOSEPG; |
---|
107 | chnode->handle1 = (char*) epgnode; |
---|
108 | } |
---|
109 | |
---|
110 | chnode->handle = (char*) tmpchannel; |
---|
111 | //if(channelnottunable(tmpchannel) == 1) |
---|
112 | // chnode->deaktivcol = convertcol("deaktivcol"); |
---|
113 | } |
---|
114 | } |
---|
115 | tmpchannel = tmpchannel->next; |
---|
116 | } |
---|
117 | free(buf); |
---|
118 | return treffer; |
---|
119 | } |
---|
120 | |
---|
121 | int showbouquetmepgchannel(struct skin* multiepg, struct skin* listbox, struct bouquet* firstbouquet, struct mainbouquet* mbouquet, int epgnr) |
---|
122 | { |
---|
123 | int treffer = 0; |
---|
124 | struct skin* chnode = NULL; |
---|
125 | struct bouquet* tmpbouquet = firstbouquet; |
---|
126 | struct epg* epgnode = NULL; |
---|
127 | struct tm *loctime = NULL; |
---|
128 | char* tmpstr = NULL, *tmpnr = NULL, *buf = NULL; |
---|
129 | |
---|
130 | if(multiepg != NULL) |
---|
131 | delmarkedscreennodes(multiepg, 1); |
---|
132 | |
---|
133 | buf = malloc(MINMALLOC); |
---|
134 | if(buf == NULL) |
---|
135 | { |
---|
136 | err("no mem"); |
---|
137 | return 1; |
---|
138 | } |
---|
139 | |
---|
140 | if(mbouquet != NULL && ostrcmp(mbouquet->filename, "0") == 0) |
---|
141 | { |
---|
142 | mostzaptobouquet(mbouquet); |
---|
143 | tmpbouquet = mbouquet->bouquet; |
---|
144 | } |
---|
145 | |
---|
146 | while(tmpbouquet != NULL) |
---|
147 | { |
---|
148 | if(tmpbouquet->channel != NULL) |
---|
149 | { |
---|
150 | if(tmpbouquet->channel->servicetype == status.servicetype) |
---|
151 | { |
---|
152 | chnode = addlistbox(multiepg, listbox, chnode, 1); |
---|
153 | if(chnode != NULL) |
---|
154 | { |
---|
155 | tmpnr = oitoa(tmpbouquet->nr); |
---|
156 | changeret(chnode, tmpnr); |
---|
157 | tmpstr = ostrcat(tmpstr, tmpnr, 1, 1); |
---|
158 | tmpstr = ostrcat(tmpstr, " ", 1, 0); |
---|
159 | tmpstr = ostrcat(tmpstr, tmpbouquet->channel->name, 1, 0); |
---|
160 | changetext(chnode, tmpstr); |
---|
161 | free(tmpstr); tmpstr = NULL; |
---|
162 | |
---|
163 | epgnode = readepgdesc(tmpbouquet->channel, epgnr); |
---|
164 | if(epgnode != NULL) |
---|
165 | { |
---|
166 | treffer = 1; |
---|
167 | |
---|
168 | chnode->type = MULTIPROGRESSBAR; |
---|
169 | chnode->progresscol = listbox->progresscol; |
---|
170 | chnode->epgrecord = getepgrecord(tmpbouquet->channel, epgnode); |
---|
171 | |
---|
172 | loctime = localtime(&epgnode->starttime); |
---|
173 | ostrftime(buf, MINMALLOC, listbox->param1, loctime); |
---|
174 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
175 | |
---|
176 | loctime = localtime(&epgnode->endtime); |
---|
177 | ostrftime(buf, MINMALLOC, listbox->param2, loctime); |
---|
178 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
179 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
180 | tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0); |
---|
181 | changetext2(chnode, tmpstr); |
---|
182 | free(tmpstr); tmpstr = NULL; |
---|
183 | chnode->textposx2 = TEXTPOSEPG; |
---|
184 | chnode->handle1 = (char*) epgnode; |
---|
185 | } |
---|
186 | chnode->handle = (char*) tmpbouquet->channel; |
---|
187 | //if(channelnottunable(tmpbouquet->channel) == 1) |
---|
188 | // chnode->deaktivcol = convertcol("deaktivcol"); |
---|
189 | } |
---|
190 | } |
---|
191 | } |
---|
192 | tmpbouquet = tmpbouquet->next; |
---|
193 | } |
---|
194 | free(buf); |
---|
195 | return treffer; |
---|
196 | } |
---|
197 | |
---|
198 | int showprovidermepgchannel(struct skin* multiepg, struct skin* listbox, struct provider* providernode, int epgnr) |
---|
199 | { |
---|
200 | int treffer = 0; |
---|
201 | struct skin* chnode = NULL; |
---|
202 | struct channel* tmpchannel = channel; |
---|
203 | struct epg* epgnode = NULL; |
---|
204 | struct tm *loctime = NULL; |
---|
205 | char* tmpstr = NULL, *buf = NULL; |
---|
206 | |
---|
207 | if(multiepg != NULL) |
---|
208 | delmarkedscreennodes(multiepg, 1); |
---|
209 | |
---|
210 | buf = malloc(MINMALLOC); |
---|
211 | if(buf == NULL) |
---|
212 | { |
---|
213 | err("no mem"); |
---|
214 | return 1; |
---|
215 | } |
---|
216 | |
---|
217 | while(tmpchannel != NULL) |
---|
218 | { |
---|
219 | if(tmpchannel->provider == providernode) |
---|
220 | { |
---|
221 | if(tmpchannel->servicetype == status.servicetype) |
---|
222 | { |
---|
223 | chnode = addlistbox(multiepg, listbox, chnode, 1); |
---|
224 | if(chnode != NULL) |
---|
225 | { |
---|
226 | changetext(chnode, tmpchannel->name); |
---|
227 | |
---|
228 | epgnode = readepgdesc(tmpchannel, epgnr); |
---|
229 | if(epgnode != NULL) |
---|
230 | { |
---|
231 | treffer = 1; |
---|
232 | |
---|
233 | chnode->type = MULTIPROGRESSBAR; |
---|
234 | chnode->progresscol = listbox->progresscol; |
---|
235 | chnode->epgrecord = getepgrecord(tmpchannel, epgnode); |
---|
236 | |
---|
237 | loctime = localtime(&epgnode->starttime); |
---|
238 | ostrftime(buf, MINMALLOC, listbox->param1, loctime); |
---|
239 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
240 | loctime = localtime(&epgnode->endtime); |
---|
241 | ostrftime(buf, MINMALLOC, listbox->param2, loctime); |
---|
242 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
243 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
244 | tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0); |
---|
245 | changetext2(chnode, tmpstr); |
---|
246 | free(tmpstr); tmpstr = NULL; |
---|
247 | chnode->textposx2 = TEXTPOSEPG; |
---|
248 | chnode->handle1 = (char*) epgnode; |
---|
249 | } |
---|
250 | chnode->handle = (char*) tmpchannel; |
---|
251 | //if(channelnottunable(tmpchannel) == 1) |
---|
252 | // chnode->deaktivcol = convertcol("deaktivcol"); |
---|
253 | } |
---|
254 | } |
---|
255 | } |
---|
256 | tmpchannel = tmpchannel->next; |
---|
257 | } |
---|
258 | free(buf); |
---|
259 | return treffer; |
---|
260 | } |
---|
261 | |
---|
262 | int showsatmepgchannel(struct skin* multiepg, struct skin* listbox, struct sat* satnode, int epgnr) |
---|
263 | { |
---|
264 | int treffer = 0; |
---|
265 | struct skin* chnode = NULL; |
---|
266 | struct channel* tmpchannel = channel; |
---|
267 | struct epg* epgnode = NULL; |
---|
268 | struct tm *loctime = NULL; |
---|
269 | char* tmpstr = NULL, *buf = NULL; |
---|
270 | |
---|
271 | if(satnode == NULL) |
---|
272 | return 1; |
---|
273 | |
---|
274 | if(multiepg != NULL) |
---|
275 | delmarkedscreennodes(multiepg, 1); |
---|
276 | |
---|
277 | buf = malloc(MINMALLOC); |
---|
278 | if(buf == NULL) |
---|
279 | { |
---|
280 | err("no mem"); |
---|
281 | return 1; |
---|
282 | } |
---|
283 | |
---|
284 | while(tmpchannel != NULL) |
---|
285 | { |
---|
286 | if(tmpchannel->transponder != NULL && tmpchannel->transponder->orbitalpos == satnode->orbitalpos) |
---|
287 | { |
---|
288 | if(tmpchannel->servicetype == status.servicetype) |
---|
289 | { |
---|
290 | chnode = addlistbox(multiepg, listbox, chnode, 1); |
---|
291 | if(chnode != NULL) |
---|
292 | { |
---|
293 | changetext(chnode, tmpchannel->name); |
---|
294 | |
---|
295 | epgnode = readepgdesc(tmpchannel, epgnr); |
---|
296 | if(epgnode != NULL) |
---|
297 | { |
---|
298 | treffer = 1; |
---|
299 | |
---|
300 | chnode->type = MULTIPROGRESSBAR; |
---|
301 | chnode->progresscol = listbox->progresscol; |
---|
302 | chnode->epgrecord = getepgrecord(tmpchannel, epgnode); |
---|
303 | |
---|
304 | loctime = localtime(&epgnode->starttime); |
---|
305 | ostrftime(buf, MINMALLOC, listbox->param1, loctime); |
---|
306 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
307 | loctime = localtime(&epgnode->endtime); |
---|
308 | ostrftime(buf, MINMALLOC, listbox->param2, loctime); |
---|
309 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
310 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
311 | tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0); |
---|
312 | changetext2(chnode, tmpstr); |
---|
313 | free(tmpstr); tmpstr = NULL; |
---|
314 | chnode->textposx2 = TEXTPOSEPG; |
---|
315 | chnode->handle1 = (char*) epgnode; |
---|
316 | } |
---|
317 | chnode->handle = (char*) tmpchannel; |
---|
318 | //if(channelnottunable(tmpchannel) == 1) |
---|
319 | // chnode->deaktivcol = convertcol("deaktivcol"); |
---|
320 | } |
---|
321 | } |
---|
322 | } |
---|
323 | tmpchannel = tmpchannel->next; |
---|
324 | } |
---|
325 | free(buf); |
---|
326 | return treffer; |
---|
327 | } |
---|
328 | |
---|
329 | int showazmepgchannel(struct skin* multiepg, struct skin* listbox, int character, int epgnr) |
---|
330 | { |
---|
331 | int treffer = 0; |
---|
332 | struct skin* chnode = NULL; |
---|
333 | struct channel* tmpchannel = channel; |
---|
334 | struct epg* epgnode = NULL; |
---|
335 | struct tm *loctime = NULL; |
---|
336 | char* tmpstr = NULL, *buf = NULL; |
---|
337 | |
---|
338 | if(multiepg != NULL) |
---|
339 | delmarkedscreennodes(multiepg, 1); |
---|
340 | |
---|
341 | buf = malloc(MINMALLOC); |
---|
342 | if(buf == NULL) |
---|
343 | { |
---|
344 | err("no mem"); |
---|
345 | return 1; |
---|
346 | } |
---|
347 | |
---|
348 | while(tmpchannel != NULL) |
---|
349 | { |
---|
350 | if(tmpchannel->name != NULL && (tmpchannel->name[0] == character || tmpchannel->name[0] == character + 32)) |
---|
351 | { |
---|
352 | if(tmpchannel->servicetype == status.servicetype) |
---|
353 | { |
---|
354 | chnode = addlistbox(multiepg, listbox, chnode, 1); |
---|
355 | if(chnode != NULL) |
---|
356 | { |
---|
357 | changetext(chnode, tmpchannel->name); |
---|
358 | epgnode = readepgdesc(tmpchannel, epgnr); |
---|
359 | if(epgnode != NULL) |
---|
360 | { |
---|
361 | treffer = 1; |
---|
362 | |
---|
363 | chnode->type = MULTIPROGRESSBAR; |
---|
364 | chnode->progresscol = listbox->progresscol; |
---|
365 | chnode->epgrecord = getepgrecord(tmpchannel, epgnode); |
---|
366 | |
---|
367 | loctime = localtime(&epgnode->starttime); |
---|
368 | ostrftime(buf, MINMALLOC, listbox->param1, loctime); |
---|
369 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
370 | loctime = localtime(&epgnode->endtime); |
---|
371 | ostrftime(buf, MINMALLOC, listbox->param2, loctime); |
---|
372 | tmpstr = ostrcat(tmpstr, buf, 1, 0); |
---|
373 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
374 | tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0); |
---|
375 | changetext2(chnode, tmpstr); |
---|
376 | free(tmpstr); tmpstr = NULL; |
---|
377 | chnode->textposx2 = TEXTPOSEPG; |
---|
378 | chnode->handle1 = (char*) epgnode; |
---|
379 | } |
---|
380 | chnode->handle = (char*) tmpchannel; |
---|
381 | //if(channelnottunable(tmpchannel) == 1) |
---|
382 | // chnode->deaktivcol = convertcol("deaktivcol"); |
---|
383 | } |
---|
384 | } |
---|
385 | } |
---|
386 | tmpchannel = tmpchannel->next; |
---|
387 | } |
---|
388 | free(buf); |
---|
389 | return treffer; |
---|
390 | } |
---|
391 | |
---|
392 | void drawchannellistmepg(struct skin* multiepg, int list, struct skin* listbox) |
---|
393 | { |
---|
394 | status.markedchannel = NULL; |
---|
395 | |
---|
396 | if(list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) |
---|
397 | { |
---|
398 | if(listbox->select == NULL) |
---|
399 | drawscreen(multiepg, 2, 0); |
---|
400 | |
---|
401 | if(listbox->select != NULL) |
---|
402 | status.markedchannel = (struct channel*)listbox->select->handle; |
---|
403 | } |
---|
404 | drawscreen(multiepg, 0, 0); |
---|
405 | } |
---|
406 | |
---|
407 | int screenmultiepg(struct channel* chnode, struct epg* epgnode, int flag) |
---|
408 | { |
---|
409 | int rcret = 0, ret = 0, epgscreenconf = 0, end = 0; |
---|
410 | struct skin* multiepg = getscreen("multiepg"); |
---|
411 | struct skin* listbox = getscreennode(multiepg, "listbox"); |
---|
412 | struct skin* b2 = getscreennode(multiepg, "b2"); |
---|
413 | struct skin* b3 = getscreennode(multiepg, "b3"); |
---|
414 | struct skin* b4 = getscreennode(multiepg, "b4"); |
---|
415 | |
---|
416 | int list = ALLCHANNEL; |
---|
417 | char* tmpstr = NULL, *tmpstr1 = NULL; |
---|
418 | void* aktlist = NULL; |
---|
419 | int epgnr = 0; |
---|
420 | int character = 0; |
---|
421 | struct sat* satnode = NULL; |
---|
422 | struct provider* providernode = NULL; |
---|
423 | int nochanneltitle = getskinconfigint("nochanneltitle", NULL); |
---|
424 | |
---|
425 | epgscreenconf = getconfigint("epg_screen", NULL); |
---|
426 | |
---|
427 | if(status.servicetype == 0) |
---|
428 | tmpstr = getconfig("channellist", NULL); |
---|
429 | else |
---|
430 | tmpstr = getconfig("rchannellist", NULL); |
---|
431 | if(ostrncmp("(BOUQUET)-", tmpstr, 10) == 0 && strlen(tmpstr) > 10) |
---|
432 | { |
---|
433 | struct mainbouquet* mainbouquetnode = NULL; |
---|
434 | mainbouquetnode = getmainbouquet(tmpstr + 10); |
---|
435 | if(mainbouquetnode != NULL && mainbouquetnode->bouquet != NULL) |
---|
436 | { |
---|
437 | tmpstr1 = ostrcat(tmpstr1, _("MULTI EPG - Bouquets"), 0, 0); |
---|
438 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
439 | tmpstr1 = ostrcat(tmpstr1, tmpstr + 10, 1, 0); |
---|
440 | if(nochanneltitle == 0) changetitle(multiepg, tmpstr1); |
---|
441 | free(tmpstr1); tmpstr1 = NULL; |
---|
442 | list = BOUQUETCHANNEL; |
---|
443 | aktlist = (void*)mainbouquetnode; |
---|
444 | showbouquetmepgchannel(multiepg, listbox, mainbouquetnode->bouquet, mainbouquetnode, epgnr); |
---|
445 | selectchannelmepg(listbox); |
---|
446 | } |
---|
447 | } |
---|
448 | else if(ostrncmp("(A-Z)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6) |
---|
449 | { |
---|
450 | tmpstr1 = ostrcat(tmpstr1, _("MULTI EPG - Channel"), 0, 0); |
---|
451 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
452 | tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0); |
---|
453 | if(nochanneltitle == 0) changetitle(multiepg, tmpstr1); |
---|
454 | free(tmpstr1); tmpstr1 = NULL; |
---|
455 | list = AZCHANNEL; |
---|
456 | character = (int)tmpstr[6]; |
---|
457 | aktlist = (void*)(int)tmpstr[6]; |
---|
458 | showazmepgchannel(multiepg, listbox, character, epgnr); |
---|
459 | selectchannelmepg(listbox); |
---|
460 | } |
---|
461 | else if(ostrncmp("(SAT)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6) |
---|
462 | { |
---|
463 | tmpstr1 = ostrcat(tmpstr1, _("MULTI EPG - Satellites"), 0, 0); |
---|
464 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
465 | tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0); |
---|
466 | if(nochanneltitle == 0) changetitle(multiepg, tmpstr1); |
---|
467 | free(tmpstr1); tmpstr1 = NULL; |
---|
468 | satnode = getsat(tmpstr + 6); |
---|
469 | list = SATCHANNEL; |
---|
470 | aktlist = (void*)satnode; |
---|
471 | showsatmepgchannel(multiepg, listbox, satnode, epgnr); |
---|
472 | selectchannelmepg(listbox); |
---|
473 | } |
---|
474 | else if(ostrncmp("(PROVIDER)-", tmpstr, 11) == 0 && strlen(tmpstr) > 6) |
---|
475 | { |
---|
476 | tmpstr1 = ostrcat(tmpstr1, _("MULTI EPG - Provider"), 0, 0); |
---|
477 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
478 | tmpstr1 = ostrcat(tmpstr1, tmpstr + 11, 1, 0); |
---|
479 | if(nochanneltitle == 0) changetitle(multiepg, tmpstr1); |
---|
480 | free(tmpstr1); tmpstr1 = NULL; |
---|
481 | providernode = getproviderbyname(tmpstr + 11); |
---|
482 | list = PROVIDERCHANNEL; |
---|
483 | aktlist = (void*)providernode; |
---|
484 | showprovidermepgchannel(multiepg, listbox, providernode, epgnr); |
---|
485 | selectchannelmepg(listbox); |
---|
486 | } |
---|
487 | else |
---|
488 | { |
---|
489 | if(nochanneltitle == 0) changetitle(multiepg, _("MULTI EPG - All Channels")); |
---|
490 | list = ALLCHANNEL; |
---|
491 | showallmepgchannel(multiepg, listbox, epgnr); |
---|
492 | selectchannelmepg(listbox); |
---|
493 | } |
---|
494 | |
---|
495 | if(flag == 0 && epgscreenconf == 2) |
---|
496 | { |
---|
497 | b2->hidden = NO; |
---|
498 | b3->hidden = NO; |
---|
499 | b4->hidden = NO; |
---|
500 | } |
---|
501 | else |
---|
502 | { |
---|
503 | b2->hidden = YES; |
---|
504 | b3->hidden = YES; |
---|
505 | b4->hidden = YES; |
---|
506 | } |
---|
507 | |
---|
508 | tmpstr = NULL; |
---|
509 | drawscreen(multiepg, 2, 0); |
---|
510 | addscreenrc(multiepg, listbox); |
---|
511 | delrc(getrcconfigint("rcchup", NULL), multiepg, listbox); |
---|
512 | delrc(getrcconfigint("rcchdown", NULL), multiepg, listbox); |
---|
513 | |
---|
514 | drawchannellistmepg(multiepg, list, listbox); |
---|
515 | |
---|
516 | while(1) |
---|
517 | { |
---|
518 | rcret = waitrc(multiepg, 0, 2); |
---|
519 | |
---|
520 | if((rcret == getrcconfigint("rcexit", NULL)) || (rcret == getrcconfigint("rcepg", NULL))) break; |
---|
521 | //if(rcret == getrcconfigint("rcinfo", NULL)) break; |
---|
522 | if(rcret == getrcconfigint("rcok", NULL)) |
---|
523 | { |
---|
524 | if(channelnottunable((struct channel*)listbox->select->handle) == 0) |
---|
525 | { |
---|
526 | int ret = 0; |
---|
527 | if(status.servicetype == 0) |
---|
528 | ret = servicestart((struct channel*)listbox->select->handle, getconfig("channellist", NULL), NULL, 0); |
---|
529 | else |
---|
530 | ret = servicestart((struct channel*)listbox->select->handle, getconfig("rchannellist", NULL), NULL, 0); |
---|
531 | if(ret == 20) writeconfigtmp(); |
---|
532 | servicecheckret(ret, 0); |
---|
533 | break; |
---|
534 | } |
---|
535 | } |
---|
536 | if(rcret == getrcconfigint("rcinfo", NULL)) |
---|
537 | { |
---|
538 | if(listbox->select != NULL) |
---|
539 | { |
---|
540 | clearscreen(multiepg); |
---|
541 | end = screenepg((struct channel*)listbox->select->handle, (struct epg*)listbox->select->handle1, 1); |
---|
542 | if(end == 1) |
---|
543 | break; |
---|
544 | else |
---|
545 | drawscreen(multiepg, 0, 0); |
---|
546 | } |
---|
547 | } |
---|
548 | |
---|
549 | if(flag == 0 && epgscreenconf == 2 && rcret == getrcconfigint("rcgreen", NULL)) |
---|
550 | { |
---|
551 | if(listbox->select != NULL) |
---|
552 | { |
---|
553 | clearscreen(multiepg); |
---|
554 | end = screenepg((struct channel*)listbox->select->handle, (struct epg*)listbox->select->handle1, 0); |
---|
555 | //drawscreen(multiepg, 0, 0); |
---|
556 | break; |
---|
557 | } |
---|
558 | } |
---|
559 | if(flag == 0 && epgscreenconf == 2 && rcret == getrcconfigint("rcyellow", NULL)) |
---|
560 | { |
---|
561 | if(listbox->select != NULL) |
---|
562 | { |
---|
563 | clearscreen(multiepg); |
---|
564 | end = screensingleepg((struct channel*)listbox->select->handle, NULL, 0); |
---|
565 | //drawscreen(multiepg, 0, 0); |
---|
566 | break; |
---|
567 | } |
---|
568 | } |
---|
569 | if(flag == 0 && epgscreenconf == 2 && rcret == getrcconfigint("rcblue", NULL)) |
---|
570 | { |
---|
571 | if(listbox->select != NULL) |
---|
572 | { |
---|
573 | clearscreen(multiepg); |
---|
574 | end = screengmultiepg((struct channel*)listbox->select->handle, NULL, 0); |
---|
575 | //drawscreen(multiepg, 0, 0); |
---|
576 | break; |
---|
577 | } |
---|
578 | } |
---|
579 | if(rcret == getrcconfigint("rc0", NULL)) |
---|
580 | { |
---|
581 | if(listbox->select != NULL && listbox->select->handle1 != NULL) |
---|
582 | { |
---|
583 | screenepgsearch(((struct epg*)listbox->select->handle1)->title); |
---|
584 | resettvpic(); |
---|
585 | drawscreen(multiepg, 0, 0); |
---|
586 | continue; |
---|
587 | } |
---|
588 | } |
---|
589 | |
---|
590 | if(list == BOUQUETCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL))) |
---|
591 | { |
---|
592 | struct mainbouquet *mnode = (struct mainbouquet*)aktlist; |
---|
593 | int round = 0; |
---|
594 | while(mnode != NULL) |
---|
595 | { |
---|
596 | if(rcret == getrcconfigint("rcff", NULL)) |
---|
597 | { |
---|
598 | mnode = mnode->next; |
---|
599 | if(mnode == NULL && round == 0) |
---|
600 | { |
---|
601 | round = 1; |
---|
602 | mnode = mainbouquet; |
---|
603 | } |
---|
604 | } |
---|
605 | else if(rcret == getrcconfigint("rcfr", NULL)) |
---|
606 | { |
---|
607 | mnode = mnode->prev; |
---|
608 | if(mnode == NULL && round == 0) |
---|
609 | { |
---|
610 | round = 1; |
---|
611 | mnode = getlastmainbouquet(mainbouquet); |
---|
612 | } |
---|
613 | } |
---|
614 | if(mnode == NULL) break; |
---|
615 | if(mnode->type != status.servicetype) continue; |
---|
616 | |
---|
617 | char* tmp = ostrcat(tmp, "(BOUQUET)-", 0, 0); |
---|
618 | tmp = ostrcat(tmp, mnode->name, 1, 0); |
---|
619 | if(status.servicetype == 0) |
---|
620 | addconfigtmp("channellist", tmp); |
---|
621 | else |
---|
622 | addconfigtmp("rchannellist", tmp); |
---|
623 | free(tmp); tmp = NULL; |
---|
624 | |
---|
625 | if(nochanneltitle == 0) |
---|
626 | { |
---|
627 | tmpstr1 = ostrcat(tmpstr1, _("MULTI EPG - Bouquets"), 0, 0); |
---|
628 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
629 | tmpstr1 = ostrcat(tmpstr1, mnode->name, 1, 0); |
---|
630 | changetitle(multiepg, tmpstr1); |
---|
631 | free(tmpstr1); tmpstr1 = NULL; |
---|
632 | } |
---|
633 | |
---|
634 | listbox->aktpage = -1; |
---|
635 | listbox->aktline = 1; |
---|
636 | listbox->select = NULL; |
---|
637 | epgnr = 0; |
---|
638 | showbouquetmepgchannel(multiepg, listbox, mnode->bouquet, mnode, epgnr); |
---|
639 | selectchannelgmepg(listbox); |
---|
640 | aktlist = (void*)mnode; |
---|
641 | |
---|
642 | drawscreen(multiepg, 0, 0); |
---|
643 | break; |
---|
644 | } |
---|
645 | continue; |
---|
646 | } |
---|
647 | |
---|
648 | if(rcret == getrcconfigint("rcchdown", NULL)) |
---|
649 | { |
---|
650 | epgnr++; |
---|
651 | |
---|
652 | if(list == BOUQUETCHANNEL) |
---|
653 | { |
---|
654 | if(showbouquetmepgchannel(multiepg, listbox, ((struct mainbouquet*)aktlist)->bouquet, (struct mainbouquet*)aktlist, epgnr) == 0) |
---|
655 | { |
---|
656 | epgnr--; |
---|
657 | if(epgnr < 0) |
---|
658 | epgnr = 0; |
---|
659 | else |
---|
660 | showbouquetmepgchannel(multiepg, listbox, ((struct mainbouquet*)aktlist)->bouquet, (struct mainbouquet*)aktlist, epgnr); |
---|
661 | |
---|
662 | } |
---|
663 | } |
---|
664 | else if(list == ALLCHANNEL) |
---|
665 | { |
---|
666 | if(showallmepgchannel(multiepg, listbox, epgnr) == 0) |
---|
667 | { |
---|
668 | epgnr--; |
---|
669 | if(epgnr < 0) |
---|
670 | epgnr = 0; |
---|
671 | else |
---|
672 | showallmepgchannel(multiepg, listbox, epgnr); |
---|
673 | } |
---|
674 | } |
---|
675 | else if(list == AZCHANNEL) |
---|
676 | { |
---|
677 | if(showazmepgchannel(multiepg, listbox, character, epgnr) == 0) |
---|
678 | { |
---|
679 | epgnr--; |
---|
680 | if(epgnr < 0) |
---|
681 | epgnr = 0; |
---|
682 | else |
---|
683 | showazmepgchannel(multiepg, listbox, character, epgnr); |
---|
684 | } |
---|
685 | } |
---|
686 | else if(list == SATCHANNEL) |
---|
687 | { |
---|
688 | if(showsatmepgchannel(multiepg, listbox, satnode, epgnr) == 0) |
---|
689 | { |
---|
690 | epgnr--; |
---|
691 | if(epgnr < 0) |
---|
692 | epgnr = 0; |
---|
693 | else |
---|
694 | showsatmepgchannel(multiepg, listbox, satnode, epgnr); |
---|
695 | } |
---|
696 | } |
---|
697 | else if(list == PROVIDERCHANNEL) |
---|
698 | { |
---|
699 | if(showprovidermepgchannel(multiepg, listbox, providernode, epgnr) == 0) |
---|
700 | { |
---|
701 | epgnr--; |
---|
702 | if(epgnr < 0) |
---|
703 | epgnr = 0; |
---|
704 | else |
---|
705 | showprovidermepgchannel(multiepg, listbox, providernode, epgnr); |
---|
706 | } |
---|
707 | } |
---|
708 | drawscreen(multiepg, 0, 0); |
---|
709 | continue; |
---|
710 | } |
---|
711 | |
---|
712 | if(rcret == getrcconfigint("rcchup", NULL)) |
---|
713 | { |
---|
714 | epgnr--; |
---|
715 | if(epgnr < 0) epgnr = 0; |
---|
716 | |
---|
717 | if(list == BOUQUETCHANNEL) |
---|
718 | showbouquetmepgchannel(multiepg, listbox, ((struct mainbouquet*)aktlist)->bouquet, (struct mainbouquet*)aktlist, epgnr); |
---|
719 | else if(list == ALLCHANNEL) |
---|
720 | showallmepgchannel(multiepg, listbox, epgnr); |
---|
721 | else if(list == AZCHANNEL) |
---|
722 | showazmepgchannel(multiepg, listbox, character, epgnr); |
---|
723 | else if(list == SATCHANNEL) |
---|
724 | showsatmepgchannel(multiepg, listbox, satnode, epgnr); |
---|
725 | else if(list == PROVIDERCHANNEL) |
---|
726 | showprovidermepgchannel(multiepg, listbox, providernode, epgnr); |
---|
727 | drawscreen(multiepg, 0, 0); |
---|
728 | continue; |
---|
729 | } |
---|
730 | |
---|
731 | if(rcret == getrcconfigint("rcred", NULL) && listbox->select != NULL) |
---|
732 | { |
---|
733 | clearscreen(multiepg); |
---|
734 | ret = addrecepg((struct channel*)listbox->select->handle, readepgdesc((struct channel*)listbox->select->handle, epgnr), NULL); |
---|
735 | drawscreen(multiepg, 0, 0); |
---|
736 | continue; |
---|
737 | } |
---|
738 | |
---|
739 | drawscreen(multiepg, 0, 0); |
---|
740 | } |
---|
741 | |
---|
742 | delconfigtmp("channellist"); |
---|
743 | delconfigtmp("rchannellist"); |
---|
744 | status.markedchannel = NULL; |
---|
745 | status.markmodus = 0; |
---|
746 | delmarkedscreennodes(multiepg, 1); |
---|
747 | delownerrc(multiepg); |
---|
748 | clearscreen(multiepg); |
---|
749 | |
---|
750 | return end; |
---|
751 | } |
---|
752 | |
---|
753 | #endif |
---|