source: titan/titan/channellist.h @ 15585

Last change on this file since 15585 was 15585, checked in by obi, 11 years ago

fix

File size: 44.2 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<<<<<<< .mine
457        if(*oldcol == -9999)
458                *oldcol = channellist->fontcol;
459=======
460        if(*oldcol == NULL)
461                *oldcol = channellist->bgcol;
462>>>>>>> .r15584
463
464        if(listmode == MVMODE)
465        {
466                tmpstr = ostrcat(*oldtitle, " - ", 0, 0);
467                tmpstr = ostrcat(tmpstr, _("Move mode"), 1, 0);
468                changetitle(channellist, tmpstr);
469<<<<<<< .mine
470                channellist->fontcol = convercol("mvmode");
471=======
472                channellist->bgcol = convercol("mvmode");
473>>>>>>> .r15584
474        }
475        else if(listmode == RMMODE)
476        {
477                tmpstr = ostrcat(*oldtitle, " - ", 0, 0);
478                tmpstr = ostrcat(tmpstr, _("Remove mode"), 1, 0);
479                changetitle(channellist, tmpstr);
480<<<<<<< .mine
481                channellist->fontcol = convercol("rmmode");
482=======
483                channellist->bgcol = convercol("rmmode");
484>>>>>>> .r15584
485        }
486        else if(listmode == CPMODE)
487        {
488                tmpstr = ostrcat(*oldtitle, " - ", 0, 0);
489                tmpstr = ostrcat(tmpstr, _("Copy mode"), 1, 0);
490                changetitle(channellist, tmpstr);
491<<<<<<< .mine
492                channellist->fontcol = convercol("cpmode");
493=======
494                channellist->bgcol = convercol("cpmode");               
495>>>>>>> .r15584
496        }
497        else if(listmode == PROTECTMODE)
498        {
499                tmpstr = ostrcat(*oldtitle, " - ", 0, 0);
500                tmpstr = ostrcat(tmpstr, _("Protect mode"), 1, 0);
501                changetitle(channellist, tmpstr);
502<<<<<<< .mine
503                channellist->fontcol = convercol("protectmode");
504=======
505                channellist->bgcol = convercol("protectmode");
506>>>>>>> .r15584
507        }
508        else if(listmode == EDITMODE)
509        {
510                tmpstr = ostrcat(*oldtitle, " - ", 0, 0);
511                tmpstr = ostrcat(tmpstr, _("Edit mode"), 1, 0);
512                changetitle(channellist, tmpstr);
513<<<<<<< .mine
514                channellist->fontcol = convercol("editmode");
515=======
516                channellist->bgcol = convercol("editmode");
517>>>>>>> .r15584
518        }
519        else
520        {       
521                changetitle(channellist, *oldtitle);
522                *oldtitle = NULL;
523<<<<<<< .mine
524                channellist->fontcol = *oldcol;
525                *oldcol = -9999;
526=======
527                channellist->bgcol = *oldcol;
528>>>>>>> .r15584
529        }
530}
531
532//flag 1: called from recordtimer screen
533//flag 2: rcfav (open bouquetlist)
534//flag 3: edit modus
535int screenchannellist(struct channel** retchannel, char** retchannellist, int flag)
536{
537        struct skin* channellist = getscreen("channellist");
538        struct skin* listbox = getscreennode(channellist, "listbox");
539        struct skin* channeltimeline = getscreennode(channellist, "channeltimeline");
540        struct skin* b1 = getscreennode(channellist, "b1");
541        struct skin* b2 = getscreennode(channellist, "b2");
542        struct skin* b3 = getscreennode(channellist, "b3");
543        struct skin* b4 = getscreennode(channellist, "b4");
544        struct skin* b5 = getscreennode(channellist, "b5");
545        struct skin* b6 = getscreennode(channellist, "b6");
546        struct skin* b7 = getscreennode(channellist, "b7");
547        struct skin* b8 = getscreennode(channellist, "b8");
548        struct skin* b9 = getscreennode(channellist, "b9");
549        struct skin* tmpskin;
550        int rcret, ret, listmode, newmodus, list;
551        char* tmpstr = NULL, *tmpstr1 = NULL, *oldtitle = NULL;
552        void* movesel = NULL, *aktlist = NULL;
553        int nochanneltitle = getskinconfigint("nochanneltitle", NULL);
554        int firstdraw = 0;
555        long oldcol = -9999;
556       
557        status.channelswitch = 1;
558
559start:
560        rcret = 0, ret = -1, list = ALLCHANNEL, listmode = NOMODE, newmodus = 0;
561        tmpstr = NULL, tmpstr1 = NULL, movesel = NULL, aktlist = NULL, tmpskin = NULL;
562        if(nochanneltitle == 0) changetitle(channellist, "");
563
564        if(status.servicetype == 0)
565        {
566                tmpstr = getconfig("channellist", NULL);
567                changetext(b7, _("Radio (Info)"));
568        }
569        else
570        {
571                tmpstr = getconfig("rchannellist", NULL);
572                changetext(b7, _("TV (Info)"));
573        }
574        if(ostrncmp("(BOUQUET)-", tmpstr, 10) == 0 && strlen(tmpstr) > 10)
575        {
576                struct mainbouquet* mainbouquetnode = NULL;
577                mainbouquetnode = getmainbouquet(tmpstr + 10);
578                if(mainbouquetnode != NULL && mainbouquetnode->bouquet != NULL)
579                {
580                        tmpstr1 = ostrcat(tmpstr1, _("Bouquets"), 0, 0);
581                        tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0);
582                        tmpstr1 = ostrcat(tmpstr1, tmpstr + 10, 1, 0);
583                        if(nochanneltitle == 0) changetitle(channellist, tmpstr1);
584                        free(tmpstr1); tmpstr1 = NULL;
585                        list = BOUQUETCHANNEL;
586                        aktlist = (void*)mainbouquetnode;
587                        showbouquetchannel(channellist, listbox, channeltimeline, mainbouquetnode->bouquet, flag);
588                        selectchannel(listbox, 0, 0);
589                }
590        }
591        else if(ostrncmp("(A-Z)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6)
592        {
593                tmpstr1 = ostrcat(tmpstr1, _("Channel"), 0, 0);
594                tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0);
595                tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0);
596                if(nochanneltitle == 0) changetitle(channellist, tmpstr1);
597                free(tmpstr1); tmpstr1 = NULL;
598                list = AZCHANNEL;
599                aktlist = (void*)(int)tmpstr[6];
600                showazchannel(channellist, listbox, (int)tmpstr[6], flag);
601                selectchannel(listbox, 0, 0);
602        }
603        else if(ostrncmp("(SAT)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6)
604        {
605                tmpstr1 = ostrcat(tmpstr1, _("Satellites"), 0, 0);
606                tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0);
607                tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0);
608                if(nochanneltitle == 0) changetitle(channellist, tmpstr1);
609                free(tmpstr1); tmpstr1 = NULL;
610                struct sat* satnode = getsat(tmpstr + 6);
611                list = SATCHANNEL;
612                aktlist = (void*)satnode;
613                showsatchannel(channellist, listbox, satnode, flag);
614                selectchannel(listbox, 0, 0);
615        }
616        else if(ostrncmp("(PROVIDER)-", tmpstr, 11) == 0 && strlen(tmpstr) > 6)
617        {
618                tmpstr1 = ostrcat(tmpstr1, _("Provider"), 0, 0);
619                tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0);
620                tmpstr1 = ostrcat(tmpstr1, tmpstr + 11, 1, 0);
621                if(nochanneltitle == 0) changetitle(channellist, tmpstr1);
622                free(tmpstr1); tmpstr1 = NULL;
623                struct provider* providernode = getproviderbyname(tmpstr + 11);
624                list = PROVIDERCHANNEL;
625                aktlist = (void*)providernode;
626                showproviderchannel(channellist, listbox, providernode, flag);
627                selectchannel(listbox, 0, 0);
628        }
629        else
630        {
631                if(nochanneltitle == 0) changetitle(channellist, _("All Channels"));
632                list = ALLCHANNEL;
633                showallchannel(channellist, listbox, flag);
634                selectchannel(listbox, 0, 0);
635        }
636
637        tmpstr = NULL;
638        if(status.screenanim > 0 && firstdraw == 0)
639        {
640                firstdraw = 1;
641                drawscreen(channellist, 4);
642        }
643        else
644        {
645                status.screencalc = 2;
646                drawscreen(channellist, 0);
647                status.screencalc = 0;
648        }
649        addscreenrc(channellist, listbox);
650
651        if(flag == 3)
652        {
653                if(listbox->select != NULL)
654                        listmode = screenlistedit(list, (struct channel*)listbox->select->handle);
655                if(listmode == NOMODE) goto end;
656                if(nochanneltitle == 0) changechanneltitle(channellist, listmode, &oldtitle, &oldcol);
657        }
658        if(flag != 2)
659        {
660                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
661                drawchannellist(channellist, list, listbox);
662        }
663
664        while(1)
665        {
666                if(flag == 2)
667                {
668                        rcret = getrcconfigint("rcblue", NULL);
669                        flag = 0;
670                }
671                else
672                {
673                        status.screencalc = 2;
674                        rcret = waitrc(channellist, 10000, 0);
675                        status.screencalc = 0;
676                }
677
678                //read epg new
679                if(listbox != NULL && listbox->select != NULL && (list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL))
680                {
681                        tmpskin = listbox->select;
682                        while(tmpskin != NULL)
683                        {
684                                if(tmpskin->pagecount != listbox->aktpage) break;
685                                changechannelepg((struct channel*)tmpskin->handle, tmpskin);
686                                tmpskin = tmpskin->prev;
687                        }
688                        tmpskin = listbox->select;
689                        while(tmpskin != NULL)
690                        {
691                                if(tmpskin->pagecount != listbox->aktpage) break;
692                                changechannelepg((struct channel*)tmpskin->handle, tmpskin);
693                                tmpskin = tmpskin->next;
694                        }
695                }
696
697                if(rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rcdown", NULL) || rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL))
698                {
699                        if(listmode != MVMODE || (listmode == MVMODE && status.markmodus == 0))
700                        {
701                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
702                                drawchannellist(channellist, list, listbox);
703                        }
704                }
705
706                if(rcret == RCTIMEOUT)
707                {
708                        changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
709                        drawscreen(channellist, 0);
710                }
711
712                if(rcret == getrcconfigint("rcexit", NULL)) break;
713
714                if((flag == 0 || flag == 3) && listmode > NOMODE)
715                {
716
717                        if(rcret == getrcconfigint("rcmenu", NULL))
718                        {
719                                int sid = 0;
720                                unsigned long tid = 0;
721                                if((list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) && listbox->select->handle != NULL)
722                                {
723                                        sid = ((struct channel*)listbox->select->handle)->serviceid;
724                                        tid = ((struct channel*)listbox->select->handle)->transponderid;
725                                }
726
727                                status.markmodus = 0;
728                                movesel = NULL;
729                                clearscreen(channellist);
730                                listmode = screenlistedit(list, NULL);
731                                if(listmode == MVMODE)
732                                {
733                                        delrc(getrcconfigint("rcright", NULL), channellist, listbox);
734                                        delrc(getrcconfigint("rcleft", NULL), channellist, listbox);
735                                }
736                                else
737                                        addscreenrc(channellist, listbox);
738                                if(listmode == NOMODE && flag == 3) flag = 0;
739
740                                if(nochanneltitle == 0) changechanneltitle(channellist, listmode, &oldtitle, &oldcol);
741
742                                delmarkedscreennodes(channellist, 1);
743                                delmarkedscreennodes(channellist, 2);
744                                recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline);
745                                selectchannel(listbox, sid, tid);
746                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
747                                drawscreen(channellist, 0);
748                        }
749                        if(listmode == PROTECTMODE && listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcok", NULL))
750                        {
751                                if((list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) && listbox->select->handle != NULL)
752                                {
753                                        if(((struct channel*)listbox->select->handle)->protect == 0)
754                                                ((struct channel*)listbox->select->handle)->protect = 1;
755                                        else
756                                        {
757                                                if(screenpincheck(1, NULL) == 0)
758                                                        ((struct channel*)listbox->select->handle)->protect = 0;
759                                        }
760                                        status.writechannel = 1;
761                                }
762                                delmarkedscreennodes(channellist, 1);
763                                delmarkedscreennodes(channellist, 2);
764                                recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline);
765                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
766                                drawscreen(channellist, 0);
767                        }
768                        if(listmode == CPMODE && listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcok", NULL))
769                        {
770                                struct mainbouquet* mbouquet = screenmainbouquet();
771                                if(mbouquet != NULL && getbouquetbychannel(mbouquet->bouquet, ((struct channel*)listbox->select->handle)->serviceid, ((struct channel*)listbox->select->handle)->transponderid) == NULL)
772                                {
773                                        tmpstr1 = oitoa(((struct channel*)listbox->select->handle)->serviceid);
774                                        tmpstr = ostrcat(tmpstr, tmpstr1, 1, 1); tmpstr1 = NULL;
775                                        tmpstr = ostrcat(tmpstr, "#", 1, 0);
776                                        tmpstr1 = oitoa(((struct channel*)listbox->select->handle)->transponderid);
777                                        tmpstr = ostrcat(tmpstr, tmpstr1, 1, 1); tmpstr1 = NULL;
778                                        addbouquet(&mbouquet->bouquet, tmpstr, status.servicetype, 0, NULL);
779                                        free(tmpstr); tmpstr = NULL;
780                                        recalcbouquetnr();
781                                        if(list == BOUQUETCHANNEL)
782                                        {
783                                                delmarkedscreennodes(channellist, 1);
784                                                delmarkedscreennodes(channellist, 2);
785                                                showbouquetchannel(channellist, listbox, channeltimeline, ((struct mainbouquet*)aktlist)->bouquet, 1);
786                                        }
787                                }
788                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
789                                drawscreen(channellist, 0);
790                        }
791                        if(listmode == EDITMODE && listbox->select != NULL && listbox->select->handle1 != NULL && rcret == getrcconfigint("rcok", NULL))
792                        {
793                                if(list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL)
794                                {
795                                        struct channel* oldentry = ((struct channel*)listbox->select->handle1);
796                                        char* newentry = textinput(NULL, oldentry->name);
797                                        if(newentry != NULL)
798                                        {
799                                                newentry = stringreplacechar(newentry, '#', '_');
800                                                free(oldentry->name);
801                                                oldentry->name = newentry;
802                                                status.writechannel = 1;
803                                        }
804                                }
805                                if(list == MAINBOUQUETLIST)
806                                {
807                                        struct mainbouquet* oldentry = ((struct mainbouquet*)listbox->select->handle1);
808                                        char* newentry = textinput(NULL, oldentry->name);
809                                        if(newentry != NULL)
810                                        {
811                                                newentry = stringreplacechar(newentry, '#', '_');
812                                                free(oldentry->name);
813                                                oldentry->name = newentry;
814                                                status.writemainbouquet = 1;
815                                        }
816                                }
817                                if(list == BOUQUETCHANNEL)
818                                {
819                                        struct channel* oldentry = getchannel(((struct bouquet*)listbox->select->handle1)->serviceid, ((struct bouquet*)listbox->select->handle1)->transponderid);
820                                        if(oldentry != NULL)
821                                        {
822                                                char* newentry = textinput(NULL, oldentry->name);
823                                                if(newentry != NULL)
824                                                {
825                                                        newentry = stringreplacechar(newentry, '#', '_');
826                                                        free(oldentry->name);
827                                                        oldentry->name = newentry;
828                                                        status.writechannel = 1;
829                                                }
830                                        }
831                                }
832                                delmarkedscreennodes(channellist, 1);
833                                delmarkedscreennodes(channellist, 2);
834                                status.markedchannel = NULL;
835                                recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline);
836                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
837                                drawscreen(channellist, 0);
838                        }
839                        if(listmode == RMMODE && listbox->select != NULL && listbox->select->handle1 != NULL && rcret == getrcconfigint("rcok", NULL))
840                        {
841                                if(list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL)
842                                {
843                                        if(delchannel(((struct channel*)listbox->select->handle1)->serviceid, ((struct channel*)listbox->select->handle1)->transponderid, 0) == 0)
844                                        {
845                                                listbox->aktline--;
846                                                listbox->aktpage = -1;
847                                        }
848                                        else
849                                                textbox(_("Message"), _("Can't remove akive Service"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 7, 0);
850                                }
851                                if(list == SATLIST)
852                                {
853                                        delsat(((struct sat*)listbox->select->handle1)->name);
854                                        listbox->aktline--;
855                                        listbox->aktpage = -1;
856                                }
857                                if(list == PROVIDERLIST)
858                                {
859                                        delprovider(((struct provider*)listbox->select->handle1)->providerid);
860                                        listbox->aktline--;
861                                        listbox->aktpage = -1;
862                                }
863                                if(list == MAINBOUQUETLIST)
864                                {
865                                        delmainbouquet(((struct mainbouquet*)listbox->select->handle1)->name);
866                                        recalcbouquetnr();
867                                        listbox->aktline--;
868                                        listbox->aktpage = -1;
869                                }
870                                if(list == BOUQUETCHANNEL)
871                                {
872                                        delbouquet(((struct bouquet*)listbox->select->handle1)->serviceid, ((struct bouquet*)listbox->select->handle1)->transponderid, &((struct mainbouquet*)aktlist)->bouquet);
873                                        recalcbouquetnr();
874                                        listbox->aktline--;
875                                        listbox->aktpage = -1;
876                                }
877                                delmarkedscreennodes(channellist, 1);
878                                delmarkedscreennodes(channellist, 2);
879                                status.markedchannel = NULL;
880                                recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline);
881                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
882                                drawscreen(channellist, 0);
883                        }
884                        if(listmode == MVMODE && listbox->select != NULL && rcret == getrcconfigint("rcok", NULL))
885                        {
886                                if(movesel == NULL)
887                                {
888                                        status.markmodus = 1;
889                                        movesel = listbox->select->handle1;
890                                }
891                                else
892                                {
893                                        status.markmodus = 0;
894                                        movesel = NULL;
895                                }
896                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
897                                drawscreen(channellist, 0);
898                        }
899                        if(listmode == MVMODE && listbox->select != NULL && movesel != NULL && (rcret == getrcconfigint("rcup", NULL) || rcret == getrcconfigint("rcdown", NULL)))
900                        {
901                                if(rcret == getrcconfigint("rcup", NULL))
902                                {
903                                        if(list == ALLCHANNEL)
904                                        {
905                                                movechannelup(movesel);
906                                                while(((struct channel*)movesel)->next != NULL && ((struct channel*)movesel)->next->servicetype != status.servicetype)
907                                                        movechannelup(movesel);
908                                        }
909                                        if(list == SATLIST)
910                                                movesatup(movesel);
911                                        if(list == PROVIDERLIST)
912                                                moveproviderup(movesel);
913                                        if(list == MAINBOUQUETLIST)
914                                        {
915                                                movemainbouquetup(movesel);
916                                                while(((struct mainbouquet*)movesel)->next != NULL && ((struct mainbouquet*)movesel)->next->type != status.servicetype)
917                                                        movemainbouquetup(movesel);
918                                                recalcbouquetnr();
919                                        }
920                                        if(list == BOUQUETCHANNEL)
921                                        {
922                                                movebouquetup(movesel);
923                                                while(((struct bouquet*)movesel)->next != NULL && ((struct bouquet*)movesel)->next->channel != NULL && ((struct bouquet*)movesel)->next->channel->servicetype != status.servicetype)
924                                                        movebouquetup(movesel);
925                                                recalcbouquetnr();
926                                        }
927                                }
928                                if(rcret == getrcconfigint("rcdown", NULL))
929                                {
930                                        if(list == ALLCHANNEL)
931                                        {
932                                                movechanneldown(movesel);
933                                                while(((struct channel*)movesel)->prev != NULL && ((struct channel*)movesel)->prev->servicetype != status.servicetype)
934                                                        movechanneldown(movesel);
935                                        }
936                                        if(list == SATLIST)
937                                                movesatdown(movesel);
938                                        if(list == PROVIDERLIST)
939                                                moveproviderdown(movesel);
940                                        if(list == MAINBOUQUETLIST)
941                                        {
942                                                movemainbouquetdown(movesel);
943                                                while(((struct mainbouquet*)movesel)->prev != NULL && ((struct mainbouquet*)movesel)->prev->type != status.servicetype)
944                                                        movemainbouquetdown(movesel);
945                                                recalcbouquetnr();
946                                        }
947                                        if(list == BOUQUETCHANNEL)
948                                        {
949                                                movebouquetdown(movesel);
950                                                while(((struct bouquet*)movesel)->prev != NULL && ((struct bouquet*)movesel)->prev->channel != NULL && ((struct bouquet*)movesel)->prev->channel->servicetype != status.servicetype)
951                                                        movebouquetdown(movesel);
952                                                recalcbouquetnr();
953                                        }
954                                }
955                                delmarkedscreennodes(channellist, 1);
956                                delmarkedscreennodes(channellist, 2);
957                                recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline);
958                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
959                                drawscreen(channellist, 0);
960                        }
961                        continue;
962                }
963
964                if(rcret == getrcconfigint("rcred", NULL))
965                {
966                        list = ALLCHANNEL;
967                        if(status.servicetype == 0)
968                                addconfigtmp("channellist", "(ALL)");
969                        else
970                                addconfigtmp("rchannellist", "(ALL)");
971                        if(nochanneltitle == 0) changetitle(channellist, _("All Channels"));
972                        delmarkedscreennodes(channellist, 1);
973                        delmarkedscreennodes(channellist, 2);
974                        showallchannel(channellist, listbox, flag);
975                        selectchannel(listbox, 0, 0);
976                        changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
977                        drawchannellist(channellist, list, listbox);
978                        continue;
979                }
980                if(rcret == getrcconfigint("rcblue", NULL) || rcret == getrcconfigint("rcfav", NULL))
981                {
982                        list = MAINBOUQUETLIST;
983                        if(nochanneltitle == 0) changetitle(channellist, _("Bouquets"));
984                        delmarkedscreennodes(channellist, 1);
985                        delmarkedscreennodes(channellist, 2);
986                        showmainbouquet(channellist, listbox);
987                        if(status.servicetype == 0)
988                        {
989                                delconfigtmp("channellist");
990                                tmpstr = getconfig("channellist", NULL);
991                        }
992                        else
993                        {
994                                delconfigtmp("rchannellist");
995                                tmpstr = getconfig("rchannellist", NULL);
996                        }
997                        if(ostrncmp("(BOUQUET)-", tmpstr, 10) != 0) tmpstr = NULL;
998                        if(tmpstr != NULL && strlen(tmpstr) > 10)
999                                setlistboxselection(listbox, tmpstr + 10);
1000                        else
1001                        {
1002                                listbox->aktpage = -1;
1003                                listbox->aktline = 1;
1004                        }
1005                        tmpstr = NULL;
1006                        changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1007                        drawchannellist(channellist, list, listbox);
1008                        continue;
1009                }
1010                if(rcret == getrcconfigint("rcgreen", NULL))
1011                {
1012                        list = SATLIST;
1013                        if(nochanneltitle == 0) changetitle(channellist, _("Satellites"));
1014                        delmarkedscreennodes(channellist, 1);
1015                        delmarkedscreennodes(channellist, 2);
1016                        showsat(channellist, listbox);
1017                        if(status.servicetype == 0)
1018                        {
1019                                delconfigtmp("channellist");
1020                                tmpstr = getconfig("channellist", NULL);
1021                        }
1022                        else
1023                        {
1024                                delconfigtmp("rchannellist");
1025                                tmpstr = getconfig("rchannellist", NULL);
1026                        }
1027                        if(ostrncmp("(SAT)-", tmpstr, 6) != 0) tmpstr = NULL;
1028                        if(tmpstr != NULL && strlen(tmpstr) > 6)
1029                                setlistboxselection(listbox, tmpstr + 6);
1030                        else
1031                        {
1032                                listbox->aktpage = -1;
1033                                listbox->aktline = 1;
1034                        }
1035                        tmpstr = NULL;
1036                        changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1037                        drawchannellist(channellist, list, listbox);
1038                        continue;
1039                }
1040                if(rcret == getrcconfigint("rctext", NULL))
1041                {
1042                        list = AZLIST;
1043                        if(nochanneltitle == 0) changetitle(channellist, _("Channels A-Z"));
1044                        delmarkedscreennodes(channellist, 1);
1045                        delmarkedscreennodes(channellist, 2);
1046                        showaz(channellist, listbox);
1047                        if(status.servicetype == 0)
1048                        {
1049                                delconfigtmp("channellist");
1050                                tmpstr = getconfig("channellist", NULL);
1051                        }
1052                        else
1053                        {
1054                                delconfigtmp("rchannellist");
1055                                tmpstr = getconfig("rchannellist", NULL);
1056                        }
1057                        if(ostrncmp("(A-Z)-", tmpstr, 6) != 0) tmpstr = NULL;
1058                        if(tmpstr != NULL && strlen(tmpstr) > 6)
1059                                setlistboxselection(listbox, &tmpstr[6]);
1060                        else
1061                        {
1062                                listbox->aktpage = -1;
1063                                listbox->aktline = 1;
1064                        }
1065                        tmpstr = NULL;
1066                        changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1067                        drawchannellist(channellist, list, listbox);
1068                        continue;
1069                }
1070                if(rcret == getrcconfigint("rcyellow", NULL))
1071                {
1072                        list = PROVIDERLIST;
1073                        if(nochanneltitle == 0) changetitle(channellist, _("Provider"));
1074                        delmarkedscreennodes(channellist, 1);
1075                        delmarkedscreennodes(channellist, 2);
1076                        showprovider(channellist, listbox);
1077                        if(status.servicetype == 0)
1078                        {
1079                                delconfigtmp("channellist");
1080                                tmpstr = getconfig("channellist", NULL);
1081                        }
1082                        else
1083                        {
1084                                delconfigtmp("rchannellist");
1085                                tmpstr = getconfig("rchannellist", NULL);
1086                        }
1087                        if(ostrncmp("(PROVIDER)-", tmpstr, 11) != 0) tmpstr = NULL;
1088                        if(tmpstr != NULL && strlen(tmpstr) > 11)
1089                                setlistboxselection(listbox, tmpstr + 11);
1090                        else
1091                        {
1092                                listbox->aktpage = -1;
1093                                listbox->aktline = 1;
1094                        }
1095                        tmpstr = NULL;
1096                        changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1097                        drawchannellist(channellist, list, listbox);
1098                        continue;
1099                }
1100                if((list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) && rcret == getrcconfigint("rcok", NULL))
1101                {
1102                        if(listbox->select != NULL && listbox->select->handle != NULL)
1103                        {
1104                                if(flag == 1)
1105                                {
1106                                        if(retchannel != NULL)
1107                                                *retchannel = (struct channel*)listbox->select->handle;
1108                                        if(retchannellist != NULL)
1109                                        {
1110                                                if(status.servicetype == 0)
1111                                                        *retchannellist = ostrcat(getconfig("channellist", NULL), "", 0, 0);
1112                                                else
1113                                                        *retchannellist = ostrcat(getconfig("rchannellist", NULL), "", 0, 0);
1114                                        }
1115                                        break;
1116                                }
1117
1118                                clearscreen(channellist);
1119                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1120                                resettvpic();
1121                                drawscreen(skin, 0);
1122                                if(status.servicetype == 0)
1123                                        ret = servicestart((struct channel*)listbox->select->handle, getconfig("channellist", NULL), NULL, 0);
1124                                else
1125                                        ret = servicestart((struct channel*)listbox->select->handle, getconfig("rchannellist", NULL), NULL, 0);
1126                                if(ret == 20) writeconfigtmp();
1127                                servicecheckret(ret, 0);
1128                                break;
1129                        }
1130                        continue;
1131                }
1132                if(list == BOUQUETCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL)))
1133                {
1134                        struct mainbouquet* tmpaktlist = ((struct mainbouquet*)aktlist);
1135
1136                        int round = 0;
1137                        while(tmpaktlist != NULL)
1138                        {
1139                                if(rcret == getrcconfigint("rcff", NULL))
1140                                {
1141                                        tmpaktlist = tmpaktlist->next;
1142                                        if(tmpaktlist == NULL && round == 0)   
1143                                        {
1144                                                round = 1;
1145                                                tmpaktlist = mainbouquet;
1146                                        }
1147                                }
1148                                else if(rcret == getrcconfigint("rcfr", NULL))
1149                                {
1150                                        tmpaktlist = tmpaktlist->prev;
1151                                        if(tmpaktlist == NULL && round == 0)   
1152                                        {
1153                                                round = 1;
1154                                                tmpaktlist = getlastmainbouquet(mainbouquet);
1155                                        }
1156                                }
1157                                if(tmpaktlist == NULL) break;
1158                                if(tmpaktlist->type != status.servicetype) continue;
1159
1160                                delmarkedscreennodes(channellist, 1);
1161                                struct skin* tmpnode = addlistbox(channellist, listbox, NULL, 2);
1162                                if(tmpnode != NULL)
1163                                {
1164                                        listbox->aktline = 1;
1165                                        listbox->aktpage = -1;
1166
1167                                        status.screencalc = 2;
1168                                        drawscreen(channellist, 0);
1169                                        status.screencalc = 0;
1170                                        changetext(tmpnode, tmpaktlist->name);
1171                                        tmpnode->handle = (char*)tmpaktlist->bouquet;
1172                                        tmpnode->handle1 = (char*)tmpaktlist;
1173                                        rcret = getrcconfigint("rcok", NULL);
1174                                        list = MAINBOUQUETLIST;
1175                                        break;
1176                                }
1177                        }
1178                }
1179                if(list == MAINBOUQUETLIST && rcret == getrcconfigint("rcok", NULL))
1180                {
1181                        if(listbox->select != NULL)
1182                        {
1183                                list = BOUQUETCHANNEL;
1184                                tmpstr = ostrcat(tmpstr, _("Bouquets"), 0, 0);
1185                                tmpstr = ostrcat(tmpstr, " - ", 1, 0);
1186                                tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0);
1187                                if(nochanneltitle == 0) changetitle(channellist, tmpstr);
1188                                free(tmpstr); tmpstr = NULL;
1189                                tmpstr = ostrcat(tmpstr, "(BOUQUET)-", 0, 0);
1190                                tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0);
1191                                if(status.servicetype == 0)
1192                                        addconfigtmp("channellist", tmpstr);
1193                                else
1194                                        addconfigtmp("rchannellist", tmpstr);
1195                                free(tmpstr); tmpstr = NULL;
1196                                aktlist = listbox->select->handle1;
1197                                showbouquetchannel(channellist, listbox, channeltimeline, (struct bouquet*)listbox->select->handle, flag);
1198                                delmarkedscreennodes(channellist, 2);
1199                                selectchannel(listbox, 0, 0);
1200                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1201                                drawchannellist(channellist, list, listbox);
1202                        }
1203                        continue;
1204                }
1205                if(list == SATCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL)))
1206                {
1207                        struct sat* tmpaktlist = ((struct sat*)aktlist);
1208
1209                        int round = 0;
1210                        while(tmpaktlist != NULL)
1211                        {
1212                                if(rcret == getrcconfigint("rcff", NULL))
1213                                {
1214                                        tmpaktlist = tmpaktlist->next;
1215                                        if(tmpaktlist == NULL && round == 0)   
1216                                        {
1217                                                round = 1;
1218                                                tmpaktlist = sat;
1219                                        }
1220                                }
1221                                else if(rcret == getrcconfigint("rcfr", NULL))
1222                                {
1223                                        tmpaktlist = tmpaktlist->prev;
1224                                        if(tmpaktlist == NULL && round == 0)   
1225                                        {
1226                                                round = 1;
1227                                                tmpaktlist = getlastsat(sat);
1228                                        }
1229                                }
1230                                if(tmpaktlist == NULL) break;
1231
1232                                delmarkedscreennodes(channellist, 1);
1233                                struct skin* tmpnode = addlistbox(channellist, listbox, NULL, 2);
1234                                if(tmpnode != NULL)
1235                                {
1236                                        listbox->aktline = 1;
1237                                        listbox->aktpage = -1;
1238
1239                                        status.screencalc = 2;
1240                                        drawscreen(channellist, 0);
1241                                        status.screencalc = 0;
1242                                        changetext(tmpnode, tmpaktlist->name);
1243                                        tmpnode->handle = (char*)tmpaktlist;
1244                                        tmpnode->handle1 = (char*)tmpaktlist;
1245                                        rcret = getrcconfigint("rcok", NULL);
1246                                        list = SATLIST;
1247                                        break;
1248                                }
1249                        }
1250                }
1251                if(list == SATLIST && rcret == getrcconfigint("rcok", NULL))
1252                {
1253                        if(listbox->select != NULL)
1254                        {
1255                                list = SATCHANNEL;
1256                                tmpstr = ostrcat(tmpstr, _("Satellites"), 0, 0);
1257                                tmpstr = ostrcat(tmpstr, " - ", 1, 0);
1258                                tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0);
1259                                if(nochanneltitle == 0) changetitle(channellist, tmpstr);
1260                                free(tmpstr); tmpstr = NULL;
1261                                tmpstr = ostrcat(tmpstr, "(SAT)-", 0, 0);
1262                                tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0);
1263                                if(status.servicetype == 0)
1264                                        addconfigtmp("channellist", tmpstr);
1265                                else
1266                                        addconfigtmp("rchannellist", tmpstr);
1267                                free(tmpstr); tmpstr = NULL;
1268                                aktlist = listbox->select->handle;
1269                                showsatchannel(channellist, listbox, (struct sat*)listbox->select->handle, flag);
1270                                delmarkedscreennodes(channellist, 2);
1271                                selectchannel(listbox, 0, 0);
1272                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1273                                drawchannellist(channellist, list, listbox);
1274                        }
1275                        continue;
1276                }
1277                if(list == AZCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL)))
1278                {
1279                        int tmpaktlist = (int)aktlist;
1280
1281                        if(rcret == getrcconfigint("rcff", NULL))
1282                        {
1283                                tmpaktlist++;
1284                                if(tmpaktlist > 90) tmpaktlist = 65;
1285                        }
1286                        else if(rcret == getrcconfigint("rcfr", NULL))
1287                        {
1288                                tmpaktlist--;
1289                                if(tmpaktlist < 65) tmpaktlist = 90;
1290                        }
1291
1292                        delmarkedscreennodes(channellist, 1);
1293                        struct skin* tmpnode = addlistbox(channellist, listbox, NULL, 2);
1294                        if(tmpnode != NULL)
1295                        {
1296                                listbox->aktline = 1;
1297                                listbox->aktpage = -1;
1298
1299                                status.screencalc = 2;
1300                                drawscreen(channellist, 0);
1301                                status.screencalc = 0;
1302                                tmpstr = malloc(2);
1303                                if(tmpstr != NULL)
1304                                {
1305                                        snprintf(tmpstr, 2, "%c", tmpaktlist);
1306                                        changetext(tmpnode, tmpstr);
1307                                        free(tmpstr); tmpstr = NULL;
1308                                }
1309                                tmpnode->handle = (char*)tmpaktlist;
1310                                tmpnode->handle1 = (char*)tmpaktlist;
1311                                rcret = getrcconfigint("rcok", NULL);
1312                                list = AZLIST;
1313                        }
1314                }
1315                if(list == AZLIST && rcret == getrcconfigint("rcok", NULL))
1316                {
1317                        if(listbox->select != NULL)
1318                        {
1319                                list = AZCHANNEL;
1320                                tmpstr = ostrcat(tmpstr, _("Channel"), 0, 0);
1321                                tmpstr = ostrcat(tmpstr, " - ", 1, 0);
1322                                tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0);
1323                                if(nochanneltitle == 0) changetitle(channellist, tmpstr);
1324                                free(tmpstr); tmpstr = NULL;
1325                                tmpstr = ostrcat(tmpstr, "(A-Z)-", 0, 0);
1326                                tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0);
1327                                if(status.servicetype == 0)
1328                                        addconfigtmp("channellist", tmpstr);
1329                                else
1330                                        addconfigtmp("rchannellist", tmpstr);
1331                                free(tmpstr); tmpstr = NULL;
1332                                aktlist = listbox->select->handle;
1333                                showazchannel(channellist, listbox, (int)listbox->select->handle, flag);
1334                                delmarkedscreennodes(channellist, 2);
1335                                selectchannel(listbox, 0, 0);
1336                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1337                                drawchannellist(channellist, list, listbox);
1338                        }
1339                        continue;
1340                }
1341                if(list == PROVIDERCHANNEL && (rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfr", NULL)))
1342                {
1343                        struct provider* tmpaktlist = ((struct provider*)aktlist);
1344
1345                        int round = 0;
1346                        while(tmpaktlist != NULL)
1347                        {
1348                                if(rcret == getrcconfigint("rcff", NULL))
1349                                {
1350                                        tmpaktlist = tmpaktlist->next;
1351                                        if(tmpaktlist == NULL && round == 0)   
1352                                        {
1353                                                round = 1;
1354                                                tmpaktlist = provider;
1355                                        }
1356                                }
1357                                else if(rcret == getrcconfigint("rcfr", NULL))
1358                                {
1359                                        tmpaktlist = tmpaktlist->prev;
1360                                        if(tmpaktlist == NULL && round == 0)   
1361                                        {
1362                                                round = 1;
1363                                                tmpaktlist = getlastprovider(provider);
1364                                        }
1365                                }
1366                                if(tmpaktlist == NULL) break;
1367
1368                                delmarkedscreennodes(channellist, 1);
1369                                struct skin* tmpnode = addlistbox(channellist, listbox, NULL, 2);
1370                                if(tmpnode != NULL)
1371                                {
1372                                        listbox->aktline = 1;
1373                                        listbox->aktpage = -1;
1374
1375                                        status.screencalc = 2;
1376                                        drawscreen(channellist, 0);
1377                                        status.screencalc = 0;
1378                                        changetext(tmpnode, tmpaktlist->name);
1379                                        tmpnode->handle = (char*)tmpaktlist;
1380                                        tmpnode->handle1 = (char*)tmpaktlist;
1381                                        rcret = getrcconfigint("rcok", NULL);
1382                                        list = PROVIDERLIST;
1383                                        break;
1384                                }
1385                        }
1386                }
1387                if(list == PROVIDERLIST && rcret == getrcconfigint("rcok", NULL))
1388                {
1389                        if(listbox->select != NULL)
1390                        {
1391                                list = PROVIDERCHANNEL;
1392                                tmpstr = ostrcat(tmpstr, _("Provider"), 0, 0);
1393                                tmpstr = ostrcat(tmpstr, " - ", 1, 0);
1394                                tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0);
1395                                if(nochanneltitle == 0) changetitle(channellist, tmpstr);
1396                                free(tmpstr); tmpstr = NULL;
1397                                tmpstr = ostrcat(tmpstr, "(PROVIDER)-", 0, 0);
1398                                tmpstr = ostrcat(tmpstr, listbox->select->text, 1, 0);
1399                                if(status.servicetype == 0)
1400                                        addconfigtmp("channellist", tmpstr);
1401                                else
1402                                        addconfigtmp("rchannellist", tmpstr);
1403                                free(tmpstr); tmpstr = NULL;
1404                                aktlist = listbox->select->handle;
1405                                showproviderchannel(channellist, listbox, (struct provider*) listbox->select->handle, flag);
1406                                delmarkedscreennodes(channellist, 2);
1407                                selectchannel(listbox, 0, 0);
1408                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1409                                drawchannellist(channellist, list, listbox);
1410                        }
1411                        continue;
1412                }
1413                if(flag == 0 && rcret == getrcconfigint("rcmenu", NULL))
1414                {
1415                        if(list == AZLIST) continue;
1416
1417                        int sid = 0;
1418                        unsigned long tid = 0;
1419                        if((list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL) && listbox->select->handle != NULL)
1420                        {
1421                                sid = ((struct channel*)listbox->select->handle)->serviceid;
1422                                tid = ((struct channel*)listbox->select->handle)->transponderid;
1423                        }
1424
1425                        clearscreen(channellist);
1426                        if(listbox->select != NULL)
1427                                listmode = screenlistedit(list, (struct channel*)listbox->select->handle);
1428                        else
1429                                listmode = screenlistedit(list, NULL);
1430                               
1431                        if(listmode == MVMODE)
1432                        {
1433                                delrc(getrcconfigint("rcright", NULL), channellist, listbox);
1434                                delrc(getrcconfigint("rcleft", NULL), channellist, listbox);
1435                        }
1436                        else
1437                                addscreenrc(channellist, listbox);
1438
1439                        if(nochanneltitle == 0) changechanneltitle(channellist, listmode, &oldtitle, &oldcol);
1440
1441                        if(listmode == NOMODE && flag == 3) flag = 0;
1442                        delmarkedscreennodes(channellist, 1);
1443                        delmarkedscreennodes(channellist, 2);
1444                        recalclist(list, aktlist, listmode, channellist, listbox, channeltimeline);
1445                        selectchannel(listbox, sid, tid);
1446                        changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1447                        drawscreen(channellist, 0);
1448                        continue;
1449                }
1450                if(flag == 0 && rcret == getrcconfigint("rcepg", NULL) && (list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL))
1451                {
1452                        if(listbox->select != NULL)
1453                        {
1454                                clearscreen(channellist);
1455                                epgchoice((struct channel*)listbox->select->handle);
1456                                changebutton(listmode, b1, b2, b3, b4, b5, b6, b7, b8, b9);
1457                                drawscreen(channellist, 0);
1458                        }
1459                        continue;
1460                }
1461                if(flag == 0 && rcret == getrcconfigint("rcinfo", NULL))
1462                {
1463                        if(status.servicetype == 0)
1464                        {
1465                                status.servicetype = 1;
1466                                changetext(b7, _("TV (Info)"));
1467                        }
1468                        else
1469                        {
1470                                status.servicetype = 0;
1471                                changetext(b7, _("Radio (Info)"));
1472                        }
1473                        newmodus = 1;
1474                        break;
1475                }
1476        }
1477
1478end:
1479        free(oldtitle);
1480        status.markedchannel = NULL;
1481        status.markmodus = 0;
1482        status.screencalc = 0;
1483        delmarkedscreennodes(channellist, 1);
1484        delmarkedscreennodes(channellist, 2);
1485        delownerrc(channellist);
1486        delconfigtmp("channellist");
1487        delconfigtmp("rchannellist");
1488        clearscreen(channellist);
1489        if(newmodus == 1) goto start;
1490        status.channelswitch = 0;
1491        resettvpic();
1492        return ret;
1493}
1494
1495#endif
Note: See TracBrowser for help on using the repository browser.