2011-06-02 06:04:35 +03:00
|
|
|
#ifndef POWERSAVER_H
|
|
|
|
#define POWERSAVER_H
|
2011-10-23 07:56:01 +03:00
|
|
|
|
2011-06-02 06:04:35 +03:00
|
|
|
#include <SDL.h>
|
2011-10-23 07:56:01 +03:00
|
|
|
|
2011-06-02 06:04:35 +03:00
|
|
|
class PowerSaver {
|
2011-10-23 07:56:01 +03:00
|
|
|
public:
|
|
|
|
static PowerSaver *getInstance();
|
|
|
|
static bool isRunning();
|
|
|
|
~PowerSaver();
|
|
|
|
void resetScreenTimer();
|
2011-06-02 06:04:35 +03:00
|
|
|
|
2011-10-23 07:56:01 +03:00
|
|
|
void enableScreen();
|
|
|
|
void disableScreen();
|
2011-06-02 06:04:35 +03:00
|
|
|
|
2011-10-23 07:56:01 +03:00
|
|
|
void setScreenTimeout(unsigned int seconds);
|
2011-06-02 06:04:35 +03:00
|
|
|
|
2011-10-23 07:56:01 +03:00
|
|
|
private:
|
|
|
|
PowerSaver();
|
|
|
|
void addScreenTimer();
|
|
|
|
void setScreenBlanking(bool state);
|
|
|
|
|
|
|
|
static PowerSaver *instance;
|
|
|
|
bool screenState;
|
|
|
|
unsigned int screenTimeout;
|
2012-02-03 00:36:26 +02:00
|
|
|
unsigned int timeout_startms;
|
2011-10-23 07:56:01 +03:00
|
|
|
SDL_TimerID screenTimer;
|
2011-06-02 06:04:35 +03:00
|
|
|
};
|
2011-10-23 07:56:01 +03:00
|
|
|
|
2011-06-02 06:04:35 +03:00
|
|
|
#endif
|