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