From 8e53fa85215f384584bf45b857b5d2bd8640747b Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Wed, 18 Aug 2004 04:20:00 +0300 Subject: [PATCH] Fixed OSDSTATUSWIN_XC define. Added preliminary NTSC support (make NTSC_SYSTEM=1 plugins). Fixed "Setup/OSD/Use Small Fonts" bug (Thanks to Winni for reporting this one). Added patches directory: CA system names by Lauri Tischler. --- HISTORY | 7 +++++ Makefile | 4 +++ README | 9 ++++++- femon.h | 2 +- femonosd.c | 21 ++++++++++----- patches/ca_system_names.diff | 52 ++++++++++++++++++++++++++++++++++++ 6 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 patches/ca_system_names.diff diff --git a/HISTORY b/HISTORY index c6a96a6..5d07acd 100644 --- a/HISTORY +++ b/HISTORY @@ -87,3 +87,10 @@ VDR Plugin 'femon' Revision History - Added some new symbols and beautified the old ones. - Added audio track selection feature. - Added preliminary device switching feature (disabled at the moment). + +2004-08-18: Version 0.1.5 + +- Fixed OSDSTATUSWIN_XC define. +- Added preliminary NTSC support (make NTSC_SYSTEM=1 plugins). +- Fixed "Setup/OSD/Use Small Fonts" bug (Thanks to Winni for reporting this one). +- Added patches directory: CA system names by Lauri Tischler. diff --git a/Makefile b/Makefile index 5e74e03..7bc6397 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,10 @@ INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +ifdef NTSC_SYSTEM +DEFINES += -DNTSC_SYSTEM +endif + ### The object files (add further files here): OBJS = femon.o femonosd.o femonreceiver.o femoncfg.o femoni18n.o diff --git a/README b/README index f42429c..27e1067 100644 --- a/README +++ b/README @@ -31,7 +31,7 @@ Terminology: -------------------------------------------------------------- |## Channel Name ######################### [DD][AR][VF][A][D]| -|[=====Signal Strength in % =============|=================]| +|[=====Signal Strength in % ==============|=================]| |[=====Signal-to-Noise Ratio in % ========|=================]| | STR: #0000 (0%) BER: #00000000 Video: 0 Mbit/s | | SNR: #0000 (0%) UNC: #00000000 Audio: 0 kbit/s | @@ -86,3 +86,10 @@ Notes: ttxtsubs, but closing and reopening the femon plugin might help temporarily as well. Btw., this same thing happens with OSDTeletext plugin too :) - Disable the stream analyze to speed up heavy zapping sessions. +- The signal strength and signal-to-noise ratio values are comparable only + between the same brand/model frontends. Due to a lack of proper frontend + specifications those values cannot be calculated into any real unit. +- Shrinked OSD is available for NTSC users: make NTSC_SYSTEM=1 +- The device switching feature is still non-functional. + +"Femon - A real womon who lives according to her natural feminine inclinations." diff --git a/femon.h b/femon.h index 505a961..f74c3a2 100644 --- a/femon.h +++ b/femon.h @@ -11,7 +11,7 @@ #include -static const char *VERSION = "0.1.4"; +static const char *VERSION = "0.1.5"; static const char *DESCRIPTION = "DVB Signal Information Monitor (OSD)"; static const char *MAINMENUENTRY = "Signal Information"; diff --git a/femonosd.c b/femonosd.c index 59a345e..3818f8b 100644 --- a/femonosd.c +++ b/femonosd.c @@ -31,10 +31,12 @@ #define FRONTEND_DEVICE "/dev/dvb/adapter%d/frontend%d" #define CHANNELINPUT_TIMEOUT 1000 -#define SCREENWIDTH 720 // in pixels -#define SCREENHEIGHT 576 // in pixels -#define OSDWIDTH 600 // in pixels +#ifdef NTSC_SYSTEM +#define OSDHEIGHT 420 // in pixels +#else #define OSDHEIGHT 480 // in pixels +#endif +#define OSDWIDTH 600 // in pixels #define OSDINFOHEIGHT (m_Font->Height() * 11) // in pixels (11 rows) #define OSDSTATUSHEIGHT (m_Font->Height() * 6) // in pixels (6 rows) @@ -42,7 +44,7 @@ #define OSDINFOWIN_X(col) ((col == 4) ? 470 : (col == 3) ? 300 : (col==2) ? 180 : 15) #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_XC(col,txt) (((col - 1) * SCREENWIDTH / 6) + ((SCREENWIDTH / 6 - m_Font->Width(txt)) / 2)) +#define OSDSTATUSWIN_XC(col,txt) (((col - 1) * OSDWIDTH / 5) + ((OSDWIDTH / 5 - m_Font->Width(txt)) / 2)) #define BARWIDTH(x) (OSDWIDTH * x / 100) #define SPACING 5 @@ -80,8 +82,15 @@ cFemonOsd::cFemonOsd(void) m_BER = 0; m_UNC = 0; m_DisplayMode = femonConfig.displaymode; - m_Font = cFont::GetFont(fontSml); m_Mutex = new cMutex(); + if (Setup.UseSmallFont == 0) { + // Dirty hack to force the small fonts... + Setup.UseSmallFont = 1; + m_Font = cFont::GetFont(fontSml); + Setup.UseSmallFont = 0; + } + else + m_Font = cFont::GetFont(fontSml); } cFemonOsd::~cFemonOsd(void) @@ -311,7 +320,7 @@ void cFemonOsd::DrawInfoWindow(void) m_Osd->DrawText(OSDINFOWIN_X(4), OSDINFOWIN_Y(offset), buf, clrYellow, clrBackground, m_Font); offset += m_Font->Height(); m_Osd->DrawText(OSDINFOWIN_X(1), OSDINFOWIN_Y(offset), tr("CA"), clrWhite, clrBackground, m_Font); - snprintf(buf, sizeof(buf), "%d", channel->Ca()); + snprintf(buf, sizeof(buf), "%X", channel->Ca()); m_Osd->DrawText(OSDINFOWIN_X(2), OSDINFOWIN_Y(offset), buf, clrYellow, clrBackground, m_Font); m_Osd->DrawText(OSDINFOWIN_X(3), OSDINFOWIN_Y(offset), tr("Tpid"), clrWhite, clrBackground, m_Font); snprintf(buf, sizeof(buf), "%d", channel->Tpid()); diff --git a/patches/ca_system_names.diff b/patches/ca_system_names.diff new file mode 100644 index 0000000..6bf4da1 --- /dev/null +++ b/patches/ca_system_names.diff @@ -0,0 +1,52 @@ +--- femonosd.c.orig 2004-08-19 19:42:32.000000000 +0300 ++++ femonosd.c 2004-08-19 20:02:31.000000000 +0300 +@@ -320,7 +320,48 @@ + m_Osd->DrawText(OSDINFOWIN_X(4), OSDINFOWIN_Y(offset), buf, clrYellow, clrBackground, m_Font); + offset += m_Font->Height(); + m_Osd->DrawText(OSDINFOWIN_X(1), OSDINFOWIN_Y(offset), tr("CA"), clrWhite, clrBackground, m_Font); +- snprintf(buf, sizeof(buf), "%X", channel->Ca()); ++ value = channel->Ca(); ++ switch (value >> 8) { ++ case 0x0: ++ if (value) ++ snprintf(buf, sizeof(buf), "%s", "Fixed"); ++ else ++ snprintf(buf, sizeof(buf), "%s", "Free to Air"); ++ break; ++ case 0x1: ++ snprintf(buf, sizeof(buf), "%s", "SECA/Mediaguard"); ++ break; ++ case 0x5: ++ snprintf(buf, sizeof(buf), "%s", "Viaccess"); ++ break; ++ case 0x6: ++ snprintf(buf, sizeof(buf), "%s", "Irdeto"); ++ break; ++ case 0x9: ++ snprintf(buf, sizeof(buf), "%s", "NDS/Videoguard"); ++ break; ++ case 0xB: ++ snprintf(buf, sizeof(buf), "%s", "Conax"); ++ break; ++ case 0xD: ++ snprintf(buf, sizeof(buf), "%s", "CryptoWorks"); ++ break; ++ case 0xE: ++ snprintf(buf, sizeof(buf), "%s", "PowerVu"); ++ break; ++ case 0x17: ++ snprintf(buf, sizeof(buf), "%s", "BetaCrypt"); ++ break; ++ case 0x18: ++ snprintf(buf, sizeof(buf), "%s", "NagraVision"); ++ break; ++ case 0x4A: ++ snprintf(buf, sizeof(buf), "%s", "SkyCrypt"); ++ break; ++ default: ++ snprintf(buf, sizeof(buf), "%X", value); ++ break; ++ } + m_Osd->DrawText(OSDINFOWIN_X(2), OSDINFOWIN_Y(offset), buf, clrYellow, clrBackground, m_Font); + m_Osd->DrawText(OSDINFOWIN_X(3), OSDINFOWIN_Y(offset), tr("Tpid"), clrWhite, clrBackground, m_Font); + snprintf(buf, sizeof(buf), "%d", channel->Tpid());