From b81bf2d1c92e2ac820d2116c66f328869eb627cd Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 31 May 2004 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.3.9=20-=20Completed=20Croatian=20language?= =?UTF-8?q?=20texts=20(thanks=20to=20Drazen=20Dupor).=20-=20New=20iso8859-?= =?UTF-8?q?2=20font=20to=20fix=20the=20problem=20with=20program=20freezes?= =?UTF-8?q?=20(thanks=20to=20Drazen=20Dupor).=20-=20Implemented=20a=20defa?= =?UTF-8?q?ult=20cRemote::Initialize()=20that=20waits=2010=20seconds=20for?= =?UTF-8?q?=20a=20keypress=20=20=20in=20order=20to=20prevent=20a=20"hangup?= =?UTF-8?q?"=20in=20case,=20e.g.,=20the=20LIRC=20driver=20is=20not=20loade?= =?UTF-8?q?d=20(thanks=20=20=20to=20Helmut=20Auer).=20-=20Updated=20'chann?= =?UTF-8?q?els.conf.terr'=20for=20Hannover=20(thanks=20to=20Peter=20Waecht?= =?UTF-8?q?ler).=20-=20cBitmap::DrawBitmap()=20now=20also=20resets=20the?= =?UTF-8?q?=20palette=20if=20the=20entire=20bitmap=20area=20is=20=20=20cov?= =?UTF-8?q?ered=20(suggested=20by=20Sascha=20Volkenandt).=20-=20Fixed=20se?= =?UTF-8?q?tting=20the=20title=20in=20the=20replay=20display=20of=20the=20?= =?UTF-8?q?"Classic=20VDR"=20skin=20in=20case=20=20=20a=20shorter=20title?= =?UTF-8?q?=20is=20set=20after=20a=20longer=20one=20(thanks=20to=20Stefan?= =?UTF-8?q?=20Huelswitt=20for=20=20=20reporting=20this=20one).=20-=20Now?= =?UTF-8?q?=20using=20more=20separate=20areas=20in=20the=20"ST:TNG=20Panel?= =?UTF-8?q?s"=20skin=20to=20allow=20a=20theme=20to=20=20=20use=20more=20in?= =?UTF-8?q?dependent=20clrMenu*=20colors.=20-=20Fixed=20removing=20the=20"?= =?UTF-8?q?scanning=20recordings..."=20message=20in=20case=20the=20video?= =?UTF-8?q?=20directory=20=20=20is=20empty=20(thanks=20to=20Andreas=20Rege?= =?UTF-8?q?l=20for=20reporting=20this=20one).=20-=20Added=20SetMessage()?= =?UTF-8?q?=20functions=20to=20the=20Replay=20and=20Channel=20skin=20funct?= =?UTF-8?q?ions.=20Plugins=20=20=20that=20implement=20skins=20will=20need?= =?UTF-8?q?=20to=20implement=20these=20functions.=20This=20fixes=20a=20mis?= =?UTF-8?q?sing=20=20=20"Editing=20process=20finished"=20message=20(thanks?= =?UTF-8?q?=20to=20Oliver=20Endriss=20for=20reporting=20this=20=20=20one).?= =?UTF-8?q?=20-=20Fixed=20the=20height=20of=20the=20channel=20display=20in?= =?UTF-8?q?=20the=20"Classic=20VDR"=20skin.=20-=20Fixed=20handling=20descr?= =?UTF-8?q?iptor=20loops=20in=20'libsi',=20which=20had=20sometimes=20cause?= =?UTF-8?q?d=20invalid=20=20=20CA=20ids=20to=20be=20added=20to=20the=20cha?= =?UTF-8?q?nnel=20definitions=20(thanks=20to=20Wayne=20Keer=20for=20report?= =?UTF-8?q?ing=20=20=20this=20one,=20and=20Marcel=20Wiesweg=20for=20fixing?= =?UTF-8?q?=20it).=20-=20Fixed=20handling=20colors=20in=20cDvbSpuPalette::?= =?UTF-8?q?yuv2rgb()=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20?= =?UTF-8?q?Made=20some=20functions=20of=20cFont=20virtual=20to=20allow=20i?= =?UTF-8?q?mplementing=20dummy=20fonts=20for=20the=20=20=20'curses'=20skin?= =?UTF-8?q?.=20-=20The=20new=20plugin=20'skincurses'=20re-implements=20the?= =?UTF-8?q?=20functionality=20that=20was=20previously=20=20=20available=20?= =?UTF-8?q?by=20compiling=20VDR=20with=20DEBUG=5FOSD.=20Some=20things=20ma?= =?UTF-8?q?y=20not=20yet=20work=20as=20they=20=20=20should,=20but=20it's?= =?UTF-8?q?=20a=20starting=20point.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skinclassic.c | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) (limited to 'skinclassic.c') diff --git a/skinclassic.c b/skinclassic.c index 3f0de1c..8fd6fe9 100644 --- a/skinclassic.c +++ b/skinclassic.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinclassic.c 1.3 2004/05/23 10:40:02 kls Exp $ + * $Id: skinclassic.c 1.7 2004/05/29 14:04:50 kls Exp $ */ #include "skinclassic.h" @@ -71,16 +71,18 @@ THEME_CLR(Theme, clrReplayProgressCurrent, clrRed); // --- cSkinClassicDisplayChannel -------------------------------------------- -class cSkinClassicDisplayChannel : public cSkinDisplayChannel{ +class cSkinClassicDisplayChannel : public cSkinDisplayChannel { private: cOsd *osd; int lineHeight; int timeWidth; + bool message; public: cSkinClassicDisplayChannel(bool WithInfo); virtual ~cSkinClassicDisplayChannel(); virtual void SetChannel(const cChannel *Channel, int Number); virtual void SetEvents(const cEvent *Present, const cEvent *Following); + virtual void SetMessage(eMessageType Type, const char *Text); virtual void Flush(void); }; @@ -89,9 +91,10 @@ cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(bool WithInfo) int Lines = WithInfo ? 5 : 1; const cFont *font = cFont::GetFont(fontOsd); lineHeight = font->Height(); + message = false; osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + (Setup.ChannelInfoPos ? 0 : Setup.OSDHeight - Lines * lineHeight)); timeWidth = font->Width("00:00") + 4; - tArea Areas[] = { { 0, 0, Setup.OSDWidth - 1, Lines * lineHeight, 4 } }; + tArea Areas[] = { { 0, 0, Setup.OSDWidth - 1, Lines * lineHeight - 1, 4 } }; osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); osd->DrawRectangle(0, 0, osd->Width() - 1, osd->Height() - 1, Theme.Color(clrBackground)); } @@ -121,10 +124,26 @@ void cSkinClassicDisplayChannel::SetEvents(const cEvent *Present, const cEvent * } } +void cSkinClassicDisplayChannel::SetMessage(eMessageType Type, const char *Text) +{ + const cFont *font = cFont::GetFont(fontOsd); + if (Text) { + osd->SaveRegion(0, 0, osd->Width() - 1, lineHeight - 1); + osd->DrawText(0, 0, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, osd->Width(), 0, taCenter); + message = true; + } + else { + osd->RestoreRegion(); + message = false; + } +} + void cSkinClassicDisplayChannel::Flush(void) { - const char *date = DayDateTime(); - osd->DrawText(osd->Width() - cFont::GetFont(fontSml)->Width(date) - 2, 0, date, Theme.Color(clrChannelDate), Theme.Color(clrBackground), cFont::GetFont(fontSml)); + if (!message) { + const char *date = DayDateTime(); + osd->DrawText(osd->Width() - cFont::GetFont(fontSml)->Width(date) - 2, 0, date, Theme.Color(clrChannelDate), Theme.Color(clrBackground), cFont::GetFont(fontSml)); + } osd->Flush(); } @@ -333,6 +352,7 @@ private: int x0, x1; int y0, y1, y2, y3; int lastCurrentWidth; + bool message; public: cSkinClassicDisplayReplay(bool ModeOnly); virtual ~cSkinClassicDisplayReplay(); @@ -342,6 +362,7 @@ public: virtual void SetCurrent(const char *Current); virtual void SetTotal(const char *Total); virtual void SetJump(const char *Jump); + virtual void SetMessage(eMessageType Type, const char *Text); virtual void Flush(void); }; @@ -350,6 +371,7 @@ cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(bool ModeOnly) const cFont *font = cFont::GetFont(fontOsd); int lineHeight = font->Height(); lastCurrentWidth = 0; + message = false; x0 = 0; x1 = Setup.OSDWidth; y0 = 0; @@ -369,7 +391,7 @@ cSkinClassicDisplayReplay::~cSkinClassicDisplayReplay() void cSkinClassicDisplayReplay::SetTitle(const char *Title) { - osd->DrawText(x0, y0, Title, Theme.Color(clrReplayTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd)); + osd->DrawText(x0, y0, Title, Theme.Color(clrReplayTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd), x1 - x0); } void cSkinClassicDisplayReplay::SetMode(bool Play, bool Forward, int Speed) @@ -413,6 +435,20 @@ void cSkinClassicDisplayReplay::SetJump(const char *Jump) osd->DrawText(x0 + (x1 - x0) / 4, y2, Jump, Theme.Color(clrReplayModeJump), Theme.Color(clrBackground), cFont::GetFont(fontOsd), (x1 - x0) / 2, 0, taCenter); } +void cSkinClassicDisplayReplay::SetMessage(eMessageType Type, const char *Text) +{ + const cFont *font = cFont::GetFont(fontOsd); + if (Text) { + osd->SaveRegion(x0, y2, x1 - 1, y3 - 1); + osd->DrawText(x0, y2, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x1 - x0, y3 - y2, taCenter); + message = true; + } + else { + osd->RestoreRegion(); + message = false; + } +} + void cSkinClassicDisplayReplay::Flush(void) { osd->Flush(); -- cgit v1.2.3