pictureviewer: add support for g_settings.lcd4l_logodir to GetLogoName() function

Origin commit data
------------------
Commit: f9cd35290a
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-12-18 (Tue, 18 Dec 2018)

Origin message was:
------------------
- pictureviewer: add support for g_settings.lcd4l_logodir to GetLogoName() function
This commit is contained in:
vanhofen
2018-12-18 00:19:35 +01:00
parent e1877ac7c0
commit 50dd8ff34c
2 changed files with 20 additions and 2 deletions

View File

@@ -529,10 +529,11 @@ void CPictureViewer::getSize(const char* name, int* width, int *height)
}
}
bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &ChannelName, std::string &name, int *width, int *height)
bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &ChannelName, std::string &name, int *width, int *height, bool lcd4l_mode)
{
std::string fileType[] = { ".png", ".jpg", ".gif" };
std::vector<std::string> v_path;
std::vector<std::string> v_file;
// create eventname for eventlogos; Note: We don't process channellogos if any eventlogo was found.
std::string EventName = "";
@@ -560,6 +561,8 @@ bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &C
//printf("GetLogoName(): EventName \"%s\"\n", EventName.c_str());
v_path.clear();
if (lcd4l_mode)
v_path.push_back(g_settings.lcd4l_logodir);
v_path.push_back(g_settings.logo_hdd_dir);
if (g_settings.logo_hdd_dir != LOGODIR_VAR)
v_path.push_back(LOGODIR_VAR);
@@ -635,6 +638,21 @@ bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &C
v_path.clear();
std::string id_tmp_path;
if (lcd4l_mode)
{
v_file.clear();
v_file.push_back(ChannelName);
v_file.push_back(SpecialChannelName);
v_file.push_back(strChnId);
if (e2filename1[0] != '\0')
v_file.push_back(std::string(e2filename1));
if (e2filename2[0] != '\0')
v_file.push_back(std::string(e2filename2));
for (size_t f = 0; f < v_file.size(); f++)
v_path.push_back(g_settings.lcd4l_logodir + "/" + v_file[f] + fileType[i]);
}
//create filename with channel name (logo_hdd_dir)
id_tmp_path = g_settings.logo_hdd_dir + "/";
id_tmp_path += ChannelName + fileType[i];

View File

@@ -67,7 +67,7 @@ class CPictureViewer
static double m_aspect_ratio_correction;
bool DisplayImage (const std::string & name, int posx, int posy, int width, int height, int transp=0 /*CFrameBuffer::TM_EMPTY*/);
// bool DisplayLogo (uint64_t channel_id, int posx, int posy, int width, int height);
bool GetLogoName(const uint64_t &ChannelID, const std::string &ChannelName, std::string &name, int *width = NULL, int *height = NULL);
bool GetLogoName(const uint64_t &ChannelID, const std::string &ChannelName, std::string &name, int *width = NULL, int *height = NULL, bool lcd4l_mode = false);
fb_pixel_t * getImage (const std::string & name, int width, int height);
fb_pixel_t * getIcon (const std::string & name, int *width, int *height);
void getSize(const char *name, int* width, int *height);