source: titan/titan/channellist.h @ 26727

Last change on this file since 26727 was 24223, checked in by nit, 11 years ago

[titan] add flag to copy only provider/sat with channel

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