mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 00:11:08 +02:00
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:
@@ -77,6 +77,7 @@ nGLCD::nGLCD() {
|
|||||||
percent_bar = 0;
|
percent_bar = 0;
|
||||||
percent_space = 0;
|
percent_space = 0;
|
||||||
percent_logo = 0;
|
percent_logo = 0;
|
||||||
|
power_state = 1;
|
||||||
Scale = 0;
|
Scale = 0;
|
||||||
bitmap = NULL;
|
bitmap = NULL;
|
||||||
blitFlag = true;
|
blitFlag = true;
|
||||||
@@ -941,6 +942,18 @@ void nGLCD::SetBrightness(unsigned int b)
|
|||||||
nglcd->SetBrightness(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()
|
void nGLCD::Blit()
|
||||||
{
|
{
|
||||||
if (nglcd)
|
if (nglcd)
|
||||||
|
@@ -60,6 +60,7 @@ class nGLCD
|
|||||||
int percent_bar;
|
int percent_bar;
|
||||||
int percent_logo;
|
int percent_logo;
|
||||||
int percent_space;
|
int percent_space;
|
||||||
|
int power_state;
|
||||||
GLCD::cBitmap * bitmap;
|
GLCD::cBitmap * bitmap;
|
||||||
std::string Channel;
|
std::string Channel;
|
||||||
std::string Epg;
|
std::string Epg;
|
||||||
@@ -138,6 +139,7 @@ class nGLCD
|
|||||||
static void Exit();
|
static void Exit();
|
||||||
static void Blit();
|
static void Blit();
|
||||||
static void SetBrightness(unsigned int b);
|
static void SetBrightness(unsigned int b);
|
||||||
|
static void TogglePower();
|
||||||
int GetConfigSize();
|
int GetConfigSize();
|
||||||
std::string GetConfigName(int);
|
std::string GetConfigName(int);
|
||||||
void UpdateBrightness();
|
void UpdateBrightness();
|
||||||
|
Reference in New Issue
Block a user