source: titan/titan/channellist.h @ 15586

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

fix

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