mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
spark: improve time display in standby mode
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7a22a029d1
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-03-30 (Fri, 30 Mar 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -605,7 +605,7 @@ void CLCD::setMovieAudio(const bool is_ac3)
|
||||
showPercentOver(percentOver, true, MODE_MOVIE);
|
||||
}
|
||||
|
||||
void CLCD::showTime()
|
||||
void CLCD::showTime(bool)
|
||||
{
|
||||
if (showclock)
|
||||
{
|
||||
|
@@ -192,7 +192,7 @@ class CLCD
|
||||
void setMovieInfo(const AUDIOMODES playmode, const std::string big, const std::string small, const bool centered = false);
|
||||
void setMovieAudio(const bool is_ac3);
|
||||
std::string getMenutitle() { return menutitle; };
|
||||
void showTime();
|
||||
void showTime(bool force = false);
|
||||
/** blocks for duration seconds */
|
||||
void showRCLock(int duration = 2);
|
||||
void showVolume(const char vol, const bool perform_update = true);
|
||||
|
@@ -130,7 +130,7 @@ printf("spark_led:%s red:%d green:%d\n", __func__, red, green);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
void CLCD::showTime()
|
||||
void CLCD::showTime(bool force)
|
||||
{
|
||||
static bool redled = false;
|
||||
|
||||
@@ -141,14 +141,14 @@ void CLCD::showTime()
|
||||
}
|
||||
|
||||
time_t now = time(NULL);
|
||||
if (power && showclock && (now - last_display) > 4)
|
||||
if (power && (force || (showclock && (now - last_display) > 4)))
|
||||
{
|
||||
char timestr[5];
|
||||
struct tm *t;
|
||||
static int hour = 0, minute = 0;
|
||||
|
||||
t = localtime(&now);
|
||||
if (last_display || (hour != t->tm_hour) || (minute != t->tm_min)) {
|
||||
if (force || last_display || (hour != t->tm_hour) || (minute != t->tm_min)) {
|
||||
hour = t->tm_hour;
|
||||
minute = t->tm_min;
|
||||
sprintf(timestr, "%02d%02d", hour, minute);
|
||||
@@ -239,8 +239,7 @@ printf("spark_led:%s %d\n", __func__, (int)m);
|
||||
case MODE_STANDBY:
|
||||
setled(0, 1);
|
||||
showclock = true;
|
||||
last_display = 0;
|
||||
showTime();
|
||||
showTime(true);
|
||||
break;
|
||||
default:
|
||||
showclock = true;
|
||||
@@ -281,6 +280,8 @@ void CLCD::togglePower(void)
|
||||
power = !power;
|
||||
if (!power)
|
||||
Clear();
|
||||
else
|
||||
showTime(true);
|
||||
}
|
||||
|
||||
void CLCD::setMuted(bool mu)
|
||||
|
Reference in New Issue
Block a user