diff --git a/src/driver/nglcd.cpp b/src/driver/nglcd.cpp index a83114819..207241083 100644 --- a/src/driver/nglcd.cpp +++ b/src/driver/nglcd.cpp @@ -77,6 +77,7 @@ nGLCD::nGLCD() { percent_bar = 0; percent_space = 0; percent_logo = 0; + power_state = 1; Scale = 0; bitmap = NULL; blitFlag = true; @@ -941,6 +942,18 @@ void nGLCD::SetBrightness(unsigned int b) nglcd->SetBrightness(b); } +void nGLCD::TogglePower() +{ + if (nglcd) + { + nglcd->power_state = 1 - nglcd->power_state; + if (nglcd->power_state) + nglcd->Resume(); + else + nglcd->Suspend(); + } +} + void nGLCD::Blit() { if (nglcd) diff --git a/src/driver/nglcd.h b/src/driver/nglcd.h index 7c910e096..d9c40ace0 100644 --- a/src/driver/nglcd.h +++ b/src/driver/nglcd.h @@ -60,6 +60,7 @@ class nGLCD int percent_bar; int percent_logo; int percent_space; + int power_state; GLCD::cBitmap * bitmap; std::string Channel; std::string Epg; @@ -138,6 +139,7 @@ class nGLCD static void Exit(); static void Blit(); static void SetBrightness(unsigned int b); + static void TogglePower(); int GetConfigSize(); std::string GetConfigName(int); void UpdateBrightness();