summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--po/de_DE.po14
-rw-r--r--po/it_IT.po14
-rw-r--r--setup.c28
-rw-r--r--setup.h9
-rw-r--r--vfd.c85
-rw-r--r--watch.c82
-rw-r--r--watch.h4
7 files changed, 150 insertions, 86 deletions
diff --git a/po/de_DE.po b/po/de_DE.po
index c5cdfe4..6aaf59b 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-02 21:25+0200\n"
+"POT-Creation-Date: 2010-07-11 15:53+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"
@@ -63,6 +63,18 @@ msgstr "Nächsten Timer anzeigen"
msgid "Exit mode"
msgstr "Ende Modus"
+msgid "Never"
+msgstr "Nie"
+
+msgid "Timed"
+msgstr "Zeitlich"
+
+msgid "Ever"
+msgstr "Immer"
+
+msgid "Show volume bargraph"
+msgstr "Lautstärkebargraph anzeigen"
+
msgid "Control a targa vfd"
msgstr "Steuert ein Targa VFD"
diff --git a/po/it_IT.po b/po/it_IT.po
index 694df10..15fe1a7 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.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2010-07-02 21:25+0200\n"
+"POT-Creation-Date: 2010-07-11 15:53+0200\n"
"PO-Revision-Date: 2009-06-07 23:30+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: \n"
@@ -66,6 +66,18 @@ msgstr "Mostra prossimo timer"
msgid "Exit mode"
msgstr "Modalità d'uscita"
+msgid "Never"
+msgstr ""
+
+msgid "Timed"
+msgstr ""
+
+msgid "Ever"
+msgstr ""
+
+msgid "Show volume bargraph"
+msgstr ""
+
msgid "Control a targa vfd"
msgstr "Controlla un VFD targa"
diff --git a/setup.c b/setup.c
index 780f1c6..df6e868 100644
--- a/setup.c
+++ b/setup.c
@@ -31,6 +31,7 @@
#define DEFAULT_TWO_LINE_MODE 0
#define DEFAULT_BIG_FONT_HEIGHT 14
#define DEFAULT_SMALL_FONT_HEIGHT 7
+#define DEFAULT_VOLUME_MODE eVolumeMode_ShowEver /**< Show the volume bar ever */
/// The one and only Stored setup data
cVFDSetup theSetup;
@@ -45,6 +46,7 @@ cVFDSetup::cVFDSetup(void)
m_bTwoLineMode = DEFAULT_TWO_LINE_MODE;
m_nBigFontHeight = DEFAULT_BIG_FONT_HEIGHT;
m_nSmallFontHeight = DEFAULT_SMALL_FONT_HEIGHT;
+ m_nVolumeMode = DEFAULT_VOLUME_MODE;
strncpy(m_szFont,DEFAULT_FONT,sizeof(m_szFont));
}
@@ -65,6 +67,8 @@ cVFDSetup& cVFDSetup::operator = (const cVFDSetup& x)
m_nBigFontHeight = x.m_nBigFontHeight;
m_nSmallFontHeight = x.m_nSmallFontHeight;
+ m_nVolumeMode = x.m_nVolumeMode;
+
strncpy(m_szFont,x.m_szFont,sizeof(m_szFont));
return *this;
@@ -151,6 +155,19 @@ bool cVFDSetup::SetupParse(const char *szName, const char *szValue)
}
return true;
}
+
+ // VolumeMode
+ 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",
+ eVolumeMode_ShowNever, eVolumeMode_LASTITEM, DEFAULT_VOLUME_MODE);
+ n = DEFAULT_VOLUME_MODE;
+ }
+ m_nVolumeMode = n;
+ return true;
+ }
+
//Unknow parameter
return false;
}
@@ -167,6 +184,7 @@ void cVFDMenuSetup::Store(void)
SetupStore("BigFont", theSetup.m_nBigFontHeight);
SetupStore("SmallFont", theSetup.m_nSmallFontHeight);
SetupStore("TwoLineMode",theSetup.m_bTwoLineMode);
+ SetupStore("VolumeMode", theSetup.m_nVolumeMode);
}
cVFDMenuSetup::cVFDMenuSetup(cVFDWatch* pDev)
@@ -210,6 +228,16 @@ cVFDMenuSetup::cVFDMenuSetup(cVFDWatch* pDev)
Add(new cMenuEditStraItem (tr("Exit mode"),
&m_tmpSetup.m_nOnExit,
memberof(szExitModes), szExitModes));
+
+
+ static const char * szVolumeMode[eVolumeMode_LASTITEM];
+ szVolumeMode[eVolumeMode_ShowNever] = tr("Never");
+ szVolumeMode[eVolumeMode_ShowTimed] = tr("Timed");
+ szVolumeMode[eVolumeMode_ShowEver] = tr("Ever");
+
+ Add(new cMenuEditStraItem (tr("Show volume bargraph"),
+ &m_tmpSetup.m_nVolumeMode,
+ memberof(szVolumeMode), szVolumeMode));
}
eOSState cVFDMenuSetup::ProcessKey(eKeys nKey)
diff --git a/setup.h b/setup.h
index 12650b2..e9f5cf0 100644
--- a/setup.h
+++ b/setup.h
@@ -25,6 +25,13 @@ enum eOnExitMode {
,eOnExitMode_LASTITEM
};
+enum eVolumeMode {
+ eVolumeMode_ShowNever /**< Show the volume bar never */
+ ,eVolumeMode_ShowTimed /**< Show the volume bar short time */
+ ,eVolumeMode_ShowEver /**< Show the volume bar ever */
+ ,eVolumeMode_LASTITEM
+};
+
struct cVFDSetup
{
int m_nOnExit;
@@ -40,6 +47,8 @@ struct cVFDSetup
int m_bTwoLineMode; /** enable two line mode */
+ int m_nVolumeMode;
+
cVFDSetup(void);
cVFDSetup(const cVFDSetup& x);
cVFDSetup& operator = (const cVFDSetup& x);
diff --git a/vfd.c b/vfd.c
index 0b73ae9..7dd7f01 100644
--- a/vfd.c
+++ b/vfd.c
@@ -373,57 +373,56 @@ void cVFD::clear()
bool cVFD::flush(bool refreshAll)
{
- unsigned int n, x, yb;
+ unsigned int n, x, yb;
- if (!backingstore || !framebuf)
- return false;
+ if (!backingstore || !framebuf)
+ return false;
+
+ const uchar* fb = framebuf->getBitmap();
+ const unsigned int width = framebuf->Width();
+
+ bool doRefresh = false;
+ unsigned int minX = width;
+ unsigned int maxX = 0;
+
+ for (yb = 0; yb < m_iSizeYb; ++yb)
+ for (x = 0; x < width; ++x)
+ {
+ n = x + (yb * width);
+ if (*(fb + n) != *(backingstore + n))
+ {
+ *(backingstore + n) = *(fb + n);
+ minX = min(minX, x);
+ maxX = max(maxX, x + 1);
+ doRefresh = true;
+ }
+ }
+
+ if (refreshAll || doRefresh) {
+ if (refreshAll) {
+ minX = 0;
+ maxX = width;
+ }
- const uchar* fb = framebuf->getBitmap();
- const unsigned int width = framebuf->Width();
+ maxX = min(maxX, width);
- bool doRefresh = false;
- unsigned int minX = width;
- unsigned int maxX = 0;
+ unsigned int nData = (maxX-minX) * m_iSizeYb;
+ if(nData) {
+ // send data to display, controller
+ QueueCmd(CMD_SETRAM);
+ QueueData(minX*m_iSizeYb);
+ QueueCmd(CMD_SETPIXEL);
+ QueueData(nData);
- for (yb = 0; yb < m_iSizeYb; ++yb)
- for (x = 0; x < width; ++x)
+ for (x = minX; x < maxX; ++x)
+ for (yb = 0; yb < m_iSizeYb; ++yb)
{
n = x + (yb * width);
- if (*(fb + n) != *(backingstore + n))
- {
- *(backingstore + n) = *(fb + n);
- minX = min(minX, x);
- maxX = max(maxX, x + 1);
- doRefresh = true;
- }
+ QueueData((*(backingstore + n)));
}
-
- if (refreshAll || doRefresh)
- {
- if (refreshAll) {
- minX = 0;
- maxX = width;
- }
-
- maxX = min(maxX, width);
-
- unsigned int nData = (maxX-minX) * m_iSizeYb;
- if(nData) {
- // send data to display, controller
- QueueCmd(CMD_SETRAM);
- QueueData(minX*m_iSizeYb);
- QueueCmd(CMD_SETPIXEL);
- QueueData(nData);
-
- for (x = minX; x < maxX; ++x)
- for (yb = 0; yb < m_iSizeYb; ++yb)
- {
- n = x + (yb * width);
- QueueData((*(backingstore + n)));
- }
}
- }
- return QueueFlush();
+ }
+ return QueueFlush();
}
/**
diff --git a/watch.c b/watch.c
index 5efb30c..c0d9525 100644
--- a/watch.c
+++ b/watch.c
@@ -53,7 +53,8 @@ cVFDWatch::cVFDWatch()
m_nLastVolume = cDevice::CurrentVolume();
m_bVolumeMute = false;
-
+ tsVolumeLast = time(NULL);
+
osdTitle = NULL;
osdItem = NULL;
osdMessage = NULL;
@@ -76,28 +77,28 @@ cVFDWatch::~cVFDWatch()
{
close();
if(chName) {
- delete chName;
- chName = NULL;
+ delete chName;
+ chName = NULL;
}
if(chPresentTitle) {
- delete chPresentTitle;
- chPresentTitle = NULL;
+ delete chPresentTitle;
+ chPresentTitle = NULL;
}
if(chPresentShortTitle) {
- delete chPresentShortTitle;
- chPresentShortTitle = NULL;
+ delete chPresentShortTitle;
+ chPresentShortTitle = NULL;
}
if(osdMessage) {
- delete osdMessage;
- osdMessage = NULL;
+ delete osdMessage;
+ osdMessage = NULL;
}
if(osdTitle) {
- delete osdTitle;
- osdTitle = NULL;
+ delete osdTitle;
+ osdTitle = NULL;
}
if(osdItem) {
- delete osdItem;
- osdItem = NULL;
+ delete osdItem;
+ osdItem = NULL;
}
if(replayTitle) {
delete replayTitle;
@@ -114,13 +115,13 @@ cVFDWatch::~cVFDWatch()
}
bool cVFDWatch::open() {
- if(cVFD::open()) {
- m_bShutdown = false;
- m_bUpdateScreen = true;
- Start();
- return true;
- }
- return false;
+ if(cVFD::open()) {
+ m_bShutdown = false;
+ m_bUpdateScreen = true;
+ Start();
+ return true;
+ }
+ return false;
}
void cVFDWatch::close() {
@@ -205,10 +206,12 @@ void cVFDWatch::Action(void)
cMutexLooker m(mutex);
runTime.Set();
- // every second the clock need updates.
- if (theSetup.m_bTwoLineMode) {
+ time_t ts = time(NULL);
+
+ // every second the clock need updates.
+ if (theSetup.m_bTwoLineMode) {
if((0 == (nCnt % 2))) {
- bReDraw = CurrentTime();
+ bReDraw = CurrentTime(ts);
if(m_eWatchMode != eLiveTV) {
bReDraw |= ReplayTime();
}
@@ -216,15 +219,7 @@ void cVFDWatch::Action(void)
}
bFlush = RenderScreen(bReDraw);
- if(m_eWatchMode == eLiveTV) {
- //if((chFollowingTime - chPresentTime) > 0) {
- // nBottomProgressBar = (time(NULL) - chPresentTime) * 32 / (chFollowingTime - chPresentTime);
- // if(nBottomProgressBar > 32) nBottomProgressBar = 32;
- // if(nBottomProgressBar < 0) nBottomProgressBar = 0;
- //} else {
- // nBottomProgressBar = 0;
- //}
- } else {
+ if(m_eWatchMode != eLiveTV) {
switch(ReplayMode()) {
case eReplayNone:
case eReplayPaused:
@@ -252,12 +247,19 @@ void cVFDWatch::Action(void)
}
}
- if(m_bVolumeMute) {
- nIcons |= eIconMUTE;
- } else {
- nIcons |= eIconVOLUME;
- const int nVolSteps = (MAXVOLUME/14);
- nIcons |= (((1 << (m_nLastVolume / nVolSteps)) - 1) << 0x0B);
+ // update volume - bargraph or mute symbol
+ if(theSetup.m_nVolumeMode != eVolumeMode_ShowNever) {
+ if(m_bVolumeMute) {
+ nIcons |= eIconMUTE;
+ } else {
+ if(theSetup.m_nVolumeMode == eVolumeMode_ShowEver
+ || ( theSetup.m_nVolumeMode == eVolumeMode_ShowTimed
+ && (ts - tsVolumeLast) < 15 )) { // if timed - delay 15 seconds
+ nIcons |= eIconVOLUME;
+ const int nVolSteps = (MAXVOLUME/14);
+ nIcons |= (((1 << (m_nLastVolume / nVolSteps)) - 1) << 0x0B);
+ }
+ }
}
if(theSetup.m_nBrightness != nBrightness) {
@@ -381,8 +383,7 @@ bool cVFDWatch::RenderScreen(bool bReDraw) {
return false;
}
-bool cVFDWatch::CurrentTime() {
- time_t ts = time(NULL);
+bool cVFDWatch::CurrentTime(time_t ts) {
if((ts / 60) != (tsCurrentLast / 60)) {
@@ -734,6 +735,7 @@ void cVFDWatch::Volume(int nVolume, bool bAbsolute)
m_bVolumeMute = false;
}
m_nLastVolume = nAbsVolume;
+ tsVolumeLast = time(NULL);
}
diff --git a/watch.h b/watch.h
index 0fd81d1..4a71a7c 100644
--- a/watch.h
+++ b/watch.h
@@ -82,6 +82,8 @@ private:
int m_nLastVolume;
bool m_bVolumeMute;
+ time_t tsVolumeLast;
+
cString* osdTitle;
cString* osdItem;
@@ -100,7 +102,7 @@ protected:
bool RenderScreen(bool bReDraw);
eReplayState ReplayMode() const;
bool ReplayPosition(int &current, int &total) const;
- bool CurrentTime();
+ bool CurrentTime(time_t ts);
bool ReplayTime();
const char * FormatReplayTime(int current, int total) const;
public: