diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-08-15 11:21:14 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-08-15 11:21:14 +0200 |
commit | 69c17e7101a472f2d5b048bf1464a6bca27bcf6e (patch) | |
tree | 843be957e0f32fa2cd6bfc420cac6020a205fbc0 /skinsttng.c | |
parent | 8680d9213610cdcdd2eff0c53c436f08a748804c (diff) | |
download | vdr-69c17e7101a472f2d5b048bf1464a6bca27bcf6e.tar.gz vdr-69c17e7101a472f2d5b048bf1464a6bca27bcf6e.tar.bz2 |
Avoiding unnecessary OSD draw operations caused by the audio track description display in the ST:TNG skin's channel display
Diffstat (limited to 'skinsttng.c')
-rw-r--r-- | skinsttng.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/skinsttng.c b/skinsttng.c index b9d9ccbb..e7f3d8b8 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 1.14 2005/05/16 10:44:58 kls Exp $ + * $Id: skinsttng.c 1.15 2005/08/15 11:14:59 kls Exp $ */ // Star Trek: The Next Generation® is a registered trademark of Paramount Pictures @@ -130,6 +130,7 @@ private: bool message; const cEvent *present; int lastSeen; + tTrackId lastTrackId; static cBitmap bmTeletext, bmRadio, bmAudio, bmDolbyDigital, bmEncrypted, bmRecording; public: cSkinSTTNGDisplayChannel(bool WithInfo); @@ -151,6 +152,7 @@ cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(bool WithInfo) { present = NULL; lastSeen = -1; + memset(&lastTrackId, 0, sizeof(lastTrackId)); const cFont *font = cFont::GetFont(fontOsd); withInfo = WithInfo; lineHeight = font->Height(); @@ -298,7 +300,10 @@ void cSkinSTTNGDisplayChannel::Flush(void) osd->DrawText(x4 - w - 2, y7 - font->Height(date), date, Theme.Color(clrChannelDate), frameColor, font); cDevice *Device = cDevice::PrimaryDevice(); const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack()); - osd->DrawText(x3 + 2, y6, Track ? Track->description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 4); + if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) { + osd->DrawText(x3 + 2, y6, Track ? Track->description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 4); + strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description)); + } } int seen = 0; |