source: titan/titan/skinfunc.h @ 40399

Last change on this file since 40399 was 39752, checked in by gost, 7 years ago

arm.. fix signal display

File size: 39.2 KB
Line 
1#ifndef SKINFUNC_H
2#define SKINFUNC_H
3
4char* Mtitletext = NULL;
5
6char* getplaytext(struct skin* node, char* path)
7{
8        char* tmpstr = NULL;
9
10        if(status.pause > 0 && status.slowspeed == 0)
11                tmpstr = ostrcat("Pause", NULL, 0, 0);
12        else if(status.play > 0)
13                tmpstr = ostrcat("Play", NULL, 0, 0);
14        else if(status.playspeed == 1)
15                tmpstr = ostrcat(">> 2x", NULL, 0, 0);
16        else if(status.playspeed == 2)
17                tmpstr = ostrcat(">> 4x", NULL, 0, 0);
18        else if(status.playspeed == 3)
19                tmpstr = ostrcat(">> 8x", NULL, 0, 0);
20        else if(status.playspeed == 4)
21                tmpstr = ostrcat(">> 16x", NULL, 0, 0);
22        else if(status.playspeed == 5)
23                tmpstr = ostrcat(">> 32x", NULL, 0, 0);
24        else if(status.playspeed == 6)
25                tmpstr = ostrcat(">> 64x", NULL, 0, 0);
26        else if(status.playspeed == 7)
27                tmpstr = ostrcat(">> 128x", NULL, 0, 0);
28        else if(status.playspeed == -1)
29                tmpstr = ostrcat("<< 2x", NULL, 0, 0);
30        else if(status.playspeed == -2)
31                tmpstr = ostrcat("<< 4x", NULL, 0, 0);
32        else if(status.playspeed == -3)
33                tmpstr = ostrcat("<< 8x", NULL, 0, 0);
34        else if(status.playspeed == -4)
35                tmpstr = ostrcat("<< 16x", NULL, 0, 0);
36        else if(status.playspeed == -5)
37                tmpstr = ostrcat("<< 32x", NULL, 0, 0);
38        else if(status.playspeed == -6)
39                tmpstr = ostrcat("<< 64x", NULL, 0, 0);
40        else if(status.playspeed == -7)
41                tmpstr = ostrcat("<< 128x", NULL, 0, 0);
42        else if(status.slowspeed == 1)
43                tmpstr = ostrcat("|| 2x", NULL, 0, 0);
44        else if(status.slowspeed == 2)
45                tmpstr = ostrcat("|| 4x", NULL, 0, 0);
46        else if(status.slowspeed == 3)
47                tmpstr = ostrcat("|| 8x", NULL, 0, 0);
48        else if(status.slowspeed == 4)
49                tmpstr = ostrcat("|| 16x", NULL, 0, 0);
50        else if(status.slowspeed == 5)
51                tmpstr = ostrcat("|| 32x", NULL, 0, 0);
52        else if(status.slowspeed == 6)
53                tmpstr = ostrcat("|| 64x", NULL, 0, 0);
54        else if(status.slowspeed == 7)
55                tmpstr = ostrcat("|| 128x", NULL, 0, 0);
56
57        return tmpstr;
58}
59
60char* getplaypic(struct skin* node, char* path)
61{
62        char* tmpstr = NULL;
63
64        if(status.pause > 0 && status.slowspeed == 0)
65                tmpstr = ostrcat("pause.png", NULL, 0, 0);
66        else if(status.play > 0)
67                tmpstr = ostrcat("play.png", NULL, 0, 0);
68        else if(status.playspeed == 1)
69                tmpstr = ostrcat("forward1.png", NULL, 0, 0);
70        else if(status.playspeed == 2)
71                tmpstr = ostrcat("forward1.png", NULL, 0, 0);
72        else if(status.playspeed == 3)
73                tmpstr = ostrcat("forward1.png", NULL, 0, 0);
74        else if(status.playspeed == 4)
75                tmpstr = ostrcat("forward1.png", NULL, 0, 0);
76        else if(status.playspeed == 5)
77                tmpstr = ostrcat("forward1.png", NULL, 0, 0);
78        else if(status.playspeed == 6)
79                tmpstr = ostrcat("forward1.png", NULL, 0, 0);
80        else if(status.playspeed == 7)
81                tmpstr = ostrcat("forward1.png", NULL, 0, 0);
82        else if(status.playspeed == -1)
83                tmpstr = ostrcat("rewind1.png", NULL, 0, 0);
84        else if(status.playspeed == -2)
85                tmpstr = ostrcat("rewind1.png", NULL, 0, 0);
86        else if(status.playspeed == -3)
87                tmpstr = ostrcat("rewind1.png", NULL, 0, 0);
88        else if(status.playspeed == -4)
89                tmpstr = ostrcat("rewind1.png", NULL, 0, 0);
90        else if(status.playspeed == -5)
91                tmpstr = ostrcat("rewind1.png", NULL, 0, 0);
92        else if(status.playspeed == -6)
93                tmpstr = ostrcat("rewind1.png", NULL, 0, 0);
94        else if(status.playspeed == -7)
95                tmpstr = ostrcat("rewind1.png", NULL, 0, 0);
96        else if(status.slowspeed == 1)
97                tmpstr = ostrcat("slow1.png", NULL, 0, 0);
98        else if(status.slowspeed == 2)
99                tmpstr = ostrcat("slow1.png", NULL, 0, 0);
100        else if(status.slowspeed == 3)
101                tmpstr = ostrcat("slow1.png", NULL, 0, 0);
102        else if(status.slowspeed == 4)
103                tmpstr = ostrcat("slow1.png", NULL, 0, 0);
104        else if(status.slowspeed == 5)
105                tmpstr = ostrcat("slow1.png", NULL, 0, 0);
106        else if(status.slowspeed == 6)
107                tmpstr = ostrcat("slow1.png", NULL, 0, 0);
108        else if(status.slowspeed == 7)
109                tmpstr = ostrcat("slow1.png", NULL, 0, 0);
110
111        if(tmpstr != NULL)
112        {
113                if(path != NULL && tmpstr != NULL)
114                        tmpstr = ostrcat("/", tmpstr, 0, 1);
115                tmpstr = ostrcat(path, tmpstr, 0, 1);
116        }
117       
118        return tmpstr;
119}
120
121char* getreccount(struct skin* node)
122{
123        char* tmpstr = NULL;
124
125        if(status.recording > 0)
126                tmpstr = oitoa(status.recording);
127
128        return tmpstr;
129}
130
131char* getrec(struct skin* node, char* path)
132{
133        char* tmpstr = NULL;
134
135        if(status.recording > 0)
136        {
137                tmpstr = ostrcat("rec.png", NULL, 0, 0);
138
139                if(path != NULL)
140                        tmpstr = ostrcat("/", tmpstr, 0, 1);
141                tmpstr = ostrcat(path, tmpstr, 0, 1);
142        }
143       
144        return tmpstr;
145}
146
147#ifdef MIPSEL
148//oled indicators for Nemesis
149//rec png
150        char* getoledrec(struct skin* node, char* path)
151        {
152                char* tmpstr = NULL;
153
154                if(status.recording > 0)
155                {
156                        if(node->nodestyle != 1)
157                                node->hidden = NO;
158                        if(node->picmem == 1)
159                                return tmpstr;
160                        tmpstr = ostrcat("oled_rec.png", NULL, 0, 0);
161
162                        if(path != NULL)
163                                tmpstr = ostrcat("/", tmpstr, 0, 1);
164                        tmpstr = ostrcat(path, tmpstr, 0, 1);
165                }
166                else
167                        node->hidden = YES;
168       
169                return tmpstr;
170        }
171//mute png
172        char* getoledmute(struct skin* node, char* path)
173        {
174                char* tmpstr = NULL;
175
176                if(status.mute > 0)
177                {
178                        if(node->nodestyle != 1)
179                                node->hidden = NO;
180                        if(node->picmem == 1)
181                                return tmpstr;
182                        tmpstr = ostrcat("oled_mute.png", NULL, 0, 0);
183                        if(path != NULL)
184                                tmpstr = ostrcat("/", tmpstr, 0, 1);
185                        tmpstr = ostrcat(path, tmpstr, 0, 1);
186                }
187                else
188                        node->hidden = YES;
189               
190                return tmpstr;
191        }
192
193//timeshift png
194        char* getoledtimeshift(struct skin* node, char* path)
195        {
196                char* tmpstr = NULL;
197
198                if(status.timeshift > 0)
199                {
200                        if(node->nodestyle != 1)
201                                node->hidden = NO;
202                        if(node->picmem == 1)
203                                return tmpstr;
204                        tmpstr = ostrcat("oled_timeshift.png", NULL, 0, 0);
205
206                        if(path != NULL)
207                tmpstr = ostrcat("/", tmpstr, 0, 1);
208                        tmpstr = ostrcat(path, tmpstr, 0, 1);
209                }
210                else
211                        node->hidden = YES;
212               
213                return tmpstr;
214        }
215
216//streaming png
217        char* getoledstreaming(struct skin* node, char* path)
218        {
219                char* tmpstr = NULL;
220
221                if(status.streaming > 0)
222                {
223                        if(node->nodestyle != 1)
224                                node->hidden = NO;
225                        if(node->picmem == 1)
226                                return tmpstr;
227                        tmpstr = ostrcat("oled_streaming.png", NULL, 0, 0);
228
229                        if(path != NULL)
230                tmpstr = ostrcat("/", tmpstr, 0, 1);
231                        tmpstr = ostrcat(path, tmpstr, 0, 1);
232                }
233                else
234                        node->hidden = YES;
235               
236                return tmpstr;
237        }
238
239//crypt png
240    char* getoledcrypt(struct skin* node, char* path)
241    {
242            char* tmpstr = NULL;
243
244            if(status.aktservice->channel != NULL)
245            {
246                    if(status.aktservice->channel->crypt > 0)
247                          {
248                                if(node->nodestyle != 1)
249                                                node->hidden = NO;
250                                        if(node->picmem == 1)
251                                                return tmpstr; 
252                            tmpstr = ostrcat("oled_crypt.png", NULL, 0, 0);
253                          }
254                          else
255                                node->hidden = YES;
256                    if(path != NULL)
257                            tmpstr = ostrcat("/", tmpstr, 0, 1);
258                    tmpstr = ostrcat(path, tmpstr, 0, 1);
259            }
260                        else
261                                node->hidden = YES;
262            return tmpstr;
263    }
264
265//real aspect 16:9 png
266    char* getoledchannelaspect(struct skin* node, char* path)
267    {
268            char* tmpstr = NULL;
269       
270            videoreadqwidth(status.aktservice->videodev);
271            if(status.videosize.aspect_ratio == 3 || status.videosize.aspect_ratio == 11)
272                {
273                        if(node->nodestyle != 1)
274                                node->hidden = NO;
275                        if(node->picmem == 1)
276                                return tmpstr;
277                    tmpstr = ostrcat("oled_16_9.png", NULL, 0, 0);
278                }
279
280                else
281                        node->hidden = YES;
282            if(path != NULL)
283                    tmpstr = ostrcat("/", tmpstr, 0, 1);
284                        tmpstr = ostrcat(path, tmpstr, 0, 1);
285
286            return tmpstr;
287    }
288
289//real resolution 576 png
290    char* getoledchannelresolution576(struct skin* node, char* path)
291    {
292            char* tmpstr = NULL;
293
294            videoreadqwidth(status.aktservice->videodev);
295        if(status.videosize.h == 576)
296                {
297                        if(node->nodestyle != 1)
298                                node->hidden = NO;
299                        if(node->picmem == 1)
300                                return tmpstr; 
301                    tmpstr = ostrcat("oled_576.png", NULL, 0, 0);
302                }
303                else
304                        node->hidden = YES;
305            if(path != NULL)
306                    tmpstr = ostrcat("/", tmpstr, 0, 1);
307                        tmpstr = ostrcat(path, tmpstr, 0, 1);
308
309            return tmpstr;
310    }
311   
312//real resolution 720 png
313    char* getoledchannelresolution720(struct skin* node, char* path)
314    {
315            char* tmpstr = NULL;
316
317            videoreadqwidth(status.aktservice->videodev);
318        if(status.videosize.h == 720)
319                {
320                        if(node->nodestyle != 1)
321                                node->hidden = NO;
322                        if(node->picmem == 1)
323                                return tmpstr; 
324                    tmpstr = ostrcat("oled_720.png", NULL, 0, 0);
325                }
326                else
327                        node->hidden = YES;
328            if(path != NULL)
329                    tmpstr = ostrcat("/", tmpstr, 0, 1);
330                        tmpstr = ostrcat(path, tmpstr, 0, 1);
331
332            return tmpstr;
333    }
334   
335//real resolution 1080 png
336    char* getoledchannelresolution1080(struct skin* node, char* path)
337    {
338            char* tmpstr = NULL;
339
340            videoreadqwidth(status.aktservice->videodev);
341        if(status.videosize.h == 1080)
342                {
343                        if(node->nodestyle != 1)
344                                node->hidden = NO;
345                        if(node->picmem == 1)
346                                return tmpstr; 
347                    tmpstr = ostrcat("oled_1080.png", NULL, 0, 0);
348                }
349                else
350                        node->hidden = YES;
351            if(path != NULL)
352                    tmpstr = ostrcat("/", tmpstr, 0, 1);
353                        tmpstr = ostrcat(path, tmpstr, 0, 1);
354
355            return tmpstr;
356    }
357
358//hd png
359    char* getoledhd(struct skin* node, char* path)
360    {
361            char* tmpstr = NULL;
362
363            videoreadqwidth(status.aktservice->videodev);
364            if(status.videosize.h == 720 || status.videosize.h == 1080)
365            {
366                        if(node->nodestyle != 1)
367                                node->hidden = NO;
368                        if(node->picmem == 1)
369                                return tmpstr; 
370                    tmpstr = ostrcat("oled_hd.png", NULL, 0, 0);
371                }
372
373                else
374                        node->hidden = YES;
375                if(path != NULL)
376                    tmpstr = ostrcat("/", tmpstr, 0, 1);
377                        tmpstr = ostrcat(path, tmpstr, 0, 1);   
378
379                return tmpstr;
380    }
381   
382//dolby png
383    char* getoleddolby(struct skin* node, char* path)
384    {
385            char* tmpstr = NULL;
386
387            if(status.aktservice->channel->audiocodec == AC3 || status.aktservice->channel->audiocodec == DTS)
388            {
389                        if(node->nodestyle != 1)
390                                node->hidden = NO;
391                        if(node->picmem == 1)
392                                return tmpstr; 
393                    //tmpstr = ostrcat("oled_dolby.png", NULL, 0, 0);
394                }
395
396                else
397                        node->hidden = YES;
398                if(path != NULL)
399                    tmpstr = ostrcat("/", tmpstr, 0, 1);
400                        tmpstr = ostrcat(path, tmpstr, 0, 1);   
401
402                return tmpstr;
403    }
404       
405#endif
406
407
408char* getcrypt(struct skin* node, char* path)
409{
410        char* tmpstr = NULL;
411
412        if(status.aktservice->channel != NULL)
413        {
414                if(status.aktservice->channel->crypt > 0)
415                        tmpstr = ostrcat("crypt.png", NULL, 0, 0);
416                else
417                        tmpstr = ostrcat("nocrypt.png", NULL, 0, 0);
418
419                if(path != NULL)
420                        tmpstr = ostrcat("/", tmpstr, 0, 1);
421                tmpstr = ostrcat(path, tmpstr, 0, 1);
422        }
423       
424        return tmpstr;
425}
426
427char* getaspectmode(struct skin* node, char* path)
428{
429        char* tmpstr = NULL;
430
431        tmpstr = getaspect();
432
433#ifdef MIPSEL   
434    if(ostrcmp(tmpstr, "4:3") == 1)
435        {
436                free(tmpstr); tmpstr = NULL;
437                tmpstr = ostrcat(tmpstr, "4_3.png", 1, 0);
438        }
439        if(ostrcmp(tmpstr, "16:9") == 3 || ostrcmp(tmpstr, "16:9") == 11)
440        {
441                free(tmpstr); tmpstr = NULL;
442                tmpstr = ostrcat(tmpstr, "16_9.png", 1, 0);
443        }
444#else
445    if(ostrcmp(tmpstr, "4:3") == 0)
446        {
447                free(tmpstr); tmpstr = NULL;
448                tmpstr = ostrcat(tmpstr, "4_3.png", 1, 0);
449        }
450        if(ostrcmp(tmpstr, "16:9") == 1)
451        {
452                free(tmpstr); tmpstr = NULL;
453                tmpstr = ostrcat(tmpstr, "16_9.png", 1, 0);
454        }
455#endif
456        if(path != NULL)
457                tmpstr = ostrcat("/", tmpstr, 0, 1);
458        tmpstr = ostrcat(path, tmpstr, 0, 1);
459
460        return tmpstr;
461}
462
463char* getsdhd(struct skin* node, char* path)
464{
465        char* tmpstr = NULL;
466
467        videoreadqwidth(status.aktservice->videodev);
468
469//      if(getaktvideosize() == 0) //videosize is ok
470//      {
471                if(status.videosize.h == 576)
472                        tmpstr = ostrcat("sd.png", NULL, 0, 0);
473                else if(status.videosize.h == 720)
474                        tmpstr = ostrcat("hdready.png", NULL, 0, 0);
475                else if(status.videosize.h == 1080)
476                        tmpstr = ostrcat("hd.png", NULL, 0, 0);
477//      }
478       
479        if(tmpstr == NULL) tmpstr = ostrcat("novideo.png", NULL, 0, 0);
480
481        if(path != NULL)
482                tmpstr = ostrcat("/", tmpstr, 0, 1);
483        tmpstr = ostrcat(path, tmpstr, 0, 1);
484
485        return tmpstr;
486}
487       
488char* getresolution(struct skin* node, char* path)
489{
490        char* tmpstr = NULL;
491
492        if(fb->width == 720 && fb->height == 576)
493                tmpstr = ostrcat("576.png", NULL, 0, 0);
494        else if(fb->width == 1280 && fb->height == 720)
495                tmpstr = ostrcat("720.png", NULL, 0, 0);
496        else if(fb->width == 1920 && fb->height == 1080)
497                tmpstr = ostrcat("1080.png", NULL, 0, 0);
498
499        if(path != NULL)
500                tmpstr = ostrcat("/", tmpstr, 0, 1);
501        tmpstr = ostrcat(path, tmpstr, 0, 1);
502       
503        return tmpstr;
504}
505
506char* getchannelresolution(struct skin* node, char* path)
507{
508        char* tmpstr = NULL;
509
510        videoreadqwidth(status.aktservice->videodev);
511
512//      if(getaktvideosize() == 0) //videosize is ok
513//      {
514                if(status.videosize.h == 576)
515                        tmpstr = ostrcat("576.png", NULL, 0, 0);
516                else if(status.videosize.h == 720)
517                        tmpstr = ostrcat("720.png", NULL, 0, 0);
518                else if(status.videosize.h == 1080)
519                        tmpstr = ostrcat("1080.png", NULL, 0, 0);
520//      }
521       
522        if(tmpstr == NULL) tmpstr = ostrcat("novideores.png", NULL, 0, 0);
523
524        if(path != NULL)
525                tmpstr = ostrcat("/", tmpstr, 0, 1);
526        tmpstr = ostrcat(path, tmpstr, 0, 1);
527
528        return tmpstr;
529}
530
531char* getchannelaspect(struct skin* node, char* path)
532{
533        char* tmpstr = NULL;
534       
535        videoreadqwidth(status.aktservice->videodev);
536
537#ifdef MIPSEL
538//      if(getaktvideosize() == 0) //videosize is ok
539//      {
540                if(status.videosize.aspect_ratio == 1)
541                        tmpstr = ostrcat("4_3.png", NULL, 0, 0);
542                else if(status.videosize.aspect_ratio == 3 || status.videosize.aspect_ratio == 11)
543                        tmpstr = ostrcat("16_9.png", NULL, 0, 0);
544//      }
545
546#else
547//      if(getaktvideosize() == 0) //videosize is ok
548//      {
549                if(status.videosize.aspect_ratio == 0)
550                        tmpstr = ostrcat("4_3.png", NULL, 0, 0);
551                else if(status.videosize.aspect_ratio == 1)
552                        tmpstr = ostrcat("16_9.png", NULL, 0, 0);
553//      }
554#endif
555       
556        if(tmpstr == NULL) tmpstr = ostrcat("novideoasp.png", NULL, 0, 0);
557
558        if(path != NULL)
559                tmpstr = ostrcat("/", tmpstr, 0, 1);
560        tmpstr = ostrcat(path, tmpstr, 0, 1);
561
562        return tmpstr;
563}
564
565char* getteletext(struct skin* node, char* path)
566{
567        char* tmpstr = NULL;
568
569        if(status.aktservice->channel != NULL)
570        {
571                if(status.aktservice->channel->txtpid > 0)
572                        tmpstr = ostrcat("teletext.png", NULL, 0, 0);
573                else
574                        tmpstr = ostrcat("noteletext.png", NULL, 0, 0);
575
576                if(path != NULL)
577                        tmpstr = ostrcat("/", tmpstr, 0, 1);
578                tmpstr = ostrcat(path, tmpstr, 0, 1);
579        }
580       
581        return tmpstr;
582}
583
584char* getsoundtype(struct skin* node, char* path)
585{
586        char* tmpstr = NULL;
587
588        if(status.aktservice->channel != NULL)
589        {
590                switch(status.aktservice->channel->audiocodec)
591                {
592                        case AC3:
593                                tmpstr = ostrcat("ac3.png", NULL, 0, 0);
594                                break;
595                        case MPEGA:
596                                tmpstr = ostrcat("mpega.png", NULL, 0, 0);
597                                break;
598                        case DTS:
599                                tmpstr = ostrcat("dts.png", NULL, 0, 0);
600                                break;
601                        case LPCM:
602                                tmpstr = ostrcat("lpcm.png", NULL, 0, 0);
603                                break;
604                        case AAC:
605                                tmpstr = ostrcat("aac.png", NULL, 0, 0);
606                                break;
607                        case AACHE:
608                                tmpstr = ostrcat("aache.png", NULL, 0, 0);
609                                break;
610                }
611                if(path != NULL)
612                        tmpstr = ostrcat("/", tmpstr, 0, 1);
613                tmpstr = ostrcat(path, tmpstr, 0, 1);
614        }
615       
616        return tmpstr;
617}
618
619char* getprovidername(struct skin* node)
620{
621        char* tmpstr = NULL;
622
623        if(status.aktservice->channel != NULL && status.aktservice->channel->provider != NULL)
624                tmpstr = ostrcat(status.aktservice->channel->provider->name, NULL, 0, 0);
625
626        return tmpstr;
627}
628
629char* getsatname(struct skin* node)
630{
631        struct sat* satnode = NULL;
632        char* tmpstr = NULL;
633
634        if(status.aktservice->channel != NULL && status.aktservice->channel->transponder != NULL)
635        {
636                satnode = getsatbyorbitalpos(status.aktservice->channel->transponder->orbitalpos);
637                if(satnode != NULL)
638                        tmpstr = ostrcat(satnode->name, NULL, 0, 0);
639        }
640
641        return tmpstr;
642}
643
644char* getber(struct skin* node, char* format)
645{
646        uint32_t ber = 0;
647        char* buf = NULL, *buf1 = NULL;
648
649        ber = fereadber(status.aktservice->fedev);
650
651        buf = malloc(MINMALLOC);
652        if(buf == NULL)
653        {
654                err("no mem");
655                return NULL;
656        }
657       
658        snprintf(buf, MINMALLOC, format, ber);
659        buf1 = ostrcat(buf, NULL, 1, 0);
660
661        return buf1;
662}
663
664char* getsignal(struct skin* node, char* format)
665{
666        uint16_t signal = 0;
667        char* buf = NULL, *buf1 = NULL;
668
669        signal = fereadsignalstrength(status.aktservice->fedev);
670        signal = (signal * 100) / 0xffff;
671
672        buf = malloc(MINMALLOC);
673        if(buf == NULL)
674        {
675                err("no mem");
676                return NULL;
677        }
678       
679        snprintf(buf, MINMALLOC, format, signal);
680        buf1 = ostrcat(buf, NULL, 1, 0);
681
682        return buf1;
683}
684
685char* getunc(struct skin* node, char* format)
686{
687        uint32_t unc = 0;
688        char* buf = NULL, *buf1 = NULL;
689
690        unc = fereaduncorrectedblocks(status.aktservice->fedev);
691
692        buf = malloc(MINMALLOC);
693        if(buf == NULL)
694        {
695                err("no mem");
696                return NULL;
697        }
698       
699        snprintf(buf, MINMALLOC, format, unc);
700        buf1 = ostrcat(buf, NULL, 1, 0);
701
702        return buf1;
703}
704
705char* getsnr(struct skin* node, char* format)
706{
707        uint16_t snr = 0;
708        char* buf = NULL, *buf1 = NULL;
709        snr = fereadsnr(status.aktservice->fedev);
710        snr = (snr * 100) / 0xffff;
711
712        buf = malloc(MINMALLOC);
713        if(buf == NULL)
714        {
715                err("no mem");
716                return NULL;
717        }
718       
719        snprintf(buf, MINMALLOC, format, snr);
720        buf1 = ostrcat(buf, NULL, 1, 0);
721
722        return buf1;
723}
724
725char* getepgtimeline(struct skin* node, int akt)
726{       
727        struct epg* epgnode = NULL;
728        struct channel* chnode = NULL;
729        char* tmpstr = NULL, *tmpnr = NULL;
730        int proz = 0;
731
732        if(akt == 0) chnode = status.markedchannel;
733        if(akt == 1) chnode = status.aktservice->channel;
734        if(akt == 2 && node != NULL) chnode = (struct channel*)node->handle;
735
736        if(chnode != NULL)
737        {
738                epgnode = getepgakt(chnode);
739                if(epgnode != NULL)
740                {
741                        proz = (time(NULL) - epgnode->starttime) * 100 / (epgnode->endtime - epgnode->starttime);
742                        tmpnr = oitoa(proz);
743                        tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
744                        return tmpstr;
745                }
746        }
747        return NULL;
748}
749
750char* getepgmarkedtimeline(struct skin* node)
751{
752        return getepgtimeline(node, 0);
753}
754
755char* getepgakttimeline(struct skin* node)
756{
757        return getepgtimeline(node, 1);
758}
759
760char* getepgchanneltimeline(struct skin* node)
761{
762        return getepgtimeline(node, 2);
763}
764
765char* getaktchannelname(struct skin* node)
766{
767        char* tmpstr = NULL;
768
769        if(status.aktservice->channel != NULL)
770        {
771                tmpstr = ostrcat(tmpstr, status.aktservice->channel->name, 1, 0);
772                return tmpstr;
773        }
774        return NULL;
775}
776
777char* getepgtime(struct skin* node, char* format, int akt, int type)
778{
779        // akt 0 = marked channel
780        // akt 1 = akt channel now
781        // akt 2 = akt channel next
782
783        // type 0 = starttime
784        // type 1 = endtime
785        // type 2 = remainingtime
786
787        struct epg* epgnode = NULL;
788        struct tm *loctime = NULL;
789        struct channel* chnode = NULL;
790        char *buf = NULL, *buf1 = NULL;
791        time_t min = 0;
792       
793        if(format == NULL)
794        {
795                err("NULL detect");
796                return NULL;
797        }
798
799        if(akt == 0) chnode = status.markedchannel;
800        if(akt == 1 || akt == 2) chnode = status.aktservice->channel;
801
802// dynamic default skin infobar start
803        if(status.fontsizeadjust > 0 && status.getepgaktstart == 0 && ostrcmp(node->name, "infobar_getepgaktstart") == 0)
804        {
805                status.getepgaktstart++;
806                node->height += status.fontsizeadjust;
807                node->width += (status.fontsizeadjust * 2);
808        }
809        else if(status.fontsizeadjust > 0 && status.getepgnextstart == 0 && ostrcmp(node->name, "infobar_getepgnextstart") == 0)
810        {
811                status.getepgnextstart++;
812                node->height += status.fontsizeadjust;
813                node->posy += status.fontsizeadjust;
814                node->width += (status.fontsizeadjust * 2);
815        }
816        else if(status.fontsizeadjust > 0 && status.getepgaktend == 0 && ostrcmp(node->name, "infobar_getepgaktend") == 0)
817        {
818                status.getepgaktend++;
819                node->height += status.fontsizeadjust;
820                node->posx += (status.fontsizeadjust * 2.4);
821                node->width += (status.fontsizeadjust * 2);
822        }
823        else if(status.fontsizeadjust > 0 && status.getepgnextend == 0 && ostrcmp(node->name, "infobar_getepgnextend") == 0)
824        {
825                status.getepgnextend++;
826                node->height += status.fontsizeadjust;
827                node->posx += (status.fontsizeadjust * 2.4);
828                node->posy += status.fontsizeadjust;
829                node->width += (status.fontsizeadjust * 2);
830        }
831        else if(status.fontsizeadjust > 0 && status.getepgakttimeremaining == 0 && ostrcmp(node->name, "infobar_getepgakttimeremaining") == 0)
832        {
833                status.getepgakttimeremaining++;
834                node->height += status.fontsizeadjust;
835                node->posx -= (status.fontsizeadjust * 4);
836                node->width += (status.fontsizeadjust * 4);
837        }
838        else if(status.fontsizeadjust > 0 && status.getepgnexttimeremaining == 0 && ostrcmp(node->name, "infobar_getepgnexttimeremaining") == 0)
839        {
840                status.getepgnexttimeremaining++;
841                node->height += status.fontsizeadjust;
842                node->posx -= (status.fontsizeadjust * 4);
843                node->posy += status.fontsizeadjust;
844                node->width += (status.fontsizeadjust * 4);
845        }
846// dynamic default skin infobar end
847
848        if(chnode != NULL)
849        {
850                epgnode = getepgakt(chnode);
851
852                if(akt == 2)
853                {
854                        if(epgnode != NULL)
855                                epgnode = epgnode->next;
856                }
857
858                if(epgnode != NULL)
859                {
860                        if(type == 0)
861                                loctime = olocaltime(&epgnode->starttime);
862                        else if(type == 1)
863                                loctime = olocaltime(&epgnode->endtime);
864                        else if(type == 2)
865                        {
866                                if(akt == 1)
867                                        min = ((epgnode->endtime - (epgnode->endtime % 60)) - (time(NULL) - (time(NULL) % 60))) / 60;
868                                else if(akt == 2)
869                                        min = ((epgnode->endtime - (epgnode->endtime % 60)) - (epgnode->starttime - (epgnode->starttime % 60))) / 60;
870                                if(min < 0) min = 0;
871                        }
872
873                        buf = malloc(MINMALLOC);
874                        if(buf == NULL)
875                        {
876                                free(loctime);
877                                err("no memory");
878                                return NULL;
879                        }
880
881                        if(type == 2)
882                                snprintf(buf, MINMALLOC, format, min);
883                        else if(loctime != NULL)
884                                ostrftime(buf, MINMALLOC, format, loctime);
885                        buf1 = ostrcat(buf, NULL, 1, 0);
886
887                        buf1 = translate_time(buf1, 0);
888
889                        free(loctime); loctime = NULL;
890                        return buf1;
891                }
892        }
893        return NULL;
894}
895
896char* getepgakttimeremaining(struct skin* node, char* format)
897{
898        return getepgtime(node, format, 1, 2);
899}
900
901char* getepgnexttimeremaining(struct skin* node, char* format)
902{
903        return getepgtime(node, format, 2, 2);
904}
905
906char* getepgmarkedstart(struct skin* node, char* format)
907{
908        return getepgtime(node, format, 0, 0);
909}
910
911char* getepgmarkedend(struct skin* node, char* format)
912{
913        return getepgtime(node, format, 0, 1);
914}
915
916char* getepgaktstart(struct skin* node, char* format)
917{
918        return getepgtime(node, format, 1, 0);
919}
920
921char* getepgaktend(struct skin* node, char* format)
922{
923        return getepgtime(node, format, 1, 1);
924}
925
926char* getepgnextstart(struct skin* node, char* format)
927{
928        return getepgtime(node, format, 2, 0);
929}
930
931char* getepgnextend(struct skin* node, char* format)
932{
933        return getepgtime(node, format, 2, 1);
934}
935
936char* getepgaktsubtitle(struct skin* node)
937{
938        struct epg* epgnode = NULL;
939        char* tmpstr = NULL;
940
941        epgnode = getepgakt(status.aktservice->channel);
942        if(epgnode != NULL)
943        {
944                tmpstr = ostrcat(tmpstr, epgnode->subtitle, 1, 0);
945                return tmpstr;
946        }
947
948        return NULL;
949}
950
951char* getepgakttitle(struct skin* node)
952{
953        struct epg* epgnode = NULL;
954        char* tmpstr = NULL;
955
956// dynamic default skin infobar start
957        if(status.fontsizeadjust > 0 && status.getepgakttitle == 0 && ostrcmp(node->name,"infobar_getepgakttitle") == 0)
958        {
959                status.getepgakttitle++;
960                node->height += status.fontsizeadjust;
961                node->posx += (status.fontsizeadjust * 4.8);
962                node->width -= (status.fontsizeadjust * 6);
963                printf("set fontsize on name=%s\n", node->name);
964        }
965// dynamic default skin infobar end
966               
967        if(status.aktservice->type == HDMIIN)
968        {
969                tmpstr = ostrcat(tmpstr, "HDMI-in", 1, 0);
970                return tmpstr;
971        }
972
973        epgnode = getepgakt(status.aktservice->channel);
974        if(epgnode != NULL)
975        {
976                tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
977                return tmpstr;
978        }
979
980        return NULL;
981}
982
983char* getepgnexttitle(struct skin* node)
984{
985        struct epg* epgnode = NULL;
986        char* tmpstr = NULL;
987
988// dynamic default skin infobar start
989        if(status.fontsizeadjust > 0 && status.getepgnexttitle == 0 && ostrcmp(node->name,"infobar_getepgnexttitle") == 0)
990        {
991                status.getepgnexttitle++;
992                node->height += status.fontsizeadjust;
993                node->posx += (status.fontsizeadjust * 4.8);
994                node->posy += status.fontsizeadjust;
995                node->width -= (status.fontsizeadjust * 6);
996                printf("set fontsize on name=%s\n", node->name);
997        }
998// dynamic default skin infobar end
999
1000        epgnode = getepgakt(status.aktservice->channel);
1001        if(epgnode != NULL)
1002        {
1003                epgnode = epgnode->next;
1004                if(epgnode != NULL)
1005                {
1006                        tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
1007                        return tmpstr;
1008                }
1009        }
1010
1011        return NULL;
1012}
1013
1014char* getepgaktdesc(struct skin* node)
1015{
1016        struct epg* epgnode = NULL;
1017
1018        if(status.aktservice->channel != NULL)
1019        {
1020                epgnode = getepgakt(status.aktservice->channel);
1021                if(epgnode != NULL)
1022                        return epgdescunzip(epgnode);
1023        }
1024
1025        return NULL;
1026}
1027
1028char* getepgnextdesc(struct skin* node)
1029{
1030        struct epg* epgnode = NULL;
1031
1032        if(status.aktservice->channel != NULL)
1033        {
1034                epgnode = getepgakt(status.aktservice->channel);
1035                if(epgnode != NULL)
1036                {
1037                        epgnode = epgnode->next;
1038                        if(epgnode != NULL)
1039                                return epgdescunzip(epgnode);
1040                }
1041        }
1042
1043        return NULL;
1044}
1045
1046char* getepgmarkeddesc(struct skin* node)
1047{
1048        struct epg* epgnode = NULL;
1049
1050        if(status.markedchannel != NULL)
1051        {
1052                epgnode = getepgakt(status.markedchannel);
1053                if(epgnode != NULL)
1054                        return epgdescunzip(epgnode);
1055        }
1056
1057        return NULL;
1058}
1059
1060char* getepgmarkedtitle(struct skin* node)
1061{
1062        struct epg* epgnode = NULL;
1063        char* tmpstr = NULL;
1064
1065        if(status.markedchannel != NULL)
1066        {
1067                epgnode = getepgakt(status.markedchannel);
1068                if(epgnode != NULL)
1069                {
1070                        tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
1071                        return tmpstr;
1072                }
1073        }
1074
1075        return NULL;
1076}
1077
1078char* getepgmarkedlist(struct skin* node, char* ccount)
1079{
1080        struct epg* epgnode = NULL;
1081        char* tmpstr = NULL, *buf = NULL;
1082        int count = atoi(ccount);
1083        struct tm* loctime = NULL;
1084
1085        buf = malloc(MINMALLOC);
1086        if(buf == NULL)
1087        {
1088                err("no memory");
1089                return NULL;
1090        }
1091
1092        if(status.markedchannel != NULL)
1093        {
1094                epgnode = getepgakt(status.markedchannel);
1095                while(epgnode != NULL)
1096                {
1097                        epgnode = epgnode->next;
1098                        if(epgnode != NULL)
1099                        {
1100                                loctime = olocaltime(&epgnode->starttime);
1101                                if(loctime != NULL)
1102                                        strftime(buf, MINMALLOC, "%H:%M", loctime);
1103                                free(loctime); loctime = NULL;
1104                                tmpstr = ostrcat(tmpstr, buf, 1, 0);
1105                                tmpstr = ostrcat(tmpstr, " ", 1, 0);
1106                                tmpstr = ostrcat(tmpstr, epgnode->title, 1, 0);
1107                                tmpstr = ostrcat(tmpstr, "\n", 1, 0);
1108                                count--;
1109                        }
1110                        if(count < 1) break;
1111                }
1112        }
1113
1114        free(buf);
1115        return tmpstr;
1116}
1117
1118char* getepgpicon(struct skin* node)
1119{
1120        char* tmpstr = NULL;
1121       
1122        if(status.epgchannel != NULL)
1123                tmpstr = createpiconpath(status.epgchannel, 0);
1124        return tmpstr;
1125}
1126
1127char* getepgalternatepicon(struct skin* node)
1128{
1129        char* tmpstr = NULL;
1130       
1131        if(status.epgchannel != NULL)
1132        {
1133                tmpstr = createpiconpath(status.epgchannel, 1);
1134                if(ostrstr(tmpstr, "defpicon.png") != NULL)
1135                {
1136                        free(tmpstr); tmpstr=NULL;
1137                        tmpstr = createpiconpath(status.epgchannel, 0);
1138                }
1139        }
1140       
1141        return tmpstr;
1142}
1143
1144char* getmarkedpicon(struct skin* node)
1145{
1146        char* tmpstr = NULL;
1147       
1148        if(status.markedchannel != NULL)
1149                tmpstr = createpiconpath(status.markedchannel, 0);
1150        return tmpstr;
1151}
1152
1153char* getmarkedalternatepicon(struct skin* node)
1154{
1155        char* tmpstr = NULL;
1156       
1157        if(status.markedchannel != NULL)
1158        {
1159                tmpstr = createpiconpath(status.markedchannel, 1);
1160                if(ostrstr(tmpstr, "defpicon.png") != NULL)
1161                {
1162                        free(tmpstr); tmpstr=NULL;
1163                        tmpstr = createpiconpath(status.markedchannel, 0);
1164                }
1165        }       
1166       
1167        return tmpstr;
1168}
1169
1170char* getpicon(struct skin* node)
1171{
1172        char* tmpstr = NULL;
1173        tmpstr = createpiconpath(status.aktservice->channel, 0);
1174        return tmpstr;
1175}
1176
1177char* getalternatepicon(struct skin* node)
1178{
1179        char* tmpstr = NULL;
1180        tmpstr = createpiconpath(status.aktservice->channel, 1);
1181        if(ostrstr(tmpstr, "defpicon.png") != NULL)
1182        {
1183                free(tmpstr); tmpstr=NULL;
1184                tmpstr = createpiconpath(status.aktservice->channel, 0);
1185        }
1186        return tmpstr;
1187}
1188
1189char* getallpicon(struct skin* node, char* firstpath)
1190{
1191        char* tmpstr = NULL;
1192        int p1 = 0;
1193        int p2 = 1;
1194       
1195        if(firstpath != NULL)
1196        {
1197                if(ostrcmp("alternate", firstpath) == 0)
1198                {
1199                        p1 = 1;
1200                        p2 = 0;
1201                }
1202        }
1203       
1204        tmpstr = createpiconpath(status.aktservice->channel, p1);
1205        if(ostrstr(tmpstr, "defpicon.png") != NULL)
1206        {
1207                free(tmpstr); tmpstr=NULL;
1208                tmpstr = createpiconpath(status.aktservice->channel, p2);
1209        }
1210        return tmpstr;
1211}
1212
1213char* gettime(struct skin* node, char* format)
1214{
1215        time_t sec;
1216        struct tm *loctime = NULL;
1217        char *buf = NULL, *buf1 = NULL;
1218
1219        if(format == NULL)
1220        {
1221                err("NULL detect");
1222                return NULL;
1223        }
1224
1225        buf = malloc(MINMALLOC);
1226        if(buf == NULL)
1227        {
1228                err("no memory");
1229                return NULL;
1230        }
1231
1232        sec = time(NULL);
1233        loctime = olocaltime(&sec);
1234
1235        if(loctime != NULL)
1236        {
1237                ostrftime(buf, MINMALLOC, format, loctime);
1238                buf1 = ostrcat(buf, NULL, 1, 0);
1239        }
1240
1241        if(ostrstr(format, "%a") != NULL)
1242                buf1 = translate_time(buf1, 1);
1243        else if(ostrstr(format, "%A") != NULL)
1244                buf1 = translate_time(buf1, 2);
1245        else if(ostrstr(format, "%B") != NULL)
1246                buf1 = translate_time(buf1, 3);
1247        else
1248                buf1 = translate_time(buf1, 1);
1249
1250        free(loctime);
1251        return buf1;
1252}
1253
1254char* getchannelnr(struct skin* node, struct channel* chnode)
1255{
1256        char *tmpstr = NULL, *tmpnr = NULL;
1257
1258        if(chnode == NULL) chnode = status.aktservice->channel;
1259
1260        if(status.servicetype == 0)
1261                tmpstr = getconfig("channellist", NULL);
1262        else
1263                tmpstr = getconfig("rchannellist", NULL);
1264        if(ostrncmp("(BOUQUET)-", tmpstr, 10) == 0 && strlen(tmpstr) > 10)
1265        {
1266                struct mainbouquet* mainbouquetnode = NULL;
1267                int count = 0;
1268
1269                mainbouquetnode = getmainbouquet(tmpstr + 10);
1270                if(mainbouquetnode != NULL && mainbouquetnode->bouquet != NULL)
1271                {
1272                        struct bouquet* bnode = mainbouquetnode->bouquet;
1273
1274                        while(bnode != NULL)
1275                        {
1276                                if(bnode->channel == chnode)
1277                                {
1278                                        tmpnr = oitoa(mainbouquetnode->bouquet->nr + count);
1279                                        return tmpnr;
1280                                }
1281                                count++;
1282                                bnode = bnode->next;
1283                        }
1284                }
1285                return tmpnr;
1286        }
1287        else
1288                return tmpnr;
1289}
1290
1291char* getakttuner(struct skin* node)
1292{
1293        char* tmpstr = NULL;
1294
1295        if(status.aktservice->fedev != NULL)
1296        {
1297                tmpstr = oitoa(status.aktservice->fedev->devnr);
1298                return tmpstr;
1299        }
1300
1301        return NULL;
1302}
1303
1304char* getchannellistname(struct skin* node)
1305{
1306        char* tmpstr = NULL, *tmpstr1 = NULL;
1307
1308        if(status.servicetype == 0)
1309                tmpstr = getconfig("channellist", NULL);
1310        else
1311                tmpstr = getconfig("rchannellist", NULL);
1312
1313        if(tmpstr != NULL)
1314        {
1315                if(ostrncmp("(BOUQUET)-", tmpstr, 10) == 0 && strlen(tmpstr) > 10)
1316                        tmpstr1 = ostrcat(tmpstr1, tmpstr + 10, 1, 0);
1317
1318                else if(ostrncmp("(A-Z)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6)
1319                        tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0);
1320
1321                else if(ostrncmp("(SAT)-", tmpstr, 6) == 0 && strlen(tmpstr) > 6)
1322                        tmpstr1 = ostrcat(tmpstr1, tmpstr + 6, 1, 0);
1323
1324                else if(ostrncmp("(PROVIDER)-", tmpstr, 11) == 0 && strlen(tmpstr) > 6)
1325                        tmpstr1 = ostrcat(tmpstr1, tmpstr + 11, 1, 0);
1326        }
1327
1328        return tmpstr1;
1329}
1330
1331char* getpowerofftime(struct skin* node, char* format)
1332{
1333        char* buf = NULL, *buf1 = NULL;
1334        int resttime = 0;
1335
1336        if(format == NULL) return NULL;
1337
1338        if(status.sd_timer != NULL && status.sd_timer->active)
1339        {
1340                buf = malloc(MINMALLOC);
1341                if(buf == NULL)
1342                {
1343                        err("no mem");
1344                        return NULL;
1345                }
1346
1347                resttime = (status.sd_timer->shutdown_time - time(NULL)) / 60;
1348                if(resttime < 0) resttime = 0;
1349                snprintf(buf, MINMALLOC, format, resttime);
1350                buf1 = ostrcat(buf, NULL, 1, 0);
1351        }
1352
1353        return buf1;
1354}
1355
1356char* gettvpic(struct skin* node, char* pos)
1357{
1358        struct splitstr* ret = NULL;
1359        char* tmpstr = NULL;
1360        int count = 0, left = 0, top = 0, width = 0;
1361
1362        if(pos != NULL)
1363        {
1364                tmpstr = ostrcat(pos, NULL, 0, 0);
1365                ret = strsplit(tmpstr, ":", &count);
1366                if(count == 3)
1367                {
1368                        if((&ret[0])->part != NULL)
1369                                left = atoi((&ret[0])->part);
1370                        if((&ret[1])->part != NULL)
1371                                top = atoi((&ret[1])->part);
1372                        if((&ret[2])->part != NULL)
1373                                width = atoi((&ret[2])->part);
1374                       
1375                        setvmpegrect(status.aktservice->videodev, left, top, width, 0);
1376                }
1377                free(tmpstr); tmpstr = NULL;
1378        }
1379
1380        free(ret); ret = NULL;
1381        return NULL;
1382}
1383
1384char* getrecfreesize(struct skin* node)
1385{
1386        int ret = 0;
1387
1388        if(status.showrecfreesize > 0)
1389        {
1390                unsigned long long full = getfullspace(getconfig("rec_path", NULL)) / (1024 * 1024 * 1024);
1391                unsigned long long free = getfreespace(getconfig("rec_path", NULL)) / (1024 * 1024 * 1024);
1392
1393                if(full > 0 && full >= free) ret = ((full - free) * 100) / full;
1394
1395                if(ret < 0) ret = 0;
1396                if(ret > 100) ret = 100;
1397        }
1398
1399        return oitoa(ret);
1400}
1401
1402char* getrecfreesizetext(struct skin* node)
1403{
1404        int ret = 0;
1405        char* tmpstr = NULL;
1406
1407        if(status.showrecfreesize > 0)
1408        {
1409                unsigned long long full = getfullspace(getconfig("rec_path", NULL)) / (1024 * 1024 * 1024);
1410                unsigned long long free = getfreespace(getconfig("rec_path", NULL)) / (1024 * 1024 * 1024);
1411
1412                if(full > 0 && full >= free) ret = ((full - free) * 100) / full;
1413
1414                if(ret < 0) ret = 0;
1415                if(ret > 100) ret = 100;
1416               
1417                if(status.showrecfreesize == 1)
1418                        tmpstr = ostrcat(oitoa(ret), " %", 1, 0);
1419                else
1420                        tmpstr = ostrcat(ollutoa(free), " GB", 1, 0);
1421        }
1422
1423        return tmpstr;
1424}
1425
1426char* gethbbtv(struct skin* node, char* path)
1427{
1428        char* tmpstr = NULL;
1429
1430        if(status.aktservice->channel != NULL)
1431        {
1432    if(status.aktservice->channel->hbbtvurl != NULL)
1433      tmpstr = ostrcat("hbbtv_on.png", "", 0, 0);
1434    else
1435      tmpstr = ostrcat("hbbtv_off.png", "", 0, 0);
1436
1437                if(path != NULL)
1438                        tmpstr = ostrcat("/", tmpstr, 0, 1);
1439                tmpstr = ostrcat(path, tmpstr, 0, 1);
1440        }
1441       
1442        return tmpstr;
1443}
1444
1445char* getimgname(struct skin* node)
1446{
1447        return getimgnamereal();
1448}
1449
1450char* getoscamcaid(struct skin* node)
1451{
1452        char* buf = NULL, *tmpstr = NULL;
1453
1454        buf = readfiletomem("/tmp/ecm.info", 1);
1455        tmpstr = ostrstr(buf, "caid:");
1456        if(tmpstr != NULL)
1457        {
1458                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1459                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1460        }
1461        free(buf); buf = NULL;
1462
1463        return tmpstr;
1464}
1465
1466char* getoscampid(struct skin* node)
1467{
1468        char* buf = NULL, *tmpstr = NULL;
1469
1470        buf = readfiletomem("/tmp/ecm.info", 1);
1471        tmpstr = ostrstr(buf, "pid:");
1472        if(tmpstr != NULL)
1473        {
1474                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1475                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1476        }
1477        free(buf); buf = NULL;
1478
1479        return tmpstr;
1480}
1481
1482char* getoscamprov(struct skin* node)
1483{
1484        char* buf = NULL, *tmpstr = NULL;
1485
1486        buf = readfiletomem("/tmp/ecm.info", 1);
1487        tmpstr = ostrstr(buf, "prov:");
1488        if(tmpstr != NULL)
1489        {
1490                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1491                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1492        }
1493        free(buf); buf = NULL;
1494
1495        return tmpstr;
1496}
1497
1498char* getoscamreader(struct skin* node)
1499{
1500        char* buf = NULL, *tmpstr = NULL;
1501
1502        buf = readfiletomem("/tmp/ecm.info", 1);
1503        tmpstr = ostrstr(buf, "reader:");
1504        if(tmpstr != NULL)
1505        {
1506                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1507                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1508        }
1509        free(buf); buf = NULL;
1510
1511        return tmpstr;
1512}
1513
1514char* getoscamfrom(struct skin* node)
1515{
1516        char* buf = NULL, *tmpstr = NULL;
1517
1518        buf = readfiletomem("/tmp/ecm.info", 1);
1519        tmpstr = ostrstr(buf, "from:");
1520        if(tmpstr != NULL)
1521        {
1522                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1523                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1524        }
1525        free(buf); buf = NULL;
1526
1527        return tmpstr;
1528}
1529
1530char* getoscamprotocol(struct skin* node)
1531{
1532        char* buf = NULL, *tmpstr = NULL;
1533
1534        buf = readfiletomem("/tmp/ecm.info", 1);
1535        tmpstr = ostrstr(buf, "protocol:");
1536        if(tmpstr != NULL)
1537        {
1538                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1539                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1540        }
1541        free(buf); buf = NULL;
1542
1543        return tmpstr;
1544}
1545
1546char* getoscamhops(struct skin* node)
1547{
1548        char* buf = NULL, *tmpstr = NULL;
1549
1550        buf = readfiletomem("/tmp/ecm.info", 1);
1551        tmpstr = ostrstr(buf, "hops:");
1552        if(tmpstr != NULL)
1553        {
1554                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1555                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1556        }
1557        free(buf); buf = NULL;
1558
1559        return tmpstr;
1560}
1561
1562char* getoscamecmtime(struct skin* node)
1563{
1564        char* buf = NULL, *tmpstr = NULL;
1565
1566        buf = readfiletomem("/tmp/ecm.info", 1);
1567        tmpstr = ostrstr(buf, "ecm time:");
1568        if(tmpstr != NULL)
1569        {
1570                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1571                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1572        }
1573        free(buf); buf = NULL;
1574
1575        return tmpstr;
1576}
1577
1578char* getoscamcw0(struct skin* node)
1579{
1580        char* buf = NULL, *tmpstr = NULL;
1581
1582        buf = readfiletomem("/tmp/ecm.info", 1);
1583        tmpstr = ostrstr(buf, "cw0:");
1584        if(tmpstr != NULL)
1585        {
1586                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1587                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1588        }
1589        free(buf); buf = NULL;
1590
1591        return tmpstr;
1592}
1593
1594char* getoscamcw1(struct skin* node)
1595{
1596        char* buf = NULL, *tmpstr = NULL;
1597
1598        buf = readfiletomem("/tmp/ecm.info", 1);
1599        tmpstr = ostrstr(buf, "cw1:");
1600        if(tmpstr != NULL)
1601        {
1602                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1603                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1604        }
1605        free(buf); buf = NULL;
1606
1607        return tmpstr;
1608}
1609
1610char* getoscamsystem(struct skin* node)
1611{
1612        char* buf = NULL, *tmpstr = NULL;
1613
1614        buf = readfiletomem("/tmp/ecm.info", 1);
1615        tmpstr = ostrstr(buf, "system:");
1616        if(tmpstr != NULL)
1617        {
1618                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1619                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1620        }
1621        free(buf); buf = NULL;
1622
1623        return tmpstr;
1624}
1625
1626char* getoscamsource(struct skin* node)
1627{
1628        char* buf = NULL, *tmpstr = NULL;
1629
1630        buf = readfiletomem("/tmp/ecm.info", 1);
1631        tmpstr = ostrstr(buf, "source:");
1632        if(tmpstr != NULL)
1633        {
1634                tmpstr = stringreplacecharonce(tmpstr, '\n', '\0');
1635                tmpstr = ostrcat(tmpstr, NULL, 0, 0);
1636        }
1637        free(buf); buf = NULL;
1638
1639        return tmpstr;
1640}
1641
1642char* getemu(struct skin* node)
1643{
1644        char* tmpstr = NULL;
1645        char* tmpstr1 = NULL;
1646        tmpstr = string_newline(command("emu.sh infoname"));
1647
1648        if(ostrstr(tmpstr, "not found") != NULL)
1649        {
1650                free(tmpstr);
1651                tmpstr = NULL;
1652        }
1653        else
1654        {
1655                        tmpstr1 = ostrcat(tmpstr, NULL, 0, 0);
1656                        free(tmpstr),tmpstr = NULL;                     
1657                        tmpstr = ostrcat("emu: ", tmpstr1, 0, 0);                       
1658                        free(tmpstr1),tmpstr1 = NULL;
1659        }
1660        return tmpstr;
1661}
1662
1663char* getbufferstatus(struct skin* node)
1664{
1665        int ret = 0;
1666
1667#ifdef EPLAYER4
1668/*
1669        GstMessage *msg = NULL;
1670        gint percent = 0;
1671        gst_message_parse_buffering (msg, &percent);
1672        g_print ("Buffering (%3d%%)\r", percent);
1673        ret = (int)percent;
1674*/
1675        ret = status.bufferpercent;
1676#else
1677        int size = 0, status = 0;
1678        size = playergetbuffersize();
1679        if(size > 0)
1680                status = playergetbufferstatus();
1681
1682        if(size > 0 && size >= status) ret = 100 - (((size - status) * 100) / size);
1683#endif         
1684               
1685        if(ret < 0) ret = 0;
1686        if(ret > 100) ret = 100;
1687
1688        return oitoa(ret);
1689}
1690
1691char* getwlanlinkquality(struct skin* node)
1692{
1693        int quality = 0;
1694
1695        quality = wlanlinkquality();
1696
1697        if(quality < 0) quality = 0;
1698        if(quality > 100) quality = 100;
1699
1700        return oitoa(quality);
1701}
1702
1703char* getwlanlinkqualitytext(struct skin* node)
1704{
1705        int quality = 0;
1706        char* tmpstr = NULL;
1707
1708        quality = wlanlinkquality();
1709
1710        if(quality < 0) quality = 0;
1711        if(quality > 100) quality = 100;
1712
1713        tmpstr = ostrcat(oitoa(quality), " %", 1, 0);
1714
1715        return tmpstr;
1716}
1717
1718char* getredbutton(struct skin* node)
1719{
1720        char* tmpstr = ostrcat(getconfig("redkey", NULL), NULL, 0, 0);
1721        if(tmpstr == NULL) tmpstr = ostrcat(tmpstr, "Extensions List", 1, 0);
1722        return tmpstr;
1723}
1724
1725char* getbluebutton(struct skin* node)
1726{
1727        char* tmpstr = ostrcat(getconfig("bluekey", NULL), NULL, 0, 0);
1728        if(tmpstr == NULL) tmpstr = ostrcat(tmpstr, "TV/Radio", 1, 0);
1729        return tmpstr;
1730}
1731
1732char* setblink(struct skin* node)
1733{
1734        if(status.skinblink == 0)
1735                node->hidden = YES;
1736        else
1737                node->hidden = NO;
1738        return NULL;
1739}
1740
1741char* gettunerlockpic(struct skin* node, char* path, char* tuner)
1742{
1743        char* tmpstr = NULL;
1744        int tunernr = 0;
1745        int tunerlock = 0;
1746        if(tuner != NULL)
1747                tunernr = atoi(tuner);
1748        tunerlock = fegetlock(tunernr);
1749       
1750        if(tunerlock > 0 || (tunerlock != -1 && status.aktservice->fedev != NULL && status.aktservice->fedev->devnr == tunernr && status.standby == 0 && status.playing == 0))
1751        {
1752                if(node->nodestyle != 1)
1753                        node->hidden = NO;     
1754                if(node->picmem == 1)
1755                        return tmpstr;
1756                //tuner?act.png
1757                if(tuner != NULL)
1758                        tmpstr = ostrcat("tuner",tuner, 0, 0);
1759                else
1760                        tmpstr = ostrcat("tuner","0", 0, 0);
1761                tmpstr = ostrcat(tmpstr,"act.png", 1, 0);
1762                if(path != NULL)
1763        tmpstr = ostrcat("/", tmpstr, 0, 1);
1764    tmpstr = ostrcat(path, tmpstr, 0, 1);
1765        }
1766  else
1767                node->hidden = YES;     
1768        return tmpstr;
1769}   
1770
1771char* gettunerlocktext(struct skin* node, char* onlyhidden, char* tuner)
1772{
1773        char* tmpstr = NULL;
1774        int tunernr = 0;
1775        int tunerlock = 0;
1776        if(tuner != NULL)
1777                tunernr = atoi(tuner);
1778        tunerlock = fegetlock(tunernr);
1779        debug(100, "tunernr:%i tunerlock:%i", tunernr, tunerlock);
1780       
1781        if(tunerlock > 0 || (tunerlock != -1 && status.aktservice->fedev != NULL && status.aktservice->fedev->devnr == tunernr && status.standby == 0 && status.playing == 0))
1782        {
1783                if(node->nodestyle != 1)
1784                        node->hidden = NO;
1785                if(onlyhidden == NULL)
1786                {
1787                        if(tunernr == 0)
1788                                tmpstr = ostrcat("A",NULL, 0, 0);
1789                        if(tunernr == 1)
1790                                tmpstr = ostrcat("B",NULL, 0, 0);
1791                        if(tunernr == 2)
1792                                tmpstr = ostrcat("C",NULL, 0, 0);               
1793                        if(tunernr == 3)
1794                                tmpstr = ostrcat("D",NULL, 0, 0);       
1795                }
1796                else
1797                        tmpstr = ostrcat(node->text,NULL, 0, 0);
1798        }
1799  else
1800                node->hidden = YES;     
1801        return tmpstr;
1802
1803
1804char* getlasttitle(struct skin* node, char* parm1, char* parm2)
1805
1806        char* tmpstr = NULL;
1807        tmpstr = ostrcat(Mtitletext,NULL, 0, 0);
1808        return tmpstr;
1809}
1810                       
1811#endif
Note: See TracBrowser for help on using the repository browser.