source: titan/titan/standby.h @ 45557

Last change on this file since 45557 was 44676, checked in by obi, 4 years ago

remove work

File size: 5.8 KB
Line 
1#ifndef STANDBY_H
2#define STANDBY_H
3
4void screenstandby()
5{
6        int rcret = 0, voltoff = 1;
7        struct skin* standbyscreen = getscreen("standby");
8        char* loctime = NULL, *tmpstr = NULL;
9        time_t lastrun = 0;
10        struct dvbdev* dvbnode = dvbdev;
11
12        rcret = servicestop(status.aktservice, 1, 0);
13        if(rcret == 1)
14        {
15                status.standby = 0;
16                return;
17        }
18
19        //wenn ON dann startet die GUI bei einer Aufnahme neu
20        if(checkrealbox("HD51") == 1 || checkrealbox("HD60") == 1 || checkrealbox("HD61") == 1 || checkchipset("BCM7424") == 1)
21                addconfig("standbytuneroff", "0");
22
23        //check if all tuner unlocked, if yes set all volt off
24        if(getconfigint("standbytuneroff", NULL) == 1 && checkbox("DM7020HD") == 0 && checkbox("DM7020HDV2") == 0 && checkbox("DM900") == 0 && checkbox("DM920") == 0 && checkbox("DM520") == 0 && checkbox("DM525") == 0)
25        {
26                while(dvbnode != NULL)
27                {
28                        if(dvbnode->type == FRONTENDDEV && dvbnode->feinfo->type == FE_QPSK && dvbnode->felock > 0)
29                                voltoff = 0;
30                        dvbnode = dvbnode->next;
31                }
32                if(voltoff == 1)
33                {
34                        dvbnode = dvbdev;
35                        while(dvbnode != NULL)
36                        {
37                                if(dvbnode->type == FRONTENDDEV && dvbnode->feinfo->type == FE_QPSK && dvbnode->felock == 0)
38                                        fesetvoltage(dvbnode, SEC_VOLTAGE_OFF, 15);
39                                dvbnode = dvbnode->next;
40                        }
41                }
42        }
43        else
44                voltoff = 0;
45       
46        subtitlepause(1);
47//      clearfb(skinfb);
48//      blitfb(0);
49        setfbtransparent(0);
50        debug(10, "[standby] set vfdstandbybrightness");
51        setvfdbrightness(getconfigint("vfdstandbybrightness", NULL));
52        setoverclockfreq(0);
53       
54        if(checkchipset("BCM7424") == 1) //inihdp
55        {
56                if(getconfigint("vfdisplaystandby", NULL) == 1)
57                        setvfdbrightness(0);
58        }
59       
60        if(checkbox("ATEVIO7000") == 1)
61        {
62                if(getconfig("at7000frontsleep", NULL) != NULL)
63                        tmpstr = ostrcat("fp_control -P ",getconfig("at7000frontsleep", NULL), 0, 0);
64                else
65                        tmpstr = ostrcat("fp_control -P ", "0", 0, 0);
66                system(tmpstr);
67                free(tmpstr); tmpstr=NULL;
68        }
69        if(checkbox("UFS922") == 1)
70                setfanspeed(-2, 0);
71        else if(checkchipset("BCM7424") == 1) // inihdp
72        {       
73                if(getconfigint("fanmode", NULL) == 3)
74                        writesys("/proc/stb/fp/fan", "1", 1);
75        }
76        else if(checkbox("DM900") == 1 || checkbox("DM920") == 1 || checkbox("DM520") == 1 || checkbox("DM525") == 1)
77                setled(1);
78                       
79
80        status.protecttime = 0;
81        status.rcstandby = standbyscreen;
82       
83        setcecstandby(1);
84        if(file_exist("/bin/vdstandby") == 1)
85                system("vdstandby -a");
86
87// mipsel work set unknown videomod = display > off     (set)
88#ifdef MIPSEL
89        char* savevideomode = NULL;
90        savevideomode = getvideomode();
91        //setvideomode("720p24", 1);
92        writesys("/proc/stb/avs/0/input", "aux", 1);
93        if(checkchipset("3798MV200") == 1 || checkchipset("HI3798MV200") == 1)
94                writesys("/proc/stb/hdmi/output", "off", 1);
95#endif
96
97        //workaround..  sometimes reboot
98        writerc(getrcconfigint("rcexit", NULL));
99        printf("standby -> start");
100        while(1)
101        {
102                rcret = waitrc(standbyscreen, 10000, 0);
103
104                if(rcret == getrcconfigint("rcpower", NULL) || rcret == getrcconfigint("rcfrontpower", NULL)) break;
105
106                //check for epg update
107                loctime = gettime(NULL, "%H:%M");
108                if(lastrun + 300 < time(NULL) && ostrcmp(loctime, getconfig("epg_refreshtime", NULL)) == 0)
109                {
110                        voltoff = 1; //is not a real voltoff, but after standby this makes a new channel tuning
111                        //start epg scanlist
112                        lastrun = time(NULL);
113                        if(status.epgscanlistthread == NULL)
114                                status.epgscanlistthread = addtimer(&epgscanlistthread, START, 1000, 1, NULL, NULL, NULL);
115                }
116                free(loctime); loctime = 0;
117        }
118        //workaround after standby poweroff menu reboot
119        printf("standby -> stop");
120        writerc(getrcconfigint("rcexit", NULL));
121        rcret = waitrc(standbyscreen, 1000, 0);
122        //
123        status.updatevfd = STOP;
124        m_lock(&status.vfdmutex, 3);
125// mipsel work set unknown videomode = display > off (reset)
126#ifdef MIPSEL
127        writesys("/proc/stb/avs/0/input", "encoder", 1);
128        setvideomode(savevideomode, 1);
129        free(savevideomode); savevideomode = NULL;
130        if(checkchipset("3798MV200") == 1 || checkchipset("HI3798MV200") == 1)
131                writesys("/proc/stb/hdmi/output", "on", 1);
132#endif
133
134        if(status.epgscanlistthread != NULL)
135        {
136                int i = 0;
137                status.epgscanlistthread->aktion = STOP;
138                while(status.epgscanlistthread != NULL)
139                {
140                        usleep(100000);
141                        i++; if(i > 50) break;
142                }
143        }
144        if(checkbox("UFS922") == 1)
145                setfanspeed(-1, 0);
146        else if(checkchipset("BCM7424") == 1)   //inihdp
147                writesys("/proc/stb/fp/fan", getconfig("fanmode", NULL), 1);
148       
149        setcecstandby(0);
150        if(file_exist("/bin/vdstandby") == 1)
151                system("vdstandby -d");
152
153        setoverclockfreq(1);
154        setosdtransparent(getskinconfigint("osdtransparent", NULL));
155        setvfdbrightness(getconfigint("vfdbrightness", NULL));
156       
157        if(checkbox("ATEVIO7000") == 1)
158        {
159                if(getconfig("at7000frontrun", NULL) != NULL)
160                        tmpstr = ostrcat("fp_control -P ",getconfig("at7000frontrun", NULL), 0, 0);
161                else
162                        tmpstr = ostrcat("fp_control -P ", "15", 0, 0);
163                system(tmpstr);
164                free(tmpstr); tmpstr=NULL;
165        }
166       
167        //set waittime for unicable new
168        status.firstunicablewait = 0;
169        status.standby = 0;
170        status.startmode = 1;
171        status.rcstandby = NULL;
172
173        if(checkbox("DM900") == 1 || checkbox("DM920") == 1 || checkbox("DM520") == 1 || checkbox("DM525") == 1)
174                setled(1);
175       
176        if(status.aktservice->channel != NULL)
177        {
178                tmpstr = ostrcat(status.aktservice->channellist, NULL, 0, 0);
179                if(voltoff == 1)
180                        servicecheckret(servicestart(status.aktservice->channel, tmpstr, NULL, 5), 0);
181                else
182                        servicecheckret(servicestart(status.aktservice->channel, tmpstr, NULL, 3), 0);
183        }
184        else
185        {
186                tmpstr = ostrcat(status.lastservice->channellist, NULL, 0, 0);
187                if(voltoff == 1)
188                        servicecheckret(servicestart(status.lastservice->channel, tmpstr, NULL, 4), 0);
189                else
190                        servicecheckret(servicestart(status.lastservice->channel, tmpstr, NULL, 0), 0);
191        }
192        free(tmpstr); tmpstr = NULL;
193
194        subtitlepause(0);
195        m_unlock(&status.vfdmutex, 3);
196        status.updatevfd = START;
197        putmsgbuffer();
198        addtimer(&setdate, START, 10000, 1, NULL, NULL, NULL);
199        printf("standby -> ende");
200#ifdef MIPSEL
201        cecwakeup();
202#endif
203}
204
205#endif
Note: See TracBrowser for help on using the repository browser.