summaryrefslogtreecommitdiff
path: root/skinclassic.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2004-05-31 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2004-05-31 18:00:00 +0200
commitb81bf2d1c92e2ac820d2116c66f328869eb627cd (patch)
treea3edee268e9ff1d2e41fb02f8d8b2b8bdef566f4 /skinclassic.c
parent3c349510b5060ec05a684425b6b2e5b70d67f65c (diff)
downloadvdr-patch-lnbsharing-b81bf2d1c92e2ac820d2116c66f328869eb627cd.tar.gz
vdr-patch-lnbsharing-b81bf2d1c92e2ac820d2116c66f328869eb627cd.tar.bz2
Version 1.3.9vdr-1.3.9
- Completed Croatian language texts (thanks to Drazen Dupor). - New iso8859-2 font to fix the problem with program freezes (thanks to Drazen Dupor). - Implemented a default cRemote::Initialize() that waits 10 seconds for a keypress in order to prevent a "hangup" in case, e.g., the LIRC driver is not loaded (thanks to Helmut Auer). - Updated 'channels.conf.terr' for Hannover (thanks to Peter Waechtler). - cBitmap::DrawBitmap() now also resets the palette if the entire bitmap area is covered (suggested by Sascha Volkenandt). - Fixed setting the title in the replay display of the "Classic VDR" skin in case a shorter title is set after a longer one (thanks to Stefan Huelswitt for reporting this one). - Now using more separate areas in the "ST:TNG Panels" skin to allow a theme to use more independent clrMenu* colors. - Fixed removing the "scanning recordings..." message in case the video directory is empty (thanks to Andreas Regel for reporting this one). - Added SetMessage() functions to the Replay and Channel skin functions. Plugins that implement skins will need to implement these functions. This fixes a missing "Editing process finished" message (thanks to Oliver Endriss for reporting this one). - Fixed the height of the channel display in the "Classic VDR" skin. - Fixed handling descriptor loops in 'libsi', which had sometimes caused invalid CA ids to be added to the channel definitions (thanks to Wayne Keer for reporting this one, and Marcel Wiesweg for fixing it). - Fixed handling colors in cDvbSpuPalette::yuv2rgb() (thanks to Marco Schlüßler). - Made some functions of cFont virtual to allow implementing dummy fonts for the 'curses' skin. - The new plugin 'skincurses' re-implements the functionality that was previously available by compiling VDR with DEBUG_OSD. Some things may not yet work as they should, but it's a starting point.
Diffstat (limited to 'skinclassic.c')
-rw-r--r--skinclassic.c48
1 files changed, 42 insertions, 6 deletions
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();