mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
screensaver: move more repeatedly used code to screensaver's code
Signed-off-by: Thilo Graf <dbt@novatux.de>
Origin commit data
------------------
Branch: ni/coolstream
Commit: 81b82668ac
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-11-25 (Sat, 25 Nov 2017)
Origin message was:
------------------
- screensaver: move more repeatedly used code to screensaver's code
Signed-off-by: Thilo Graf <dbt@novatux.de>
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1671,8 +1671,7 @@ void CMoviePlayerGui::PlayFileLoop(void)
|
|||||||
|
|
||||||
if (playstate == CMoviePlayerGui::PAUSE && (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER))
|
if (playstate == CMoviePlayerGui::PAUSE && (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER))
|
||||||
{
|
{
|
||||||
time_t delay = time(NULL) - CScreenSaver::getInstance()->getIdleTime();
|
if (CScreenSaver::getInstance()->canStart() && !CScreenSaver::getInstance()->isActive())
|
||||||
if (g_settings.screensaver_delay && delay > g_settings.screensaver_delay*60 && !CScreenSaver::getInstance()->isActive())
|
|
||||||
{
|
{
|
||||||
videoDecoder->setBlank(true);
|
videoDecoder->setBlank(true);
|
||||||
CScreenSaver::getInstance()->Start();
|
CScreenSaver::getInstance()->Start();
|
||||||
|
@@ -314,6 +314,13 @@ void CScreenSaver::paint()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CScreenSaver::canStart()
|
||||||
|
{
|
||||||
|
if (g_settings.screensaver_delay && (time(NULL) - idletime > g_settings.screensaver_delay*60))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool CScreenSaver::isActive()
|
bool CScreenSaver::isActive()
|
||||||
{
|
{
|
||||||
if(thrScreenSaver)
|
if(thrScreenSaver)
|
||||||
|
@@ -53,7 +53,7 @@ class CScreenSaver : public sigc::trackable
|
|||||||
struct s_color {
|
struct s_color {
|
||||||
uint8_t b, g, r, a;
|
uint8_t b, g, r, a;
|
||||||
} uc_color;
|
} uc_color;
|
||||||
unsigned int i_color;
|
unsigned int i_color;
|
||||||
};
|
};
|
||||||
|
|
||||||
u_color clr;
|
u_color clr;
|
||||||
@@ -68,6 +68,7 @@ class CScreenSaver : public sigc::trackable
|
|||||||
CScreenSaver();
|
CScreenSaver();
|
||||||
~CScreenSaver();
|
~CScreenSaver();
|
||||||
static CScreenSaver* getInstance();
|
static CScreenSaver* getInstance();
|
||||||
|
bool canStart();
|
||||||
bool isActive();
|
bool isActive();
|
||||||
void Start();
|
void Start();
|
||||||
void Stop();
|
void Stop();
|
||||||
|
@@ -2613,8 +2613,7 @@ void CNeutrinoApp::RealRun()
|
|||||||
);
|
);
|
||||||
if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER)
|
if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER)
|
||||||
{
|
{
|
||||||
time_t delay = time(NULL) - CScreenSaver::getInstance()->getIdleTime();
|
if (CScreenSaver::getInstance()->canStart() && !CScreenSaver::getInstance()->isActive())
|
||||||
if (g_settings.screensaver_delay && delay > g_settings.screensaver_delay*60 && !CScreenSaver::getInstance()->isActive())
|
|
||||||
{
|
{
|
||||||
CInfoClock::getInstance()->block();
|
CInfoClock::getInstance()->block();
|
||||||
CScreenSaver::getInstance()->Start();
|
CScreenSaver::getInstance()->Start();
|
||||||
|
Reference in New Issue
Block a user