From 2e6a236a565d9dc4e8c551c56bb9d55697e2c144 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Wed, 8 Jul 2009 23:14:19 +0300 Subject: [PATCH] Removed OSD offset and height options. --- HISTORY | 4 ++++ README | 5 ++--- femon.c | 12 +----------- femoncfg.c | 2 -- femoncfg.h | 2 -- femonosd.c | 36 ++++++++++++++++++++++++++++-------- femonosd.h | 2 ++ po/de_DE.po | 11 +---------- po/es_ES.po | 11 +---------- po/et_EE.po | 11 +---------- po/fi_FI.po | 11 +---------- po/fr_FR.po | 11 +---------- po/it_IT.po | 11 +---------- po/ru_RU.po | 11 +---------- 14 files changed, 44 insertions(+), 96 deletions(-) diff --git a/HISTORY b/HISTORY index 4571eff..8fb7f66 100644 --- a/HISTORY +++ b/HISTORY @@ -364,3 +364,7 @@ VDR Plugin 'femon' Revision History - Cleaned up compilation warnings. - Fixed font handling to be thread-safe. + +2009-07-xx: Version 1.7.3 + +- Removed OSD offset and height options. diff --git a/README b/README index 2879315..9a0424d 100644 --- a/README +++ b/README @@ -110,9 +110,8 @@ Notes: specifications those values cannot be calculated into any real units. - If the OSD isn't visible, you've configured the OSD height too big or too - small. Please, try to adjust the variable on the setup page before writing - any bug reports. NTSC users should use a shrinked default OSD height by - modifying VDR's setup.conf: femon.OSDHeight = 420 + small. Please, try to adjust the variable on the OSD setup page before + writing any bug reports. - If the SVDRP service is used: femon won't notice if the server is tuned to a different channel and tuning the channel on the server might annoy diff --git a/femon.c b/femon.c index 69b2fe0..185f293 100644 --- a/femon.c +++ b/femon.c @@ -18,7 +18,7 @@ #error "VDR-1.7.0 API version or greater is required!" #endif -static const char VERSION[] = "1.7.2"; +static const char VERSION[] = "1.7.3"; static const char DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)"); static const char MAINMENUENTRY[] = trNOOP("Signal Information"); @@ -110,8 +110,6 @@ bool cPluginFemon::SetupParse(const char *Name, const char *Value) if (!strcasecmp(Name, "HideMenu")) femonConfig.hidemenu = atoi(Value); else if (!strcasecmp(Name, "DisplayMode")) femonConfig.displaymode = atoi(Value); else if (!strcasecmp(Name, "Position")) femonConfig.position = atoi(Value); - else if (!strcasecmp(Name, "OSDHeight")) femonConfig.osdheight = atoi(Value); - else if (!strcasecmp(Name, "OSDOffset")) femonConfig.osdoffset = atoi(Value); else if (!strcasecmp(Name, "Skin")) femonConfig.skin = atoi(Value); else if (!strcasecmp(Name, "Theme")) femonConfig.theme = atoi(Value); else if (!strcasecmp(Name, "RedLimit")) femonConfig.redlimit = atoi(Value); @@ -321,12 +319,6 @@ void cMenuFemonSetup::Setup(void) Add(new cMenuEditBoolItem(tr("Position"), &data.position, trVDR("bottom"), trVDR("top"))); help.Append(tr("Define the position of OSD.")); - Add(new cMenuEditIntItem(trVDR("Setup.OSD$Height"), &data.osdheight, 400, 500)); - help.Append(tr("Define the height of OSD.")); - - Add(new cMenuEditIntItem(tr("Horizontal offset"), &data.osdoffset, -50, 50)); - help.Append(tr("Define the horizontal offset of OSD.")); - Add(new cMenuEditIntItem(tr("Red limit [%]"), &data.redlimit, 1, 50)); help.Append(tr("Define a limit for red bar, which is used to indicate a bad signal.")); @@ -368,8 +360,6 @@ void cMenuFemonSetup::Store(void) SetupStore("Skin", femonConfig.skin); SetupStore("Theme", femonConfig.theme); SetupStore("Position", femonConfig.position); - SetupStore("OSDHeight", femonConfig.osdheight); - SetupStore("OSDOffset", femonConfig.osdoffset); SetupStore("RedLimit", femonConfig.redlimit); SetupStore("GreenLimit", femonConfig.greenlimit); SetupStore("UpdateInterval", femonConfig.updateinterval); diff --git a/femoncfg.c b/femoncfg.c index 9c629af..02f1d0b 100644 --- a/femoncfg.c +++ b/femoncfg.c @@ -22,8 +22,6 @@ cFemonConfig::cFemonConfig(void) updateinterval = 5; analyzestream = 1; calcinterval = 20; - osdheight = 480; - osdoffset = 0; usesvdrp = 0; svdrpport = 2001; strncpy(svdrpip, "0.0.0.0", sizeof(svdrpip)); diff --git a/femoncfg.h b/femoncfg.h index b90cf09..13647e2 100644 --- a/femoncfg.h +++ b/femoncfg.h @@ -33,8 +33,6 @@ public: int updateinterval; int analyzestream; int calcinterval; - int osdheight; - int osdoffset; int usesvdrp; int svdrpport; char svdrpip[MaxSvdrpIp + 1]; // must end with additional null diff --git a/femonosd.c b/femonosd.c index 624d32a..aa23456 100644 --- a/femonosd.c +++ b/femonosd.c @@ -6,6 +6,7 @@ */ #include +#include #include "femoncfg.h" #include "femonreceiver.h" #include "femontools.h" @@ -15,19 +16,27 @@ #define CHANNELINPUT_TIMEOUT 1000 #define SVDRPPLUGIN "svdrpservice" -#define OSDHEIGHT femonConfig.osdheight // in pixels -#define OSDWIDTH 600 // in pixels +#define OSDWIDTH m_OsdWidth // in pixels +#define OSDHEIGHT m_OsdHeight // in pixels #define OSDROWHEIGHT m_Font->Height() // in pixels #define OSDINFOHEIGHT (OSDROWHEIGHT * 13) // in pixels (13 rows) #define OSDSTATUSHEIGHT (OSDROWHEIGHT * 6) // in pixels (6 rows) #define OSDSPACING 5 #define OSDROUNDING 10 #define IS_OSDROUNDING (femonConfig.skin == eFemonSkinElchi) - #define OSDINFOWIN_Y(offset) (femonConfig.position ? (OSDHEIGHT - OSDINFOHEIGHT + offset) : offset) -#define OSDINFOWIN_X(col) ((col == 4) ? 455 : (col == 3) ? 305 : (col == 2) ? 155 : 15) +#define OSDINFOWIN_X(col) ((col == 4) ? int(round(OSDWIDTH * 0.76)) : \ + (col == 3) ? int(round(OSDWIDTH * 0.51)) : \ + (col == 2) ? int(round(OSDWIDTH * 0.26)) : \ + int(round(OSDWIDTH * 0.025))) #define OSDSTATUSWIN_Y(offset) (femonConfig.position ? offset : (OSDHEIGHT - OSDSTATUSHEIGHT + offset)) -#define OSDSTATUSWIN_X(col) ((col == 7) ? 475 : (col == 6) ? 410 : (col == 5) ? 275 : (col == 4) ? 220 : (col == 3) ? 125 : (col == 2) ? 70 : 15) +#define OSDSTATUSWIN_X(col) ((col == 7) ? int(round(OSDWIDTH * 0.79)) : \ + (col == 6) ? int(round(OSDWIDTH * 0.68)) : \ + (col == 5) ? int(round(OSDWIDTH * 0.46)) : \ + (col == 4) ? int(round(OSDWIDTH * 0.37)) : \ + (col == 3) ? int(round(OSDWIDTH * 0.21)) : \ + (col == 2) ? int(round(OSDWIDTH * 0.12)) : \ + int(round(OSDWIDTH * 0.025))) #define OSDSTATUSWIN_XSYMBOL(c,w) (c * ((OSDWIDTH - (5 * w)) / 6) + ((c - 1) * w)) #define OSDBARWIDTH(x) (OSDWIDTH * x / 100) @@ -160,10 +169,13 @@ cFemonOsd::cFemonOsd() m_BER(0), m_UNC(0), m_DisplayMode(femonConfig.displaymode), + m_OsdWidth(cOsd::OsdWidth()), + m_OsdHeight(cOsd::OsdHeight()), m_InputTime(0), m_Sleep(), m_Mutex() { + int tmp; Dprintf("%s()\n", __PRETTY_FUNCTION__); m_SvdrpConnection.handle = -1; m_Font = cFont::CreateFont(Setup.FontSml, min(max(Setup.FontSmlSize, MINFONTSIZE), MAXFONTSIZE)); @@ -171,8 +183,16 @@ cFemonOsd::cFemonOsd() m_Font = new cFemonDummyFont; esyslog("ERROR: cFemonOsd::cFemonOsd() cannot create required font."); } - if (OSDHEIGHT < (OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT)) - OSDHEIGHT = (OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT); + tmp = 5 * bmSymbol[SYMBOL_LOCK].Width() + 6 * OSDSPACING; + if (OSDWIDTH < tmp) { + esyslog("ERROR: cFemonOsd::cFemonOsd() OSD width (%d) smaller than required (%d).", OSDWIDTH, tmp); + OSDWIDTH = tmp; + } + tmp = OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT; + if (OSDHEIGHT < tmp) { + esyslog("ERROR: cFemonOsd::cFemonOsd() OSD height (%d) smaller than required (%d).", OSDHEIGHT, tmp); + OSDHEIGHT = tmp; + } } cFemonOsd::~cFemonOsd(void) @@ -532,7 +552,7 @@ void cFemonOsd::Show(void) return; } - m_Osd = cOsdProvider::NewOsd(((cOsd::OsdWidth() - OSDWIDTH) / 2) + cOsd::OsdLeft() + femonConfig.osdoffset, ((cOsd::OsdHeight() - OSDHEIGHT) / 2) + cOsd::OsdTop()); + m_Osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop()); if (m_Osd) { tArea Areas1[] = { { 0, 0, OSDWIDTH - 1, OSDHEIGHT - 1, 8 } }; if (Setup.AntiAlias && m_Osd->CanHandleAreas(Areas1, sizeof(Areas1) / sizeof(tArea)) == oeOk) { diff --git a/femonosd.h b/femonosd.h index 4d0d1fa..0bc7120 100644 --- a/femonosd.h +++ b/femonosd.h @@ -43,6 +43,8 @@ private: uint32_t m_UNC; fe_status_t m_FrontendStatus; int m_DisplayMode; + int m_OsdWidth; + int m_OsdHeight; cFont *m_Font; cTimeMs m_InputTime; cCondWait m_Sleep; diff --git a/po/de_DE.po b/po/de_DE.po index 511f5a0..5c914d8 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: femon 1.7.0\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2008-12-16 12:08+0200\n" +"POT-Creation-Date: 2009-07-08 02:42+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n" "Last-Translator: Christian Wieninger\n" "Language-Team: \n" @@ -89,15 +89,6 @@ msgstr "Position" msgid "Define the position of OSD." msgstr "" -msgid "Define the height of OSD." -msgstr "" - -msgid "Horizontal offset" -msgstr "Horizontaler Offset" - -msgid "Define the horizontal offset of OSD." -msgstr "" - msgid "Red limit [%]" msgstr "Grenze Rot [%]" diff --git a/po/es_ES.po b/po/es_ES.po index 3da044d..7f058b5 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: femon 1.7.0\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2008-12-16 12:08+0200\n" +"POT-Creation-Date: 2009-07-08 02:42+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n" "Last-Translator: Luis Palacios\n" "Language-Team: \n" @@ -87,15 +87,6 @@ msgstr "Posici msgid "Define the position of OSD." msgstr "" -msgid "Define the height of OSD." -msgstr "" - -msgid "Horizontal offset" -msgstr "Desplazamiento horizontal" - -msgid "Define the horizontal offset of OSD." -msgstr "" - msgid "Red limit [%]" msgstr "Límite de rojo [%s]" diff --git a/po/et_EE.po b/po/et_EE.po index 09f5f11..690df18 100644 --- a/po/et_EE.po +++ b/po/et_EE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: femon 1.7.0\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2008-12-16 12:08+0200\n" +"POT-Creation-Date: 2009-07-08 02:42+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n" "Last-Translator: Arthur Konovalov\n" "Language-Team: \n" @@ -87,15 +87,6 @@ msgstr "Positsioon" msgid "Define the position of OSD." msgstr "" -msgid "Define the height of OSD." -msgstr "" - -msgid "Horizontal offset" -msgstr "Horisontaalne nihe" - -msgid "Define the horizontal offset of OSD." -msgstr "" - msgid "Red limit [%]" msgstr "Punase limiit [%]" diff --git a/po/fi_FI.po b/po/fi_FI.po index 7c86e57..797feca 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: femon 1.7.0\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2008-12-16 12:08+0200\n" +"POT-Creation-Date: 2009-07-08 02:42+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: \n" @@ -87,15 +87,6 @@ msgstr "Sijainti" msgid "Define the position of OSD." msgstr "Määrittele näytön sijainti." -msgid "Define the height of OSD." -msgstr "Määrittele näytön korkeus." - -msgid "Horizontal offset" -msgstr "Vaakakeskitys" - -msgid "Define the horizontal offset of OSD." -msgstr "Määrittele näytön vaakakeskitys." - msgid "Red limit [%]" msgstr "Punaisen taso [%]" diff --git a/po/fr_FR.po b/po/fr_FR.po index 8708326..349b229 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: femon 1.7.0\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2008-12-16 12:08+0200\n" +"POT-Creation-Date: 2009-07-08 02:42+0300\n" "PO-Revision-Date: 2008-01-26 09:59+0100\n" "Last-Translator: NIVAL Michaël \n" "Language-Team: \n" @@ -87,15 +87,6 @@ msgstr "Position" msgid "Define the position of OSD." msgstr "Définit la position de l'OSD." -msgid "Define the height of OSD." -msgstr "Définit l'hauteur de l'OSD." - -msgid "Horizontal offset" -msgstr "Déplacement horizontal" - -msgid "Define the horizontal offset of OSD." -msgstr "Définit le déplacement horizontal de l'OSD." - msgid "Red limit [%]" msgstr "Limite du rouge (%)" diff --git a/po/it_IT.po b/po/it_IT.po index aa44359..4d36b25 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: femon 1.7.0\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2008-12-16 12:08+0200\n" +"POT-Creation-Date: 2009-07-08 02:42+0300\n" "PO-Revision-Date: 2008-11-10 23:37+0100\n" "Last-Translator: Diego Pierotto \n" "Language-Team: \n" @@ -88,15 +88,6 @@ msgstr "Posizione" msgid "Define the position of OSD." msgstr "Definisci la posizione dell'OSD." -msgid "Define the height of OSD." -msgstr "Definisci l'altezza dell'OSD." - -msgid "Horizontal offset" -msgstr "Limite orizzontale" - -msgid "Define the horizontal offset of OSD." -msgstr "Definisci il limite orizzontale dell'OSD." - msgid "Red limit [%]" msgstr "Limite rosso [%]" diff --git a/po/ru_RU.po b/po/ru_RU.po index 3206caa..c7cdd39 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: femon 1.7.0\n" "Report-Msgid-Bugs-To: Rolf Ahrenberg\n" -"POT-Creation-Date: 2008-12-16 12:08+0200\n" +"POT-Creation-Date: 2009-07-08 02:42+0300\n" "PO-Revision-Date: 2007-08-12 23:22+0300\n" "Last-Translator: Vyacheslav Dikonov\n" "Language-Team: \n" @@ -87,15 +87,6 @@ msgstr " msgid "Define the position of OSD." msgstr "" -msgid "Define the height of OSD." -msgstr "" - -msgid "Horizontal offset" -msgstr "" - -msgid "Define the horizontal offset of OSD." -msgstr "" - msgid "Red limit [%]" msgstr "ºàÐáÝÐï ×ÞÝÐ áÛÐÑÞÓÞ áØÓÝÐÛÐ ÔÞ (%)"