summaryrefslogtreecommitdiff
path: root/skinclassic.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-05-29 13:21:02 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2004-05-29 13:21:02 +0200
commit6b60a35f8da342b5853f6e0cb09458d955005814 (patch)
tree10c448534b0f96d28aa82fc10c1181da365e7b49 /skinclassic.c
parenta4bdc1ada3e97eebc6ef28b6fa4d91ad9ae6ecbb (diff)
downloadvdr-6b60a35f8da342b5853f6e0cb09458d955005814.tar.gz
vdr-6b60a35f8da342b5853f6e0cb09458d955005814.tar.bz2
Added SetMessage() functions to the Replay and Channel skin functions
Diffstat (limited to 'skinclassic.c')
-rw-r--r--skinclassic.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/skinclassic.c b/skinclassic.c
index f7c06cc6..25d0ef50 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.4 2004/05/29 09:18:21 kls Exp $
+ * $Id: skinclassic.c 1.5 2004/05/29 13:13:50 kls Exp $
*/
#include "skinclassic.h"
@@ -76,11 +76,13 @@ 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,6 +91,7 @@ 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 } };
@@ -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;
@@ -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();