1
0
mirror of https://github.com/rofafor/vdr-plugin-femon.git synced 2023-10-10 13:36:53 +02:00

Removed OSD offset and height options.

This commit is contained in:
Rolf Ahrenberg 2009-07-08 23:14:19 +03:00
parent 6086c135c7
commit 2e6a236a56
14 changed files with 44 additions and 96 deletions

View File

@ -364,3 +364,7 @@ VDR Plugin 'femon' Revision History
- Cleaned up compilation warnings. - Cleaned up compilation warnings.
- Fixed font handling to be thread-safe. - Fixed font handling to be thread-safe.
2009-07-xx: Version 1.7.3
- Removed OSD offset and height options.

5
README
View File

@ -110,9 +110,8 @@ Notes:
specifications those values cannot be calculated into any real units. 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 - 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 small. Please, try to adjust the variable on the OSD setup page before
any bug reports. NTSC users should use a shrinked default OSD height by writing any bug reports.
modifying VDR's setup.conf: femon.OSDHeight = 420
- If the SVDRP service is used: femon won't notice if the server is tuned - 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 to a different channel and tuning the channel on the server might annoy

12
femon.c
View File

@ -18,7 +18,7 @@
#error "VDR-1.7.0 API version or greater is required!" #error "VDR-1.7.0 API version or greater is required!"
#endif #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 DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)");
static const char MAINMENUENTRY[] = trNOOP("Signal Information"); 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); if (!strcasecmp(Name, "HideMenu")) femonConfig.hidemenu = atoi(Value);
else if (!strcasecmp(Name, "DisplayMode")) femonConfig.displaymode = atoi(Value); else if (!strcasecmp(Name, "DisplayMode")) femonConfig.displaymode = atoi(Value);
else if (!strcasecmp(Name, "Position")) femonConfig.position = 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, "Skin")) femonConfig.skin = atoi(Value);
else if (!strcasecmp(Name, "Theme")) femonConfig.theme = atoi(Value); else if (!strcasecmp(Name, "Theme")) femonConfig.theme = atoi(Value);
else if (!strcasecmp(Name, "RedLimit")) femonConfig.redlimit = 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"))); Add(new cMenuEditBoolItem(tr("Position"), &data.position, trVDR("bottom"), trVDR("top")));
help.Append(tr("Define the position of OSD.")); 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)); 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.")); 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("Skin", femonConfig.skin);
SetupStore("Theme", femonConfig.theme); SetupStore("Theme", femonConfig.theme);
SetupStore("Position", femonConfig.position); SetupStore("Position", femonConfig.position);
SetupStore("OSDHeight", femonConfig.osdheight);
SetupStore("OSDOffset", femonConfig.osdoffset);
SetupStore("RedLimit", femonConfig.redlimit); SetupStore("RedLimit", femonConfig.redlimit);
SetupStore("GreenLimit", femonConfig.greenlimit); SetupStore("GreenLimit", femonConfig.greenlimit);
SetupStore("UpdateInterval", femonConfig.updateinterval); SetupStore("UpdateInterval", femonConfig.updateinterval);

View File

@ -22,8 +22,6 @@ cFemonConfig::cFemonConfig(void)
updateinterval = 5; updateinterval = 5;
analyzestream = 1; analyzestream = 1;
calcinterval = 20; calcinterval = 20;
osdheight = 480;
osdoffset = 0;
usesvdrp = 0; usesvdrp = 0;
svdrpport = 2001; svdrpport = 2001;
strncpy(svdrpip, "0.0.0.0", sizeof(svdrpip)); strncpy(svdrpip, "0.0.0.0", sizeof(svdrpip));

View File

@ -33,8 +33,6 @@ public:
int updateinterval; int updateinterval;
int analyzestream; int analyzestream;
int calcinterval; int calcinterval;
int osdheight;
int osdoffset;
int usesvdrp; int usesvdrp;
int svdrpport; int svdrpport;
char svdrpip[MaxSvdrpIp + 1]; // must end with additional null char svdrpip[MaxSvdrpIp + 1]; // must end with additional null

View File

@ -6,6 +6,7 @@
*/ */
#include <ctype.h> #include <ctype.h>
#include <math.h>
#include "femoncfg.h" #include "femoncfg.h"
#include "femonreceiver.h" #include "femonreceiver.h"
#include "femontools.h" #include "femontools.h"
@ -15,19 +16,27 @@
#define CHANNELINPUT_TIMEOUT 1000 #define CHANNELINPUT_TIMEOUT 1000
#define SVDRPPLUGIN "svdrpservice" #define SVDRPPLUGIN "svdrpservice"
#define OSDHEIGHT femonConfig.osdheight // in pixels #define OSDWIDTH m_OsdWidth // in pixels
#define OSDWIDTH 600 // in pixels #define OSDHEIGHT m_OsdHeight // in pixels
#define OSDROWHEIGHT m_Font->Height() // in pixels #define OSDROWHEIGHT m_Font->Height() // in pixels
#define OSDINFOHEIGHT (OSDROWHEIGHT * 13) // in pixels (13 rows) #define OSDINFOHEIGHT (OSDROWHEIGHT * 13) // in pixels (13 rows)
#define OSDSTATUSHEIGHT (OSDROWHEIGHT * 6) // in pixels (6 rows) #define OSDSTATUSHEIGHT (OSDROWHEIGHT * 6) // in pixels (6 rows)
#define OSDSPACING 5 #define OSDSPACING 5
#define OSDROUNDING 10 #define OSDROUNDING 10
#define IS_OSDROUNDING (femonConfig.skin == eFemonSkinElchi) #define IS_OSDROUNDING (femonConfig.skin == eFemonSkinElchi)
#define OSDINFOWIN_Y(offset) (femonConfig.position ? (OSDHEIGHT - OSDINFOHEIGHT + offset) : offset) #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_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 OSDSTATUSWIN_XSYMBOL(c,w) (c * ((OSDWIDTH - (5 * w)) / 6) + ((c - 1) * w))
#define OSDBARWIDTH(x) (OSDWIDTH * x / 100) #define OSDBARWIDTH(x) (OSDWIDTH * x / 100)
@ -160,10 +169,13 @@ cFemonOsd::cFemonOsd()
m_BER(0), m_BER(0),
m_UNC(0), m_UNC(0),
m_DisplayMode(femonConfig.displaymode), m_DisplayMode(femonConfig.displaymode),
m_OsdWidth(cOsd::OsdWidth()),
m_OsdHeight(cOsd::OsdHeight()),
m_InputTime(0), m_InputTime(0),
m_Sleep(), m_Sleep(),
m_Mutex() m_Mutex()
{ {
int tmp;
Dprintf("%s()\n", __PRETTY_FUNCTION__); Dprintf("%s()\n", __PRETTY_FUNCTION__);
m_SvdrpConnection.handle = -1; m_SvdrpConnection.handle = -1;
m_Font = cFont::CreateFont(Setup.FontSml, min(max(Setup.FontSmlSize, MINFONTSIZE), MAXFONTSIZE)); m_Font = cFont::CreateFont(Setup.FontSml, min(max(Setup.FontSmlSize, MINFONTSIZE), MAXFONTSIZE));
@ -171,8 +183,16 @@ cFemonOsd::cFemonOsd()
m_Font = new cFemonDummyFont; m_Font = new cFemonDummyFont;
esyslog("ERROR: cFemonOsd::cFemonOsd() cannot create required font."); esyslog("ERROR: cFemonOsd::cFemonOsd() cannot create required font.");
} }
if (OSDHEIGHT < (OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT)) tmp = 5 * bmSymbol[SYMBOL_LOCK].Width() + 6 * OSDSPACING;
OSDHEIGHT = (OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT); 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) cFemonOsd::~cFemonOsd(void)
@ -532,7 +552,7 @@ void cFemonOsd::Show(void)
return; 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) { if (m_Osd) {
tArea Areas1[] = { { 0, 0, OSDWIDTH - 1, OSDHEIGHT - 1, 8 } }; tArea Areas1[] = { { 0, 0, OSDWIDTH - 1, OSDHEIGHT - 1, 8 } };
if (Setup.AntiAlias && m_Osd->CanHandleAreas(Areas1, sizeof(Areas1) / sizeof(tArea)) == oeOk) { if (Setup.AntiAlias && m_Osd->CanHandleAreas(Areas1, sizeof(Areas1) / sizeof(tArea)) == oeOk) {

View File

@ -43,6 +43,8 @@ private:
uint32_t m_UNC; uint32_t m_UNC;
fe_status_t m_FrontendStatus; fe_status_t m_FrontendStatus;
int m_DisplayMode; int m_DisplayMode;
int m_OsdWidth;
int m_OsdHeight;
cFont *m_Font; cFont *m_Font;
cTimeMs m_InputTime; cTimeMs m_InputTime;
cCondWait m_Sleep; cCondWait m_Sleep;

View File

@ -9,7 +9,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: femon 1.7.0\n" "Project-Id-Version: femon 1.7.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Christian Wieninger\n" "Last-Translator: Christian Wieninger\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -89,15 +89,6 @@ msgstr "Position"
msgid "Define the position of OSD." msgid "Define the position of OSD."
msgstr "" 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 [%]" msgid "Red limit [%]"
msgstr "Grenze Rot [%]" msgstr "Grenze Rot [%]"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: femon 1.7.0\n" "Project-Id-Version: femon 1.7.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Luis Palacios\n" "Last-Translator: Luis Palacios\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -87,15 +87,6 @@ msgstr "Posici
msgid "Define the position of OSD." msgid "Define the position of OSD."
msgstr "" 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 [%]" msgid "Red limit [%]"
msgstr "Límite de rojo [%s]" msgstr "Límite de rojo [%s]"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: femon 1.7.0\n" "Project-Id-Version: femon 1.7.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Arthur Konovalov\n" "Last-Translator: Arthur Konovalov\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -87,15 +87,6 @@ msgstr "Positsioon"
msgid "Define the position of OSD." msgid "Define the position of OSD."
msgstr "" 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 [%]" msgid "Red limit [%]"
msgstr "Punase limiit [%]" msgstr "Punase limiit [%]"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: femon 1.7.0\n" "Project-Id-Version: femon 1.7.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Rolf Ahrenberg\n" "Last-Translator: Rolf Ahrenberg\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -87,15 +87,6 @@ msgstr "Sijainti"
msgid "Define the position of OSD." msgid "Define the position of OSD."
msgstr "Määrittele näytön sijainti." 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 [%]" msgid "Red limit [%]"
msgstr "Punaisen taso [%]" msgstr "Punaisen taso [%]"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: femon 1.7.0\n" "Project-Id-Version: femon 1.7.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2008-01-26 09:59+0100\n"
"Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n" "Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -87,15 +87,6 @@ msgstr "Position"
msgid "Define the position of OSD." msgid "Define the position of OSD."
msgstr "Définit la position de l'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 [%]" msgid "Red limit [%]"
msgstr "Limite du rouge (%)" msgstr "Limite du rouge (%)"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: femon 1.7.0\n" "Project-Id-Version: femon 1.7.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2008-11-10 23:37+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -88,15 +88,6 @@ msgstr "Posizione"
msgid "Define the position of OSD." msgid "Define the position of OSD."
msgstr "Definisci la posizione dell'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 [%]" msgid "Red limit [%]"
msgstr "Limite rosso [%]" msgstr "Limite rosso [%]"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: femon 1.7.0\n" "Project-Id-Version: femon 1.7.0\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\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" "PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Vyacheslav Dikonov\n" "Last-Translator: Vyacheslav Dikonov\n"
"Language-Team: <vdr@linuxtv.org>\n" "Language-Team: <vdr@linuxtv.org>\n"
@ -87,15 +87,6 @@ msgstr "
msgid "Define the position of OSD." msgid "Define the position of OSD."
msgstr "" msgstr ""
msgid "Define the height of OSD."
msgstr ""
msgid "Horizontal offset"
msgstr ""
msgid "Define the horizontal offset of OSD."
msgstr ""
msgid "Red limit [%]" msgid "Red limit [%]"
msgstr "ºàÐáÝÐï ×ÞÝÐ áÛÐÑÞÓÞ áØÓÝÐÛÐ ÔÞ (%)" msgstr "ºàÐáÝÐï ×ÞÝÐ áÛÐÑÞÓÞ áØÓÝÐÛÐ ÔÞ (%)"