mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
screensaver: add optional colored property
Origin commit data
------------------
Branch: ni/coolstream
Commit: 0f2c73aed3
Author: defans <defans@bluepeercrew.us>
Date: 2016-01-07 (Thu, 07 Jan 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -53,6 +53,7 @@ CScreenSaver::CScreenSaver()
|
||||
index = 0;
|
||||
status_mute = CAudioMute::getInstance()->getStatus();
|
||||
scr_clock = NULL;
|
||||
clr.i_color = COL_DARK_GRAY;
|
||||
}
|
||||
|
||||
CScreenSaver::~CScreenSaver()
|
||||
@@ -250,7 +251,6 @@ void CScreenSaver::paint()
|
||||
if (!scr_clock){
|
||||
scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H.%M:%S", "%H.%M %S", true);
|
||||
scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]);
|
||||
scr_clock->setTextColor(COL_DARK_GRAY);
|
||||
scr_clock->enableSaveBg();
|
||||
scr_clock->doPaintBg(false);
|
||||
}
|
||||
@@ -258,7 +258,26 @@ void CScreenSaver::paint()
|
||||
scr_clock->Stop();
|
||||
|
||||
scr_clock->kill();
|
||||
scr_clock->setTextColor(clr.i_color);
|
||||
scr_clock->setPosP(rand() % 80, rand() % 90);
|
||||
scr_clock->Start();
|
||||
|
||||
if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) {
|
||||
srand (time(NULL));
|
||||
uint32_t brightness;
|
||||
|
||||
// sorcery, no darkness
|
||||
do {
|
||||
clr.i_color = rand();
|
||||
brightness = (unsigned int)clr.uc_color.r * 19595 + (unsigned int)clr.uc_color.g * 38469 + (unsigned int)clr.uc_color.b * 7471;
|
||||
//printf("[%s] %s: brightness: %d\n", __FILE__, __FUNCTION__, brightness>> 16);
|
||||
}
|
||||
while(brightness >> 16 < 80);
|
||||
|
||||
clr.i_color &= 0x00FFFFFF;
|
||||
//printf("[%s] %s: clr.i_color: r %02x g %02x b %02x a %02x\n", __FILE__, __FUNCTION__, clr.uc_color.r, clr.uc_color.g, clr.uc_color.b, clr.uc_color.a);
|
||||
}
|
||||
else
|
||||
clr.i_color = COL_DARK_GRAY;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user