diff options
-rw-r--r-- | po/de_DE.po | 15 | ||||
-rw-r--r-- | po/it_IT.po | 13 | ||||
-rw-r--r-- | setup.c | 12 | ||||
-rw-r--r-- | targavfd.c | 2 | ||||
-rw-r--r-- | vfd.c | 83 | ||||
-rw-r--r-- | vfd.h | 8 | ||||
-rw-r--r-- | watch.c | 10 |
7 files changed, 99 insertions, 44 deletions
diff --git a/po/de_DE.po b/po/de_DE.po index f5dcde0..c5cdfe4 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -5,10 +5,10 @@ # Andreas Brachold <vdr07 AT deltab de> 2009, 2010. msgid "" msgstr "" -"Project-Id-Version: vdr-targavfd-plugin 0.0.1\n" +"Project-Id-Version: vdr-targavfd-plugin 0.0.5\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2010-04-18 17:28+0200\n" -"PO-Revision-Date: 2010-04-18 18:22+0200\n" +"POT-Creation-Date: 2010-07-02 21:25+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" "MIME-Version: 1.0\n" @@ -18,6 +18,15 @@ msgstr "" msgid "targavfd" msgstr "TargaVFD" +msgid "Show nothing" +msgstr "Nichts anzeigen" + +msgid "Half brightness" +msgstr "Halbe Helligkeit" + +msgid "Full brightness" +msgstr "Volle Helligkeit" + msgid "Brightness" msgstr "Helligkeit" diff --git a/po/it_IT.po b/po/it_IT.po index e397730..694df10 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-04-18 17:28+0200\n" +"POT-Creation-Date: 2010-07-02 21:25+0200\n" "PO-Revision-Date: 2009-06-07 23:30+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: \n" @@ -21,8 +21,17 @@ msgstr "" msgid "targavfd" msgstr "TargaVFD" +msgid "Show nothing" +msgstr "Non fare visualizzare" + +msgid "Half brightness" +msgstr "Mezzora luminosità" + +msgid "Full brightness" +msgstr "Completa luminosità" + msgid "Brightness" -msgstr "" +msgstr "Luminosità" msgid "Render mode" msgstr "" @@ -179,9 +179,15 @@ cVFDMenuSetup::cVFDMenuSetup(cVFDWatch* pDev) fontNames.Insert(strdup(DEFAULT_FONT)); fontIndex = max(0, fontNames.Find(m_tmpSetup.m_szFont)); - Add(new cMenuEditIntItem (tr("Brightness"), - &m_tmpSetup.m_nBrightness, - 0, 2)); + static const char * szBrightness[3]; + szBrightness[0] = tr("Show nothing"); + szBrightness[1] = tr("Half brightness"); + szBrightness[2] = tr("Full brightness"); + + Add(new cMenuEditStraItem (tr("Brightness"), + &m_tmpSetup.m_nBrightness, + memberof(szBrightness), szBrightness)); + Add(new cMenuEditBoolItem(tr("Render mode"), &m_tmpSetup.m_bTwoLineMode, tr("Single line"), tr("Dual lines"))); @@ -20,7 +20,7 @@ #include "status.h" #include "setup.h" -static const char *VERSION = "0.0.4"; +static const char *VERSION = "0.0.5"; class cPluginTargaVFD : public cPlugin { private: @@ -244,7 +244,7 @@ const char *cVFDQueue::hiderror(hid_return ret) const cVFD::cVFD() { - this->pFont = NULL; + this->pFont = NULL; this->lastIconState = 0; } @@ -278,14 +278,14 @@ bool cVFD::open() esyslog("targaVFD: unable to allocate framebuffer"); return false; } + m_iSizeYb = ((theSetup.m_cHeight + 7) / 8); /* Make sure the framebuffer backing store is there... */ - this->backingstore = new cVFDBitmap(theSetup.m_cWidth,theSetup.m_cHeight); + this->backingstore = new unsigned char[theSetup.m_cWidth * m_iSizeYb]; if (this->backingstore == NULL) { esyslog("targaVFD: unable to create framebuffer backing store"); return false; } - backingstore->SetPixel(0,0);//make dirty this->lastIconState = 0; @@ -368,35 +368,64 @@ void cVFD::clear() /** - * Flush data on screen to the LCD. + * Flush cached bitmap data and submit changes rows to the Display. */ -bool cVFD::flush() + +bool cVFD::flush(bool refreshAll) { - /* - * The display only provides for a complete screen refresh. If - * nothing has changed, don't refresh. - */ - if (!((*backingstore) == (*framebuf))) { - /* send buffer for one command or display data */ - const uchar* fb = framebuf->getBitmap(); - int bytes = framebuf->Width() * framebuf->Height() / 8; - int width = framebuf->Width(); - QueueCmd(CMD_SETRAM); - QueueData(0); - QueueCmd(CMD_SETPIXEL); - QueueData(bytes); - for (int i=0;i<width;i+=1) + unsigned int n, x, yb; + + 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) { - QueueData(*(fb + i)); - QueueData(*(fb + (i + width))); - } - /* Update the backing store. */ - (*backingstore) = (*framebuf); - } - return QueueFlush(); + 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(); } - /** * Print a string on the screen at position (x,y). * The upper-left corner is (1,1), the lower-right corner is (this->width, this->height). @@ -69,8 +69,10 @@ class cVFD : public cVFDQueue { /* framebuffer and backingstore for current contents */ cVFDBitmap* framebuf; - cVFDBitmap* backingstore; - unsigned int lastIconState; + unsigned char * backingstore; + unsigned int lastIconState; + unsigned int m_iSizeYb; + protected: cVFDFont* pFont; @@ -87,7 +89,7 @@ public: void clear (); int DrawText(int x, int y, const char* string); - bool flush (); + bool flush (bool refreshAll = true); void icons(unsigned int state); virtual bool SetFont(const char *szFont, int bTwoLineMode, int nBigFontHeight, int nSmallFontHeight); @@ -158,7 +158,7 @@ void cVFDWatch::close() { this->DrawText(0,0,tr("None active timer")); this->icons(0); } - this->flush(); + this->flush(true); break; } case eOnExitMode_SHOWMSG: { @@ -205,9 +205,9 @@ void cVFDWatch::Action(void) cMutexLooker m(mutex); runTime.Set(); - // every second the clock need updates. - if (theSetup.m_bTwoLineMode) { - if((0 == (nCnt % 5))) { + // every second the clock need updates. + if (theSetup.m_bTwoLineMode) { + if((0 == (nCnt % 2))) { bReDraw = CurrentTime(); if(m_eWatchMode != eLiveTV) { bReDraw |= ReplayTime(); @@ -277,7 +277,7 @@ void cVFDWatch::Action(void) } if(bFlush) { - flush(); + flush(false); } } int nDelay = 100 - runTime.Elapsed(); |