mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-11 15:41:00 +02:00
simple_display: fix display of volume in menu- and audio-mode ...
small cleanups
use fixed timeout for clock
TODO: fix timeout for volume
Origin commit data
------------------
Branch: ni/coolstream
Commit: d8c0a6af06
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-10-30 (Mon, 30 Oct 2017)
Origin message was:
------------------
- simple_display: fix display of volume in menu- and audio-mode ...
small cleanups
use fixed timeout for clock
TODO: fix timeout for volume
------------------
This commit was generated by Migit
This commit is contained in:
@@ -205,7 +205,7 @@ void CLCD::wake_up()
|
|||||||
setPower(1);
|
setPower(1);
|
||||||
|
|
||||||
if (g_settings.lcd_info_line)
|
if (g_settings.lcd_info_line)
|
||||||
switch_name_time_cnt = g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] + 10;
|
switch_name_time_cnt = 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,11 +216,11 @@ void* CLCD::TimeThread(void *)
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) {
|
if (g_info.hw_caps->display_type == HW_DISPLAY_LINE_TEXT) {
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if (stat("/tmp/vfd.locked", &buf) == -1) {
|
if (stat("/tmp/vfd.locked", &buf) == -1) {
|
||||||
CLCD::getInstance()->showTime();
|
CLCD::getInstance()->showTime();
|
||||||
CLCD::getInstance()->count_down();
|
CLCD::getInstance()->count_down();
|
||||||
} else
|
} else
|
||||||
CLCD::getInstance()->wake_up();
|
CLCD::getInstance()->wake_up();
|
||||||
} else
|
} else
|
||||||
CLCD::getInstance()->showTime();
|
CLCD::getInstance()->showTime();
|
||||||
#if 0
|
#if 0
|
||||||
@@ -265,10 +265,8 @@ void CLCD::setlcdparameter(void)
|
|||||||
|
|
||||||
void CLCD::showServicename(std::string name, bool)
|
void CLCD::showServicename(std::string name, bool)
|
||||||
{
|
{
|
||||||
if (g_info.hw_caps->display_type == HW_DISPLAY_LED_NUM)
|
|
||||||
return;
|
|
||||||
servicename = name;
|
servicename = name;
|
||||||
if (mode != MODE_TVRADIO && mode != MODE_AUDIO)
|
if (mode != MODE_TVRADIO)
|
||||||
return;
|
return;
|
||||||
replace_umlauts(name);
|
replace_umlauts(name);
|
||||||
strncpy(display_text, name.c_str(), sizeof(display_text) - 1);
|
strncpy(display_text, name.c_str(), sizeof(display_text) - 1);
|
||||||
@@ -355,7 +353,7 @@ void CLCD::showTime(bool force)
|
|||||||
static int hour = 0, minute = 0;
|
static int hour = 0, minute = 0;
|
||||||
|
|
||||||
t = localtime(&now);
|
t = localtime(&now);
|
||||||
if (force || last_display || (hour != t->tm_hour) || (minute != t->tm_min)) {
|
if (force || last_display || (switch_name_time_cnt == 0 && ((hour != t->tm_hour) || (minute != t->tm_min)))) {
|
||||||
hour = t->tm_hour;
|
hour = t->tm_hour;
|
||||||
minute = t->tm_min;
|
minute = t->tm_min;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@@ -377,7 +375,7 @@ void CLCD::showTime(bool force)
|
|||||||
close(fd);
|
close(fd);
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_ARM_HARDWARE
|
#if HAVE_ARM_HARDWARE
|
||||||
if (mode == MODE_STANDBY || ( g_settings.lcd_info_line && (MODE_TVRADIO == mode)))
|
if (mode == MODE_STANDBY || (g_settings.lcd_info_line && mode == MODE_TVRADIO))
|
||||||
#else
|
#else
|
||||||
if (ret < 0 && servicename.empty())
|
if (ret < 0 && servicename.empty())
|
||||||
#endif
|
#endif
|
||||||
@@ -391,8 +389,10 @@ void CLCD::showTime(bool force)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (vol_active)
|
if (vol_active)
|
||||||
showServicename(servicename);
|
{
|
||||||
vol_active = false;
|
display(display_text);
|
||||||
|
vol_active = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
last_display = 0;
|
last_display = 0;
|
||||||
}
|
}
|
||||||
@@ -475,7 +475,11 @@ void CLCD::showAudioTrack(const std::string &, const std::string & title, const
|
|||||||
{
|
{
|
||||||
if (mode != MODE_AUDIO)
|
if (mode != MODE_AUDIO)
|
||||||
return;
|
return;
|
||||||
ShowText(title.c_str());
|
std::string tmp = title;
|
||||||
|
replace_umlauts(tmp);
|
||||||
|
strncpy(display_text, tmp.c_str(), sizeof(display_text) - 1);
|
||||||
|
display_text[sizeof(display_text) - 1] = '\0';
|
||||||
|
upd_display = true;
|
||||||
#if HAVE_ARM_HARDWARE
|
#if HAVE_ARM_HARDWARE
|
||||||
wake_up();
|
wake_up();
|
||||||
#endif
|
#endif
|
||||||
@@ -508,6 +512,8 @@ void CLCD::setMode(const MODES m, const char * const)
|
|||||||
upd_display = true;
|
upd_display = true;
|
||||||
}
|
}
|
||||||
showTime();
|
showTime();
|
||||||
|
if (g_settings.lcd_info_line)
|
||||||
|
switch_name_time_cnt = 10;
|
||||||
break;
|
break;
|
||||||
case MODE_SHUTDOWN:
|
case MODE_SHUTDOWN:
|
||||||
showclock = false;
|
showclock = false;
|
||||||
@@ -679,7 +685,8 @@ void CLCD::Clear()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void CLCD::count_down() {
|
void CLCD::count_down()
|
||||||
|
{
|
||||||
if (timeout_cnt > 0) {
|
if (timeout_cnt > 0) {
|
||||||
timeout_cnt--;
|
timeout_cnt--;
|
||||||
if (timeout_cnt == 0 ) {
|
if (timeout_cnt == 0 ) {
|
||||||
@@ -694,7 +701,7 @@ void CLCD::count_down() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (g_settings.lcd_info_line && switch_name_time_cnt > 0) {
|
if (g_settings.lcd_info_line && switch_name_time_cnt > 0) {
|
||||||
switch_name_time_cnt--;
|
switch_name_time_cnt--;
|
||||||
if (switch_name_time_cnt == 0) {
|
if (switch_name_time_cnt == 0) {
|
||||||
if (g_settings.lcd_setting_dim_brightness > -1) {
|
if (g_settings.lcd_setting_dim_brightness > -1) {
|
||||||
CLCD::getInstance()->showTime(true);
|
CLCD::getInstance()->showTime(true);
|
||||||
|
Reference in New Issue
Block a user