mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 03:22:48 +02:00
Added a boolean function to know if the powersaver is running.
This commit is contained in:
parent
bffef7cfea
commit
f31828667f
@ -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 ) {
|
||||
|
@ -5,6 +5,7 @@ class PowerSaver {
|
||||
|
||||
public:
|
||||
static PowerSaver* getInstance();
|
||||
static bool isRunning();
|
||||
~PowerSaver();
|
||||
void addScreenTimer();
|
||||
void resetScreenTimer();
|
||||
|
Loading…
Reference in New Issue
Block a user