source: titan/titan/channellist.h @ 15587

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