timerlist: formatting code using astyle; some manual code nicenings

Origin commit data
------------------
Branch: ni/coolstream
Commit: 638e29ccdd
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-12-04 (Sat, 04 Dec 2021)

Origin message was:
------------------
- timerlist: formatting code using astyle; some manual code nicenings

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2021-12-04 23:22:35 +01:00
parent b37a4cb887
commit 9c11f29691
2 changed files with 41 additions and 37 deletions

View File

@@ -33,13 +33,10 @@
#include <neutrino.h> #include <neutrino.h>
#include <gui/volumebar.h> #include <gui/volumebar.h>
#include <gui/infoclock.h> #include <gui/infoclock.h>
#include <gui/infoicons.h>
#include <gui/timeosd.h> #include <gui/timeosd.h>
#include "screensaver.h" #include "screensaver.h"
//NI InfoIcons
#include <gui/infoicons.h>
CTimeOSD::CTimeOSD(): CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON) CTimeOSD::CTimeOSD(): CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON)
{ {
m_mode = MODE_HIDE; m_mode = MODE_HIDE;
@@ -59,10 +56,13 @@ void CTimeOSD::Init()
setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0);
// set text color // set text color
if (paint_bg){ if (paint_bg)
{
cl_col_text = COL_MENUCONTENT_TEXT; cl_col_text = COL_MENUCONTENT_TEXT;
setColorBody(COL_MENUCONTENT_PLUS_0); setColorBody(COL_MENUCONTENT_PLUS_0);
}else{ }
else
{
cl_col_text = COL_INFOCLOCK_TEXT; cl_col_text = COL_INFOCLOCK_TEXT;
setColorBody(COL_BACKGROUND_PLUS_0); setColorBody(COL_BACKGROUND_PLUS_0);
} }
@@ -78,7 +78,8 @@ void CTimeOSD::Init()
timescale.setType(CProgressBar::PB_TIMESCALE); timescale.setType(CProgressBar::PB_TIMESCALE);
} }
#if 0 //if hide() or kill() required, it's recommended to use it separately #if 0
// if hide() or kill() required, it's recommended to use it separately
CTimeOSD::~CTimeOSD() CTimeOSD::~CTimeOSD()
{ {
CComponents::kill(); CComponents::kill();
@@ -137,7 +138,8 @@ void CTimeOSD::updatePos(int position, int duration)
void CTimeOSD::update(int position, int duration) void CTimeOSD::update(int position, int duration)
{ {
switch(m_mode) { switch (m_mode)
{
case MODE_ASC: case MODE_ASC:
case MODE_TMP: case MODE_TMP:
show(position, false); show(position, false);
@@ -155,24 +157,25 @@ void CTimeOSD::update(int position, int duration)
void CTimeOSD::switchMode(int position, int duration) void CTimeOSD::switchMode(int position, int duration)
{ {
switch (m_mode) { switch (m_mode)
{
case MODE_ASC: case MODE_ASC:
case MODE_TMP: case MODE_TMP:
CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons CInfoIcons::getInstance()->enableInfoIcons(false);
m_mode = MODE_DESC; m_mode = MODE_DESC;
CComponents::kill(); CComponents::kill();
break; break;
case MODE_DESC: case MODE_DESC:
CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons CInfoIcons::getInstance()->enableInfoIcons(false);
m_mode = MODE_BAR; m_mode = MODE_BAR;
CComponents::kill(); CComponents::kill();
break; break;
case MODE_BAR: case MODE_BAR:
CInfoIcons::getInstance()->enableInfoIcons(true); //NI InfoIcons CInfoIcons::getInstance()->enableInfoIcons(true);
KillAndResetTimescale(); KillAndResetTimescale();
return; return;
default: default:
CInfoIcons::getInstance()->enableInfoIcons(false); //NI InfoIcons CInfoIcons::getInstance()->enableInfoIcons(false);
m_mode = MODE_ASC; m_mode = MODE_ASC;
} }
@@ -181,7 +184,8 @@ void CTimeOSD::switchMode(int position, int duration)
void CTimeOSD::kill() void CTimeOSD::kill()
{ {
if (m_mode != MODE_HIDE) { if (m_mode != MODE_HIDE)
{
KillAndResetTimescale(); KillAndResetTimescale();
CComponents::kill(); CComponents::kill();
} }