1 | #ifndef CHANNELLIST_H |
---|
2 | #define CHANNELLIST_H |
---|
3 | |
---|
4 | int selectchannel(struct skin* listbox, int sid, uint64_t tid) |
---|
5 | { |
---|
6 | struct skin* node = listbox; |
---|
7 | struct channel* chnode = NULL; |
---|
8 | listbox->aktpage = -1; |
---|
9 | listbox->aktline = 1; |
---|
10 | |
---|
11 | listbox->select = NULL; |
---|
12 | |
---|
13 | if(status.servicetype == 0) |
---|
14 | { |
---|
15 | if(sid != 0 && tid != 0) |
---|
16 | chnode = getchannel(sid, tid); |
---|
17 | else |
---|
18 | chnode = getchannel(getconfigint("serviceid", NULL), getconfigllu("transponderid", NULL)); |
---|
19 | } |
---|
20 | else |
---|
21 | { |
---|
22 | if(sid != 0 && tid != 0) |
---|
23 | chnode = getchannel(sid, tid); |
---|
24 | else |
---|
25 | chnode = getchannel(getconfigint("rserviceid", NULL), getconfigllu("rtransponderid", NULL)); |
---|
26 | } |
---|
27 | |
---|
28 | if(chnode == NULL) |
---|
29 | { |
---|
30 | debug(1000, "out -> NULL detect"); |
---|
31 | return 1; |
---|
32 | } |
---|
33 | |
---|
34 | while(node != NULL) |
---|
35 | { |
---|
36 | if(node->deaktivcol > -1 || node->hidden == YES) |
---|
37 | { |
---|
38 | node = node->next; |
---|
39 | continue; |
---|
40 | } |
---|
41 | if(chnode == (struct channel*) node->handle) |
---|
42 | return 0; |
---|
43 | if(node->del == 1) listbox->aktline++; |
---|
44 | node = node->next; |
---|
45 | } |
---|
46 | listbox->aktline = 1; |
---|
47 | return 1; |
---|
48 | } |
---|
49 | |
---|
50 | void changechannelepg(struct channel* chnode, struct skin* node) |
---|
51 | { |
---|
52 | struct epg* epgnode = NULL; |
---|
53 | char* tmpstr = NULL; |
---|
54 | |
---|
55 | epgnode = getepgakt(chnode); |
---|
56 | if(epgnode != NULL) |
---|
57 | { |
---|
58 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
59 | tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0); |
---|
60 | changetext2(node, tmpstr); |
---|
61 | free(tmpstr); tmpstr = NULL; |
---|
62 | } |
---|
63 | } |
---|
64 | |
---|
65 | void showallchannel(struct skin* channellist, struct skin* listbox, struct skin* channeltimeline, int mode) |
---|
66 | { |
---|
67 | struct skin* chnode = NULL; |
---|
68 | struct channel* tmpchannel = channel; |
---|
69 | long long deaktivcol = convertcol("deaktivcol"); |
---|
70 | |
---|
71 | while(tmpchannel != NULL) |
---|
72 | { |
---|
73 | if(tmpchannel->servicetype == status.servicetype) |
---|
74 | { |
---|
75 | chnode = addlistbox(channellist, listbox, chnode, 1); |
---|
76 | if(chnode != NULL) |
---|
77 | { |
---|
78 | changechannelepg(tmpchannel, chnode); |
---|
79 | if(checkbouquet(tmpchannel) == 1) |
---|
80 | chnode->fontcol = convertcol("favcol"); |
---|
81 | if(tmpchannel->protect > 0) |
---|
82 | chnode->fontcol = convertcol("protectcol"); |
---|
83 | changetext(chnode, tmpchannel->name); |
---|
84 | chnode->handle = (char*) tmpchannel; |
---|
85 | chnode->handle1 = (char*) tmpchannel; |
---|
86 | if(mode == 0 && channelnottunable(tmpchannel) == 1) |
---|
87 | { |
---|
88 | if(status.channellistview == 0) |
---|
89 | chnode->hidden = YES; |
---|
90 | else |
---|
91 | chnode->deaktivcol = deaktivcol; |
---|
92 | } |
---|
93 | if(status.showchanneltimeline == 1 && channeltimeline != status.skinerr) |
---|
94 | { |
---|
95 | chnode->textposx = channeltimeline->width + 10; |
---|
96 | struct skin* chnode1 = NULL; |
---|
97 | chnode1 = addlistbox(channellist, chnode, chnode, 1); |
---|
98 | if(chnode1 != NULL) |
---|
99 | { |
---|
100 | chnode1->progresscol = channeltimeline->progresscol; |
---|
101 | chnode1->skinfunc = convertfunc("getepgchanneltimeline", &chnode1->funcrettype); |
---|
102 | chnode1->handle = (char*) tmpchannel; |
---|
103 | chnode1->posy = channeltimeline->posy; |
---|
104 | chnode1->width = channeltimeline->width; |
---|
105 | chnode1->height = channeltimeline->height; |
---|
106 | chnode1->bordersize = channeltimeline->bordersize; |
---|
107 | chnode1->bordercol = channeltimeline->bordercol; |
---|
108 | chnode1->prozwidth = 0; |
---|
109 | } |
---|
110 | } |
---|
111 | } |
---|
112 | } |
---|
113 | tmpchannel = tmpchannel->next; |
---|
114 | } |
---|
115 | } |
---|
116 | |
---|
117 | int checkbouquet(struct channel* tmpchannel) |
---|
118 | { |
---|
119 | struct mainbouquet* mainbouquetnode = mainbouquet; |
---|
120 | struct bouquet* bouquetnode = NULL; |
---|
121 | while(mainbouquetnode != NULL) |
---|
122 | { |
---|
123 | bouquetnode = mainbouquetnode->bouquet; |
---|
124 | while(bouquetnode != NULL) |
---|
125 | { |
---|
126 | if(bouquetnode->channel != NULL && bouquetnode->channel->serviceid == tmpchannel->serviceid && bouquetnode->channel->transponderid == tmpchannel->transponderid) |
---|
127 | return 1; |
---|
128 | |
---|
129 | bouquetnode = bouquetnode->next; |
---|
130 | } |
---|
131 | mainbouquetnode = mainbouquetnode->next; |
---|
132 | } |
---|
133 | return 0; |
---|
134 | } |
---|
135 | |
---|
136 | void showbouquetchannel(struct skin* channellist, struct skin* listbox, struct skin* channeltimeline, struct bouquet* firstbouquet, struct mainbouquet* mbouquet, int mode) |
---|
137 | { |
---|
138 | struct skin* chnode = NULL; |
---|
139 | struct bouquet* tmpbouquet = firstbouquet; |
---|
140 | char* tmpstr = NULL, *tmpnr = NULL; |
---|
141 | long long deaktivcol = convertcol("deaktivcol"); |
---|
142 | |
---|
143 | if(mbouquet != NULL && ostrcmp(mbouquet->filename, "0") == 0) |
---|
144 | { |
---|
145 | mostzaptobouquet(mbouquet); |
---|
146 | tmpbouquet = mbouquet->bouquet; |
---|
147 | } |
---|
148 | |
---|
149 | while(tmpbouquet != NULL) |
---|
150 | { |
---|
151 | if(tmpbouquet->channel != NULL) |
---|
152 | { |
---|
153 | if(tmpbouquet->channel->servicetype == status.servicetype) |
---|
154 | { |
---|
155 | chnode = addlistbox(channellist, listbox, chnode, 1); |
---|
156 | if(chnode != NULL) |
---|
157 | { |
---|
158 | tmpnr = oitoa(tmpbouquet->nr); |
---|
159 | changeret(chnode, tmpnr); |
---|
160 | tmpstr = ostrcat(tmpstr, tmpnr, 1, 1); |
---|
161 | tmpstr = ostrcat(tmpstr, " ", 1, 0); |
---|
162 | tmpstr = ostrcat(tmpstr, tmpbouquet->channel->name, 1, 0); |
---|
163 | changetext(chnode, tmpstr); |
---|
164 | free(tmpstr); tmpstr = NULL; |
---|
165 | if(tmpbouquet->channel->protect > 0) |
---|
166 | chnode->fontcol = convertcol("protectcol"); |
---|
167 | |
---|
168 | changechannelepg(tmpbouquet->channel, chnode); |
---|
169 | chnode->handle = (char*) tmpbouquet->channel; |
---|
170 | chnode->handle1 = (char*) tmpbouquet; |
---|
171 | if(mode == 0 && channelnottunable(tmpbouquet->channel) == 1) |
---|
172 | { |
---|
173 | if(status.channellistview == 0) |
---|
174 | chnode->hidden = YES; |
---|
175 | else |
---|
176 | chnode->deaktivcol = deaktivcol; |
---|
177 | } |
---|
178 | if(status.showchanneltimeline == 1 && channeltimeline != status.skinerr) |
---|
179 | { |
---|
180 | chnode->textposx = channeltimeline->width + 10; |
---|
181 | struct skin* chnode1 = NULL; |
---|
182 | chnode1 = addlistbox(channellist, chnode, chnode, 1); |
---|
183 | if(chnode1 != NULL) |
---|
184 | { |
---|
185 | chnode1->progresscol = channeltimeline->progresscol; |
---|
186 | chnode1->skinfunc = convertfunc("getepgchanneltimeline", &chnode1->funcrettype); |
---|
187 | chnode1->handle = (char*)tmpbouquet->channel; |
---|
188 | chnode1->posy = channeltimeline->posy; |
---|
189 | chnode1->width = channeltimeline->width; |
---|
190 | chnode1->height = channeltimeline->height; |
---|
191 | chnode1->bordersize = channeltimeline->bordersize; |
---|
192 | chnode1->bordercol = channeltimeline->bordercol; |
---|
193 | chnode1->prozwidth = 0; |
---|
194 | } |
---|
195 | } |
---|
196 | } |
---|
197 | } |
---|
198 | } |
---|
199 | tmpbouquet = tmpbouquet->next; |
---|
200 | } |
---|
201 | } |
---|
202 | |
---|
203 | void showproviderchannel(struct skin* channellist, struct skin* listbox, struct skin* channeltimeline, struct provider* providernode, int mode) |
---|
204 | { |
---|
205 | struct skin* chnode = NULL; |
---|
206 | struct channel* tmpchannel = channel; |
---|
207 | long long deaktivcol = convertcol("deaktivcol"); |
---|
208 | |
---|
209 | while(tmpchannel != NULL) |
---|
210 | { |
---|
211 | if(tmpchannel->provider == providernode) |
---|
212 | { |
---|
213 | if(tmpchannel->servicetype == status.servicetype) |
---|
214 | { |
---|
215 | chnode = addlistbox(channellist, listbox, chnode, 1); |
---|
216 | if(chnode != NULL) |
---|
217 | { |
---|
218 | changechannelepg(tmpchannel, chnode); |
---|
219 | changetext(chnode, tmpchannel->name); |
---|
220 | if(tmpchannel->protect > 0) |
---|
221 | chnode->fontcol = convertcol("protectcol"); |
---|
222 | chnode->handle = (char*) tmpchannel; |
---|
223 | chnode->handle1 = (char*) tmpchannel; |
---|
224 | if(mode == 0 && channelnottunable(tmpchannel) == 1) |
---|
225 | { |
---|
226 | if(status.channellistview == 0) |
---|
227 | chnode->hidden = YES; |
---|
228 | else |
---|
229 | chnode->deaktivcol = deaktivcol; |
---|
230 | } |
---|
231 | if(status.showchanneltimeline == 1 && channeltimeline != status.skinerr) |
---|
232 | { |
---|
233 | chnode->textposx = channeltimeline->width + 10; |
---|
234 | struct skin* chnode1 = NULL; |
---|
235 | if(chnode1 != NULL) |
---|
236 | { |
---|
237 | chnode1 = addlistbox(channellist, chnode, chnode, 1); |
---|
238 | chnode1->progresscol = channeltimeline->progresscol; |
---|
239 | chnode1->skinfunc = convertfunc("getepgchanneltimeline", &chnode1->funcrettype); |
---|
240 | chnode1->handle = (char*) tmpchannel; |
---|
241 | chnode1->posy = channeltimeline->posy; |
---|
242 | chnode1->width = channeltimeline->width; |
---|
243 | chnode1->height = channeltimeline->height; |
---|
244 | chnode1->bordersize = channeltimeline->bordersize; |
---|
245 | chnode1->bordercol = channeltimeline->bordercol; |
---|
246 | chnode1->prozwidth = 0; |
---|
247 | } |
---|
248 | } |
---|
249 | } |
---|
250 | } |
---|
251 | } |
---|
252 | tmpchannel = tmpchannel->next; |
---|
253 | } |
---|
254 | } |
---|
255 | |
---|
256 | int checkprovider(struct provider* providernode) |
---|
257 | { |
---|
258 | struct channel* tmpchannel = channel; |
---|
259 | |
---|
260 | while(tmpchannel != NULL) |
---|
261 | { |
---|
262 | if(tmpchannel->provider == providernode) |
---|
263 | { |
---|
264 | if(tmpchannel->servicetype == status.servicetype && channelnottunable(tmpchannel) != 1) |
---|
265 | return 1; |
---|
266 | } |
---|
267 | tmpchannel = tmpchannel->next; |
---|
268 | } |
---|
269 | return 0; |
---|
270 | } |
---|
271 | |
---|
272 | void showprovider(struct skin* channellist, struct skin* listbox) |
---|
273 | { |
---|
274 | struct provider *node = provider; |
---|
275 | struct skin* providernode = NULL; |
---|
276 | |
---|
277 | while(node != NULL) |
---|
278 | { |
---|
279 | if(checkprovider(node) == 1) |
---|
280 | { |
---|
281 | node->flag = 1; |
---|
282 | providernode = addlistbox(channellist, listbox, providernode, 2); |
---|
283 | if(providernode != NULL) |
---|
284 | { |
---|
285 | changetext(providernode, node->name); |
---|
286 | changename(providernode, node->name); |
---|
287 | providernode->handle = (char*) node; |
---|
288 | providernode->handle1 = (char*) node; |
---|
289 | } |
---|
290 | } |
---|
291 | else |
---|
292 | node->flag = 0; |
---|
293 | |
---|
294 | node = node->next; |
---|
295 | } |
---|
296 | } |
---|
297 | |
---|
298 | void showsatchannel(struct skin* channellist, struct skin* listbox, struct skin* channeltimeline, struct sat* satnode, int mode) |
---|
299 | { |
---|
300 | struct skin* chnode = NULL; |
---|
301 | struct channel* tmpchannel = channel; |
---|
302 | long long deaktivcol = convertcol("deaktivcol"); |
---|
303 | |
---|
304 | if(satnode == NULL) |
---|
305 | return; |
---|
306 | |
---|
307 | while(tmpchannel != NULL) |
---|
308 | { |
---|
309 | if(tmpchannel->transponder != NULL && tmpchannel->transponder->orbitalpos == satnode->orbitalpos) |
---|
310 | { |
---|
311 | if(tmpchannel->servicetype == status.servicetype) |
---|
312 | { |
---|
313 | chnode = addlistbox(channellist, listbox, chnode, 1); |
---|
314 | if(chnode != NULL) |
---|
315 | { |
---|
316 | changechannelepg(tmpchannel, chnode); |
---|
317 | changetext(chnode, tmpchannel->name); |
---|
318 | if(tmpchannel->protect > 0) |
---|
319 | chnode->fontcol = convertcol("protectcol"); |
---|
320 | chnode->handle = (char*) tmpchannel; |
---|
321 | chnode->handle1 = (char*) tmpchannel; |
---|
322 | if(mode == 0 && channelnottunable(tmpchannel) == 1) |
---|
323 | { |
---|
324 | if(status.channellistview == 0) |
---|
325 | chnode->hidden = YES; |
---|
326 | else |
---|
327 | chnode->deaktivcol = deaktivcol; |
---|
328 | } |
---|
329 | if(status.showchanneltimeline == 1 && channeltimeline != status.skinerr) |
---|
330 | { |
---|
331 | chnode->textposx = channeltimeline->width + 10; |
---|
332 | struct skin* chnode1 = NULL; |
---|
333 | if(chnode1 != NULL) |
---|
334 | { |
---|
335 | chnode1 = addlistbox(channellist, chnode, chnode, 1); |
---|
336 | chnode1->progresscol = channeltimeline->progresscol; |
---|
337 | chnode1->skinfunc = convertfunc("getepgchanneltimeline", &chnode1->funcrettype); |
---|
338 | chnode1->handle = (char*) tmpchannel; |
---|
339 | chnode1->posy = channeltimeline->posy; |
---|
340 | chnode1->width = channeltimeline->width; |
---|
341 | chnode1->height = channeltimeline->height; |
---|
342 | chnode1->bordersize = channeltimeline->bordersize; |
---|
343 | chnode1->bordercol = channeltimeline->bordercol; |
---|
344 | chnode1->prozwidth = 0; |
---|
345 | } |
---|
346 | } |
---|
347 | } |
---|
348 | } |
---|
349 | } |
---|
350 | tmpchannel = tmpchannel->next; |
---|
351 | } |
---|
352 | } |
---|
353 | |
---|
354 | void showsat(struct skin* channellist, struct skin* listbox) |
---|
355 | { |
---|
356 | int i = 0, treffer = 0; |
---|
357 | struct sat *node = sat; |
---|
358 | struct dvbdev *dvbnode = NULL; |
---|
359 | struct skin* satnode = NULL; |
---|
360 | char* tmpstr = NULL, *tmpnr = NULL; |
---|
361 | |
---|
362 | while(node != NULL) |
---|
363 | { |
---|
364 | treffer = 0; |
---|
365 | dvbnode = dvbdev; |
---|
366 | while(dvbnode != NULL) |
---|
367 | { |
---|
368 | if(dvbnode->type == FRONTENDDEV && dvbnode->feshortname != NULL) |
---|
369 | { |
---|
370 | tmpstr = ostrcat(dvbnode->feshortname, "_sat", 0, 0); |
---|
371 | for(i = 1; i <= getmaxsat(dvbnode->feshortname); i++) |
---|
372 | { |
---|
373 | tmpnr = oitoa(i); |
---|
374 | if(getconfigint(tmpstr, tmpnr) == node->orbitalpos) |
---|
375 | { |
---|
376 | free(tmpnr); tmpnr = NULL; |
---|
377 | treffer = 1; |
---|
378 | break; |
---|
379 | } |
---|
380 | free(tmpnr); tmpnr = NULL; |
---|
381 | } |
---|
382 | free(tmpstr); tmpstr = NULL; |
---|
383 | } |
---|
384 | if(treffer == 1) break; |
---|
385 | dvbnode = dvbnode->next; |
---|
386 | } |
---|
387 | |
---|
388 | if(treffer == 0) |
---|
389 | { |
---|
390 | node = node->next; |
---|
391 | continue; |
---|
392 | } |
---|
393 | |
---|
394 | satnode = addlistbox(channellist, listbox, satnode, 2); |
---|
395 | if(satnode != NULL) |
---|
396 | { |
---|
397 | changetext(satnode, node->name); |
---|
398 | changename(satnode, node->name); |
---|
399 | satnode->handle = (char*) node; |
---|
400 | satnode->handle1 = (char*) node; |
---|
401 | } |
---|
402 | node = node->next; |
---|
403 | } |
---|
404 | } |
---|
405 | |
---|
406 | void showazchannel(struct skin* channellist, struct skin* listbox, struct skin* channeltimeline, int character, int mode) |
---|
407 | { |
---|
408 | struct skin* chnode = NULL; |
---|
409 | struct channel* tmpchannel = channel; |
---|
410 | long long deaktivcol = convertcol("deaktivcol"); |
---|
411 | |
---|
412 | while(tmpchannel != NULL) |
---|
413 | { |
---|
414 | if(tmpchannel->name != NULL && (tmpchannel->name[0] == character || tmpchannel->name[0] == character + 32)) |
---|
415 | { |
---|
416 | if(tmpchannel->servicetype == status.servicetype) |
---|
417 | { |
---|
418 | chnode = addlistbox(channellist, listbox, chnode, 1); |
---|
419 | if(chnode != NULL) |
---|
420 | { |
---|
421 | changechannelepg(tmpchannel, chnode); |
---|
422 | changetext(chnode, tmpchannel->name); |
---|
423 | if(tmpchannel->protect > 0) |
---|
424 | chnode->fontcol = convertcol("protectcol"); |
---|
425 | chnode->handle = (char*) tmpchannel; |
---|
426 | chnode->handle1 = (char*) tmpchannel; |
---|
427 | if(mode == 0 && channelnottunable(tmpchannel) == 1) |
---|
428 | { |
---|
429 | if(status.channellistview == 0) |
---|
430 | chnode->hidden = YES; |
---|
431 | else |
---|
432 | chnode->deaktivcol = deaktivcol; |
---|
433 | } |
---|
434 | if(status.showchanneltimeline == 1 && channeltimeline != status.skinerr) |
---|
435 | { |
---|
436 | chnode->textposx = channeltimeline->width + 10; |
---|
437 | struct skin* chnode1 = NULL; |
---|
438 | if(chnode1 != NULL) |
---|
439 | { |
---|
440 | chnode1 = addlistbox(channellist, chnode, chnode, 1); |
---|
441 | chnode1->progresscol = channeltimeline->progresscol; |
---|
442 | chnode1->skinfunc = convertfunc("getepgchanneltimeline", &chnode1->funcrettype); |
---|
443 | chnode1->handle = (char*) tmpchannel; |
---|
444 | chnode1->posy = channeltimeline->posy; |
---|
445 | chnode1->width = channeltimeline->width; |
---|
446 | chnode1->height = channeltimeline->height; |
---|
447 | chnode1->bordersize = channeltimeline->bordersize; |
---|
448 | chnode1->bordercol = channeltimeline->bordercol; |
---|
449 | chnode1->prozwidth = 0; |
---|
450 | } |
---|
451 | } |
---|
452 | } |
---|
453 | } |
---|
454 | } |
---|
455 | tmpchannel = tmpchannel->next; |
---|
456 | } |
---|
457 | } |
---|
458 | |
---|
459 | void showaz(struct skin* channellist, struct skin* listbox) |
---|
460 | { |
---|
461 | struct skin* node = NULL; |
---|
462 | int i; |
---|
463 | char* tmpstr = NULL; |
---|
464 | |
---|
465 | tmpstr = malloc(2); |
---|
466 | if(tmpstr == NULL) |
---|
467 | { |
---|
468 | err("no memory"); |
---|
469 | return; |
---|
470 | } |
---|
471 | |
---|
472 | for(i = 65; i < 91; i++) |
---|
473 | { |
---|
474 | node = addlistbox(channellist, listbox, node, 2); |
---|
475 | if(node != NULL) |
---|
476 | { |
---|
477 | snprintf(tmpstr, 2, "%c", i); |
---|
478 | changetext(node, tmpstr); |
---|
479 | changename(node, tmpstr); |
---|
480 | node->handle = (void*) i; |
---|
481 | } |
---|
482 | } |
---|
483 | |
---|
484 | free(tmpstr); |
---|
485 | } |
---|
486 | |
---|
487 | void showmainbouquet(struct skin* channellist, struct skin* listbox) |
---|
488 | { |
---|
489 | struct mainbouquet *node = mainbouquet; |
---|
490 | struct skin* bouquetnode = NULL; |
---|
491 | |
---|
492 | while(node != NULL) |
---|
493 | { |
---|
494 | if(node->type == status.servicetype) |
---|
495 | { |
---|
496 | bouquetnode = addlistbox(channellist, listbox, bouquetnode, 2); |
---|
497 | if(bouquetnode != NULL) |
---|
498 | { |
---|
499 | changetext(bouquetnode, node->name); |
---|
500 | changename(bouquetnode, node->name); |
---|
501 | bouquetnode->handle = (char*) node->bouquet; |
---|
502 | bouquetnode->handle1 = (char*) node; |
---|
503 | } |
---|
504 | } |
---|
505 | node = node->next; |
---|
506 | } |
---|
507 | } |
---|
508 | |
---|
509 | void drawchannellist(struct skin* channellist, int list, struct skin* listbox) |
---|
510 | { |
---|
511 | status.markedchannel = NULL; |
---|
512 | if(list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) |
---|
513 | { |
---|
514 | if(listbox->select == NULL) |
---|
515 | drawscreen(channellist, 2, 0); |
---|
516 | |
---|
517 | if(listbox->select != NULL) |
---|
518 | status.markedchannel = (struct channel*)listbox->select->handle; |
---|
519 | } |
---|
520 | drawscreen(channellist, 0, 0); |
---|
521 | } |
---|
522 | |
---|
523 | void recalclist(int list, void* aktlist, int listmode, struct skin* channellist, struct skin* listbox, struct skin* channeltimeline) |
---|
524 | { |
---|
525 | if(list == ALLCHANNEL) |
---|
526 | showallchannel(channellist, listbox, channeltimeline, listmode); |
---|
527 | if(list == SATCHANNEL) |
---|
528 | showsatchannel(channellist, listbox, channeltimeline, (struct sat*)aktlist, listmode); |
---|
529 | if(list == PROVIDERCHANNEL) |
---|
530 | showproviderchannel(channellist, listbox, channeltimeline, (struct provider*)aktlist, listmode); |
---|
531 | if(list == AZCHANNEL) |
---|
532 | showazchannel(channellist, listbox, channeltimeline, (int)aktlist, listmode); |
---|
533 | if(list == BOUQUETCHANNEL) |
---|
534 | showbouquetchannel(channellist, listbox, channeltimeline, ((struct mainbouquet*)aktlist)->bouquet, (struct mainbouquet*)aktlist, listmode); |
---|
535 | if(list == MAINBOUQUETLIST) |
---|
536 | showmainbouquet(channellist, listbox); |
---|
537 | if(list == SATLIST) |
---|
538 | showsat(channellist, listbox); |
---|
539 | if(list == PROVIDERLIST) |
---|
540 | showprovider(channellist, listbox); |
---|
541 | } |
---|
542 | |
---|
543 | void changebutton(int listmode, struct skin* b1, struct skin* b2, struct skin* b3, struct skin* b4, struct skin* b5, struct skin* b6, struct skin* b7, struct skin* b8, struct skin* b9, struct skin* b10, struct skin* b11, struct skin* b12, struct skin* b13, struct skin* b14, struct skin* b15, int flag) |
---|
544 | { |
---|
545 | if(listmode == NOMODE) |
---|
546 | { |
---|
547 | b1->hidden = NO; |
---|
548 | b2->hidden = NO; |
---|
549 | b3->hidden = NO; |
---|
550 | b4->hidden = NO; |
---|
551 | b5->hidden = NO; |
---|
552 | b6->hidden = NO; |
---|
553 | b7->hidden = NO; |
---|
554 | b8->hidden = NO; |
---|
555 | b9->hidden = NO; |
---|
556 | b10->hidden = NO; |
---|
557 | b11->hidden = YES; |
---|
558 | b12->hidden = YES; |
---|
559 | b13->hidden = YES; |
---|
560 | b14->hidden = YES; |
---|
561 | b15->hidden = NO; |
---|
562 | } |
---|
563 | else if(listmode == MVMODE) |
---|
564 | { |
---|
565 | b1->hidden = NO; |
---|
566 | b2->hidden = NO; |
---|
567 | b3->hidden = YES; |
---|
568 | b4->hidden = YES; |
---|
569 | b5->hidden = YES; |
---|
570 | b6->hidden = YES; |
---|
571 | b7->hidden = YES; |
---|
572 | b8->hidden = YES; |
---|
573 | b9->hidden = YES; |
---|
574 | b10->hidden = YES; |
---|
575 | b11->hidden = NO; |
---|
576 | b12->hidden = NO; |
---|
577 | b13->hidden = YES; |
---|
578 | b14->hidden = NO; |
---|
579 | b15->hidden = YES; |
---|
580 | } |
---|
581 | else |
---|
582 | { |
---|
583 | b1->hidden = NO; |
---|
584 | b2->hidden = NO; |
---|
585 | b3->hidden = YES; |
---|
586 | b4->hidden = YES; |
---|
587 | b5->hidden = YES; |
---|
588 | b6->hidden = YES; |
---|
589 | b7->hidden = YES; |
---|
590 | b8->hidden = YES; |
---|
591 | b9->hidden = YES; |
---|
592 | b10->hidden = YES; |
---|
593 | b11->hidden = NO; |
---|
594 | b12->hidden = NO; |
---|
595 | b13->hidden = NO; |
---|
596 | b14->hidden = YES; |
---|
597 | b15->hidden = YES; |
---|
598 | } |
---|
599 | |
---|
600 | if(flag == 1) |
---|
601 | { |
---|
602 | b8->hidden = YES; |
---|
603 | b9->hidden = YES; |
---|
604 | b10->hidden = YES; |
---|
605 | b11->hidden = YES; |
---|
606 | b15->hidden = YES; |
---|
607 | } |
---|
608 | } |
---|
609 | |
---|
610 | void changechanneltitle(struct skin* channellist, struct skin* listbox, int listmode, char** oldtitle, long* oldfontcol, long* oldbgcol) |
---|
611 | { |
---|
612 | struct skin* titletext = getscreennode(channellist, "titletext"); |
---|
613 | char* tmpstr = NULL; |
---|
614 | |
---|
615 | if(*oldtitle == NULL) |
---|
616 | *oldtitle = ostrcat(channellist->title, NULL, 0, 0); |
---|
617 | if(*oldtitle == NULL) |
---|
618 | *oldtitle = ostrcat(titletext->text, NULL, 0, 0); |
---|
619 | |
---|
620 | if(listmode == MVMODE) |
---|
621 | { |
---|
622 | tmpstr = ostrcat(*oldtitle, " - ", 0, 0); |
---|
623 | tmpstr = ostrcat(tmpstr, _("Move mode"), 1, 0); |
---|
624 | listbox->bgcol = convertcol("mvmode_bgcol"); |
---|
625 | listbox->fontcol = convertcol("mvmode_fontcol"); |
---|
626 | changetitle(channellist, tmpstr); |
---|
627 | } |
---|
628 | else if(listmode == RMMODE) |
---|
629 | { |
---|
630 | tmpstr = ostrcat(*oldtitle, " - ", 0, 0); |
---|
631 | tmpstr = ostrcat(tmpstr, _("Remove mode"), 1, 0); |
---|
632 | listbox->bgcol = convertcol("rmmode_bgcol"); |
---|
633 | listbox->fontcol = convertcol("rmmode_fontcol"); |
---|
634 | changetitle(channellist, tmpstr); |
---|
635 | } |
---|
636 | else if(listmode == CPMODE) |
---|
637 | { |
---|
638 | tmpstr = ostrcat(*oldtitle, " - ", 0, 0); |
---|
639 | tmpstr = ostrcat(tmpstr, _("Copy mode"), 1, 0); |
---|
640 | listbox->bgcol = convertcol("cpmode_bgcol"); |
---|
641 | listbox->fontcol = convertcol("cpmode_fontcol"); |
---|
642 | changetitle(channellist, tmpstr); |
---|
643 | } |
---|
644 | else if(listmode == PROTECTMODE) |
---|
645 | { |
---|
646 | tmpstr = ostrcat(*oldtitle, " - ", 0, 0); |
---|
647 | tmpstr = ostrcat(tmpstr, _("Protect mode"), 1, 0); |
---|
648 | listbox->bgcol = convertcol("protectmode_bgcol"); |
---|
649 | listbox->fontcol = convertcol("protectmode_fontcol"); |
---|
650 | changetitle(channellist, tmpstr); |
---|
651 | } |
---|
652 | else if(listmode == EDITMODE) |
---|
653 | { |
---|
654 | tmpstr = ostrcat(*oldtitle, " - ", 0, 0); |
---|
655 | tmpstr = ostrcat(tmpstr, _("Edit mode"), 1, 0); |
---|
656 | listbox->bgcol = convertcol("editmode_bgcol"); |
---|
657 | listbox->fontcol = convertcol("editmode_fontcol"); |
---|
658 | changetitle(channellist, tmpstr); |
---|
659 | } |
---|
660 | else |
---|
661 | { |
---|
662 | changetitle(channellist, *oldtitle); |
---|
663 | *oldtitle = NULL; |
---|
664 | listbox->fontcol = *oldfontcol; |
---|
665 | listbox->bgcol = *oldbgcol; |
---|
666 | } |
---|
667 | } |
---|
668 | |
---|
669 | void addscreenrcchannellist(struct skin* channellist, struct skin* listbox) |
---|
670 | { |
---|
671 | addscreenrc(channellist, listbox); |
---|
672 | |
---|
673 | //deaktivate for blockmove |
---|
674 | delrc(getrcconfigint("rcchup", NULL), channellist, listbox); |
---|
675 | delrc(getrcconfigint("rcchdown", NULL), channellist, listbox); |
---|
676 | } |
---|
677 | |
---|
678 | //flag 1: called from recordtimer screen |
---|
679 | //flag 2: rcfav (open bouquetlist) |
---|
680 | //flag 3: edit modus |
---|
681 | int screenchannellist(struct channel** retchannel, char** retchannellist, int flag) |
---|
682 | { |
---|
683 | char* channellist_sel = getskinconfig("channellist_selection", NULL); |
---|
684 | debug(10, "get initial channellist=%s", channellist_sel); |
---|
685 | |
---|
686 | if(channellist_sel == NULL) { |
---|
687 | channellist_sel = ostrcat(channellist_sel, "channellist", 1, 0); // fallback to default |
---|
688 | debug(10, "fallback to default, set channellist=%s", channellist_sel); |
---|
689 | } |
---|
690 | |
---|
691 | struct skin* channellist = getscreen(channellist_sel); |
---|
692 | debug(10, "final channellist=%s", channellist_sel); |
---|
693 | |
---|
694 | // struct skin* channellist = getscreen("channellist"); |
---|
695 | struct skin* listbox = getscreennode(channellist, "listbox"); |
---|
696 | struct skin* channeltimeline = getscreennode(channellist, "channeltimeline"); |
---|
697 | struct skin* b1 = getscreennode(channellist, "b1"); |
---|
698 | struct skin* b2 = getscreennode(channellist, "b2"); |
---|
699 | struct skin* b3 = getscreennode(channellist, "b3"); |
---|
700 | struct skin* b4 = getscreennode(channellist, "b4"); |
---|
701 | struct skin* b5 = getscreennode(channellist, "b5"); |
---|
702 | struct skin* b6 = getscreennode(channellist, "b6"); |
---|
703 | struct skin* b7 = getscreennode(channellist, "b7"); |
---|
704 | struct skin* b8 = getscreennode(channellist, "b8"); |
---|
705 | struct skin* b9 = getscreennode(channellist, "b9"); |
---|
706 | struct skin* b10 = getscreennode(channellist, "b10"); |
---|
707 | struct skin* b11 = getscreennode(channellist, "b11"); |
---|
708 | struct skin* b12 = getscreennode(channellist, "b12"); |
---|
709 | struct skin* b13 = getscreennode(channellist, "b13"); |
---|
710 | struct skin* b14 = getscreennode(channellist, "b14"); |
---|
711 | struct skin* b15 = getscreennode(channellist, "b15"); |
---|
712 | struct skin* tmpskin; |
---|
713 | int rcret, ret, listmode, newmodus, list; |
---|
714 | char* tmpstr = NULL, *tmpstr1 = NULL, *oldtitle = NULL; |
---|
715 | void* movesel = NULL, *aktlist = NULL; |
---|
716 | int nochanneltitle = getskinconfigint("nochanneltitle", NULL); |
---|
717 | int firstdraw = 0; |
---|
718 | long oldfontcol = 0; |
---|
719 | long oldbgcol = 0; |
---|
720 | |
---|
721 | status.channelswitch = 1; |
---|
722 | |
---|
723 | start: |
---|
724 | rcret = 0, ret = -1, list = ALLCHANNEL, listmode = NOMODE, newmodus = 0; |
---|
725 | tmpstr = NULL, tmpstr1 = NULL, movesel = NULL, aktlist = NULL, tmpskin = NULL; |
---|
726 | if(nochanneltitle == 0) |
---|
727 | { |
---|
728 | changetitle(channellist, ""); |
---|
729 | } |
---|
730 | |
---|
731 | oldbgcol = listbox->bgcol; |
---|
732 | oldfontcol = listbox->fontcol; |
---|
733 | |
---|
734 | if(status.servicetype == 0) |
---|
735 | { |
---|
736 | tmpstr = getconfig("channellist", NULL); |
---|
737 | changetext(b8, _("Radio")); |
---|
738 | } |
---|
739 | else |
---|
740 | { |
---|
741 | tmpstr = getconfig("rchannellist", NULL); |
---|
742 | changetext(b8, _("TV")); |
---|
743 | } |
---|
744 | if(ostrncmp("(BOUQUET)-", tmpstr, 10) == 0 && strlen(tmpstr) > 10) |
---|
745 | { |
---|
746 | struct mainbouquet* mainbouquetnode = NULL; |
---|
747 | mainbouquetnode = getmainbouquet(tmpstr + 10); |
---|
748 | if(mainbouquetnode != NULL && mainbouquetnode->bouquet != NULL) |
---|
749 | { |
---|
750 | tmpstr1 = ostrcat(tmpstr1, _("Bouquets"), 0, 0); |
---|
751 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
752 | tmpstr1 = ostrcat(tmpstr1, tmpstr + 10, 1, 0); |
---|
753 | if(nochanneltitle == 0) |
---|
754 | { |
---|
755 | changetitle(channellist, tmpstr1); |
---|
756 | } |
---|
757 | free(tmpstr1); tmpstr1 = NULL; |
---|
758 | list = BOUQUETCHANNEL; |
---|
759 | aktlist = (void*)mainbouquetnode; |
---|
760 | showbouquetchannel(channellist, listbox, channeltimeline, mainbouquetnode->bouquet, mainbouquetnode, flag); |
---|
761 | selectchannel(listbox, 0, 0); |
---|
762 | } |
---|
763 | } |
---|
764 | else if(ostrncmp("(A-Z)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6) |
---|
765 | { |
---|
766 | tmpstr1 = ostrcat(tmpstr1, _("Channel"), 0, 0); |
---|
767 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
768 | tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0); |
---|
769 | if(nochanneltitle == 0) |
---|
770 | { |
---|
771 | changetitle(channellist, tmpstr1); |
---|
772 | } |
---|
773 | free(tmpstr1); tmpstr1 = NULL; |
---|
774 | list = AZCHANNEL; |
---|
775 | aktlist = (void*)(int)tmpstr[6]; |
---|
776 | showazchannel(channellist, listbox, channeltimeline, (int)tmpstr[6], flag); |
---|
777 | selectchannel(listbox, 0, 0); |
---|
778 | } |
---|
779 | else if(ostrncmp("(SAT)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6) |
---|
780 | { |
---|
781 | tmpstr1 = ostrcat(tmpstr1, _("Satellites"), 0, 0); |
---|
782 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
783 | tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0); |
---|
784 | if(nochanneltitle == 0) |
---|
785 | { |
---|
786 | changetitle(channellist, tmpstr1); |
---|
787 | } |
---|
788 | free(tmpstr1); tmpstr1 = NULL; |
---|
789 | struct sat* satnode = getsat(tmpstr + 6); |
---|
790 | list = SATCHANNEL; |
---|
791 | aktlist = (void*)satnode; |
---|
792 | showsatchannel(channellist, listbox, channeltimeline, satnode, flag); |
---|
793 | selectchannel(listbox, 0, 0); |
---|
794 | } |
---|
795 | else if(ostrncmp("(PROVIDER)-", tmpstr, 11) == 0 && strlen(tmpstr) > 6) |
---|
796 | { |
---|
797 | tmpstr1 = ostrcat(tmpstr1, _("Provider"), 0, 0); |
---|
798 | tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0); |
---|
799 | tmpstr1 = ostrcat(tmpstr1, tmpstr + 11, 1, 0); |
---|
800 | if(nochanneltitle == 0) |
---|
801 | { |
---|
802 | changetitle(channellist, tmpstr1); |
---|
803 | } |
---|
804 | free(tmpstr1); tmpstr1 = NULL; |
---|
805 | struct provider* providernode = getproviderbyname(tmpstr + 11); |
---|
806 | list = PROVIDERCHANNEL; |
---|
807 | aktlist = (void*)providernode; |
---|
808 | showproviderchannel(channellist, listbox, channeltimeline, providernode, flag); |
---|
809 | selectchannel(listbox, 0, 0); |
---|
810 | } |
---|
811 | else |
---|
812 | { |
---|
813 | if(nochanneltitle == 0) |
---|
814 | { |
---|
815 | changetitle(channellist, _("All Channels")); |
---|
816 | } |
---|
817 | list = ALLCHANNEL; |
---|
818 | showallchannel(channellist, listbox, channeltimeline, flag); |
---|
819 | selectchannel(listbox, 0, 0); |
---|
820 | } |
---|
821 | |
---|
822 | tmpstr = NULL; |
---|
823 | if(status.screenanim > 0 && firstdraw == 0) |
---|
824 | { |
---|
825 | firstdraw = 1; |
---|
826 | drawscreen(channellist, 0, 4); |
---|
827 | } |
---|
828 | else |
---|
829 | drawscreen(channellist, 2, 0); |
---|
830 | |
---|
831 | addscreenrcchannellist(channellist, listbox); |
---|
832 | |
---|
833 | if(flag == 3) |
---|
834 | { |
---|
835 | if(listbox->select != NULL) |
---|
836 | { |
---|
837 | resettvpic(); |
---|
838 | listmode = screenlistedit(list, (struct channel*)listbox->select->handle, aktlist); |
---|
839 | } |
---|
840 | if(listmode == NOMODE) goto end; |
---|
841 | if(nochanneltitle == 0) changechanneltitle(channellist, listbox, listmode, &oldtitle, &oldfontcol, &oldbgcol); |
---|
842 | } |
---|
843 | if(flag != 2) |
---|
844 | { |
---|
845 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
846 | drawchannellist(channellist, list, listbox); |
---|
847 | } |
---|
848 | |
---|
849 | while(1) |
---|
850 | { |
---|
851 | if(flag == 2) |
---|
852 | { |
---|
853 | rcret = getrcconfigint("rcblue", NULL); |
---|
854 | flag = 0; |
---|
855 | } |
---|
856 | else |
---|
857 | rcret = waitrc(channellist, 10000, 2); |
---|
858 | |
---|
859 | //read epg new |
---|
860 | if(listbox != NULL && listbox->select != NULL && (list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL)) |
---|
861 | { |
---|
862 | tmpskin = listbox->select; |
---|
863 | while(tmpskin != NULL) |
---|
864 | { |
---|
865 | if(tmpskin->pagecount != listbox->aktpage) break; |
---|
866 | changechannelepg((struct channel*)tmpskin->handle, tmpskin); |
---|
867 | tmpskin = tmpskin->prev; |
---|
868 | } |
---|
869 | tmpskin = listbox->select; |
---|
870 | while(tmpskin != NULL) |
---|
871 | { |
---|
872 | if(tmpskin->pagecount != listbox->aktpage) break; |
---|
873 | changechannelepg((struct channel*)tmpskin->handle, tmpskin); |
---|
874 | tmpskin = tmpskin->next; |
---|
875 | } |
---|
876 | } |
---|
877 | |
---|
878 | if(rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rcdown", NULL) || rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) |
---|
879 | { |
---|
880 | if(listmode != MVMODE || (listmode == MVMODE && status.markmodus == 0)) |
---|
881 | { |
---|
882 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
883 | drawchannellist(channellist, list, listbox); |
---|
884 | } |
---|
885 | } |
---|
886 | |
---|
887 | if(rcret == RCTIMEOUT) |
---|
888 | { |
---|
889 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
890 | drawscreen(channellist, 0, 0); |
---|
891 | } |
---|
892 | |
---|
893 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
894 | |
---|
895 | if((flag == 0 || flag == 3) && listmode > NOMODE) |
---|
896 | { |
---|
897 | |
---|
898 | if(rcret == getrcconfigint("rcmenu", NULL)) |
---|
899 | { |
---|
900 | int sid = 0; |
---|
901 | uint64_t tid = 0; |
---|
902 | if((list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) && listbox->select != NULL && listbox->select->handle != NULL) |
---|
903 | { |
---|
904 | sid = ((struct channel*)listbox->select->handle)->serviceid; |
---|
905 | tid = ((struct channel*)listbox->select->handle)->transponderid; |
---|
906 | } |
---|
907 | |
---|
908 | status.markmodus = 0; |
---|
909 | movesel = NULL; |
---|
910 | clearscreen(channellist); |
---|
911 | resettvpic(); |
---|
912 | |
---|
913 | listmode = screenlistedit(list, NULL, aktlist); |
---|
914 | if(listmode == MVMODE) |
---|
915 | { |
---|
916 | delrc(getrcconfigint("rcright", NULL), channellist, listbox); |
---|
917 | delrc(getrcconfigint("rcleft", NULL), channellist, listbox); |
---|
918 | } |
---|
919 | else |
---|
920 | addscreenrcchannellist(channellist, listbox); |
---|
921 | if(listmode == NOMODE && flag == 3) flag = 0; |
---|
922 | |
---|
923 | if(nochanneltitle == 0) changechanneltitle(channellist, listbox, listmode, &oldtitle, &oldfontcol, &oldbgcol); |
---|
924 | |
---|
925 | delmarkedscreennodes(channellist, 1); |
---|
926 | delmarkedscreennodes(channellist, 2); |
---|
927 | recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline); |
---|
928 | selectchannel(listbox, sid, tid); |
---|
929 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
930 | drawscreen(channellist, 0, 0); |
---|
931 | } |
---|
932 | if(listmode == PROTECTMODE && listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcok", NULL)) |
---|
933 | { |
---|
934 | if((list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) && listbox->select->handle != NULL) |
---|
935 | { |
---|
936 | if(((struct channel*)listbox->select->handle)->protect == 0) |
---|
937 | ((struct channel*)listbox->select->handle)->protect = 1; |
---|
938 | else |
---|
939 | { |
---|
940 | if(screenpincheck(1, NULL) == 0) |
---|
941 | ((struct channel*)listbox->select->handle)->protect = 0; |
---|
942 | } |
---|
943 | status.writechannel = 1; |
---|
944 | } |
---|
945 | delmarkedscreennodes(channellist, 1); |
---|
946 | delmarkedscreennodes(channellist, 2); |
---|
947 | recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline); |
---|
948 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
949 | drawscreen(channellist, 0, 0); |
---|
950 | } |
---|
951 | if(listmode == CPMODE && listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcok", NULL)) |
---|
952 | { |
---|
953 | if(list == PROVIDERLIST) |
---|
954 | { |
---|
955 | if(provider2bouquet(((struct provider*)listbox->select->handle1)->providerid, 0) == 0) |
---|
956 | textbox(_("Message"), _("Copy providerlist successfull"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0); |
---|
957 | else |
---|
958 | textbox(_("Message"), _("Copy providerlist not ok"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0); |
---|
959 | } |
---|
960 | else if(list == SATLIST) |
---|
961 | { |
---|
962 | if(sat2bouquet(((struct sat*)listbox->select->handle1)->orbitalpos, 0) == 0) |
---|
963 | textbox(_("Message"), _("Copy satlist successfull"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0); |
---|
964 | else |
---|
965 | textbox(_("Message"), _("Copy satlist not ok"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 10, 0); |
---|
966 | } |
---|
967 | else |
---|
968 | { |
---|
969 | struct mainbouquet* mbouquet = screenmainbouquet(); |
---|
970 | if(mbouquet != NULL && getbouquetbychannel(mbouquet->bouquet, ((struct channel*)listbox->select->handle)->serviceid, ((struct channel*)listbox->select->handle)->transponderid) == NULL) |
---|
971 | { |
---|
972 | tmpstr1 = oitoa(((struct channel*)listbox->select->handle)->serviceid); |
---|
973 | tmpstr = ostrcat(tmpstr, tmpstr1, 1, 1); tmpstr1 = NULL; |
---|
974 | tmpstr = ostrcat(tmpstr, "#", 1, 0); |
---|
975 | tmpstr1 = ollutoa(((struct channel*)listbox->select->handle)->transponderid); |
---|
976 | tmpstr = ostrcat(tmpstr, tmpstr1, 1, 1); tmpstr1 = NULL; |
---|
977 | addbouquet(&mbouquet->bouquet, tmpstr, status.servicetype, 0, NULL); |
---|
978 | free(tmpstr); tmpstr = NULL; |
---|
979 | recalcbouquetnr(); |
---|
980 | if(list == BOUQUETCHANNEL) |
---|
981 | { |
---|
982 | delmarkedscreennodes(channellist, 1); |
---|
983 | delmarkedscreennodes(channellist, 2); |
---|
984 | showbouquetchannel(channellist, listbox, channeltimeline, ((struct mainbouquet*)aktlist)->bouquet, (struct mainbouquet*)aktlist, 1); |
---|
985 | } |
---|
986 | } |
---|
987 | } |
---|
988 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
989 | drawscreen(channellist, 0, 0); |
---|
990 | } |
---|
991 | if(listmode == EDITMODE && listbox->select != NULL && listbox->select->handle1 != NULL && rcret == getrcconfigint("rcok", NULL)) |
---|
992 | { |
---|
993 | if(list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL) |
---|
994 | { |
---|
995 | struct channel* oldentry = ((struct channel*)listbox->select->handle1); |
---|
996 | char* newentry = textinput(NULL, oldentry->name); |
---|
997 | if(newentry != NULL) |
---|
998 | { |
---|
999 | newentry = stringreplacechar(newentry, '#', '_'); |
---|
1000 | free(oldentry->name); |
---|
1001 | oldentry->name = newentry; |
---|
1002 | status.writechannel = 1; |
---|
1003 | } |
---|
1004 | } |
---|
1005 | if(list == MAINBOUQUETLIST) |
---|
1006 | { |
---|
1007 | struct mainbouquet* oldentry = ((struct mainbouquet*)listbox->select->handle1); |
---|
1008 | char* newentry = textinput(NULL, oldentry->name); |
---|
1009 | if(newentry != NULL) |
---|
1010 | { |
---|
1011 | newentry = stringreplacechar(newentry, '#', '_'); |
---|
1012 | free(oldentry->name); |
---|
1013 | oldentry->name = newentry; |
---|
1014 | status.writemainbouquet = 1; |
---|
1015 | } |
---|
1016 | } |
---|
1017 | if(list == BOUQUETCHANNEL) |
---|
1018 | { |
---|
1019 | struct channel* oldentry = getchannel(((struct bouquet*)listbox->select->handle1)->serviceid, ((struct bouquet*)listbox->select->handle1)->transponderid); |
---|
1020 | if(oldentry != NULL) |
---|
1021 | { |
---|
1022 | char* newentry = textinput(NULL, oldentry->name); |
---|
1023 | if(newentry != NULL) |
---|
1024 | { |
---|
1025 | newentry = stringreplacechar(newentry, '#', '_'); |
---|
1026 | free(oldentry->name); |
---|
1027 | oldentry->name = newentry; |
---|
1028 | status.writechannel = 1; |
---|
1029 | } |
---|
1030 | } |
---|
1031 | } |
---|
1032 | delmarkedscreennodes(channellist, 1); |
---|
1033 | delmarkedscreennodes(channellist, 2); |
---|
1034 | status.markedchannel = NULL; |
---|
1035 | recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline); |
---|
1036 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1037 | drawscreen(channellist, 0, 0); |
---|
1038 | } |
---|
1039 | if(listmode == RMMODE && listbox->select != NULL && listbox->select->handle1 != NULL && rcret == getrcconfigint("rcok", NULL)) |
---|
1040 | { |
---|
1041 | if(list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL) |
---|
1042 | { |
---|
1043 | if(delchannel(((struct channel*)listbox->select->handle1)->serviceid, ((struct channel*)listbox->select->handle1)->transponderid, 0) == 0) |
---|
1044 | { |
---|
1045 | listbox->aktline--; |
---|
1046 | listbox->aktpage = -1; |
---|
1047 | } |
---|
1048 | else |
---|
1049 | textbox(_("Message"), _("Can't remove akive Service"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 7, 0); |
---|
1050 | } |
---|
1051 | if(list == SATLIST) |
---|
1052 | { |
---|
1053 | delsat(((struct sat*)listbox->select->handle1)->name); |
---|
1054 | listbox->aktline--; |
---|
1055 | listbox->aktpage = -1; |
---|
1056 | } |
---|
1057 | if(list == PROVIDERLIST) |
---|
1058 | { |
---|
1059 | delprovider(((struct provider*)listbox->select->handle1)->providerid); |
---|
1060 | listbox->aktline--; |
---|
1061 | listbox->aktpage = -1; |
---|
1062 | } |
---|
1063 | if(list == MAINBOUQUETLIST) |
---|
1064 | { |
---|
1065 | delmainbouquet(((struct mainbouquet*)listbox->select->handle1)->name, 1); |
---|
1066 | recalcbouquetnr(); |
---|
1067 | listbox->aktline--; |
---|
1068 | listbox->aktpage = -1; |
---|
1069 | } |
---|
1070 | if(list == BOUQUETCHANNEL) |
---|
1071 | { |
---|
1072 | delbouquet(((struct bouquet*)listbox->select->handle1)->serviceid, ((struct bouquet*)listbox->select->handle1)->transponderid, &((struct mainbouquet*)aktlist)->bouquet); |
---|
1073 | recalcbouquetnr(); |
---|
1074 | listbox->aktline--; |
---|
1075 | listbox->aktpage = -1; |
---|
1076 | } |
---|
1077 | delmarkedscreennodes(channellist, 1); |
---|
1078 | delmarkedscreennodes(channellist, 2); |
---|
1079 | status.markedchannel = NULL; |
---|
1080 | recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline); |
---|
1081 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1082 | drawscreen(channellist, 0, 0); |
---|
1083 | } |
---|
1084 | if(listmode == MVMODE && listbox->select != NULL && rcret == getrcconfigint("rcok", NULL)) |
---|
1085 | { |
---|
1086 | if(movesel == NULL) |
---|
1087 | { |
---|
1088 | status.markmodus = 1; |
---|
1089 | movesel = listbox->select->handle1; |
---|
1090 | } |
---|
1091 | else |
---|
1092 | { |
---|
1093 | status.markmodus = 0; |
---|
1094 | status.moveblockcount = 0; |
---|
1095 | movesel = NULL; |
---|
1096 | } |
---|
1097 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1098 | drawscreen(channellist, 0, 0); |
---|
1099 | } |
---|
1100 | if(listmode == MVMODE && listbox->select != NULL && movesel != NULL && (rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rcdown", NULL) || rcret == getrcconfigint("rcchdown", NULL) || rcret == getrcconfigint("rcchup", NULL))) |
---|
1101 | { |
---|
1102 | if(rcret == getrcconfigint("rcchdown", NULL) && listbox->linecount != (listbox->aktline + status.moveblockcount)) |
---|
1103 | { |
---|
1104 | struct skin* tmp = listbox->select; |
---|
1105 | int i = 0, count = 0; |
---|
1106 | status.moveblockcount++; |
---|
1107 | for(i = 0; i < status.moveblockcount; i++) |
---|
1108 | { |
---|
1109 | tmp = tmp->next; |
---|
1110 | if(tmp == NULL) |
---|
1111 | { |
---|
1112 | status.moveblockcount = count; |
---|
1113 | break; |
---|
1114 | } |
---|
1115 | count++; |
---|
1116 | } |
---|
1117 | if(status.moveblockcount > 10) |
---|
1118 | status.moveblockcount = 10; |
---|
1119 | drawscreen(channellist, 0, 0); |
---|
1120 | continue; |
---|
1121 | } |
---|
1122 | if(rcret == getrcconfigint("rcchup", NULL)) |
---|
1123 | { |
---|
1124 | status.moveblockcount--; |
---|
1125 | if(status.moveblockcount < 0) |
---|
1126 | status.moveblockcount = 0; |
---|
1127 | drawscreen(channellist, 0, 0); |
---|
1128 | continue; |
---|
1129 | } |
---|
1130 | if(rcret == getrcconfigint("rcup", NULL)) |
---|
1131 | { |
---|
1132 | if(list == ALLCHANNEL) |
---|
1133 | { |
---|
1134 | int ret = movechannelblockup(movesel); |
---|
1135 | if(ret == 99) // wrap |
---|
1136 | listbox->aktline -= (status.moveblockcount); |
---|
1137 | //movechannelup(movesel); |
---|
1138 | //while(((struct channel*)movesel)->next != NULL && ((struct channel*)movesel)->next->servicetype != status.servicetype) |
---|
1139 | // movechannelup(movesel); |
---|
1140 | } |
---|
1141 | if(list == SATLIST) |
---|
1142 | { |
---|
1143 | int ret = movesatblockup(movesel); |
---|
1144 | if(ret == 99) // wrap |
---|
1145 | listbox->aktline -= (status.moveblockcount); |
---|
1146 | //movesatup(movesel); |
---|
1147 | } |
---|
1148 | if(list == PROVIDERLIST) |
---|
1149 | { |
---|
1150 | int ret = moveproviderblockup(movesel); |
---|
1151 | if(ret == 99) // wrap |
---|
1152 | listbox->aktline -= (status.moveblockcount); |
---|
1153 | //moveproviderup(movesel); |
---|
1154 | } |
---|
1155 | if(list == MAINBOUQUETLIST) |
---|
1156 | { |
---|
1157 | int ret = movemainbouquetblockup(movesel); |
---|
1158 | if(ret == 99) // wrap |
---|
1159 | listbox->aktline -= (status.moveblockcount); |
---|
1160 | //movemainbouquetup(movesel); |
---|
1161 | //while(((struct mainbouquet*)movesel)->next != NULL && ((struct mainbouquet*)movesel)->next->type != status.servicetype) |
---|
1162 | // movemainbouquetup(movesel); |
---|
1163 | recalcbouquetnr(); |
---|
1164 | } |
---|
1165 | if(list == BOUQUETCHANNEL) |
---|
1166 | { |
---|
1167 | int ret = movebouquetblockup(movesel); |
---|
1168 | if(ret == 99) // wrap |
---|
1169 | listbox->aktline -= (status.moveblockcount); |
---|
1170 | //movebouquetup(movesel); |
---|
1171 | //while(((struct bouquet*)movesel)->next != NULL && ((struct bouquet*)movesel)->next->channel != NULL && ((struct bouquet*)movesel)->next->channel->servicetype != status.servicetype) |
---|
1172 | // movebouquetup(movesel); |
---|
1173 | recalcbouquetnr(); |
---|
1174 | } |
---|
1175 | } |
---|
1176 | if(rcret == getrcconfigint("rcdown", NULL)) |
---|
1177 | { |
---|
1178 | if(list == ALLCHANNEL) |
---|
1179 | { |
---|
1180 | int ret = movechannelblockdown(movesel); |
---|
1181 | if(ret == 99) // wrap |
---|
1182 | { |
---|
1183 | listbox->aktpage = -1; |
---|
1184 | listbox->aktline = 1; |
---|
1185 | } |
---|
1186 | //movechanneldown(movesel); |
---|
1187 | //while(((struct channel*)movesel)->prev != NULL && ((struct channel*)movesel)->prev->servicetype != status.servicetype) |
---|
1188 | // movechanneldown(movesel); |
---|
1189 | } |
---|
1190 | if(list == SATLIST) |
---|
1191 | { |
---|
1192 | int ret = movesatblockdown(movesel); |
---|
1193 | if(ret == 99) // wrap |
---|
1194 | { |
---|
1195 | listbox->aktpage = -1; |
---|
1196 | listbox->aktline = 1; |
---|
1197 | } |
---|
1198 | //movesatdown(movesel); |
---|
1199 | } |
---|
1200 | if(list == PROVIDERLIST) |
---|
1201 | { |
---|
1202 | int ret = moveproviderblockdown(movesel); |
---|
1203 | if(ret == 99) // wrap |
---|
1204 | { |
---|
1205 | listbox->aktpage = -1; |
---|
1206 | listbox->aktline = 1; |
---|
1207 | } |
---|
1208 | //moveproviderdown(movesel); |
---|
1209 | } |
---|
1210 | if(list == MAINBOUQUETLIST) |
---|
1211 | { |
---|
1212 | int ret = movemainbouquetblockdown(movesel); |
---|
1213 | if(ret == 99) // wrap |
---|
1214 | { |
---|
1215 | listbox->aktpage = -1; |
---|
1216 | listbox->aktline = 1; |
---|
1217 | } |
---|
1218 | //movemainbouquetdown(movesel); |
---|
1219 | //while(((struct mainbouquet*)movesel)->prev != NULL && ((struct mainbouquet*)movesel)->prev->type != status.servicetype) |
---|
1220 | // movemainbouquetdown(movesel); |
---|
1221 | recalcbouquetnr(); |
---|
1222 | } |
---|
1223 | if(list == BOUQUETCHANNEL) |
---|
1224 | { |
---|
1225 | int ret = movebouquetblockdown(movesel); |
---|
1226 | if(ret == 99) // wrap |
---|
1227 | { |
---|
1228 | listbox->aktpage = -1; |
---|
1229 | listbox->aktline = 1; |
---|
1230 | } |
---|
1231 | //movebouquetdown(movesel); |
---|
1232 | //while(((struct bouquet*)movesel)->prev != NULL && ((struct bouquet*)movesel)->prev->channel != NULL && ((struct bouquet*)movesel)->prev->channel->servicetype != status.servicetype) |
---|
1233 | // movebouquetdown(movesel); |
---|
1234 | recalcbouquetnr(); |
---|
1235 | } |
---|
1236 | } |
---|
1237 | delmarkedscreennodes(channellist, 1); |
---|
1238 | delmarkedscreennodes(channellist, 2); |
---|
1239 | recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline); |
---|
1240 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1241 | drawscreen(channellist, 0, 0); |
---|
1242 | } |
---|
1243 | continue; |
---|
1244 | } |
---|
1245 | |
---|
1246 | if(rcret == getrcconfigint("rcred", NULL)) |
---|
1247 | { |
---|
1248 | list = ALLCHANNEL; |
---|
1249 | if(status.servicetype == 0) |
---|
1250 | addconfigtmp("channellist", "(ALL)"); |
---|
1251 | else |
---|
1252 | addconfigtmp("rchannellist", "(ALL)"); |
---|
1253 | if(nochanneltitle == 0) |
---|
1254 | { |
---|
1255 | changetitle(channellist, _("All Channels")); |
---|
1256 | } |
---|
1257 | delmarkedscreennodes(channellist, 1); |
---|
1258 | delmarkedscreennodes(channellist, 2); |
---|
1259 | showallchannel(channellist, listbox, channeltimeline, flag); |
---|
1260 | selectchannel(listbox, 0, 0); |
---|
1261 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1262 | drawchannellist(channellist, list, listbox); |
---|
1263 | continue; |
---|
1264 | } |
---|
1265 | if(rcret == getrcconfigint("rcblue", NULL) || rcret == getrcconfigint("rcfav", NULL)) |
---|
1266 | { |
---|
1267 | list = MAINBOUQUETLIST; |
---|
1268 | if(nochanneltitle == 0) |
---|
1269 | { |
---|
1270 | changetitle(channellist, _("Bouquets")); |
---|
1271 | } |
---|
1272 | delmarkedscreennodes(channellist, 1); |
---|
1273 | delmarkedscreennodes(channellist, 2); |
---|
1274 | showmainbouquet(channellist, listbox); |
---|
1275 | if(status.servicetype == 0) |
---|
1276 | { |
---|
1277 | delconfigtmp("channellist"); |
---|
1278 | tmpstr = getconfig("channellist", NULL); |
---|
1279 | } |
---|
1280 | else |
---|
1281 | { |
---|
1282 | delconfigtmp("rchannellist"); |
---|
1283 | tmpstr = getconfig("rchannellist", NULL); |
---|
1284 | } |
---|
1285 | if(ostrncmp("(BOUQUET)-", tmpstr, 10) != 0) tmpstr = NULL; |
---|
1286 | if(tmpstr != NULL && strlen(tmpstr) > 10) |
---|
1287 | setlistboxselection(listbox, tmpstr + 10); |
---|
1288 | else |
---|
1289 | { |
---|
1290 | listbox->aktpage = -1; |
---|
1291 | listbox->aktline = 1; |
---|
1292 | } |
---|
1293 | tmpstr = NULL; |
---|
1294 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1295 | drawchannellist(channellist, list, listbox); |
---|
1296 | continue; |
---|
1297 | } |
---|
1298 | if(rcret == getrcconfigint("rcgreen", NULL)) |
---|
1299 | { |
---|
1300 | list = SATLIST; |
---|
1301 | if(nochanneltitle == 0) |
---|
1302 | { |
---|
1303 | changetitle(channellist, _("Satellites")); |
---|
1304 | } |
---|
1305 | delmarkedscreennodes(channellist, 1); |
---|
1306 | delmarkedscreennodes(channellist, 2); |
---|
1307 | showsat(channellist, listbox); |
---|
1308 | if(status.servicetype == 0) |
---|
1309 | { |
---|
1310 | delconfigtmp("channellist"); |
---|
1311 | tmpstr = getconfig("channellist", NULL); |
---|
1312 | } |
---|
1313 | else |
---|
1314 | { |
---|
1315 | delconfigtmp("rchannellist"); |
---|
1316 | tmpstr = getconfig("rchannellist", NULL); |
---|
1317 | } |
---|
1318 | if(ostrncmp("(SAT)-", tmpstr, 6) != 0) tmpstr = NULL; |
---|
1319 | if(tmpstr != NULL && strlen(tmpstr) > 6) |
---|
1320 | setlistboxselection(listbox, tmpstr + 6); |
---|
1321 | else |
---|
1322 | { |
---|
1323 | listbox->aktpage = -1; |
---|
1324 | listbox->aktline = 1; |
---|
1325 | } |
---|
1326 | tmpstr = NULL; |
---|
1327 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1328 | drawchannellist(channellist, list, listbox); |
---|
1329 | continue; |
---|
1330 | } |
---|
1331 | if(rcret == getrcconfigint("rctext", NULL)) |
---|
1332 | { |
---|
1333 | list = AZLIST; |
---|
1334 | if(nochanneltitle == 0) |
---|
1335 | { |
---|
1336 | changetitle(channellist, _("Channels A-Z")); |
---|
1337 | } |
---|
1338 | delmarkedscreennodes(channellist, 1); |
---|
1339 | delmarkedscreennodes(channellist, 2); |
---|
1340 | showaz(channellist, listbox); |
---|
1341 | if(status.servicetype == 0) |
---|
1342 | { |
---|
1343 | delconfigtmp("channellist"); |
---|
1344 | tmpstr = getconfig("channellist", NULL); |
---|
1345 | } |
---|
1346 | else |
---|
1347 | { |
---|
1348 | delconfigtmp("rchannellist"); |
---|
1349 | tmpstr = getconfig("rchannellist", NULL); |
---|
1350 | } |
---|
1351 | if(ostrncmp("(A-Z)-", tmpstr, 6) != 0) tmpstr = NULL; |
---|
1352 | if(tmpstr != NULL && strlen(tmpstr) > 6) |
---|
1353 | setlistboxselection(listbox, &tmpstr[6]); |
---|
1354 | else |
---|
1355 | { |
---|
1356 | listbox->aktpage = -1; |
---|
1357 | listbox->aktline = 1; |
---|
1358 | } |
---|
1359 | tmpstr = NULL; |
---|
1360 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1361 | drawchannellist(channellist, list, listbox); |
---|
1362 | continue; |
---|
1363 | } |
---|
1364 | if(rcret == getrcconfigint("rcyellow", NULL)) |
---|
1365 | { |
---|
1366 | list = PROVIDERLIST; |
---|
1367 | if(nochanneltitle == 0) |
---|
1368 | { |
---|
1369 | changetitle(channellist, _("Provider")); |
---|
1370 | } |
---|
1371 | delmarkedscreennodes(channellist, 1); |
---|
1372 | delmarkedscreennodes(channellist, 2); |
---|
1373 | showprovider(channellist, listbox); |
---|
1374 | if(status.servicetype == 0) |
---|
1375 | { |
---|
1376 | delconfigtmp("channellist"); |
---|
1377 | tmpstr = getconfig("channellist", NULL); |
---|
1378 | } |
---|
1379 | else |
---|
1380 | { |
---|
1381 | delconfigtmp("rchannellist"); |
---|
1382 | tmpstr = getconfig("rchannellist", NULL); |
---|
1383 | } |
---|
1384 | if(ostrncmp("(PROVIDER)-", tmpstr, 11) != 0) tmpstr = NULL; |
---|
1385 | if(tmpstr != NULL && strlen(tmpstr) > 11) |
---|
1386 | setlistboxselection(listbox, tmpstr + 11); |
---|
1387 | else |
---|
1388 | { |
---|
1389 | listbox->aktpage = -1; |
---|
1390 | listbox->aktline = 1; |
---|
1391 | } |
---|
1392 | tmpstr = NULL; |
---|
1393 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1394 | drawchannellist(channellist, list, listbox); |
---|
1395 | continue; |
---|
1396 | } |
---|
1397 | if((list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) && rcret == getrcconfigint("rcok", NULL)) |
---|
1398 | { |
---|
1399 | if(listbox->select != NULL && listbox->select->handle != NULL) |
---|
1400 | { |
---|
1401 | if(flag == 1) |
---|
1402 | { |
---|
1403 | if(retchannel != NULL) |
---|
1404 | *retchannel = (struct channel*)listbox->select->handle; |
---|
1405 | if(retchannellist != NULL) |
---|
1406 | { |
---|
1407 | if(status.servicetype == 0) |
---|
1408 | *retchannellist = ostrcat(getconfig("channellist", NULL), NULL, 0, 0); |
---|
1409 | else |
---|
1410 | *retchannellist = ostrcat(getconfig("rchannellist", NULL), NULL, 0, 0); |
---|
1411 | } |
---|
1412 | break; |
---|
1413 | } |
---|
1414 | |
---|
1415 | clearscreen(channellist); |
---|
1416 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1417 | resettvpic(); |
---|
1418 | drawscreen(skin, 0, 0); |
---|
1419 | if(status.servicetype == 0) |
---|
1420 | ret = servicestart((struct channel*)listbox->select->handle, getconfig("channellist", NULL), NULL, 0); |
---|
1421 | else |
---|
1422 | ret = servicestart((struct channel*)listbox->select->handle, getconfig("rchannellist", NULL), NULL, 0); |
---|
1423 | if(ret == 20) writeconfigtmp(); |
---|
1424 | servicecheckret(ret, 0); |
---|
1425 | break; |
---|
1426 | } |
---|
1427 | continue; |
---|
1428 | } |
---|
1429 | if(list == BOUQUETCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL) || rcret == getrcconfigint("rclast", NULL) || rcret == getrcconfigint("rcprev", NULL))) |
---|
1430 | { |
---|
1431 | struct mainbouquet* tmpaktlist = ((struct mainbouquet*)aktlist); |
---|
1432 | |
---|
1433 | int round = 0; |
---|
1434 | while(tmpaktlist != NULL) |
---|
1435 | { |
---|
1436 | if(rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcprev", NULL)) |
---|
1437 | { |
---|
1438 | tmpaktlist = tmpaktlist->next; |
---|
1439 | if(tmpaktlist == NULL && round == 0) |
---|
1440 | { |
---|
1441 | round = 1; |
---|
1442 | tmpaktlist = mainbouquet; |
---|
1443 | } |
---|
1444 | } |
---|
1445 | else if(rcret == getrcconfigint("rcfr", NULL) || rcret == getrcconfigint("rclast", NULL)) |
---|
1446 | { |
---|
1447 | tmpaktlist = tmpaktlist->prev; |
---|
1448 | if(tmpaktlist == NULL && round == 0) |
---|
1449 | { |
---|
1450 | round = 1; |
---|
1451 | tmpaktlist = getlastmainbouquet(mainbouquet); |
---|
1452 | } |
---|
1453 | } |
---|
1454 | if(tmpaktlist == NULL) break; |
---|
1455 | if(tmpaktlist->type != status.servicetype) continue; |
---|
1456 | |
---|
1457 | delmarkedscreennodes(channellist, 1); |
---|
1458 | struct skin* tmpnode = addlistbox(channellist, listbox, NULL, 2); |
---|
1459 | if(tmpnode != NULL) |
---|
1460 | { |
---|
1461 | listbox->aktline = 1; |
---|
1462 | listbox->aktpage = -1; |
---|
1463 | |
---|
1464 | drawscreen(channellist, 2, 0); |
---|
1465 | changetext(tmpnode, tmpaktlist->name); |
---|
1466 | tmpnode->handle = (char*)tmpaktlist->bouquet; |
---|
1467 | tmpnode->handle1 = (char*)tmpaktlist; |
---|
1468 | rcret = getrcconfigint("rcok", NULL); |
---|
1469 | list = MAINBOUQUETLIST; |
---|
1470 | break; |
---|
1471 | } |
---|
1472 | } |
---|
1473 | } |
---|
1474 | if(list == MAINBOUQUETLIST && rcret == getrcconfigint("rcok", NULL)) |
---|
1475 | { |
---|
1476 | if(listbox->select != NULL) |
---|
1477 | { |
---|
1478 | list = BOUQUETCHANNEL; |
---|
1479 | tmpstr = ostrcat(tmpstr, _("Bouquets"), 0, 0); |
---|
1480 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
1481 | tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0); |
---|
1482 | if(nochanneltitle == 0) |
---|
1483 | { |
---|
1484 | changetitle(channellist, tmpstr); |
---|
1485 | } |
---|
1486 | free(tmpstr); tmpstr = NULL; |
---|
1487 | tmpstr = ostrcat(tmpstr, "(BOUQUET)-", 0, 0); |
---|
1488 | tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0); |
---|
1489 | if(status.servicetype == 0) |
---|
1490 | addconfigtmp("channellist", tmpstr); |
---|
1491 | else |
---|
1492 | addconfigtmp("rchannellist", tmpstr); |
---|
1493 | free(tmpstr); tmpstr = NULL; |
---|
1494 | aktlist = listbox->select->handle1; |
---|
1495 | showbouquetchannel(channellist, listbox, channeltimeline, (struct bouquet*)listbox->select->handle, (struct mainbouquet*)aktlist, flag); |
---|
1496 | delmarkedscreennodes(channellist, 2); |
---|
1497 | selectchannel(listbox, 0, 0); |
---|
1498 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1499 | drawchannellist(channellist, list, listbox); |
---|
1500 | } |
---|
1501 | continue; |
---|
1502 | } |
---|
1503 | if(list == SATCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL))) |
---|
1504 | { |
---|
1505 | struct sat* tmpaktlist = ((struct sat*)aktlist); |
---|
1506 | |
---|
1507 | int round = 0; |
---|
1508 | while(tmpaktlist != NULL) |
---|
1509 | { |
---|
1510 | if(rcret == getrcconfigint("rcff", NULL)) |
---|
1511 | { |
---|
1512 | tmpaktlist = tmpaktlist->next; |
---|
1513 | if(tmpaktlist == NULL && round == 0) |
---|
1514 | { |
---|
1515 | round = 1; |
---|
1516 | tmpaktlist = sat; |
---|
1517 | } |
---|
1518 | } |
---|
1519 | else if(rcret == getrcconfigint("rcfr", NULL)) |
---|
1520 | { |
---|
1521 | tmpaktlist = tmpaktlist->prev; |
---|
1522 | if(tmpaktlist == NULL && round == 0) |
---|
1523 | { |
---|
1524 | round = 1; |
---|
1525 | tmpaktlist = getlastsat(sat); |
---|
1526 | } |
---|
1527 | } |
---|
1528 | if(tmpaktlist == NULL) break; |
---|
1529 | |
---|
1530 | delmarkedscreennodes(channellist, 1); |
---|
1531 | struct skin* tmpnode = addlistbox(channellist, listbox, NULL, 2); |
---|
1532 | if(tmpnode != NULL) |
---|
1533 | { |
---|
1534 | listbox->aktline = 1; |
---|
1535 | listbox->aktpage = -1; |
---|
1536 | |
---|
1537 | drawscreen(channellist, 2, 0); |
---|
1538 | changetext(tmpnode, tmpaktlist->name); |
---|
1539 | tmpnode->handle = (char*)tmpaktlist; |
---|
1540 | tmpnode->handle1 = (char*)tmpaktlist; |
---|
1541 | rcret = getrcconfigint("rcok", NULL); |
---|
1542 | list = SATLIST; |
---|
1543 | break; |
---|
1544 | } |
---|
1545 | } |
---|
1546 | } |
---|
1547 | if(list == SATLIST && rcret == getrcconfigint("rcok", NULL)) |
---|
1548 | { |
---|
1549 | if(listbox->select != NULL) |
---|
1550 | { |
---|
1551 | list = SATCHANNEL; |
---|
1552 | tmpstr = ostrcat(tmpstr, _("Satellites"), 0, 0); |
---|
1553 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
1554 | tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0); |
---|
1555 | if(nochanneltitle == 0) |
---|
1556 | { |
---|
1557 | changetitle(channellist, tmpstr); |
---|
1558 | } |
---|
1559 | free(tmpstr); tmpstr = NULL; |
---|
1560 | tmpstr = ostrcat(tmpstr, "(SAT)-", 0, 0); |
---|
1561 | tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0); |
---|
1562 | if(status.servicetype == 0) |
---|
1563 | addconfigtmp("channellist", tmpstr); |
---|
1564 | else |
---|
1565 | addconfigtmp("rchannellist", tmpstr); |
---|
1566 | free(tmpstr); tmpstr = NULL; |
---|
1567 | aktlist = listbox->select->handle; |
---|
1568 | showsatchannel(channellist, listbox, channeltimeline, (struct sat*)listbox->select->handle, flag); |
---|
1569 | delmarkedscreennodes(channellist, 2); |
---|
1570 | selectchannel(listbox, 0, 0); |
---|
1571 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1572 | drawchannellist(channellist, list, listbox); |
---|
1573 | } |
---|
1574 | continue; |
---|
1575 | } |
---|
1576 | if(list == AZCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL))) |
---|
1577 | { |
---|
1578 | int tmpaktlist = (int)aktlist; |
---|
1579 | |
---|
1580 | if(rcret == getrcconfigint("rcff", NULL)) |
---|
1581 | { |
---|
1582 | tmpaktlist++; |
---|
1583 | if(tmpaktlist > 90) tmpaktlist = 65; |
---|
1584 | } |
---|
1585 | else if(rcret == getrcconfigint("rcfr", NULL)) |
---|
1586 | { |
---|
1587 | tmpaktlist--; |
---|
1588 | if(tmpaktlist < 65) tmpaktlist = 90; |
---|
1589 | } |
---|
1590 | |
---|
1591 | delmarkedscreennodes(channellist, 1); |
---|
1592 | struct skin* tmpnode = addlistbox(channellist, listbox, NULL, 2); |
---|
1593 | if(tmpnode != NULL) |
---|
1594 | { |
---|
1595 | listbox->aktline = 1; |
---|
1596 | listbox->aktpage = -1; |
---|
1597 | |
---|
1598 | drawscreen(channellist, 2, 0); |
---|
1599 | tmpstr = malloc(2); |
---|
1600 | if(tmpstr != NULL) |
---|
1601 | { |
---|
1602 | snprintf(tmpstr, 2, "%c", tmpaktlist); |
---|
1603 | changetext(tmpnode, tmpstr); |
---|
1604 | free(tmpstr); tmpstr = NULL; |
---|
1605 | } |
---|
1606 | tmpnode->handle = (char*)tmpaktlist; |
---|
1607 | tmpnode->handle1 = (char*)tmpaktlist; |
---|
1608 | rcret = getrcconfigint("rcok", NULL); |
---|
1609 | list = AZLIST; |
---|
1610 | } |
---|
1611 | } |
---|
1612 | if(list == AZLIST && rcret == getrcconfigint("rcok", NULL)) |
---|
1613 | { |
---|
1614 | if(listbox->select != NULL) |
---|
1615 | { |
---|
1616 | list = AZCHANNEL; |
---|
1617 | tmpstr = ostrcat(tmpstr, _("Channel"), 0, 0); |
---|
1618 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
1619 | tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0); |
---|
1620 | if(nochanneltitle == 0) |
---|
1621 | { |
---|
1622 | changetitle(channellist, tmpstr); |
---|
1623 | } |
---|
1624 | free(tmpstr); tmpstr = NULL; |
---|
1625 | tmpstr = ostrcat(tmpstr, "(A-Z)-", 0, 0); |
---|
1626 | tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0); |
---|
1627 | if(status.servicetype == 0) |
---|
1628 | addconfigtmp("channellist", tmpstr); |
---|
1629 | else |
---|
1630 | addconfigtmp("rchannellist", tmpstr); |
---|
1631 | free(tmpstr); tmpstr = NULL; |
---|
1632 | aktlist = listbox->select->handle; |
---|
1633 | showazchannel(channellist, listbox, channeltimeline, (int)listbox->select->handle, flag); |
---|
1634 | delmarkedscreennodes(channellist, 2); |
---|
1635 | selectchannel(listbox, 0, 0); |
---|
1636 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1637 | drawchannellist(channellist, list, listbox); |
---|
1638 | } |
---|
1639 | continue; |
---|
1640 | } |
---|
1641 | if(list == PROVIDERCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL))) |
---|
1642 | { |
---|
1643 | struct provider* tmpaktlist = ((struct provider*)aktlist); |
---|
1644 | |
---|
1645 | int round = 0; |
---|
1646 | while(tmpaktlist != NULL) |
---|
1647 | { |
---|
1648 | if(rcret == getrcconfigint("rcff", NULL)) |
---|
1649 | { |
---|
1650 | tmpaktlist = tmpaktlist->next; |
---|
1651 | if(tmpaktlist == NULL && round == 0) |
---|
1652 | { |
---|
1653 | round = 1; |
---|
1654 | tmpaktlist = provider; |
---|
1655 | } |
---|
1656 | } |
---|
1657 | else if(rcret == getrcconfigint("rcfr", NULL)) |
---|
1658 | { |
---|
1659 | tmpaktlist = tmpaktlist->prev; |
---|
1660 | if(tmpaktlist == NULL && round == 0) |
---|
1661 | { |
---|
1662 | round = 1; |
---|
1663 | tmpaktlist = getlastprovider(provider); |
---|
1664 | } |
---|
1665 | } |
---|
1666 | if(tmpaktlist == NULL) break; |
---|
1667 | |
---|
1668 | if(checkprovider(tmpaktlist) == 1) |
---|
1669 | { |
---|
1670 | delmarkedscreennodes(channellist, 1); |
---|
1671 | struct skin* tmpnode = addlistbox(channellist, listbox, NULL, 2); |
---|
1672 | if(tmpnode != NULL) |
---|
1673 | { |
---|
1674 | listbox->aktline = 1; |
---|
1675 | listbox->aktpage = -1; |
---|
1676 | |
---|
1677 | drawscreen(channellist, 2, 0); |
---|
1678 | changetext(tmpnode, tmpaktlist->name); |
---|
1679 | tmpnode->handle = (char*)tmpaktlist; |
---|
1680 | tmpnode->handle1 = (char*)tmpaktlist; |
---|
1681 | rcret = getrcconfigint("rcok", NULL); |
---|
1682 | list = PROVIDERLIST; |
---|
1683 | break; |
---|
1684 | } |
---|
1685 | } |
---|
1686 | } |
---|
1687 | } |
---|
1688 | if(list == PROVIDERLIST && rcret == getrcconfigint("rcok", NULL)) |
---|
1689 | { |
---|
1690 | if(listbox->select != NULL) |
---|
1691 | { |
---|
1692 | list = PROVIDERCHANNEL; |
---|
1693 | tmpstr = ostrcat(tmpstr, _("Provider"), 0, 0); |
---|
1694 | tmpstr = ostrcat(tmpstr, " - ", 1, 0); |
---|
1695 | tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0); |
---|
1696 | if(nochanneltitle == 0) |
---|
1697 | { |
---|
1698 | changetitle(channellist, tmpstr); |
---|
1699 | } |
---|
1700 | free(tmpstr); tmpstr = NULL; |
---|
1701 | tmpstr = ostrcat(tmpstr, "(PROVIDER)-", 0, 0); |
---|
1702 | tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0); |
---|
1703 | if(status.servicetype == 0) |
---|
1704 | addconfigtmp("channellist", tmpstr); |
---|
1705 | else |
---|
1706 | addconfigtmp("rchannellist", tmpstr); |
---|
1707 | free(tmpstr); tmpstr = NULL; |
---|
1708 | aktlist = listbox->select->handle; |
---|
1709 | showproviderchannel(channellist, listbox, channeltimeline, (struct provider*) listbox->select->handle, flag); |
---|
1710 | delmarkedscreennodes(channellist, 2); |
---|
1711 | selectchannel(listbox, 0, 0); |
---|
1712 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1713 | drawchannellist(channellist, list, listbox); |
---|
1714 | } |
---|
1715 | continue; |
---|
1716 | } |
---|
1717 | if(flag == 0 && rcret == getrcconfigint("rcmenu", NULL)) |
---|
1718 | { |
---|
1719 | if(list == AZLIST) continue; |
---|
1720 | |
---|
1721 | int sid = 0; |
---|
1722 | uint64_t tid = 0; |
---|
1723 | if((list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) && listbox->select != NULL && listbox->select->handle != NULL) |
---|
1724 | { |
---|
1725 | sid = ((struct channel*)listbox->select->handle)->serviceid; |
---|
1726 | tid = ((struct channel*)listbox->select->handle)->transponderid; |
---|
1727 | } |
---|
1728 | |
---|
1729 | clearscreen(channellist); |
---|
1730 | resettvpic(); |
---|
1731 | |
---|
1732 | if(listbox->select != NULL) |
---|
1733 | listmode = screenlistedit(list, (struct channel*)listbox->select->handle, aktlist); |
---|
1734 | else |
---|
1735 | listmode = screenlistedit(list, NULL, aktlist); |
---|
1736 | |
---|
1737 | if(listmode == MVMODE) |
---|
1738 | { |
---|
1739 | delrc(getrcconfigint("rcright", NULL), channellist, listbox); |
---|
1740 | delrc(getrcconfigint("rcleft", NULL), channellist, listbox); |
---|
1741 | } |
---|
1742 | else |
---|
1743 | addscreenrcchannellist(channellist, listbox); |
---|
1744 | |
---|
1745 | if(nochanneltitle == 0) changechanneltitle(channellist, listbox, listmode, &oldtitle, &oldfontcol, &oldbgcol); |
---|
1746 | |
---|
1747 | if(listmode == NOMODE && flag == 3) flag = 0; |
---|
1748 | delmarkedscreennodes(channellist, 1); |
---|
1749 | delmarkedscreennodes(channellist, 2); |
---|
1750 | recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline); |
---|
1751 | selectchannel(listbox, sid, tid); |
---|
1752 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1753 | drawscreen(channellist, 0, 0); |
---|
1754 | continue; |
---|
1755 | } |
---|
1756 | if(flag == 0 && rcret == getrcconfigint("rcepg", NULL) && (list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL)) |
---|
1757 | { |
---|
1758 | int ret = 0; |
---|
1759 | if(listbox->select != NULL) |
---|
1760 | { |
---|
1761 | clearscreen(channellist); |
---|
1762 | resettvpic(); |
---|
1763 | struct channel* tmpmarkedchannel = status.markedchannel; |
---|
1764 | ret = epgchoice((struct channel*)listbox->select->handle); |
---|
1765 | //epg ends with no zap |
---|
1766 | if(ret == 0) |
---|
1767 | { |
---|
1768 | status.markedchannel = tmpmarkedchannel; |
---|
1769 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1770 | drawchannellist(channellist, list, listbox); |
---|
1771 | } |
---|
1772 | } |
---|
1773 | if(ret == 1) |
---|
1774 | break; |
---|
1775 | else |
---|
1776 | continue; |
---|
1777 | } |
---|
1778 | if(flag == 0 && rcret == getrcconfigint("rc0", NULL) && (list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL)) |
---|
1779 | { |
---|
1780 | if(listbox->select != NULL) |
---|
1781 | { |
---|
1782 | clearscreen(channellist); |
---|
1783 | resettvpic(); |
---|
1784 | struct channel* tmpmarkedchannel = status.markedchannel; |
---|
1785 | screenshortepg((struct channel*)listbox->select->handle, NULL, 0); |
---|
1786 | status.markedchannel = tmpmarkedchannel; |
---|
1787 | changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, flag); |
---|
1788 | drawscreen(channellist, 0, 0); |
---|
1789 | } |
---|
1790 | continue; |
---|
1791 | } |
---|
1792 | if(flag == 0 && rcret == getrcconfigint("rcinfo", NULL)) |
---|
1793 | { |
---|
1794 | if(status.servicetype == 0) |
---|
1795 | { |
---|
1796 | status.servicetype = 1; |
---|
1797 | changetext(b8, _("TV")); |
---|
1798 | } |
---|
1799 | else |
---|
1800 | { |
---|
1801 | status.servicetype = 0; |
---|
1802 | changetext(b8, _("Radio")); |
---|
1803 | } |
---|
1804 | newmodus = 1; |
---|
1805 | break; |
---|
1806 | } |
---|
1807 | } |
---|
1808 | |
---|
1809 | end: |
---|
1810 | listbox->fontcol = oldfontcol; |
---|
1811 | listbox->bgcol = oldbgcol; |
---|
1812 | status.moveblockcount = 0; |
---|
1813 | free(oldtitle); |
---|
1814 | status.markedchannel = NULL; |
---|
1815 | status.markmodus = 0; |
---|
1816 | delmarkedscreennodes(channellist, 1); |
---|
1817 | delmarkedscreennodes(channellist, 2); |
---|
1818 | delownerrc(channellist); |
---|
1819 | delconfigtmp("channellist"); |
---|
1820 | delconfigtmp("rchannellist"); |
---|
1821 | clearscreen(channellist); |
---|
1822 | if(newmodus == 1) goto start; |
---|
1823 | status.channelswitch = 0; |
---|
1824 | resettvpic(); |
---|
1825 | return ret; |
---|
1826 | } |
---|
1827 | |
---|
1828 | #endif |
---|