lcd4linux: code formatation using astyle

Origin commit data
------------------
Branch: ni/coolstream
Commit: 47df64ae06
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-06-11 (Fri, 11 Jun 2021)

Origin message was:
------------------
- lcd4linux: code formatation using astyle

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

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2021-06-11 21:16:22 +02:00
parent fe1c55099e
commit 67046b9135
2 changed files with 45 additions and 45 deletions

View File

@@ -137,7 +137,7 @@ void CLCD4l::InitLCD4l()
{ {
if (thrLCD4l) if (thrLCD4l)
{ {
dprintf(DEBUG_NORMAL,"\033[32m[CLCD4l] [%s - %d] initializing CLCD4l \033[0m\n", __func__, __LINE__); dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] initializing CLCD4l \033[0m\n", __func__, __LINE__);
Init(); Init();
} }
} }
@@ -146,11 +146,11 @@ void CLCD4l::StartLCD4l()
{ {
if (!thrLCD4l) if (!thrLCD4l)
{ {
dprintf(DEBUG_NORMAL,"\033[32m[CLCD4l] [%s - %d] starting thread with mode %d \033[0m\n", __func__, __LINE__, g_settings.lcd4l_support); dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] starting thread with mode %d \033[0m\n", __func__, __LINE__, g_settings.lcd4l_support);
exit_proc = false; exit_proc = false;
thrLCD4l = new std::thread (LCD4lProc, this); thrLCD4l = new std::thread(LCD4lProc, this);
dprintf(DEBUG_NORMAL,"\033[32m[CLCD4l] [%s - %d] thread [%p] is running\033[0m\n", __func__, __LINE__, thrLCD4l); dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] thread [%p] is running\033[0m\n", __func__, __LINE__, thrLCD4l);
} }
if (g_settings.lcd4l_support) if (g_settings.lcd4l_support)
exec_initscript("lcd4linux", "start"); exec_initscript("lcd4linux", "start");
@@ -160,15 +160,15 @@ void CLCD4l::StopLCD4l()
{ {
if (thrLCD4l) if (thrLCD4l)
{ {
dprintf(DEBUG_NORMAL,"\033[32m[CLCD4l] [%s - %d] stopping thread [%p]\033[0m\n", __func__, __LINE__, thrLCD4l); dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] stopping thread [%p]\033[0m\n", __func__, __LINE__, thrLCD4l);
exit_proc = true; exit_proc = true;
thrLCD4l->join(); thrLCD4l->join();
dprintf(DEBUG_NORMAL,"\033[32m[CLCD4l] [%s - %d] thread [%p] joined\033[0m\n", __func__, __LINE__, thrLCD4l); dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] thread [%p] joined\033[0m\n", __func__, __LINE__, thrLCD4l);
delete thrLCD4l; delete thrLCD4l;
thrLCD4l = NULL; thrLCD4l = NULL;
dprintf(DEBUG_NORMAL,"\033[32m[CLCD4l] [%s - %d] thread [%p] terminated\033[0m\n", __func__, __LINE__, thrLCD4l); dprintf(DEBUG_NORMAL, "\033[32m[CLCD4l] [%s - %d] thread [%p] terminated\033[0m\n", __func__, __LINE__, thrLCD4l);
} }
exec_initscript("lcd4linux", "stop"); exec_initscript("lcd4linux", "stop");
} }
@@ -252,7 +252,7 @@ void CLCD4l::Init()
m_ModeTshift = -1; m_ModeTshift = -1;
m_ModeTimer = -1; m_ModeTimer = -1;
m_ModeEcm = -1; m_ModeEcm = -1;
m_ModeCamPresent= false; m_ModeCamPresent = false;
m_ModeCam = -1; m_ModeCam = -1;
m_Service = "n/a"; m_Service = "n/a";
@@ -283,9 +283,9 @@ void CLCD4l::Init()
wait4daemon = true; wait4daemon = true;
} }
void* CLCD4l::LCD4lProc(void* arg) void *CLCD4l::LCD4lProc(void *arg)
{ {
CLCD4l *PLCD4l = static_cast<CLCD4l*>(arg); CLCD4l *PLCD4l = static_cast<CLCD4l *>(arg);
PLCD4l->Init(); PLCD4l->Init();
@@ -296,9 +296,9 @@ void* CLCD4l::LCD4lProc(void* arg)
bool NewParseID = false; bool NewParseID = false;
//printf("[CLCD4l] %s: starting loop\n", __FUNCTION__); //printf("[CLCD4l] %s: starting loop\n", __FUNCTION__);
while(!PLCD4l->exit_proc) while (!PLCD4l->exit_proc)
{ {
if ( (!access(PIDFILE, F_OK) == 0) && (!FirstRun) ) if ((!access(PIDFILE, F_OK) == 0) && (!FirstRun))
{ {
if (g_settings.lcd4l_support == 1) // automatic if (g_settings.lcd4l_support == 1) // automatic
{ {
@@ -347,10 +347,10 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
std::string fgcolor = hexStr(t.infobar_Text_red) std::string fgcolor = hexStr(t.infobar_Text_red)
+ hexStr(t.infobar_Text_green) + hexStr(t.infobar_Text_green)
+ hexStr(t.infobar_Text_blue) + hexStr(t.infobar_Text_blue)
+ hexStrA2A(t.infobar_Text_alpha); + hexStrA2A(t.infobar_Text_alpha);
if (m_fgcolor.compare(fgcolor)) if (m_fgcolor.compare(fgcolor))
{ {
@@ -360,10 +360,10 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
std::string bgcolor = hexStr(t.infobar_red) std::string bgcolor = hexStr(t.infobar_red)
+ hexStr(t.infobar_green) + hexStr(t.infobar_green)
+ hexStr(t.infobar_blue) + hexStr(t.infobar_blue)
+ hexStrA2A(t.infobar_alpha); + hexStrA2A(t.infobar_alpha);
if (m_bgcolor.compare(bgcolor)) if (m_bgcolor.compare(bgcolor))
{ {
@@ -373,10 +373,10 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
std::string fcolor1 = hexStr(t.infobar_Text_red) std::string fcolor1 = hexStr(t.infobar_Text_red)
+ hexStr(t.infobar_Text_green) + hexStr(t.infobar_Text_green)
+ hexStr(t.infobar_Text_blue) + hexStr(t.infobar_Text_blue)
+ hexStr(t.infobar_Text_alpha); + hexStr(t.infobar_Text_alpha);
if (m_fcolor1.compare(fcolor1)) if (m_fcolor1.compare(fcolor1))
{ {
@@ -386,10 +386,10 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
std::string fcolor2 = hexStr(t.colored_events_red) std::string fcolor2 = hexStr(t.colored_events_red)
+ hexStr(t.colored_events_green) + hexStr(t.colored_events_green)
+ hexStr(t.colored_events_blue) + hexStr(t.colored_events_blue)
+ hexStr(t.colored_events_alpha); + hexStr(t.colored_events_alpha);
if (!t.colored_events_infobar) if (!t.colored_events_infobar)
fcolor2 = fcolor1; fcolor2 = fcolor1;
@@ -402,10 +402,10 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
std::string pbcolor = hexStr(t.menu_Content_Selected_red) std::string pbcolor = hexStr(t.menu_Content_Selected_red)
+ hexStr(t.menu_Content_Selected_green) + hexStr(t.menu_Content_Selected_green)
+ hexStr(t.menu_Content_Selected_blue) + hexStr(t.menu_Content_Selected_blue)
+ hexStrA2A(t.menu_Content_Selected_alpha); + hexStrA2A(t.menu_Content_Selected_alpha);
if (m_pbcolor.compare(pbcolor)) if (m_pbcolor.compare(pbcolor))
{ {
@@ -657,7 +657,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
else if (parseID == NeutrinoModes::mode_audio) else if (parseID == NeutrinoModes::mode_audio)
{ {
const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData(); const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData();
if ( (!meta.sc_station.empty()) && (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP)) if ((!meta.sc_station.empty()) && (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP))
Service = meta.sc_station; Service = meta.sc_station;
else else
{ {
@@ -836,7 +836,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
const char *buf = "service lcd4linux reload"; const char *buf = "service lcd4linux reload";
//printf("[CLCD4l] %s: executing '%s'\n", __FUNCTION__, buf); //printf("[CLCD4l] %s: executing '%s'\n", __FUNCTION__, buf);
if (my_system(3,"service", "lcd4linux", "reload") != 0) if (my_system(3, "service", "lcd4linux", "reload") != 0)
printf("[CLCD4l] %s: executing '%s' failed\n", __FUNCTION__, buf); printf("[CLCD4l] %s: executing '%s' failed\n", __FUNCTION__, buf);
} }
} }
@@ -856,7 +856,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
{ {
t_channel_id channel_id = parseID & 0xFFFFFFFFFFFFULL; t_channel_id channel_id = parseID & 0xFFFFFFFFFFFFULL;
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); CZapitChannel *channel = CZapit::getInstance()->GetCurrentChannel();
if (channel) if (channel)
channel_id = channel->getEpgID(); channel_id = channel->getEpgID();
@@ -920,11 +920,11 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
else else
{ {
const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData(); const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData();
if ( !meta.artist.empty() ) if (!meta.artist.empty())
Event += meta.artist; Event += meta.artist;
if ( !meta.artist.empty() && !meta.title.empty() ) if (!meta.artist.empty() && !meta.title.empty())
Event += " - "; Event += " - ";
if ( !meta.title.empty() ) if (!meta.title.empty())
Event += meta.title; Event += meta.title;
if (!meta.album.empty()) if (!meta.album.empty())
@@ -936,7 +936,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
time_t total = meta.total_time; time_t total = meta.total_time;
time_t done = CAudioPlayer::getInstance()->getTimePlayed(); time_t done = CAudioPlayer::getInstance()->getTimePlayed();
if ( (total > 0) && (done > 0) ) if ((total > 0) && (done > 0))
{ {
Progress = 100 * done / total; Progress = 100 * done / total;
snprintf(Duration, sizeof(Duration), "%ld:%02ld/%ld:%02ld", done / 60, done % 60, total / 60, total % 60); snprintf(Duration, sizeof(Duration), "%ld:%02ld/%ld:%02ld", done / 60, done % 60, total / 60, total % 60);
@@ -982,13 +982,13 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
} }
time_t sTime = time(NULL); time_t sTime = time(NULL);
sTime -= (CMoviePlayerGui::getInstance().GetPosition()/1000); sTime -= (CMoviePlayerGui::getInstance().GetPosition() / 1000);
tm_struct = localtime(&sTime); tm_struct = localtime(&sTime);
snprintf(Start, sizeof(Start), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); snprintf(Start, sizeof(Start), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min);
time_t eTime = time(NULL); time_t eTime = time(NULL);
eTime +=(CMoviePlayerGui::getInstance().GetDuration()/1000) - (CMoviePlayerGui::getInstance().GetPosition()/1000); eTime += (CMoviePlayerGui::getInstance().GetDuration() / 1000) - (CMoviePlayerGui::getInstance().GetPosition() / 1000);
tm_struct = localtime(&eTime); tm_struct = localtime(&eTime);
snprintf(End, sizeof(End), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); snprintf(End, sizeof(End), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min);
@@ -1221,9 +1221,9 @@ std::string CLCD4l::hexStrA2A(unsigned char data)
int a = 100 - data; int a = 100 - data;
int ret = a * 0xFF / 100; int ret = a * 0xFF / 100;
if(data == 0) if (data == 0)
ret = 0xFF; ret = 0xFF;
else if(data >= 100) else if (data >= 100)
ret = 0x00; ret = 0x00;
snprintf(hexstr, sizeof hexstr, "%02x", ret); snprintf(hexstr, sizeof hexstr, "%02x", ret);

View File

@@ -64,7 +64,7 @@ class CLCD4l
private: private:
std::thread *thrLCD4l; std::thread *thrLCD4l;
static void* LCD4lProc(void *arg); static void *LCD4lProc(void *arg);
bool exit_proc; bool exit_proc;
struct tm *tm_struct; struct tm *tm_struct;