diff options
author | Andreas Mair <amair.sob@googlemail.com> | 2010-12-16 17:12:23 +0100 |
---|---|---|
committer | Andreas Mair <amair.sob@googlemail.com> | 2010-12-16 18:35:58 +0100 |
commit | c85b15372038e172da70e7ad092f2eacd4a9a386 (patch) | |
tree | 7845c1b792f708f26a160e5a962efea0690fbc84 | |
parent | 6bea748474e3ecffb16ccc89de08a95384d85d7c (diff) | |
download | vdr-plugin-skinenigmang-c85b15372038e172da70e7ad092f2eacd4a9a386.tar.gz vdr-plugin-skinenigmang-c85b15372038e172da70e7ad092f2eacd4a9a386.tar.bz2 |
New setup options for height and width of channel logos area.
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | config.c | 2 | ||||
-rw-r--r-- | config.h | 2 | ||||
-rw-r--r-- | enigma.c | 23 | ||||
-rw-r--r-- | logo.c | 4 | ||||
-rw-r--r-- | logo.h | 3 | ||||
-rw-r--r-- | setup.c | 8 | ||||
-rw-r--r-- | skinenigmang.c | 2 |
8 files changed, 24 insertions, 21 deletions
@@ -2,6 +2,7 @@ VDR Skin 'EnigmaNG' Revision History ------------------------------------------ 2010-xx-xx: Version 0.1.2 +- Added: New setup options for height and width of channel logos area. - Changed: Look for channel logos only in "logos" folder ("hqlogos" folder no longer supported). 2010-04-05: Version 0.1.1 @@ -58,7 +58,7 @@ cEnigmaConfig::cEnigmaConfig() : showAuxInfo(1), showLogo(1), showVps(1), showSy useTextEffects(0), scrollDelay(50), scrollPause(1500), scrollMode(0), blinkPause(1000), scrollInfo(1), scrollListItem(1), scrollOther(1), scrollTitle(1), dynOsd(0), statusLineMode(0), showWssSymbols(0), showStatusSymbols(0), showScrollbar(1), - showSignalInfo(0), showCaMode(0), drawRoundCorners(1) + showSignalInfo(0), showCaMode(0), drawRoundCorners(1), channelLogoWidth(80), channelLogoHeight(80) { memset(logoDir, 0, sizeof(logoDir)); memset(strImagesDir, 0, sizeof(strImagesDir)); @@ -147,6 +147,8 @@ public: int showSignalInfo; int showCaMode; int drawRoundCorners; + int channelLogoWidth; + int channelLogoHeight; FontInfo allFonts[FONT_NUMFONTS]; }; @@ -281,7 +281,7 @@ private: const cFont *pFontLanguage; const cFont *pFontMessage; - int xLogoLeft, xLogoRight, yLogoTop, yLogoBottom, xLogoDecoLeft, xLogoDecoRight, xLogoPos, yLogoPos; + int xLogoLeft, xLogoRight, yLogoTop, yLogoBottom, xLogoDecoLeft, xLogoDecoRight; int xTitleLeft, xTitleRight, yTitleTop, yTitleBottom, yTitleDecoTop, yTitleDecoBottom; int xEventNowLeft, xEventNowRight, yEventNowTop, yEventNowBottom; int xEventNextLeft, xEventNextRight, yEventNextTop, yEventNextBottom; @@ -349,16 +349,15 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) nBPP = 1; int MessageHeight = 2 * SmallGap + pFontMessage->Height() + 2 * SmallGap; - int LogoSize = 0; + int LogoHeight = 0; if (fWithInfo) - LogoSize = std::max(pFontTitle->Height() * 2 + pFontSubtitle->Height() * 2 + SmallGap, ChannelLogoHeight); + LogoHeight = std::max(pFontTitle->Height() * 2 + pFontSubtitle->Height() * 2 + SmallGap, EnigmaConfig.channelLogoHeight); else - LogoSize = std::max(std::max(pFontOsdTitle->Height(), pFontDate->Height()) + TitleDecoGap + TitleDecoHeight + TitleDecoGap2 + MessageHeight + pFontLanguage->Height() + SmallGap, ChannelLogoHeight); + LogoHeight = std::max(std::max(pFontOsdTitle->Height(), pFontDate->Height()) + TitleDecoGap + TitleDecoHeight + TitleDecoGap2 + MessageHeight + pFontLanguage->Height() + SmallGap, EnigmaConfig.channelLogoHeight); - LogoSize += (LogoSize % 2 ? 1 : 0); // title bar & logo area xLogoLeft = 0; - xLogoRight = xLogoLeft + LogoSize; + xLogoRight = xLogoLeft + EnigmaConfig.channelLogoWidth; xLogoDecoLeft = xLogoRight + LogoDecoGap; xLogoDecoRight = xLogoDecoLeft + LogoDecoWidth; xTitleLeft = (fShowLogo && (!EnigmaConfig.fullTitleWidth || !fWithInfo) ? xLogoDecoRight + LogoDecoGap2 : xLogoLeft); @@ -368,15 +367,13 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) yTitleDecoTop = yTitleBottom + TitleDecoGap; yTitleDecoBottom = yTitleDecoTop + TitleDecoHeight; yLogoTop = (fWithInfo ? yTitleDecoBottom + TitleDecoGap2 : yTitleTop); - yLogoBottom = yLogoTop + LogoSize; - xLogoPos = xLogoLeft + (LogoSize - ChannelLogoHeight) / 2; - yLogoPos = yLogoTop + (LogoSize - ChannelLogoHeight) / 2; + yLogoBottom = yLogoTop + LogoHeight; if (fWithInfo) { // current event area xEventNowLeft = (fShowLogo ? xLogoDecoRight + LogoDecoGap2 : xTitleLeft); xEventNowRight = xTitleRight; yEventNowTop = yLogoTop; - yEventNowBottom = yEventNowTop + (LogoSize - SmallGap) / 2; + yEventNowBottom = yEventNowTop + (LogoHeight - SmallGap) / 2; // next event area xEventNextLeft = xEventNowLeft; xEventNextRight = xEventNowRight; @@ -396,7 +393,7 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) // message area xMessageLeft = xEventNowLeft; xMessageRight = xTitleRight; - yMessageTop = yLogoTop + (LogoSize - MessageHeight) / 2; + yMessageTop = yLogoTop + (LogoHeight - MessageHeight) / 2; yMessageBottom = yMessageTop + MessageHeight; // date area cString date = DayDateTime(); @@ -800,8 +797,8 @@ void cSkinEnigmaDisplayChannel::SetChannel(const cChannel *Channel, int Number) osd->DrawRectangle(xLogoDecoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, Theme.Color(clrLogoBg)); if (EnigmaLogoCache.LoadChannelLogo(Channel)) { - osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - ChannelLogoWidth) / 2, - yLogoTop + (yLogoBottom - yLogoTop - ChannelLogoHeight) / 2, + osd->DrawBitmap(xLogoLeft + (xLogoRight - xLogoLeft - EnigmaLogoCache.Get().Width()) / 2, + yLogoTop + (yLogoBottom - yLogoTop - EnigmaLogoCache.Get().Height()) / 2, EnigmaLogoCache.Get(), EnigmaLogoCache.Get().Color(1), Theme.Color(clrLogoBg), true); } @@ -116,9 +116,9 @@ bool cEnigmaLogoCache::LoadChannelLogo(const cChannel *Channel) strcpy(filename, "logos/"); strcat(filename, strLogo); - if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) { + if (!(fFoundLogo = Load(filename, EnigmaConfig.channelLogoWidth, EnigmaConfig.channelLogoHeight, false))) { error("cPluginSkinEnigma::LoadChannelLogo: LOGO \"%s.xpm\" NOT FOUND in %s/logos", strLogo, EnigmaConfig.GetLogoDir()); - fFoundLogo = Load("logos/no_logo", ChannelLogoWidth, ChannelLogoHeight); //TODO? different default logo for channel/group? + fFoundLogo = Load("logos/no_logo", EnigmaConfig.channelLogoWidth, EnigmaConfig.channelLogoHeight); //TODO? different default logo for channel/group? } leave: @@ -20,9 +20,6 @@ #include <vdr/recording.h> #include <vdr/osd.h> -// size of channel logos -#define ChannelLogoWidth 80 -#define ChannelLogoHeight 80 // size of icons, e.g. icons top right in the main menu... #define IconWidth 80 #define IconHeight 80 @@ -134,6 +134,8 @@ void cPluginSkinEnigmaSetup::Store(void) SetupStore("ShowSignalInfo", EnigmaConfig.showSignalInfo); SetupStore("ShowCaMode", EnigmaConfig.showCaMode); SetupStore("DrawRoundCorners", EnigmaConfig.drawRoundCorners); + SetupStore("ChannelLogoWidth", EnigmaConfig.channelLogoWidth); + SetupStore("ChannelLogoHeight", EnigmaConfig.channelLogoHeight); char tmp[sizeof(EnigmaConfig.allFonts[0].Name) + 8]; for (int id = 0; id < FONT_NUMFONTS; id++) { @@ -391,9 +393,9 @@ void cMenuSetupLogos::Set(void) Add(new cMenuEditStraItem(tr(" Resize images"), &data->resizeImages, 3, resizeImagesTexts)); #endif Add(new cMenuEditIntItem(tr(" Image width" ), &data->imageWidth, 80, 180)); - Add(new cMenuEditIntItem(tr(" Image height" ), &data->imageHeight, 80, 144)); + Add(new cMenuEditIntItem(tr(" Image height" ), &data->imageHeight, 80, 144)); #ifdef HAVE_IMAGEMAGICK - Add(new cMenuEditStraItem(tr(" Image format"), &data->imageExtension, 3, imageExtensionTexts)); + Add(new cMenuEditStraItem(tr(" Image format"), &data->imageExtension, 3, imageExtensionTexts)); #endif } } @@ -401,6 +403,8 @@ void cMenuSetupLogos::Set(void) Add(new cMenuEditBoolItem(tr("Show channel logos"), &data->showLogo)); if (data->showLogo) { + Add(new cMenuEditIntItem(tr(" Image width" ), &data->channelLogoWidth, 64, 180)); //TODO: find suitable max values + Add(new cMenuEditIntItem(tr(" Image height" ), &data->channelLogoHeight, 48, 144)); Add(new cMenuEditBoolItem(tr(" Identify channel by"), &data->useChannelId, tr("name"), tr("data"))); } if (data->showLogo || data->showSymbols) { diff --git a/skinenigmang.c b/skinenigmang.c index 3500766..fe96453 100644 --- a/skinenigmang.c +++ b/skinenigmang.c @@ -253,6 +253,8 @@ bool cPluginSkinEnigma::SetupParse(const char *OptionName, const char *Value) else if (!strcasecmp(OptionName, "ShowSignalInfo")) EnigmaConfig.showSignalInfo = atoi(Value); else if (!strcasecmp(OptionName, "ShowCaMode")) EnigmaConfig.showCaMode = atoi(Value); else if (!strcasecmp(OptionName, "DrawRoundCorners")) EnigmaConfig.drawRoundCorners = atoi(Value); + else if (!strcasecmp(OptionName, "ChannelLogoWidth")) EnigmaConfig.channelLogoWidth = atoi(Value); + else if (!strcasecmp(OptionName, "ChannelLogoHeight")) EnigmaConfig.channelLogoHeight = atoi(Value); else return false; return true; |