Root/src/powersaver.h

Source at commit 7b10f9448bb9965e94f9a37a59f0999e9c51e68f created 7 years 5 months ago.
By Maarten ter Huurne, Suppress Clang analyzer warnings about dead assignments
1#ifndef POWERSAVER_H
2#define POWERSAVER_H
3
4#include <SDL.h>
5
6class PowerSaver {
7public:
8    PowerSaver();
9    ~PowerSaver();
10    void resetScreenTimer();
11    void setScreenTimeout(unsigned int seconds);
12
13private:
14    void addScreenTimer();
15    void removeScreenTimer();
16    void setScreenBlanking(bool state);
17    void enableScreen();
18    void disableScreen();
19
20    static PowerSaver *instance;
21    bool screenState;
22    unsigned int screenTimeout;
23    unsigned int timeout_startms;
24    SDL_TimerID screenTimer;
25
26    friend Uint32 screenTimerCallback(Uint32 timeout, void *d);
27};
28
29#endif
30

Archive Download this file



interactive