diff options
-rw-r--r-- | po/de_DE.po | 12 | ||||
-rw-r--r--[-rwxr-xr-x] | po/it_IT.po | 11 | ||||
-rw-r--r-- | setup.c | 53 | ||||
-rw-r--r-- | setup.h | 9 | ||||
-rw-r--r-- | vfd.c | 4 | ||||
-rw-r--r-- | vfd.h | 2 | ||||
-rw-r--r-- | watch.c | 12 | ||||
-rw-r--r-- | watch.h | 2 |
8 files changed, 59 insertions, 46 deletions
diff --git a/po/de_DE.po b/po/de_DE.po index eb504b8..e616ed9 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-targavfd-plugin 0.0.5\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2010-07-12 16:56+0200\n" +"POT-Creation-Date: 2010-10-09 18:56+0200\n" "PO-Revision-Date: 2010-07-02 21:25+0200\n" "Last-Translator: Andreas Brachold <vdr07 AT deltab de>\n" "Language-Team: Andreas Brachold <vdr07 AT deltab de>\n" @@ -30,15 +30,18 @@ msgstr "Volle Helligkeit" msgid "Brightness" msgstr "Helligkeit" -msgid "Render mode" -msgstr "Anzeigemodus" - msgid "Single line" msgstr "Einzelne Zeile" msgid "Dual lines" msgstr "Zwei Zeilen" +msgid "Only topic" +msgstr "Nur Titel" + +msgid "Render mode" +msgstr "Anzeigemodus" + msgid "Default font" msgstr "Zeichensatz" @@ -86,3 +89,4 @@ msgstr "Kein aktiver Timer" msgid "Unknown title" msgstr "Unbekannter Titel" + diff --git a/po/it_IT.po b/po/it_IT.po index 8d58300..b62314a 100755..100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-targavfd-plugin 0.0.5\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2010-07-12 17:19+0200\n" +"POT-Creation-Date: 2010-10-09 18:56+0200\n" "PO-Revision-Date: 2010-07-17 23:32+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: \n" @@ -33,15 +33,18 @@ msgstr "Luminosità piena" msgid "Brightness" msgstr "Luminosità" -msgid "Render mode" -msgstr "Modalità visualizzazione" - msgid "Single line" msgstr "Linea singola" msgid "Dual lines" msgstr "Linee doppie" +msgid "Only topic" +msgstr "Titolo solo" + +msgid "Render mode" +msgstr "Modalità visualizzazione" + msgid "Default font" msgstr "Carattere predefinito" @@ -28,7 +28,7 @@ #define DEFAULT_WIDTH 96 #define DEFAULT_HEIGHT 16 #define DEFAULT_FONT "Sans:Bold" -#define DEFAULT_TWO_LINE_MODE 0 +#define DEFAULT_TWO_LINE_MODE eRenderMode_SingleLine #define DEFAULT_BIG_FONT_HEIGHT 14 #define DEFAULT_SMALL_FONT_HEIGHT 7 #define DEFAULT_VOLUME_MODE eVolumeMode_ShowEver /**< Show the volume bar ever */ @@ -43,7 +43,7 @@ cVFDSetup::cVFDSetup(void) { m_nOnExit = DEFAULT_ON_EXIT; m_nBrightness = DEFAULT_BRIGHTNESS; - m_bTwoLineMode = DEFAULT_TWO_LINE_MODE; + m_nRenderMode = DEFAULT_TWO_LINE_MODE; m_nBigFontHeight = DEFAULT_BIG_FONT_HEIGHT; m_nSmallFontHeight = DEFAULT_SMALL_FONT_HEIGHT; m_nVolumeMode = DEFAULT_VOLUME_MODE; @@ -63,7 +63,7 @@ cVFDSetup& cVFDSetup::operator = (const cVFDSetup& x) m_nOnExit = x.m_nOnExit; m_nBrightness = x.m_nBrightness; - m_bTwoLineMode = x.m_bTwoLineMode; + m_nRenderMode = x.m_nRenderMode; m_nBigFontHeight = x.m_nBigFontHeight; m_nSmallFontHeight = x.m_nSmallFontHeight; @@ -81,7 +81,7 @@ bool cVFDSetup::SetupParse(const char *szName, const char *szValue) if(!strcasecmp(szName, "OnExit")) { int n = atoi(szValue); if ((n < eOnExitMode_SHOWMSG) || (n >= eOnExitMode_LASTITEM)) { - esyslog("targaVFD: OnExit must be between %d and %d; using default %d", + esyslog("targaVFD: OnExit must be between %d and %d, using default %d", eOnExitMode_SHOWMSG, eOnExitMode_LASTITEM, DEFAULT_ON_EXIT); n = DEFAULT_ON_EXIT; } @@ -93,7 +93,7 @@ bool cVFDSetup::SetupParse(const char *szName, const char *szValue) if(!strcasecmp(szName, "Brightness")) { int n = atoi(szValue); if ((n < 0) || (n > 2)) { - esyslog("targaVFD: Brightness must be between 0 and 2; using default %d", + esyslog("targaVFD: Brightness must be between 0 and 2, using default %d", DEFAULT_BRIGHTNESS); n = DEFAULT_BRIGHTNESS; } @@ -110,7 +110,7 @@ bool cVFDSetup::SetupParse(const char *szName, const char *szValue) return true; } } - esyslog("targaVFD: Font '%s' not found; using default %s", + esyslog("targaVFD: Font '%s' not found, using default %s", szValue, DEFAULT_FONT); strncpy(m_szFont,DEFAULT_FONT,sizeof(m_szFont)); return true; @@ -119,7 +119,7 @@ bool cVFDSetup::SetupParse(const char *szName, const char *szValue) if(!strcasecmp(szName, "BigFont")) { int n = atoi(szValue); if ((n < 5) || (n > 24)) { - esyslog("targaVFD: BigFont must be between 5 and 24; using default %d", + esyslog("targaVFD: BigFont must be between 5 and 24, using default %d", DEFAULT_BIG_FONT_HEIGHT); n = DEFAULT_BIG_FONT_HEIGHT; } @@ -130,7 +130,7 @@ bool cVFDSetup::SetupParse(const char *szName, const char *szValue) if(!strcasecmp(szName, "SmallFont")) { int n = atoi(szValue); if ((n < 5) || (n > 24)) { - esyslog("targaVFD: SmallFont must be between 5 and 24; using default %d", + esyslog("targaVFD: SmallFont must be between 5 and 24, using default %d", DEFAULT_SMALL_FONT_HEIGHT); n = DEFAULT_SMALL_FONT_HEIGHT; } @@ -141,18 +141,12 @@ bool cVFDSetup::SetupParse(const char *szName, const char *szValue) // Two Line Mode if(!strcasecmp(szName, "TwoLineMode")) { int n = atoi(szValue); - if ((n != 0) && (n != 1)) - { - esyslog("targaVFD: TwoLineMode must be 0 or 1. using default %d", - DEFAULT_TWO_LINE_MODE ); + if ((n < eRenderMode_SingleLine) || (n >= eRenderMode_LASTITEM)) { + esyslog("targaVFD: TwoLineMode must be between %d and %d, using default %d", + eRenderMode_SingleLine, eRenderMode_LASTITEM, DEFAULT_TWO_LINE_MODE ); n = DEFAULT_TWO_LINE_MODE; } - - if (n) { - m_bTwoLineMode = 1; - } else { - m_bTwoLineMode = 0; - } + m_nRenderMode = n; return true; } @@ -160,7 +154,7 @@ bool cVFDSetup::SetupParse(const char *szName, const char *szValue) if(!strcasecmp(szName, "VolumeMode")) { int n = atoi(szValue); if ((n < eVolumeMode_ShowNever) || (n >= eVolumeMode_LASTITEM)) { - esyslog("targaVFD: VolumeMode must be between %d and %d; using default %d", + esyslog("targaVFD: VolumeMode must be between %d and %d, using default %d", eVolumeMode_ShowNever, eVolumeMode_LASTITEM, DEFAULT_VOLUME_MODE); n = DEFAULT_VOLUME_MODE; } @@ -183,7 +177,7 @@ void cVFDMenuSetup::Store(void) SetupStore("Font", theSetup.m_szFont); SetupStore("BigFont", theSetup.m_nBigFontHeight); SetupStore("SmallFont", theSetup.m_nSmallFontHeight); - SetupStore("TwoLineMode",theSetup.m_bTwoLineMode); + SetupStore("TwoLineMode",theSetup.m_nRenderMode); SetupStore("VolumeMode", theSetup.m_nVolumeMode); } @@ -206,9 +200,14 @@ cVFDMenuSetup::cVFDMenuSetup(cVFDWatch* pDev) &m_tmpSetup.m_nBrightness, memberof(szBrightness), szBrightness)); - Add(new cMenuEditBoolItem(tr("Render mode"), - &m_tmpSetup.m_bTwoLineMode, - tr("Single line"), tr("Dual lines"))); + static const char * szRenderMode[3]; + szRenderMode[eRenderMode_SingleLine] = tr("Single line"); + szRenderMode[eRenderMode_DualLine] = tr("Dual lines"); + szRenderMode[eRenderMode_SingleTopic] = tr("Only topic"); + + Add(new cMenuEditStraItem(tr("Render mode"), + &m_tmpSetup.m_nRenderMode, + memberof(szRenderMode), szRenderMode)); Add(new cMenuEditStraItem(tr("Default font"), &fontIndex, fontNames.Size(), &fontNames[0])); @@ -247,12 +246,12 @@ eOSState cVFDMenuSetup::ProcessKey(eKeys nKey) // Store edited Values Utf8Strn0Cpy(m_tmpSetup.m_szFont, fontNames[fontIndex], sizeof(m_tmpSetup.m_szFont)); if (0 != strcmp(m_tmpSetup.m_szFont, theSetup.m_szFont) - || m_tmpSetup.m_bTwoLineMode != theSetup.m_bTwoLineMode - || (!m_tmpSetup.m_bTwoLineMode && (m_tmpSetup.m_nBigFontHeight != theSetup.m_nBigFontHeight)) - || ( m_tmpSetup.m_bTwoLineMode && (m_tmpSetup.m_nSmallFontHeight != theSetup.m_nSmallFontHeight)) + || m_tmpSetup.m_nRenderMode != theSetup.m_nRenderMode + || ( m_tmpSetup.m_nRenderMode != eRenderMode_DualLine && (m_tmpSetup.m_nBigFontHeight != theSetup.m_nBigFontHeight)) + || ( m_tmpSetup.m_nRenderMode == eRenderMode_DualLine && (m_tmpSetup.m_nSmallFontHeight != theSetup.m_nSmallFontHeight)) ) { m_pDev->SetFont(m_tmpSetup.m_szFont, - m_tmpSetup.m_bTwoLineMode, + m_tmpSetup.m_nRenderMode == eRenderMode_DualLine ? true : false, m_tmpSetup.m_nBigFontHeight, m_tmpSetup.m_nSmallFontHeight); } @@ -33,6 +33,13 @@ enum eVolumeMode { ,eVolumeMode_LASTITEM }; +enum eRenderMode { + eRenderMode_SingleLine /**< Render screen at single line */ + ,eRenderMode_DualLine /**< Render screen at dual line */ + ,eRenderMode_SingleTopic /**< Render screen at single line, only names */ + ,eRenderMode_LASTITEM +}; + struct cVFDSetup { int m_nOnExit; @@ -46,7 +53,7 @@ struct cVFDSetup char m_szFont[256]; - int m_bTwoLineMode; /** enable two line mode */ + int m_nRenderMode; /** enable two line mode */ int m_nVolumeMode; @@ -261,7 +261,7 @@ cVFD::~cVFD() { bool cVFD::open() { if(!SetFont(theSetup.m_szFont, - theSetup.m_bTwoLineMode, + theSetup.m_nRenderMode == eRenderMode_DualLine, theSetup.m_nBigFontHeight, theSetup.m_nSmallFontHeight)) { return false; @@ -476,7 +476,7 @@ void cVFD::Brightness(int nBrightness) this->QueueData((byte) (nBrightness)); } -bool cVFD::SetFont(const char *szFont, int bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) { +bool cVFD::SetFont(const char *szFont, bool bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) { cVFDFont* tmpFont = NULL; @@ -92,7 +92,7 @@ public: bool flush (bool refreshAll = true); void icons(unsigned int state); - virtual bool SetFont(const char *szFont, int bTwoLineMode, int nBigFontHeight, int nSmallFontHeight); + virtual bool SetFont(const char *szFont, bool bTwoLineMode, int nBigFontHeight, int nSmallFontHeight); }; @@ -161,7 +161,7 @@ void cVFDWatch::close() { } int w = pFont->Width(topic); - if(theSetup.m_bTwoLineMode) { + if(theSetup.m_nRenderMode == eRenderMode_DualLine) { this->DrawText(0,0,topic); if((w + 3) < theSetup.m_cWidth) this->DrawText(w + 3,0,t->Channel()->Name()); @@ -227,7 +227,7 @@ void cVFDWatch::Action(void) time_t ts = time(NULL); // every second the clock need updates. - if (theSetup.m_bTwoLineMode) { + if (theSetup.m_nRenderMode == eRenderMode_DualLine) { if((0 == (nCnt % 2))) { bReDraw = CurrentTime(ts); if(m_eWatchMode != eLiveTV) { @@ -325,7 +325,7 @@ bool cVFDWatch::RenderScreen(bool bReDraw) { if(Program()) { bForce = true; } - if(chPresentTitle) { + if(chPresentTitle && theSetup.m_nRenderMode != eRenderMode_SingleTopic) { scRender = chPresentTitle; bAllowCurrentTime = true; } else { @@ -352,7 +352,7 @@ bool cVFDWatch::RenderScreen(bool bReDraw) { if(scRender) { int iRet = -1; - if(theSetup.m_bTwoLineMode) { + if(theSetup.m_nRenderMode == eRenderMode_DualLine) { iRet = this->DrawText(0 - m_nScrollOffset,pFont->Height(), *scRender); } else { int nTop = (theSetup.m_cHeight - pFont->Height())/2; @@ -384,7 +384,7 @@ bool cVFDWatch::RenderScreen(bool bReDraw) { } } - if(scHeader && theSetup.m_bTwoLineMode) { + if(scHeader && theSetup.m_nRenderMode == eRenderMode_DualLine) { if(bAllowCurrentTime && currentTime) { int t = pFont->Width(*currentTime); int w = pFont->Width(*scHeader); @@ -874,7 +874,7 @@ void cVFDWatch::OsdStatusMessage(const char *sz) } } -bool cVFDWatch::SetFont(const char *szFont, int bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) { +bool cVFDWatch::SetFont(const char *szFont, bool bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) { cMutexLooker m(mutex); if(cVFD::SetFont(szFont, bTwoLineMode, nBigFontHeight, nSmallFontHeight)) { m_bUpdateScreen = true; @@ -122,7 +122,7 @@ public: void OsdCurrentItem(const char *sz); void OsdStatusMessage(const char *sz); - virtual bool SetFont(const char *szFont, int bTwoLineMode, int nBigFontHeight, int nSmallFontHeight); + virtual bool SetFont(const char *szFont, bool bTwoLineMode, int nBigFontHeight, int nSmallFontHeight); eIconState ForceIcon(unsigned int nIcon, eIconState nState); }; |