source: titan/plugins/panel/panel_settings_fancontrol.h @ 16512

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

[titan] update all plugins

File size: 1.4 KB
Line 
1#ifndef PANEL_SETTINGS_FANCONTROL_H
2#define PANEL_SETTINGS_FANCONTROL_H
3
4void screenpanel_settings_fancontrol()
5{
6        int rcret = 0;
7        int speed = 0;
8        char* speedWert = NULL;
9       
10        struct skin* panel_fancontrol = getscreen("panel_settings_fancontrol");
11        struct skin* fanprogress = getscreennode(panel_fancontrol, "fanprogress");
12
13        speedWert = getconfig("fanspeed", NULL);
14        if (speedWert != NULL)
15        {
16                if(ostrcmp(speedWert, "115") == 0)
17                        speed = 0;
18                else if(ostrcmp(speedWert, "130") == 0)
19                        speed = 25;
20                else if(ostrcmp(speedWert, "145") == 0)
21                        speed = 50;
22                else if(ostrcmp(speedWert, "155") == 0)
23                        speed = 75;
24                else if(ostrcmp(speedWert, "170") == 0)
25                        speed = 100;
26        }
27        else
28                speed = 100;
29               
30        fanprogress->progresssize = speed;
31        drawscreen(panel_fancontrol, 0, 0);
32
33        while(1)
34        {
35                rcret = waitrc(panel_fancontrol, 0, 0);
36
37                if(rcret == getrcconfigint("rcexit", NULL)) {
38                        setfanspeed(-1, 0);
39                        break;
40                }
41                if(rcret == getrcconfigint("rcgreen", NULL)){
42                        setfanspeed(speed, 1);
43                        break;
44                }
45                if(rcret == getrcconfigint("rcleft", NULL)){
46                        if(speed > 0)
47                                speed = speed - 25;
48                        fanprogress->progresssize = speed;
49                        setfanspeed(speed, 0);
50                        drawscreen(panel_fancontrol, 0, 0);
51                }
52                if(rcret == getrcconfigint("rcright", NULL)){
53                        if(speed < 100)
54                                speed = speed + 25;
55                        fanprogress->progresssize = speed;
56                        setfanspeed(speed, 0);
57                        drawscreen(panel_fancontrol, 0, 0);
58                }
59        }
60}
61
62#endif
Note: See TracBrowser for help on using the repository browser.