summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--imon.c4
-rw-r--r--imon.h2
-rw-r--r--po/de_DE.po11
-rw-r--r--[-rwxr-xr-x]po/it_IT.po12
-rw-r--r--setup.c52
-rw-r--r--setup.h9
-rw-r--r--watch.c14
-rw-r--r--watch.h2
8 files changed, 59 insertions, 47 deletions
diff --git a/imon.c b/imon.c
index 92f71d1..d897d92 100644
--- a/imon.c
+++ b/imon.c
@@ -133,7 +133,7 @@ ciMonLCD::~ciMonLCD() {
int ciMonLCD::open(const char* szDevice, eProtocol pro)
{
if(!SetFont(theSetup.m_szFont,
- theSetup.m_bTwoLineMode,
+ theSetup.m_nRenderMode == eRenderMode_DualLine ? true : false,
theSetup.m_nBigFontHeight,
theSetup.m_nSmallFontHeight)) {
return -1;
@@ -639,7 +639,7 @@ int ciMonLCD::lengthToPixels(int length)
return (pixLen[32 + length] ^ 0xffffffff);
}
-bool ciMonLCD::SetFont(const char *szFont, int bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) {
+bool ciMonLCD::SetFont(const char *szFont, bool bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) {
ciMonFont* tmpFont = NULL;
diff --git a/imon.h b/imon.h
index 6a62034..06567a1 100644
--- a/imon.h
+++ b/imon.h
@@ -128,7 +128,7 @@ public:
bool flush ();
bool 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);
};
#endif
diff --git a/po/de_DE.po b/po/de_DE.po
index 5569c82..2c3e895 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-imonlcd-plugin 0.0.3\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2010-04-18 18:17+0200\n"
+"POT-Creation-Date: 2010-10-09 19:26+0200\n"
"PO-Revision-Date: 2010-04-18 18:21+0200\n"
"Last-Translator: Andreas Brachold <vdr07 AT deltab de>\n"
"Language-Team: Andreas Brachold <vdr07 AT deltab de>\n"
@@ -42,15 +42,18 @@ msgstr "Schlanke Scheibe"
msgid "Full disc"
msgstr "Volle Scheibe"
-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 "Do nothing"
msgstr "Nichts unternehmen"
diff --git a/po/it_IT.po b/po/it_IT.po
index a3eefd9..6b8bfe8 100755..100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-imonlcd-plugin 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2010-04-18 18:17+0200\n"
+"POT-Creation-Date: 2010-10-09 19:26+0200\n"
"PO-Revision-Date: 2010-08-09 20:18+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: \n"
@@ -45,15 +45,18 @@ msgstr "Disco leggero"
msgid "Full disc"
msgstr "Disco pieno"
-msgid "Render mode"
-msgstr "Modalità visione"
-
msgid "Single line"
msgstr "Linea singola"
msgid "Dual lines"
msgstr "Linee doppie"
+msgid "Only topic"
+msgstr "Titolo solo"
+
+msgid "Render mode"
+msgstr "Modalità visione"
+
msgid "Do nothing"
msgstr "Non fare nulla"
@@ -80,4 +83,3 @@ msgstr "Nessun timer attivo"
msgid "Unknown title"
msgstr "Titolo sconosciuto"
-
diff --git a/setup.c b/setup.c
index ad4e405..62480a1 100644
--- a/setup.c
+++ b/setup.c
@@ -30,7 +30,7 @@
#define DEFAULT_HEIGHT 16
#define DEFAULT_FONT "Sans:Bold"
#define DEFAULT_WAKEUP 5
-#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
@@ -48,7 +48,7 @@ cIMonSetup::cIMonSetup(void)
m_nHeight = DEFAULT_HEIGHT;
m_nWakeup = DEFAULT_WAKEUP;
- m_bTwoLineMode = DEFAULT_TWO_LINE_MODE;
+ m_nRenderMode = DEFAULT_TWO_LINE_MODE;
m_nBigFontHeight = DEFAULT_BIG_FONT_HEIGHT;
m_nSmallFontHeight = DEFAULT_SMALL_FONT_HEIGHT;
@@ -70,7 +70,7 @@ cIMonSetup& cIMonSetup::operator = (const cIMonSetup& x)
m_nHeight = x.m_nHeight;
m_nWakeup = x.m_nWakeup;
- m_bTwoLineMode = x.m_bTwoLineMode;
+ m_nRenderMode = x.m_nRenderMode;
m_nBigFontHeight = x.m_nBigFontHeight;
m_nSmallFontHeight = x.m_nSmallFontHeight;
@@ -121,7 +121,7 @@ bool cIMonSetup::SetupParse(const char *szName, const char *szValue)
if(!strcasecmp(szName, "Contrast")) {
int n = atoi(szValue);
if ((n < 0) || (n > 1000)) {
- esyslog("iMonLCD: Contrast must be between 0 and 1000; using default %d",
+ esyslog("iMonLCD: Contrast must be between 0 and 1000, using default %d",
DEFAULT_CONTRAST);
n = DEFAULT_CONTRAST;
}
@@ -138,7 +138,7 @@ bool cIMonSetup::SetupParse(const char *szName, const char *szValue)
return true;
}
}
- esyslog("iMonLCD: Font '%s' not found; using default %s",
+ esyslog("iMonLCD: Font '%s' not found, using default %s",
szValue, DEFAULT_FONT);
strncpy(m_szFont,DEFAULT_FONT,sizeof(m_szFont));
return true;
@@ -154,7 +154,7 @@ bool cIMonSetup::SetupParse(const char *szName, const char *szValue)
if(!strcasecmp(szName, "Wakeup")) {
int n = atoi(szValue);
if ((n < 0) || (n > 1440)) {
- esyslog("iMonLCD: Wakeup must be between 0 and 1440; using default %d",
+ esyslog("iMonLCD: Wakeup must be between 0 and 1440, using default %d",
DEFAULT_WAKEUP);
n = DEFAULT_WAKEUP;
}
@@ -165,7 +165,7 @@ bool cIMonSetup::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("iMonLCD: BigFont must be between 5 and 24, using default %d",
DEFAULT_BIG_FONT_HEIGHT);
n = DEFAULT_BIG_FONT_HEIGHT;
}
@@ -176,7 +176,7 @@ bool cIMonSetup::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("iMonLCD: SmallFont must be between 5 and 24, using default %d",
DEFAULT_SMALL_FONT_HEIGHT);
n = DEFAULT_SMALL_FONT_HEIGHT;
}
@@ -187,20 +187,15 @@ bool cIMonSetup::SetupParse(const char *szName, const char *szValue)
// Two Line Mode
if(!strcasecmp(szName, "TwoLineMode")) {
int n = atoi(szValue);
- if ((n != 0) && (n != 1))
- {
- esyslog("iMonLCD: TwoLineMode must be 0 or 1. using default %d",
- DEFAULT_TWO_LINE_MODE );
+ if ((n < eRenderMode_SingleLine) || (n >= eRenderMode_LASTITEM)) {
+ esyslog("iMonLCD: 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;
}
+
//Unknow parameter
return false;
}
@@ -220,7 +215,7 @@ void ciMonMenuSetup::Store(void)
SetupStore("BigFont", theSetup.m_nBigFontHeight);
SetupStore("SmallFont", theSetup.m_nSmallFontHeight);
SetupStore("Wakeup", theSetup.m_nWakeup);
- SetupStore("TwoLineMode",theSetup.m_bTwoLineMode);
+ SetupStore("TwoLineMode",theSetup.m_nRenderMode);
}
ciMonMenuSetup::ciMonMenuSetup(ciMonWatch* pDev)
@@ -250,9 +245,14 @@ ciMonMenuSetup::ciMonMenuSetup(ciMonWatch* pDev)
&m_tmpSetup.m_bDiscMode,
tr("Slim disc"), tr("Full disc")));
- 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));
static const char * szExitModes[eOnExitMode_LASTITEM];
szExitModes[eOnExitMode_SHOWMSG] = tr("Do nothing");
@@ -286,12 +286,12 @@ eOSState ciMonMenuSetup::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);
}
diff --git a/setup.h b/setup.h
index db3846b..993d806 100644
--- a/setup.h
+++ b/setup.h
@@ -26,6 +26,13 @@ enum eOnExitMode {
,eOnExitMode_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 cIMonSetup
{
int m_nOnExit;
@@ -41,7 +48,7 @@ struct cIMonSetup
char m_szFont[256];
int m_nWakeup;
- int m_bTwoLineMode; /** enable two line mode */
+ int m_nRenderMode; /** enable two line mode */
cIMonSetup(void);
cIMonSetup(const cIMonSetup& x);
diff --git a/watch.c b/watch.c
index f8118d0..a7f5e6f 100644
--- a/watch.c
+++ b/watch.c
@@ -163,7 +163,7 @@ void ciMonWatch::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_nWidth)
this->DrawText(w + 3,0,t->Channel()->Name());
@@ -250,14 +250,14 @@ void ciMonWatch::Action(void)
// every second the clock need updates.
if((0 == (nCnt % 5))) {
- if (theSetup.m_bTwoLineMode) {
+ if (theSetup.m_nRenderMode == eRenderMode_DualLine) {
bReDraw = CurrentTime();
}
if(m_eWatchMode != eLiveTV) {
current = 0;
total = 0;
if (ReplayPosition(current,total)
- && theSetup.m_bTwoLineMode) {
+ && theSetup.m_nRenderMode == eRenderMode_DualLine) {
bReDraw |= ReplayTime(current,total);
}
}
@@ -426,7 +426,7 @@ bool ciMonWatch::RenderScreen(bool bReDraw) {
if(Program()) {
bForce = true;
}
- if(chPresentTitle) {
+ if(chPresentTitle && theSetup.m_nRenderMode != eRenderMode_SingleTopic) {
scRender = chPresentTitle;
bAllowCurrentTime = true;
} else {
@@ -453,7 +453,7 @@ bool ciMonWatch::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_nHeight - pFont->Height())/2;
@@ -485,7 +485,7 @@ bool ciMonWatch::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);
@@ -997,7 +997,7 @@ void ciMonWatch::OsdStatusMessage(const char *sz)
}
}
-bool ciMonWatch::SetFont(const char *szFont, int bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) {
+bool ciMonWatch::SetFont(const char *szFont, bool bTwoLineMode, int nBigFontHeight, int nSmallFontHeight) {
cMutexLooker m(mutex);
if(ciMonLCD::SetFont(szFont, bTwoLineMode, nBigFontHeight, nSmallFontHeight)) {
m_bUpdateScreen = true;
diff --git a/watch.h b/watch.h
index a471b69..f84367a 100644
--- a/watch.h
+++ b/watch.h
@@ -149,7 +149,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);
};