1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed setting the date in the channel display of the classic and sttng skins, to avoid unnecessary OSD access

This commit is contained in:
Klaus Schmidinger 2008-02-10 10:10:44 +01:00
parent df0e2f0dc8
commit 5f9f793d7b
4 changed files with 20 additions and 7 deletions

View File

@ -1449,6 +1449,8 @@ Marco Schl
an example ~cMyReceiver() in PLUGINS.html (thanks to Marco Schlüßler). an example ~cMyReceiver() in PLUGINS.html (thanks to Marco Schlüßler).
for fixing checking compatibility mode for old subtitles plugin for fixing checking compatibility mode for old subtitles plugin
for a patch that was used to implement handling of DVB-S2 for a patch that was used to implement handling of DVB-S2
for fixing setting the date in the channel display of the classic and sttng skins,
to avoid unnecessary OSD access
Jürgen Schmitz <j.schmitz@web.de> Jürgen Schmitz <j.schmitz@web.de>
for reporting a bug in displaying the current channel when switching via the SVDRP for reporting a bug in displaying the current channel when switching via the SVDRP

View File

@ -5603,3 +5603,5 @@ Video Disk Recorder Revision History
accessing file handles after they have become invalid (thanks to Reinhard accessing file handles after they have become invalid (thanks to Reinhard
Nissl for reporting an invalid access when ending VDR, and to Deti Fliegl for Nissl for reporting an invalid access when ending VDR, and to Deti Fliegl for
a patch that was used to implement StopSectionHandler()). a patch that was used to implement StopSectionHandler()).
- Fixed setting the date in the channel display of the classic and sttng skins,
to avoid unnecessary OSD access (thanks to Marco Schlüßler).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: skinclassic.c 1.19 2008/01/13 12:38:00 kls Exp $ * $Id: skinclassic.c 1.20 2008/02/10 10:01:13 kls Exp $
*/ */
#include "skinclassic.h" #include "skinclassic.h"
@ -77,6 +77,7 @@ private:
int lineHeight; int lineHeight;
int timeWidth; int timeWidth;
bool message; bool message;
cString lastDate;
public: public:
cSkinClassicDisplayChannel(bool WithInfo); cSkinClassicDisplayChannel(bool WithInfo);
virtual ~cSkinClassicDisplayChannel(); virtual ~cSkinClassicDisplayChannel();
@ -113,6 +114,7 @@ void cSkinClassicDisplayChannel::SetChannel(const cChannel *Channel, int Number)
{ {
osd->DrawRectangle(0, 0, osd->Width() - 1, lineHeight - 1, Theme.Color(clrBackground)); osd->DrawRectangle(0, 0, osd->Width() - 1, lineHeight - 1, Theme.Color(clrBackground));
osd->DrawText(2, 0, ChannelString(Channel, Number), Theme.Color(clrChannelName), Theme.Color(clrBackground), cFont::GetFont(fontOsd)); osd->DrawText(2, 0, ChannelString(Channel, Number), Theme.Color(clrChannelName), Theme.Color(clrBackground), cFont::GetFont(fontOsd));
lastDate = NULL;
} }
void cSkinClassicDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) void cSkinClassicDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
@ -147,9 +149,12 @@ void cSkinClassicDisplayChannel::Flush(void)
{ {
if (!message) { if (!message) {
cString date = DayDateTime(); cString date = DayDateTime();
if (!lastDate || strcmp(date, lastDate)) {
const cFont *font = cFont::GetFont(fontSml); const cFont *font = cFont::GetFont(fontSml);
int w = font->Width(date); int w = font->Width(date);
osd->DrawText(osd->Width() - w - 2, 0, date, Theme.Color(clrChannelDate), Theme.Color(clrBackground), cFont::GetFont(fontSml), w); osd->DrawText(osd->Width() - w - 2, 0, date, Theme.Color(clrChannelDate), Theme.Color(clrBackground), cFont::GetFont(fontSml), w);
lastDate = date;
}
} }
osd->Flush(); osd->Flush();
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: skinsttng.c 1.21 2007/06/17 13:51:56 kls Exp $ * $Id: skinsttng.c 1.22 2008/02/10 10:05:40 kls Exp $
*/ */
// Star Trek: The Next Generation® is a registered trademark of Paramount Pictures // Star Trek: The Next Generation® is a registered trademark of Paramount Pictures
@ -129,6 +129,7 @@ private:
tColor frameColor; tColor frameColor;
bool message; bool message;
const cEvent *present; const cEvent *present;
cString lastDate;
int lastSeen; int lastSeen;
tTrackId lastTrackId; tTrackId lastTrackId;
static cBitmap bmTeletext, bmRadio, bmAudio, bmDolbyDigital, bmEncrypted, bmRecording; static cBitmap bmTeletext, bmRadio, bmAudio, bmDolbyDigital, bmEncrypted, bmRecording;
@ -307,7 +308,10 @@ void cSkinSTTNGDisplayChannel::Flush(void)
const cFont *font = cFont::GetFont(fontSml); const cFont *font = cFont::GetFont(fontSml);
cString date = DayDateTime(); cString date = DayDateTime();
int w = font->Width(date); int w = font->Width(date);
if (!lastDate || strcmp(date, lastDate)) {
osd->DrawText(x4 - w - 2, y7 - font->Height(), date, Theme.Color(clrChannelDate), frameColor, font, w); osd->DrawText(x4 - w - 2, y7 - font->Height(), date, Theme.Color(clrChannelDate), frameColor, font, w);
lastDate = date;
}
cDevice *Device = cDevice::PrimaryDevice(); cDevice *Device = cDevice::PrimaryDevice();
const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack()); const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack());
if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) { if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) {