diff options
author | root <root@ion.localnet> | 2010-07-11 16:16:46 +0200 |
---|---|---|
committer | root <root@ion.localnet> | 2010-07-11 16:16:46 +0200 |
commit | 387018c94f7cd138cba5fe85eb0c5c58a0a7f00c (patch) | |
tree | 60b3c85425f680c203e8416b7aa4ad7ac95d495b /vfd.c | |
parent | bb560a735a93448872e0d954bac3d36e3b410051 (diff) | |
download | vdr-plugin-targavfd-387018c94f7cd138cba5fe85eb0c5c58a0a7f00c.tar.gz vdr-plugin-targavfd-387018c94f7cd138cba5fe85eb0c5c58a0a7f00c.tar.bz2 |
* Add option to control volume bargraph
Diffstat (limited to 'vfd.c')
-rw-r--r-- | vfd.c | 85 |
1 files changed, 42 insertions, 43 deletions
@@ -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(); } /** |