source: titan/titan/gmultiepg.h @ 13476

Last change on this file since 13476 was 13476, checked in by nit, 12 years ago

[titan] fix compiler warn

File size: 21.8 KB
Line 
1#ifndef GMULTIEPG_H
2#define GMULTIEPG_H
3
4time_t calcprimetime(time_t akttime)
5{
6        struct tm *loctime = NULL;
7        time_t ret = 0;
8
9        loctime = olocaltime(&akttime);
10        if(loctime != NULL)
11        {
12                loctime->tm_hour = 20;
13                loctime->tm_min = 15;
14                ret = mktime(loctime);
15                if(ret < akttime) // add 1 day
16                {
17                        free(loctime);
18                        ret += 86400;
19                        loctime = olocaltime(&ret);
20                        if(loctime != NULL)
21                                ret = mktime(loctime);
22                        else
23                                ret = akttime;
24                }
25        }
26
27        free(loctime);
28        return ret;
29}
30
31void createtimeline(struct skin* gmultiepg, struct skin* timeline, time_t akttime, int zoom)
32{
33        struct skin* node = NULL;
34        struct tm *loctime = NULL;
35        int posx = 0;
36        char* buf = NULL;
37
38        buf = malloc(6);
39        if(buf == NULL)
40        {
41                err("no mem");
42                return;
43        }
44
45        delmarkedscreennodes(gmultiepg, 3);
46
47        while(posx < timeline->iwidth)
48        {
49                node = addlistbox(gmultiepg, timeline, node, 3);
50                if(node != NULL)
51                {
52
53                        loctime = olocaltime(&akttime);
54                        if(loctime != NULL)
55                                strftime(buf, 6, "%H:%M", loctime);
56                        else
57                                snprintf(buf, 6, "00:00");
58                        free(loctime); loctime = NULL;
59
60                        akttime += 30 * 60;
61                        changetext(node, buf);
62                        node->prozwidth = 0;
63                        node->posx = posx;
64                        node->width = 30 * zoom; //30 min * zoom pixel
65                        node->bordersize = 1;
66                        posx += node->width;
67                        if(posx > timeline->iwidth)
68                                node->width -= (posx - timeline->iwidth);
69                }
70        }
71
72        free(buf);
73}
74
75int selectchannelgmepg(struct skin* listbox)
76{
77        struct skin* node = listbox;
78        struct channel* chnode = NULL;
79        listbox->aktpage = -1;
80        listbox->aktline = 1;
81
82        listbox->select = NULL;
83
84        if(status.servicetype == 0)
85                chnode = getchannel(getconfigint("serviceid", NULL), getconfiglu("transponderid", NULL));
86        else
87                chnode = getchannel(getconfigint("rserviceid", NULL), getconfiglu("rtransponderid", NULL));
88
89        if(chnode == NULL)
90        {
91                debug(1000, "out -> NULL detect");
92                return 1;
93        }
94
95        while(node != NULL)
96        {
97                if(node->deaktivcol > -1)
98                {
99                        node = node->next;
100                        continue;
101                }
102                if(chnode == (struct channel*)node->handle)
103                        return 0;
104
105                if(node->del == 1) listbox->aktline++;
106                node = node->next;
107        }
108        listbox->aktline = 1;
109        return 1;
110}
111
112
113int calcgmultiepg(struct channel* tmpchannel, struct skin* gmultiepg, struct skin* channellistbox, struct skin* listbox, int zoom, time_t akttime, struct channel* aktchannel, int linecol1, int linecol2, int linecol3, int* aktline, struct skin** pchnode, struct skin** pchnode1, int height, int picheight)
114{
115        int treffer = 0, gridbr = 0, aktcol = 0, nottuneable = 0;
116        struct epg* epgnode = NULL;
117        struct skin* chnode = NULL, *chnode1 = NULL;
118        char* tmpstr = NULL;
119
120        int epgpicon = getconfigint("epgpicon", NULL);
121
122        if(tmpchannel != NULL && tmpchannel->servicetype == status.servicetype)
123        {
124                if(channelnottunable(tmpchannel) == 1) nottuneable = 1;
125                *pchnode = addlistbox(gmultiepg, channellistbox, *pchnode, 1);
126                chnode = *pchnode;
127                if(chnode != NULL)
128                {
129                        chnode->bgspace = 1;
130                        tmpstr = createpiconpath(tmpchannel);
131                        if(epgpicon == 1 && tmpstr != NULL && strstr(tmpstr, "default.png") == NULL)
132                        {
133                                changepic(chnode, tmpstr);
134                                chnode->height = picheight;
135                        }
136                        else
137                        {
138                                changetext(chnode, tmpchannel->name);
139                                chnode->height = height;
140                        }
141                        free(tmpstr); tmpstr = NULL;
142
143                        epgnode = getepgakt(tmpchannel);
144
145                        while(epgnode != NULL)
146                        {
147                                if(epgnode->endtime <= akttime)
148                                {
149                                        epgnode = epgnode->next;
150                                        continue;
151                                }
152                                if(epgnode->starttime >= akttime + ((listbox->iwidth * 60) / zoom))
153                                        break;
154
155                                *pchnode1 = addlistbox(gmultiepg, listbox, *pchnode1, 1);
156                                chnode1 = *pchnode1;
157                                if(chnode1 != NULL)
158                                {
159                                        (*aktline)++;
160                                        if(gridbr == 0)
161                                        {
162                                                chnode1->type = TEXTBOXGRIDBR;
163                                                if(tmpchannel == aktchannel)
164                                                {
165                                                        listbox->aktline = *aktline;
166                                                        listbox->gridcol = 0;
167                                                }
168                                        }
169                                        else
170                                                chnode1->type = TEXTBOX;
171                                        chnode1->wrap = YES;
172                                        gridbr = 1;
173                                        treffer = 1;
174                                        chnode1->height = chnode->height;
175                                        chnode1->width = ((epgnode->endtime - epgnode->starttime) / 60) * zoom;
176                                        chnode1->posx = ((epgnode->starttime - akttime) / 60) * zoom;
177                                        if(chnode1->posx < 0)
178                                        {
179                                                chnode1->width += chnode1->posx;
180                                                chnode1->posx = 0;
181                                        }
182                                        chnode1->prozwidth = 0;
183                                        if(aktcol == linecol1)
184                                                aktcol = linecol2;
185                                        else
186                                                aktcol = linecol1;
187                                        if(akttime >= epgnode->starttime && akttime < epgnode->endtime)
188                                                aktcol = linecol3;
189                                        chnode1->bgcol = aktcol;
190                                        chnode1->bgspace = 1;
191                                        chnode1->vspace = 2;
192                                        chnode1->hspace = 2;
193                                        if(nottuneable == 1)
194                                                chnode1->deaktivcol = convertcol("deaktivcol");
195                                       
196                                        //TODO: record timeline
197                                        //chnode1->type = MULTIPROGRESSBAR;
198                                        //chnode1->progresscol = listbox->progresscol;
199                                        //chnode1->epgrecord = getepgrecord(tmpchannel, epgnode);
200               
201                                        changetext(chnode1, epgnode->title);
202                                        chnode1->handle = (char*)tmpchannel;
203                                        chnode1->handle1 = (char*)epgnode;
204                                        if(chnode1->posx + chnode1->width >= listbox->iwidth)
205                                        {
206                                                chnode1->width = listbox->iwidth - chnode1->posx;
207                                                break;
208                                        }
209                                }
210                                epgnode = epgnode->next;
211                        }
212                        if(gridbr == 0)
213                        {
214                                *pchnode1 = addlistbox(gmultiepg, listbox, *pchnode1, 1);
215                                chnode1 = *pchnode1;
216                                if(chnode1 != NULL)
217                                {
218                                        (*aktline)++;
219                                        if(tmpchannel == aktchannel)
220                                                listbox->aktline = *aktline;
221                                        if(gridbr == 0) chnode1->type = GRIDBR;
222                                        gridbr = 1;
223                                        chnode1->height = chnode->height;
224                                        chnode1->handle = (char*)tmpchannel;
225                                        chnode1->bgspace = 1;
226                                        if(nottuneable == 1)
227                                                chnode1->deaktivcol = convertcol("deaktivcol");
228                                }
229                        }
230
231                        chnode->handle = (char*)tmpchannel;
232                        if(nottuneable == 1)
233                                chnode->deaktivcol = convertcol("deaktivcol");
234                }
235        }
236        return treffer;
237}
238
239int showallgmepgchannel(struct skin* gmultiepg, struct skin* channellistbox, struct skin* listbox, int zoom, time_t akttime, struct channel* aktchannel)
240{
241        int treffer = 0, aktline = 0;
242        struct skin* chnode = NULL, *chnode1 = NULL;
243        struct channel* tmpchannel = channel;
244
245        int linecol1 = convertcol("epgcol1");
246        int linecol2 = convertcol("epgcol2");
247        int linecol3 = convertcol("epgcol3");
248        int height = getskinconfigint("epgheight", NULL);
249        int picheight = getskinconfigint("epgpicheight", NULL);
250
251        if(height < 1) height = 35;
252        if(picheight < 1) picheight = 35;
253
254        if(gmultiepg != NULL) delmarkedscreennodes(gmultiepg, 1);
255        if(listbox != NULL) listbox->aktline = 1;
256
257        while(tmpchannel != NULL)
258        {
259                if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight) == 1)
260                        treffer = 1;
261                tmpchannel = tmpchannel->next;
262        }
263        return treffer;
264}
265
266int showbouquetgmepgchannel(struct skin* gmultiepg, struct skin* channellistbox, struct skin* listbox, struct bouquet* firstbouquet, int zoom, time_t akttime, struct channel* aktchannel)
267{
268        int treffer = 0, aktline = 0;
269        struct skin* chnode = NULL, *chnode1 = NULL;
270        struct bouquet* tmpbouquet = firstbouquet;
271
272        int linecol1 = convertcol("epgcol1");
273        int linecol2 = convertcol("epgcol2");
274        int linecol3 = convertcol("epgcol3");
275        int height = getskinconfigint("epgheight", NULL);
276        int picheight = getskinconfigint("epgpicheight", NULL);
277
278        if(height < 1) height = 35;
279        if(picheight < 1) picheight = 35;
280
281        if(gmultiepg != NULL) delmarkedscreennodes(gmultiepg, 1);
282        if(listbox != NULL) listbox->aktline = 1;
283
284        while(tmpbouquet != NULL)
285        {
286                if(calcgmultiepg(tmpbouquet->channel, gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight) == 1)
287                        treffer = 1;
288                tmpbouquet = tmpbouquet->next;
289        }
290        return treffer;
291}
292
293int showprovidergmepgchannel(struct skin* gmultiepg, struct skin* channellistbox, struct skin* listbox, struct provider* providernode, int zoom, time_t akttime, struct channel* aktchannel)
294{
295        int treffer = 0, aktline = 0;
296        struct skin* chnode = NULL, *chnode1 = NULL;
297        struct channel* tmpchannel = channel;
298
299        int linecol1 = convertcol("epgcol1");
300        int linecol2 = convertcol("epgcol2");
301        int linecol3 = convertcol("epgcol3");
302        int height = getskinconfigint("epgheight", NULL);
303        int picheight = getskinconfigint("epgpicheight", NULL);
304
305        if(height < 1) height = 35;
306        if(picheight < 1) picheight = 35;
307
308        if(gmultiepg != NULL) delmarkedscreennodes(gmultiepg, 1);
309
310        while(tmpchannel != NULL)
311        {
312                if(tmpchannel->provider == providernode)
313                {
314                        if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight) == 1)
315                                treffer = 1;
316                }
317                tmpchannel = tmpchannel->next;
318        }
319        return treffer;
320}
321
322int showsatgmepgchannel(struct skin* gmultiepg, struct skin* channellistbox, struct skin* listbox, struct sat* satnode, int zoom, time_t akttime, struct channel* aktchannel)
323{
324        int treffer = 0, aktline = 0;
325        struct skin* chnode = NULL, *chnode1 = NULL;
326        struct channel* tmpchannel = channel;
327       
328        if(satnode == NULL) return 1;
329
330        int linecol1 = convertcol("epgcol1");
331        int linecol2 = convertcol("epgcol2");
332        int linecol3 = convertcol("epgcol3");
333        int height = getskinconfigint("epgheight", NULL);
334        int picheight = getskinconfigint("epgpicheight", NULL);
335
336        if(height < 1) height = 35;
337        if(picheight < 1) picheight = 35;
338
339        if(gmultiepg != NULL) delmarkedscreennodes(gmultiepg, 1);
340
341        while(tmpchannel != NULL)
342        {
343                if(tmpchannel->transponder != NULL && tmpchannel->transponder->orbitalpos == satnode->orbitalpos)
344                {
345                        if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight) == 1)
346                                treffer = 1;
347                }
348                tmpchannel = tmpchannel->next;
349        }
350        return treffer;
351}
352
353int showazgmepgchannel(struct skin* gmultiepg, struct skin* channellistbox, struct skin* listbox, int character, int zoom, time_t akttime, struct channel* aktchannel)
354{
355        int treffer = 0, aktline = 0;
356        struct skin* chnode = NULL, *chnode1 = NULL;
357        struct channel* tmpchannel = channel;
358
359        int linecol1 = convertcol("epgcol1");
360        int linecol2 = convertcol("epgcol2");
361        int linecol3 = convertcol("epgcol3");
362        int height = getskinconfigint("epgheight", NULL);
363        int picheight = getskinconfigint("epgpicheight", NULL);
364
365        if(height < 1) height = 35;
366        if(picheight < 1) picheight = 35;
367
368        if(gmultiepg != NULL) delmarkedscreennodes(gmultiepg, 1);
369
370        while(tmpchannel != NULL)
371        {
372                if(tmpchannel->name != NULL && (tmpchannel->name[0] == character || tmpchannel->name[0] == character + 32))
373                {
374                        if(calcgmultiepg(tmpchannel, gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel, linecol1, linecol2, linecol3, &aktline, &chnode, &chnode1, height, picheight) == 1)
375                                treffer = 1;
376                }
377                tmpchannel = tmpchannel->next;
378        }
379        return treffer;
380}
381
382void drawchannellistgmepg(struct skin* gmultiepg, int list, struct skin* listbox)
383{
384        status.markedchannel = NULL;
385
386        if(list == ALLCHANNEL || list == SATCHANNEL || list == PROVIDERCHANNEL || list == AZCHANNEL || list == BOUQUETCHANNEL)
387        {
388                if(listbox->select == NULL)
389                {
390                        status.screencalc = 2;
391                        drawscreen(gmultiepg, 0);
392                        status.screencalc = 0;
393                }
394                if(listbox->select != NULL)
395                        status.markedchannel = (struct channel*)listbox->select->handle;
396        }
397        drawscreen(gmultiepg, 0);
398}
399
400void screengmultiepg(struct channel* chnode, struct epg* epgnode, int flag)
401{
402        int rcret = 0, ret = 0, epgscreenconf = 0;
403        struct skin* gmultiepg = getscreen("gmultiepg");
404        struct skin* listbox = getscreennode(gmultiepg, "listbox");
405        struct skin* channellistbox = getscreennode(gmultiepg, "channellistbox");
406        struct skin* epgdesc = getscreennode(gmultiepg, "epgdesc");
407        struct skin* timeline = getscreennode(gmultiepg, "timeline");
408        struct skin* b2 = getscreennode(gmultiepg, "b2");
409        struct skin* b3 = getscreennode(gmultiepg, "b3");
410        struct skin* b4 = getscreennode(gmultiepg, "b4");
411       
412        int list = ALLCHANNEL;
413        char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL;
414        void* aktlist = NULL;
415        int character = 0;
416        struct sat* satnode = NULL;
417        struct provider* providernode = NULL;
418        struct channel* aktchannel = NULL;
419#ifdef SIMULATE
420        time_t akttime = 1307871000;
421        //akttime = 1315614900;
422        //akttime = 1317926400;
423#else
424        time_t akttime = time(NULL);
425#endif
426        int zoom = getconfigint("gmultiepgzoom", NULL);
427        if(zoom < 1) zoom = 4;
428        int nochanneltitle = getskinconfigint("nochanneltitle", NULL);
429
430        akttime -= (((akttime / 60) % 15) * 60);
431        akttime -= (((akttime) % 60));
432        time_t starttime = akttime;
433
434        if(chnode == NULL) chnode = status.aktservice->channel;
435        if(epgnode == NULL) epgnode = getepgakt(chnode);
436        tmpstr2 = epgdescunzip(epgnode);
437        changetext(epgdesc, tmpstr2);
438        free(tmpstr2); tmpstr2 = NULL;
439
440        //chalc screen, so we have all infos
441        status.screencalc = 2;
442        drawscreen(gmultiepg, 0);
443        status.screencalc = 0;
444
445        time_t addtime = (listbox->iwidth / zoom) * 60;
446        addtime -= (((addtime / 60) % 15) * 60);
447        addtime -= (((addtime) % 60));
448        epgscreenconf = getconfigint("epg_screen", NULL);
449
450        if(status.servicetype == 0)
451        {
452                tmpstr = getconfig("channellist", NULL);
453                aktchannel = getchannel(getconfigint("serviceid", NULL), getconfiglu("transponderid", NULL));
454        }
455        else
456        {
457                tmpstr = getconfig("rchannellist", NULL);
458                aktchannel = getchannel(getconfigint("rserviceid", NULL), getconfiglu("rtransponderid", NULL));
459        }
460
461        if(ostrncmp("(BOUQUET)-", tmpstr, 10) == 0 && strlen(tmpstr) > 10)
462        {
463                struct mainbouquet* mainbouquetnode = NULL;
464                mainbouquetnode = getmainbouquet(tmpstr + 10);
465                if(mainbouquetnode != NULL && mainbouquetnode->bouquet != NULL)
466                {
467                        tmpstr1 = ostrcat(tmpstr1, _("GRAPHIC MULTI EPG - Bouquets"), 0, 0);
468                        tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0);
469                        tmpstr1 = ostrcat(tmpstr1, tmpstr + 10, 1, 0);
470                        if(nochanneltitle == 0) changetitle(gmultiepg, tmpstr1);
471                        free(tmpstr1); tmpstr1 = NULL;
472                        list = BOUQUETCHANNEL;
473                        aktlist = (void*)mainbouquetnode;
474                        showbouquetgmepgchannel(gmultiepg, channellistbox, listbox, mainbouquetnode->bouquet, zoom, akttime, aktchannel);
475                        selectchannelgmepg(channellistbox);
476                }
477        }
478        else if(ostrncmp("(A-Z)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6)
479        {
480                tmpstr1 = ostrcat(tmpstr1, _("GRAPHIC MULTI EPG - Channel"), 0, 0);
481                tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0);
482                tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0);
483                if(nochanneltitle == 0) changetitle(gmultiepg, tmpstr1);
484                free(tmpstr1); tmpstr1 = NULL;
485                list = AZCHANNEL;
486                character = (int)tmpstr[6];
487                aktlist = (void*)(int)tmpstr[6];
488                showazgmepgchannel(gmultiepg, channellistbox, listbox, character, zoom, akttime, aktchannel);
489                selectchannelgmepg(channellistbox);
490        }
491        else if(ostrncmp("(SAT)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6)
492        {
493                tmpstr1 = ostrcat(tmpstr1, _("GRAPHIC MULTI EPG - Satellites"), 0, 0);
494                tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0);
495                tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0);
496                if(nochanneltitle == 0) changetitle(gmultiepg, tmpstr1);
497                free(tmpstr1); tmpstr1 = NULL;
498                satnode = getsat(tmpstr + 6);
499                list = SATCHANNEL;
500                aktlist = (void*)satnode;
501                showsatgmepgchannel(gmultiepg, channellistbox, listbox, satnode, zoom, akttime, aktchannel);
502                selectchannelgmepg(channellistbox);
503        }
504        else if(ostrncmp("(PROVIDER)-", tmpstr, 11) == 0 && strlen(tmpstr) > 6)
505        {
506                tmpstr1 = ostrcat(tmpstr1, _("GRAPHIC MULTI EPG - Provider"), 0, 0);
507                tmpstr1 = ostrcat(tmpstr1, " - ", 1, 0);
508                tmpstr1 = ostrcat(tmpstr1, tmpstr + 11, 1, 0);
509                if(nochanneltitle == 0) changetitle(gmultiepg, tmpstr1);
510                free(tmpstr1); tmpstr1 = NULL;
511                providernode = getproviderbyname(tmpstr + 11);
512                list = PROVIDERCHANNEL;
513                aktlist = (void*)providernode;
514                showprovidergmepgchannel(gmultiepg, channellistbox, listbox, providernode, zoom, akttime, aktchannel);
515                selectchannelgmepg(channellistbox);
516        }
517        else
518        {
519                if(nochanneltitle == 0) changetitle(gmultiepg, _("GRAPHIC MULTI EPG - All Channels"));
520                list = ALLCHANNEL;
521                showallgmepgchannel(gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel);
522                selectchannelgmepg(channellistbox);
523        }
524
525        if(flag == 0 && epgscreenconf == 3)
526        {
527                b2->hidden = NO;
528                b3->hidden = NO;
529                b4->hidden = NO;
530        }
531        else
532        {
533                b2->hidden = YES;
534                b3->hidden = YES;
535                b4->hidden = YES;
536        }
537
538        tmpstr = NULL;
539        status.screencalc = 2;
540        drawscreen(gmultiepg, 0);
541        status.screencalc = 0;
542        addscreenrc(gmultiepg, listbox);
543        listbox->aktpage = channellistbox->aktpage;
544
545        createtimeline(gmultiepg, timeline, akttime, zoom);
546
547        drawchannellistgmepg(gmultiepg, list, listbox);
548
549        while(1)
550        {
551                status.screencalc = 2;
552                rcret = waitrc(gmultiepg, 0, 0);
553                status.screencalc = 0;
554
555                channellistbox->aktpage = listbox->aktpage;
556
557                if((rcret == getrcconfigint("rcexit", NULL)) || (rcret == getrcconfigint("rcepg", NULL))) break;
558                //if(rcret == getrcconfigint("rcinfo", NULL)) break;
559                if(rcret == getrcconfigint("rcok", NULL))
560                {
561                        servicecheckret(servicestart((struct channel*)listbox->select->handle, NULL, NULL, 0), 0);
562                        break;
563                }
564                if(rcret == getrcconfigint("rcinfo", NULL))
565                {
566                        if(listbox->select != NULL)
567                        {
568                                clearscreen(gmultiepg);
569                                screenepg((struct channel*)listbox->select->handle, (struct epg*)listbox->select->handle1, 1);
570                                drawscreen(gmultiepg, 0);
571                        }
572                }
573               
574                if(flag == 0 && epgscreenconf == 3 && rcret == getrcconfigint("rcgreen", NULL))
575                {
576                        if(listbox->select != NULL)
577                        {
578                                clearscreen(gmultiepg);
579                                screenepg((struct channel*)listbox->select->handle, (struct epg*)listbox->select->handle1, 0);
580                                //drawscreen(gmultiepg, 0);
581                                break;
582                        }
583                }
584                if(flag == 0 && epgscreenconf == 3 && rcret == getrcconfigint("rcyellow", NULL))
585                {
586                        if(listbox->select != NULL)
587                        {
588                                clearscreen(gmultiepg);
589                                screensingleepg((struct channel*)listbox->select->handle, NULL, 0);
590                                //drawscreen(gmultiepg, 0);
591                                break;
592                        }
593                }
594                if(flag == 0 && epgscreenconf == 3 && rcret == getrcconfigint("rcblue", NULL))
595                {
596                        if(listbox->select != NULL)
597                        {
598                                clearscreen(gmultiepg);
599                                screenmultiepg((struct channel*)listbox->select->handle, NULL, 0);
600                                //drawscreen(gmultiepg, 0);
601                                break;
602                        }
603                }
604
605                if(rcret == getrcconfigint("rcff", NULL) || rcret == getrcconfigint("rcfav", NULL))
606                {
607                        time_t tmptime = 0;
608
609                        if(rcret == getrcconfigint("rcfav", NULL))
610                        {
611                                tmptime = calcprimetime(akttime);
612                                if(tmptime != 0)
613                                {
614                                        akttime = tmptime;
615                                        akttime -= addtime;
616                                }
617                        }
618                        akttime += addtime;
619
620                        if(list == BOUQUETCHANNEL)
621                        {
622                                if(showbouquetgmepgchannel(gmultiepg, channellistbox, listbox, ((struct mainbouquet*)aktlist)->bouquet, zoom, akttime, aktchannel) == 0)
623                                {
624                                        if(tmptime == 0)
625                                                akttime -= addtime;
626                                        else
627                                                akttime = starttime;
628                                        if(akttime < starttime)
629                                                akttime = starttime;
630                                        else
631                                                showbouquetgmepgchannel(gmultiepg, channellistbox, listbox, ((struct mainbouquet*)aktlist)->bouquet, zoom, akttime, aktchannel);
632                                }
633                        }
634                        else if(list == ALLCHANNEL)
635                        {
636                                if(showallgmepgchannel(gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel) == 0)
637                                {
638                                        if(tmptime == 0)
639                                                akttime -= addtime;
640                                        else
641                                                akttime = starttime;
642                                        if(akttime < starttime)
643                                                akttime = starttime;
644                                        else
645                                                showallgmepgchannel(gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel);
646                                }
647                        }
648                        else if(list == AZCHANNEL)
649                        {
650                                if(showazgmepgchannel(gmultiepg, channellistbox, listbox, character, zoom, akttime, aktchannel) == 0)
651                                {
652                                        if(tmptime == 0)
653                                                akttime -= addtime;
654                                        else
655                                                akttime = starttime;
656                                        if(akttime < starttime)
657                                                akttime = starttime;
658                                        else
659                                                showazgmepgchannel(gmultiepg, channellistbox, listbox, character, zoom, akttime, aktchannel);
660                                }
661                        }
662                        else if(list == SATCHANNEL)
663                        {
664                                if(showsatgmepgchannel(gmultiepg, channellistbox, listbox, satnode, zoom, akttime, aktchannel) == 0)
665                                {
666                                        if(tmptime == 0)
667                                                akttime -= addtime;
668                                        else
669                                                akttime = starttime;
670                                        if(akttime < starttime)
671                                                akttime = starttime;
672                                        else
673                                                showsatgmepgchannel(gmultiepg, channellistbox, listbox, satnode, zoom, akttime, aktchannel);
674                                }
675                        }
676                        else if(list == PROVIDERCHANNEL)
677                        {
678                                if(showprovidergmepgchannel(gmultiepg, channellistbox, listbox, providernode, zoom, akttime, aktchannel) == 0)
679                                {
680                                        if(tmptime == 0)
681                                                akttime -= addtime;
682                                        else
683                                                akttime = starttime;
684                                        if(akttime < starttime)
685                                                akttime = starttime;
686                                        else
687                                                showprovidergmepgchannel(gmultiepg, channellistbox, listbox, providernode, zoom, akttime, aktchannel);
688                                }
689                        }
690                        createtimeline(gmultiepg, timeline, akttime, zoom);
691                        drawscreen(gmultiepg, 0);
692                        if(listbox->select != NULL)
693                                aktchannel = (struct channel*)listbox->select->handle;
694                        continue;
695                }
696
697                if(rcret == getrcconfigint("rcfr", NULL))
698                {
699                        akttime -= addtime;
700                        if(akttime < starttime) akttime = starttime;
701
702                        if(list == BOUQUETCHANNEL)
703                                showbouquetgmepgchannel(gmultiepg, channellistbox, listbox, ((struct mainbouquet*)aktlist)->bouquet, zoom, akttime, aktchannel);
704                        else if(list == ALLCHANNEL)
705                                showallgmepgchannel(gmultiepg, channellistbox, listbox, zoom, akttime, aktchannel);
706                        else if(list == AZCHANNEL)
707                                showazgmepgchannel(gmultiepg, channellistbox, listbox, character, zoom, akttime, aktchannel);
708                        else if(list == SATCHANNEL)
709                                showsatgmepgchannel(gmultiepg, channellistbox, listbox, satnode, zoom, akttime, aktchannel);
710                        else if(list == PROVIDERCHANNEL)
711                                showprovidergmepgchannel(gmultiepg, channellistbox, listbox, providernode, zoom, akttime, aktchannel);
712                        createtimeline(gmultiepg, timeline, akttime, zoom);
713                        drawscreen(gmultiepg, 0);
714                        if(listbox->select != NULL)
715                                aktchannel = (struct channel*)listbox->select->handle;
716                        continue;
717                }
718
719                if(rcret == getrcconfigint("rcred", NULL) && listbox->select != NULL)
720                {
721                        clearscreen(gmultiepg);
722                        ret = addrecepg((struct channel*)listbox->select->handle, (struct epg*)listbox->select->handle1, NULL);
723                        drawscreen(gmultiepg, 0);
724                        continue;
725                }
726
727                if(listbox->select != NULL)
728                {
729                        tmpstr2 = epgdescunzip((struct epg*)listbox->select->handle1);
730                        changetext(epgdesc, tmpstr2);
731                        free(tmpstr2); tmpstr2 = NULL;
732
733                        aktchannel = (struct channel*)listbox->select->handle;
734                }
735                drawscreen(gmultiepg, 0);
736        }
737
738        status.markedchannel = NULL;
739        status.markmodus = 0;
740        status.screencalc = 0;
741        delmarkedscreennodes(gmultiepg, 1);
742        delmarkedscreennodes(gmultiepg, 3);
743        delownerrc(gmultiepg);
744        clearscreen(gmultiepg);
745}
746
747#endif
Note: See TracBrowser for help on using the repository browser.