Root/src/powersaver.h

1#ifndef POWERSAVER_H
2#define POWERSAVER_H
3
4#include <SDL.h>
5
6class PowerSaver {
7public:
8    static PowerSaver *getInstance();
9    static bool isRunning();
10    ~PowerSaver();
11    void resetScreenTimer();
12
13    void enableScreen();
14    void disableScreen();
15
16    void setScreenTimeout(unsigned int seconds);
17
18private:
19    PowerSaver();
20    void addScreenTimer();
21    void setScreenBlanking(bool state);
22
23    static PowerSaver *instance;
24    bool screenState;
25    unsigned int screenTimeout;
26    unsigned int timeout_startms;
27    SDL_TimerID screenTimer;
28};
29
30#endif
31

Archive Download this file



interactive