diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 6806dce61..7815f9c7a 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -895,6 +895,7 @@ glcd.epg_y_position EPG y-Position glcd.font Schrift glcd.font_autoresize Automatische Schriftgröße glcd.head GraphLCD-Unterstützung +glcd.logodir Senderlogo-Verzeichnis glcd.logo_x_position Senderlogo x-Position glcd.logo_y_position Senderlogo y-Position glcd.mirror_osd OSD-Menü auf GraphLCD anzeigen diff --git a/data/locale/english.locale b/data/locale/english.locale index deb3c87b6..c2d4c9709 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -895,6 +895,7 @@ glcd.epg_y_position EPG y-position glcd.font Font glcd.font_autoresize Auto size glcd.head GraphLCD-support +glcd.logodir Channel logo directory glcd.logo_x_position Channel logo x-position glcd.logo_y_position Channel logo y-position glcd.mirror_osd Show OSD-menu on GraphLCD diff --git a/src/driver/glcd/glcd.cpp b/src/driver/glcd/glcd.cpp index bbf33c484..89866bb16 100644 --- a/src/driver/glcd/glcd.cpp +++ b/src/driver/glcd/glcd.cpp @@ -1501,7 +1501,7 @@ bool cGLCD::showImage(uint64_t cid, std::string cname, uint32_t dx, uint32_t dy, std::string logo; int sw, sh; - if (g_PicViewer->GetLogoName(cid, cname, logo, &sw, &sh)) + if (g_PicViewer->GetLogoName(cid, cname, logo, &sw, &sh, CPictureViewer::GRAPHLCD, true)) { return showImage(logo, (uint32_t) sw, (uint32_t) sh, dx, dy, dw, dh, transp, maximize); } diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index cd7c5d06a..9b7b73e58 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -681,7 +681,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) else Service = g_RemoteControl->getCurrentChannelName(); - g_PicViewer->GetLogoName(parseID, Service, Logo, &dummy, &dummy, true, true); + g_PicViewer->GetLogoName(parseID, Service, Logo, &dummy, &dummy, CPictureViewer::LCD4LINUX, true); ChannelNr = CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber(); } @@ -752,7 +752,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) { if (!g_PicViewer->GetLogoName(CMoviePlayerGui::getInstance().p_movie_info->channelId, CMoviePlayerGui::getInstance().p_movie_info->channelName, - Logo, &dummy, &dummy, true, true)) + Logo, &dummy, &dummy, CPictureViewer::LCD4LINUX, true)) Logo = ICONSDIR "/" NEUTRINO_ICON_PLAY ICONSEXT; } else /* show play-icon */ diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index b7ec02eac..e54894f88 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -531,7 +531,7 @@ 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 lcd4l_mode, bool enable_event_logo) +bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &ChannelName, std::string &name, int *width, int *height, int enable_special_logo, bool enable_event_logo) { std::string fileType[] = { ".png", ".jpg", ".gif" }; std::vector v_path; @@ -562,11 +562,21 @@ bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &C // add neccessary paths to v_path v_path.clear(); - if (lcd4l_mode) + switch(enable_special_logo) { + case LCD4LINUX: #ifdef ENABLE_LCD4LINUX - v_path.push_back(g_settings.lcd4l_logodir); + v_path.push_back(g_settings.lcd4l_logodir); #endif + break; + case GRAPHLCD: +#ifdef ENABLE_GRAPHLCD + v_path.push_back(g_settings.glcd_logodir); +#endif + break; + case NOPE: + default: + break; } v_path.push_back(g_settings.logo_hdd_dir); if (g_settings.logo_hdd_dir != LOGODIR_VAR) @@ -652,12 +662,23 @@ bool CPictureViewer::GetLogoName(const uint64_t &ChannelID, const std::string &C for (size_t f = 0; f < v_file.size(); f++) { - // process g_settings.lcd4l_logodir - if (lcd4l_mode) + switch(enable_special_logo) { + case LCD4LINUX: #ifdef ENABLE_LCD4LINUX - v_path.push_back(g_settings.lcd4l_logodir + "/" + v_file[f] + fileType[i]); + // process g_settings.lcd4l_logodir + v_path.push_back(g_settings.lcd4l_logodir + "/" + v_file[f] + fileType[i]); #endif + break; + case GRAPHLCD: +#ifdef ENABLE_GRAPHLCD + // process g_settings.glcd_logodir + v_path.push_back(g_settings.glcd_logodir + "/" + v_file[f] + fileType[i]); +#endif + break; + case NOPE: + default: + break; } // process g_settings.logo_hdd_dir v_path.push_back(g_settings.logo_hdd_dir + "/" + v_file[f] + fileType[i]); diff --git a/src/driver/pictureviewer/pictureviewer.h b/src/driver/pictureviewer/pictureviewer.h index 63b2ef921..06d5b0302 100644 --- a/src/driver/pictureviewer/pictureviewer.h +++ b/src/driver/pictureviewer/pictureviewer.h @@ -50,6 +50,11 @@ class CPictureViewer SIMPLE=1, COLOR=2 }; + enum { + NOPE = 0, + LCD4LINUX = 1, + GRAPHLCD = 2 + }; CPictureViewer(); virtual~CPictureViewer(); bool ShowImage(const std::string & filename, bool unscaled=false); @@ -67,7 +72,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 lcd4l_mode = false, bool enable_event_logo = false); + bool GetLogoName(const uint64_t &ChannelID, const std::string &ChannelName, std::string &name, int *width = NULL, int *height = NULL, int enable_special_logo = NOPE, bool enable_event_logo = 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); diff --git a/src/gui/glcdsetup.cpp b/src/gui/glcdsetup.cpp index d55550978..0f3fbd097 100644 --- a/src/gui/glcdsetup.cpp +++ b/src/gui/glcdsetup.cpp @@ -210,6 +210,12 @@ int GLCD_Menu::exec(CMenuTarget* parent, const std::string & actionKey) { return GLCD_Theme_Position_Settings(); } + else if (actionKey == "glcd_logodir") + { + const char *action_str = "glcd_logodir"; + chooserDir(g_settings.glcd_logodir, false, action_str); + return menu_return::RETURN_REPAINT; + } else { return GLCD_Menu_Settings(); @@ -334,6 +340,11 @@ int GLCD_Menu::GLCD_Menu_Settings() gms->addItem(GenericMenuSeparatorLine); int shortcut = 1; + gms->addItem(new CMenuForwarder(LOCALE_GLCD_LOGODIR, true, g_settings.glcd_logodir, this, "glcd_logodir", + CRCInput::convertDigitToKey(shortcut++))); + + gms->addItem(GenericMenuSeparator); + gms->addItem(new CMenuForwarder(LOCALE_GLCD_THEME_SETTINGS, true, NULL, this, "theme_settings", CRCInput::convertDigitToKey(shortcut++))); gms->addItem(new CMenuForwarder(LOCALE_GLCD_BRIGHTNESS_SETTINGS, true, NULL, this, "brightness_settings", @@ -342,6 +353,7 @@ int GLCD_Menu::GLCD_Menu_Settings() CRCInput::convertDigitToKey(shortcut++))); gms->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SCROLL_SPEED, &g_settings.glcd_scroll_speed, true, 1, 63, this)); + gms->addItem(GenericMenuSeparatorLine); gms->addItem(new CMenuOptionChooser(LOCALE_GLCD_MIRROR_OSD, &g_settings.glcd_mirror_osd, diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 90d50c90c..cbe955f91 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -709,6 +709,7 @@ int CNeutrinoApp::loadSetup(const char * fname) #ifdef ENABLE_GRAPHLCD g_settings.glcd_enable = configfile.getInt32("glcd_enable", strcmp(g_info.hw_caps->boxvendor, "VU+") == 0); + g_settings.glcd_logodir = configfile.getString("glcd_logodir", "/media/sda1/logos"); g_settings.glcd_time_in_standby = configfile.getInt32("glcd_time_in_standby", 1); g_settings.glcd_standby_weather = configfile.getInt32("glcd_standby_weather", 1); @@ -1706,6 +1707,7 @@ void CNeutrinoApp::saveSetup(const char * fname) #ifdef ENABLE_GRAPHLCD configfile.setInt32("glcd_enable", g_settings.glcd_enable); + configfile.setString("glcd_logodir" , g_settings.glcd_logodir); configfile.setInt32("glcd_time_in_standby", g_settings.glcd_time_in_standby); configfile.setInt32("glcd_standby_weather", g_settings.glcd_standby_weather); configfile.setInt32("glcd_mirror_osd", g_settings.glcd_mirror_osd); diff --git a/src/system/locals.h b/src/system/locals.h index bbd5cc7a4..75a6abf6d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -922,6 +922,7 @@ typedef enum LOCALE_GLCD_FONT, LOCALE_GLCD_FONT_AUTORESIZE, LOCALE_GLCD_HEAD, + LOCALE_GLCD_LOGODIR, LOCALE_GLCD_LOGO_X_POSITION, LOCALE_GLCD_LOGO_Y_POSITION, LOCALE_GLCD_MIRROR_OSD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e84bb6588..8e48870c6 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -922,6 +922,7 @@ const char * locale_real_names[] = "glcd.font", "glcd.font_autoresize", "glcd.head", + "glcd.logodir", "glcd.logo_x_position", "glcd.logo_y_position", "glcd.mirror_osd", diff --git a/src/system/settings.h b/src/system/settings.h index 21505f5f7..33c5a1445 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -923,6 +923,7 @@ struct SNeutrinoSettings #ifdef ENABLE_GRAPHLCD // graphlcd int glcd_enable; + std::string glcd_logodir; int glcd_time_in_standby; int glcd_standby_weather;