glcd: rework

contains:
84e96916bf
0391fe435e
9fdbdc8717
3d1f5b6a8a


Origin commit data
------------------
Branch: ni/coolstream
Commit: d52813cf67
Author: TangoCash <eric@loxat.de>
Date: 2022-11-15 (Tue, 15 Nov 2022)

Origin message was:
------------------
- glcd: rework

contains:
84e96916bf
0391fe435e
9fdbdc8717
3d1f5b6a8a


------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2022-11-15 22:43:21 +01:00
committed by vanhofen
parent 106f60dbb4
commit 5f251b06bc
16 changed files with 414 additions and 406 deletions

View File

@@ -113,6 +113,7 @@ cGLCD::cGLCD()
percent_epg = 0;
percent_bar = 0;
percent_logo = 0;
percent_logo_width = 0;
power_state = 1;
Scale = 0;
bitmap = NULL;
@@ -229,19 +230,19 @@ void cGLCD::Exec()
if (doStandbyTime || doStandbyWeather)
{
if (g_settings.glcd_time_in_standby == CLOCK_ANALOG)
if (t.glcd_time_in_standby == CLOCK_ANALOG)
{
ShowAnalogClock(tm->tm_hour, tm->tm_min, tm->tm_sec, bitmap->Width()/2, bitmap->Height()/2);
}
else if (g_settings.glcd_time_in_standby == CLOCK_DIGITAL)
else if (t.glcd_time_in_standby == CLOCK_DIGITAL)
{
ShowDigitalClock(tm->tm_hour, tm->tm_min);
}
else if (g_settings.glcd_time_in_standby > CLOCK_OFF)
else if (t.glcd_time_in_standby > CLOCK_OFF)
{
ShowSimpleClock(strftime("%H:%M", tm), g_settings.glcd_time_in_standby);
ShowSimpleClock(strftime("%H:%M", tm), t.glcd_time_in_standby);
}
if (g_settings.glcd_standby_weather == 1 && g_settings.glcd_time_in_standby != CLOCK_ANALOG)
if (t.glcd_standby_weather == 1 && t.glcd_time_in_standby != CLOCK_ANALOG)
{
ShowWeather(true);
}
@@ -324,11 +325,11 @@ void cGLCD::Exec()
g_PicViewer->getSize(Logo.c_str(), &icon_start_width, &icon_start_height);
if (t.glcd_logo && percent_logo &&
showImage(channel_id, Channel, t.glcd_channel_x_position, t.glcd_channel_y_position, bitmap->Width(), percent_logo * bitmap->Height()/100, true, false)) {
showImage(channel_id, Channel, t.glcd_logo_x_position+(bitmap->Width()-(percent_logo_width * bitmap->Width()/100))/2, t.glcd_logo_y_position, percent_logo_width * bitmap->Width()/100, percent_logo * bitmap->Height()/100, true, false)) {
doScrollChannel = false;
scrollChannelSkip = 0;
} else if (percent_logo && icon_start_width && icon_start_height &&
doShowLcdIcon && showImage(Logo, icon_start_width, icon_start_height, t.glcd_channel_x_position, t.glcd_channel_y_position, bitmap->Width(), percent_logo * bitmap->Height()/100, true, false)) {
doShowLcdIcon && showImage(Logo, icon_start_width, icon_start_height, t.glcd_logo_x_position, t.glcd_logo_y_position, bitmap->Width(), percent_logo * bitmap->Height()/100, true, false)) {
doScrollChannel = false;
scrollChannelSkip = 0;
} else if (percent_channel) {
@@ -593,6 +594,7 @@ void cGLCD::updateFonts()
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
percent_logo = std::min(t.glcd_logo_percent, 100);
percent_logo_width = std::min(t.glcd_logo_width_percent, 100);
percent_channel = std::min(t.glcd_channel_percent, 100);
percent_epg = std::min(t.glcd_epg_percent, 100);
percent_bar = std::min(t.glcd_progressbar_percent, 100);
@@ -809,6 +811,7 @@ void cGLCD::Run(void)
struct timespec ts;
CSectionsdClient::CurrentNextInfo info_CurrentNext;
t_channel_id epg_id = -1;
channel_id = -1;
info_CurrentNext.current_zeit.startzeit = 0;
info_CurrentNext.current_zeit.dauer = 0;
@@ -1070,6 +1073,7 @@ void cGLCD::Run(void)
{
Channel = channelList->getActiveChannelName ();
ChannelWidth = font_channel.Width(Channel);
epg_id = channelList->getActiveChannel()->getEpgID();
Epg = "";
EpgWidth = 0;
Scale = 0;
@@ -1088,7 +1092,7 @@ void cGLCD::Run(void)
info_CurrentNext.current_zeit.dauer = 0;
}
CEitManager::getInstance()->getCurrentNextServiceKey(channel_id & 0xFFFFFFFFFFFFULL, info_CurrentNext);
CEitManager::getInstance()->getCurrentNextServiceKey(epg_id & 0xFFFFFFFFFFFFULL, info_CurrentNext);
channel_id = new_channel_id;
if (info_CurrentNext.current_name.compare(Epg))
@@ -1111,7 +1115,7 @@ void cGLCD::Run(void)
if ((info_CurrentNext.current_zeit.dauer > 0) && (info_CurrentNext.current_zeit.dauer < 86400))
{
Scale = (ts.tv_sec - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer;
char tmp_duration[15] = {0};
char tmp_duration[6] = {0};
int total = info_CurrentNext.current_zeit.dauer / 60;
int done = (abs(time(NULL) - info_CurrentNext.current_zeit.startzeit) + 30) / 60;
int todo = total - done;
@@ -1192,16 +1196,17 @@ void cGLCD::Update()
void cGLCD::StandbyMode(bool b)
{
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
if (cglcd)
{
if (g_settings.glcd_time_in_standby || g_settings.glcd_standby_weather)
if (t.glcd_time_in_standby || t.glcd_standby_weather)
{
if (g_settings.glcd_time_in_standby)
if (t.glcd_time_in_standby)
cglcd->doStandbyTime = b;
else
cglcd->doStandbyTime = false;
if (g_settings.glcd_standby_weather)
if (t.glcd_standby_weather)
cglcd->doStandbyWeather = b;
else
cglcd->doStandbyWeather = false;