mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-15 09:23:37 +02:00
lcd4l: porting color and font support from TangoCash
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7359f1f38d
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-05-23 (Mon, 23 May 2016)
Origin message was:
------------------
- lcd4l: porting color and font support from TangoCash
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
Copyright (C) 2012-2016 'vanhofen'
|
Copyright (C) 2012-2016 'vanhofen'
|
||||||
Homepage: http://www.neutrino-images.de/
|
Homepage: http://www.neutrino-images.de/
|
||||||
|
|
||||||
|
Modded (C) 2016 'TangoCash'
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -33,6 +35,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
@@ -87,6 +90,10 @@ extern CRemoteControl *g_RemoteControl;
|
|||||||
#define START LCD_DATADIR "start"
|
#define START LCD_DATADIR "start"
|
||||||
#define END LCD_DATADIR "end"
|
#define END LCD_DATADIR "end"
|
||||||
|
|
||||||
|
#define FONT LCD_DATADIR "font"
|
||||||
|
#define FGCOLOR LCD_DATADIR "fgcolor"
|
||||||
|
#define BGCOLOR LCD_DATADIR "bgcolor"
|
||||||
|
|
||||||
#define FLAG_LCD4LINUX "/tmp/.lcd4linux"
|
#define FLAG_LCD4LINUX "/tmp/.lcd4linux"
|
||||||
#define PIDFILE "/tmp/lcd4linux.pid"
|
#define PIDFILE "/tmp/lcd4linux.pid"
|
||||||
|
|
||||||
@@ -166,7 +173,8 @@ int CLCD4l::RemoveFile(const char *file)
|
|||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (access(file, F_OK) == 0) {
|
if (access(file, F_OK) == 0)
|
||||||
|
{
|
||||||
if (unlink(file) != 0)
|
if (unlink(file) != 0)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
@@ -260,6 +268,44 @@ void* CLCD4l::LCD4lProc(void* arg)
|
|||||||
|
|
||||||
void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
|
void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun)
|
||||||
{
|
{
|
||||||
|
SNeutrinoTheme &t = g_settings.theme;
|
||||||
|
|
||||||
|
std::string font = g_settings.font_file;
|
||||||
|
|
||||||
|
if (m_font.compare(font))
|
||||||
|
{
|
||||||
|
WriteFile(FONT, font);
|
||||||
|
m_font = font;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------- */
|
||||||
|
|
||||||
|
std::string fgcolor = hexStr(&t.infobar_Text_red)
|
||||||
|
+ hexStr(&t.infobar_Text_green)
|
||||||
|
+ hexStr(&t.infobar_Text_blue)
|
||||||
|
+ hexStr(&t.infobar_Text_alpha);
|
||||||
|
|
||||||
|
if (m_fgcolor.compare(fgcolor))
|
||||||
|
{
|
||||||
|
WriteFile(FGCOLOR, fgcolor);
|
||||||
|
m_fgcolor = fgcolor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------- */
|
||||||
|
|
||||||
|
std::string bgcolor = hexStr(&t.infobar_red)
|
||||||
|
+ hexStr(&t.infobar_green)
|
||||||
|
+ hexStr(&t.infobar_blue)
|
||||||
|
+ hexStr(&t.infobar_alpha);
|
||||||
|
|
||||||
|
if (m_bgcolor.compare(bgcolor))
|
||||||
|
{
|
||||||
|
WriteFile(BGCOLOR, bgcolor);
|
||||||
|
m_bgcolor = bgcolor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------- */
|
||||||
|
|
||||||
int Tuner = 1 + CFEManager::getInstance()->getLiveFE()->getNumber();
|
int Tuner = 1 + CFEManager::getInstance()->getLiveFE()->getNumber();
|
||||||
|
|
||||||
if (m_Tuner != Tuner)
|
if (m_Tuner != Tuner)
|
||||||
@@ -794,6 +840,15 @@ void CLCD4l::strReplace(std::string & orig, const char *fstr, const std::string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CLCD4l::hexStr(unsigned char* data)
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << std::hex;
|
||||||
|
for(int i=0; i<1; ++i)
|
||||||
|
ss << std::setw(2) << std::setfill('0') << (int)data[i];
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
||||||
bool CLCD4l::GetLogoName(uint64_t channel_id, std::string channel_name, std::string &logo)
|
bool CLCD4l::GetLogoName(uint64_t channel_id, std::string channel_name, std::string &logo)
|
||||||
{
|
{
|
||||||
int h, i, j;
|
int h, i, j;
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
Copyright (C) 2012-2016 'vanhofen'
|
Copyright (C) 2012-2016 'vanhofen'
|
||||||
Homepage: http://www.neutrino-images.de/
|
Homepage: http://www.neutrino-images.de/
|
||||||
|
|
||||||
|
Modded (C) 2016 'TangoCash'
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -78,6 +80,7 @@ class CLCD4l
|
|||||||
bool GetLogoName(uint64_t channel_id, std::string channel_name, std::string & logo);
|
bool GetLogoName(uint64_t channel_id, std::string channel_name, std::string & logo);
|
||||||
|
|
||||||
std::string Int2String(int iconvert);
|
std::string Int2String(int iconvert);
|
||||||
|
std::string hexStr(unsigned char* data);
|
||||||
void strReplace(std::string & orig, const char *fstr, const std::string rstr);
|
void strReplace(std::string & orig, const char *fstr, const std::string rstr);
|
||||||
bool WriteFile(const char *file, std::string content = "", bool convert = false);
|
bool WriteFile(const char *file, std::string content = "", bool convert = false);
|
||||||
|
|
||||||
@@ -106,6 +109,10 @@ class CLCD4l
|
|||||||
std::string m_Event;
|
std::string m_Event;
|
||||||
int m_Progress;
|
int m_Progress;
|
||||||
char m_Duration[15];
|
char m_Duration[15];
|
||||||
|
|
||||||
|
std::string m_font;
|
||||||
|
std::string m_fgcolor;
|
||||||
|
std::string m_bgcolor;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user