summaryrefslogtreecommitdiff
path: root/skinsttng.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-06-02 13:28:42 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2011-06-02 13:28:42 +0200
commite572cbda47df902ae7d83313fd01483ce2d3193f (patch)
tree55a020216bff73ad3541089eabdd331f81ff5520 /skinsttng.c
parent40278ec12131f07fdc15556511f689455e2b7931 (diff)
downloadvdr-e572cbda47df902ae7d83313fd01483ce2d3193f.tar.gz
vdr-e572cbda47df902ae7d83313fd01483ce2d3193f.tar.bz2
Implemented signal strength and quality handling
Diffstat (limited to 'skinsttng.c')
-rw-r--r--skinsttng.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/skinsttng.c b/skinsttng.c
index 9bd1b15c..5039a6c2 100644
--- a/skinsttng.c
+++ b/skinsttng.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skinsttng.c 2.7 2011/02/20 13:02:49 kls Exp $
+ * $Id: skinsttng.c 2.8 2011/06/02 12:54:43 kls Exp $
*/
// Star Trek: The Next Generation® is a registered trademark of Paramount Pictures
@@ -92,6 +92,8 @@ THEME_CLR(Theme, clrChannelEpgTitle, clrCyan);
THEME_CLR(Theme, clrChannelEpgShortText, clrYellow);
THEME_CLR(Theme, clrChannelTimebarSeen, clrYellow);
THEME_CLR(Theme, clrChannelTimebarRest, clrGray50);
+THEME_CLR(Theme, clrChannelSignalValue, clrGreen);
+THEME_CLR(Theme, clrChannelSignalRest, clrRed);
THEME_CLR(Theme, clrMenuFrame, clrYellow);
THEME_CLR(Theme, clrMenuTitle, clrBlack);
THEME_CLR(Theme, clrMenuDate, clrBlack);
@@ -134,6 +136,9 @@ private:
const cEvent *present;
cString lastDate;
int lastSeen;
+ int lastDeviceNumber;
+ int lastSignalStrength;
+ int lastSignalQuality;
tTrackId lastTrackId;
static cBitmap bmTeletext, bmRadio, bmAudio, bmDolbyDigital, bmEncrypted, bmRecording;
public:
@@ -156,6 +161,9 @@ cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(bool WithInfo)
{
present = NULL;
lastSeen = -1;
+ lastDeviceNumber = -1;
+ lastSignalStrength = -1;
+ lastSignalQuality = -1;
memset(&lastTrackId, 0, sizeof(lastTrackId));
const cFont *font = cFont::GetFont(fontOsd);
withInfo = WithInfo;
@@ -344,6 +352,36 @@ void cSkinSTTNGDisplayChannel::Flush(void)
osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y3 + seen, Theme.Color(clrChannelTimebarSeen));
lastSeen = seen;
}
+ int DeviceNumber = cDevice::ActualDevice()->DeviceNumber() + 1;
+ int SignalStrength = cDevice::ActualDevice()->SignalStrength();
+ int SignalQuality = cDevice::ActualDevice()->SignalQuality();
+ if (DeviceNumber != lastDeviceNumber || SignalStrength != lastSignalStrength || SignalQuality != lastSignalQuality) {
+ int d = 3;
+ int h = ((y7 - y6 + 1) - 3 * d) / 2;
+ int w = (x4 - x3) / 5;
+ int x = (x3 + x4) / 2 - w / 2;
+ if (SignalStrength >= 0) {
+ int s = SignalStrength * w / 100;
+ osd->DrawRectangle(x, y6 + d, x + s - 1, y6 + d + h - 1, Theme.Color(clrChannelSignalValue));
+ osd->DrawRectangle(x + s, y6 + d, x + w - 1, y6 + d + h - 1, Theme.Color(clrChannelSignalRest));
+ }
+ else if (DeviceNumber != lastDeviceNumber)
+ osd->DrawRectangle(x, y6 + d, x + w - 1, y6 + d + h - 1, Theme.Color(clrChannelFrame));
+ if (SignalQuality >= 0) {
+ int q = SignalQuality * w / 100;
+ osd->DrawRectangle(x, y7 - d - h + 1, x + q - 1, y7 - d, Theme.Color(clrChannelSignalValue));
+ osd->DrawRectangle(x + q, y7 - d - h + 1, x + w - 1, y7 - d, Theme.Color(clrChannelSignalRest));
+ }
+ else if (DeviceNumber != lastDeviceNumber)
+ osd->DrawRectangle(x, y7 - d - h + 1, x + w - 1, y7 - d, Theme.Color(clrChannelFrame));
+ cString dn = cString::sprintf(" %d ", DeviceNumber);
+ const cFont *font = cFont::GetFont(fontSml);
+ int dw = font->Width(dn);
+ osd->DrawText(x - 2 * d - dw, y6, dn, Theme.Color(clrChannelDate), frameColor, font, dw);
+ lastDeviceNumber = DeviceNumber;
+ lastSignalStrength = SignalStrength;
+ lastSignalQuality = SignalQuality;
+ }
}
osd->Flush();
}