source: titan/titan/channellist.h @ 35769

Last change on this file since 35769 was 34279, checked in by tobayer, 9 years ago

[titan] remove some changetext of titletext, was moved to changetitle

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