1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-26 05:47:30 +02:00

Added a boolean function to know if the powersaver is running.

This commit is contained in:
Ayla 2011-08-17 00:44:45 +02:00
parent bffef7cfea
commit f31828667f
2 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,10 @@ PowerSaver* PowerSaver::getInstance() {
return instance;
}
bool PowerSaver::isRunning() {
return instance != NULL;
}
PowerSaver::PowerSaver( ) {
SDL_InitSubSystem(SDL_INIT_TIMER);
setScreenTimeout(0);
@ -30,6 +34,7 @@ PowerSaver::PowerSaver( ) {
PowerSaver::~PowerSaver() {
SDL_RemoveTimer(screenTimer);
SDL_QuitSubSystem(SDL_INIT_TIMER);
instance = NULL;
}
void PowerSaver::setScreenTimeout( unsigned int seconds ) {

View File

@ -5,6 +5,7 @@ class PowerSaver {
public:
static PowerSaver* getInstance();
static bool isRunning();
~PowerSaver();
void addScreenTimer();
void resetScreenTimer();