From 7a6f5376f83d9f45a07d322ef36bf6ad5bb6170e Mon Sep 17 00:00:00 2001 From: Andreas Mair Date: Sat, 19 May 2012 08:20:51 +0000 Subject: Added setup options to set width of signal information and progress bar in channel info OSD. --- diff --git a/HISTORY b/HISTORY index 1283e2e..7d55f56 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,9 @@ VDR Skin 'EnigmaNG' Revision History ------------------------------------------ +2012-xx-xx: Version 0.1.3 +- Added: Setup options to set width of signal information and progress bar in channel info OSD. + 2012-04-29: Version 0.1.2 - Changed: Use vdr fuctions to determine signal strength (Closes #811). - Added: Hungarian translation (Provided by István Füley). --- skinenigmang-0.1.2/README.orig 2012-06-29 19:04:10.005813994 +0200 +++ skinenigmang-0.1.2/README 2012-06-29 19:04:10.004813996 +0200 @@ -185,10 +185,17 @@ channel info. "elapsed/remaining" will show both elapsed and remaining number of minutes. +- Width of progress bar + The width of the progress bar that visualizes the elapsed time of the current + event. + - Show signal info If set to yes the signal strength (top) and signal-to-noise ratio (bottom) will be shown at the bottom right side of the channel info OSD. +- Width of signal info + The width of the signal info. + - Show CA system as text Show used CA system (e.g. Cryptoworks) as text instead of symbol in the channel info OSD. diff --git a/config.c b/config.c index b43dc8a..ff5913f 100644 --- a/config.c +++ b/config.c @@ -58,7 +58,8 @@ 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), channelLogoWidth(80), channelLogoHeight(80) + showSignalInfo(0), showCaMode(0), drawRoundCorners(1), channelLogoWidth(80), channelLogoHeight(80), + signalInfoWidth(74), progressBarWidth(124) { memset(logoDir, 0, sizeof(logoDir)); memset(strImagesDir, 0, sizeof(strImagesDir)); diff --git a/config.h b/config.h index 469f45f..f9aec34 100644 --- a/config.h +++ b/config.h @@ -149,6 +149,8 @@ public: int drawRoundCorners; int channelLogoWidth; int channelLogoHeight; + int signalInfoWidth; + int progressBarWidth; FontInfo allFonts[FONT_NUMFONTS]; }; diff --git a/enigma.c b/enigma.c index cb72fd6..4db0a7d 100644 --- a/enigma.c +++ b/enigma.c @@ -231,10 +231,6 @@ THEME_CLR(Theme, clrSignalLowFg, 0xFFCC0000); #define MIN_DATEWIDTH 144 -// Minimum progress bar width in channel info -#define MIN_CI_PROGRESS 124 -// Minimum signal bar width in channel info -#define MIN_CI_SIGNALBAR 74 #define TinyGap 1 #define SmallGap 2 @@ -403,7 +399,7 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) int w = pFontDate->Width(date); xDateLeft = xTitleRight - xIndent - w - SmallGap; #ifndef DISABLE_SIGNALINFO - xSignalBarLeft = EnigmaConfig.showSignalInfo ? (xBottomRight - xIndent - MIN_CI_SIGNALBAR) : -1; + xSignalBarLeft = EnigmaConfig.showSignalInfo ? (xBottomRight - xIndent - EnigmaConfig.signalInfoWidth) : -1; #endif // create osd @@ -659,7 +655,7 @@ void cSkinEnigmaDisplayChannel::DrawSymbols(const cChannel *Channel) } } - xFirstSymbol = DrawStatusSymbols(xBottomLeft + xIndent + MIN_CI_PROGRESS + Gap, xs, yBottomTop, yBottomBottom, Channel) - Gap; + xFirstSymbol = DrawStatusSymbols(xBottomLeft + xIndent + EnigmaConfig.progressBarWidth + Gap, xs, yBottomTop, yBottomBottom, Channel) - Gap; } #ifndef DISABLE_SIGNALINFO @@ -710,7 +706,7 @@ void cSkinEnigmaDisplayChannel::UpdateSignal() { if (snr < 0 && str < 0) return; - int bw = MIN_CI_SIGNALBAR; //45; + int bw = EnigmaConfig.signalInfoWidth; int xSignalBarRight = xSignalBarLeft + bw; #if VDRVERSNUM < 10719 @@ -930,7 +926,7 @@ void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present, } // draw timebar int xBarLeft = xBottomLeft + xIndent; - int xBarWidth = MIN_CI_PROGRESS; + int xBarWidth = EnigmaConfig.progressBarWidth; int x = xBarLeft + SmallGap + (int)(ceil((float)(now) / (float)(total) * (float)(xBarWidth - SmallGap - SmallGap))); x = std::min(x, xBarLeft + xBarWidth - SmallGap - 1); osd->DrawRectangle(xBarLeft, yBottomTop + Gap, diff --git a/setup.c b/setup.c index e3ea915..02feaba 100644 --- a/setup.c +++ b/setup.c @@ -136,6 +136,8 @@ void cPluginSkinEnigmaSetup::Store(void) SetupStore("DrawRoundCorners", EnigmaConfig.drawRoundCorners); SetupStore("ChannelLogoWidth", EnigmaConfig.channelLogoWidth); SetupStore("ChannelLogoHeight", EnigmaConfig.channelLogoHeight); + SetupStore("SignalInfoWidth", EnigmaConfig.signalInfoWidth); + SetupStore("ProgressBarWidth", EnigmaConfig.progressBarWidth); char tmp[sizeof(EnigmaConfig.allFonts[0].Name) + 8]; for (int id = 0; id < FONT_NUMFONTS; id++) { @@ -226,11 +228,17 @@ cMenuSetupGeneral::cMenuSetupGeneral(cEnigmaConfig* Data) : cMenuSetupSubMenu(tr eOSState cMenuSetupGeneral::ProcessKey(eKeys Key) { int oldShowInfo = data->showInfo; +#ifndef DISABLE_SIGNALINFO + int oldShowSignalInfo = data->showSignalInfo; +#endif eOSState state = cMenuSetupSubMenu::ProcessKey(Key); if (Key != kNone && ((data->showInfo != oldShowInfo) +#ifndef DISABLE_SIGNALINFO + || (data->showSignalInfo != oldShowSignalInfo) +#endif )) { Set(); } @@ -268,8 +276,11 @@ void cMenuSetupGeneral::Set(void) Add(new cMenuEditStraItem(tr("Show recording's size"), &data->showRecSize, 3, showRecSizeTexts)); AddCategory(tr("Channel Info OSD")); Add(new cMenuEditStraItem(tr("Show remaining/elapsed time"), &data->showRemaining, 4, showRemainingTexts)); + Add(new cMenuEditIntItem(tr("Width of progress bar"), &data->progressBarWidth, 74, Setup.OSDWidth)); #ifndef DISABLE_SIGNALINFO Add(new cMenuEditBoolItem(tr("Show signal info"), &data->showSignalInfo)); + if (data->showSignalInfo) + Add(new cMenuEditIntItem(tr(" Width of signal info"), &data->signalInfoWidth, 74, Setup.OSDWidth)); #endif //DISABLE_SIGNALINFO Add(new cMenuEditBoolItem(tr("Show CA system as text"), &data->showCaMode)); diff --git a/skinenigmang.c b/skinenigmang.c index 577ceb7..0eabe3a 100644 --- a/skinenigmang.c +++ b/skinenigmang.c @@ -255,6 +255,8 @@ bool cPluginSkinEnigma::SetupParse(const char *OptionName, const char *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 if (!strcasecmp(OptionName, "SignalInfoWidth")) EnigmaConfig.signalInfoWidth = atoi(Value); + else if (!strcasecmp(OptionName, "ProgressBarWidth")) EnigmaConfig.progressBarWidth = atoi(Value); else return false; return true; -- cgit v0.9.0.2-39-g756e