nglcd: add toggle power function

Origin commit data
------------------
Commit: 863dee245d
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-06-16 (Tue, 16 Jun 2020)

Origin message was:
------------------
- nglcd: add toggle power function
This commit is contained in:
vanhofen
2020-06-16 23:48:50 +02:00
parent 24939d7eb7
commit f09a45c8ef
2 changed files with 15 additions and 0 deletions

View File

@@ -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)

View File

@@ -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();