17#define ScrollWidth (Setup.FontOsdSize / 4)
18#define TextFrame (Setup.FontOsdSize / 10)
19#define TextSpacing (Setup.FontOsdSize / 4)
90 virtual void Flush(
void);
95 int Lines = WithInfo ? 5 : 1;
102 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
103 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
106 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
127 for (
int i = 0; i < 2; i++) {
128 const cEvent *e = !i ? Present : Following;
142 osd->DrawText(0, 0, Text,
Theme.Color(clrMessageStatusFg + 2 * Type),
Theme.Color(clrMessageStatusBg + 2 * Type), font,
osd->Width(), 0,
taCenter);
146 osd->RestoreRegion();
157 int w = font->
Width(date);
178 void DrawScrollbar(
int Total,
int Offset,
int Shown,
int Top,
int Height,
bool CanScrollUp,
bool CanScrollDown);
183 virtual void Scroll(
bool Up,
bool Page);
185 virtual void Clear(
void);
186 virtual void SetTitle(
const char *Title);
187 virtual void SetButtons(
const char *Red,
const char *Green = NULL,
const char *Yellow = NULL,
const char *Blue = NULL);
189 virtual void SetItem(
const char *Text,
int Index,
bool Current,
bool Selectable);
193 virtual void SetText(
const char *Text,
bool FixedFont);
196 virtual void Flush(
void);
217 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
218 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
221 if (
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
222 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
228 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
241 if (Total > 0 && Total > Shown) {
243 int yb = yt + Height;
246 int th =
max(
int((sb - st) *
double(Shown) / Total + 0.5),
ScrollWidth);
247 int tt =
min(
int(st + (sb - st) *
double(Offset) / Total + 0.5), sb - th);
248 int tb =
min(tt + th, sb);
250 osd->DrawRectangle(xl, st,
x3 - 1, sb - 1,
Theme.Color(clrMenuScrollbarTotal));
251 osd->DrawRectangle(xl, tt,
x3 - 1, tb - 1,
Theme.Color(clrMenuScrollbarShown));
294 const char *lutText[] = { Red, Green, Yellow, Blue };
295 tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg };
296 tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg };
313 osd->DrawText(
x0,
y3, Text,
Theme.Color(clrMessageStatusFg + 2 * Type),
Theme.Color(clrMessageStatusBg + 2 * Type), font,
x3 -
x0, 0,
taCenter);
323 ColorFg =
Theme.Color(clrMenuItemCurrentFg);
324 ColorBg =
Theme.Color(clrMenuItemCurrentBg);
327 ColorFg =
Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable);
331 for (
int i = 0; i <
MaxTabs; i++) {
334 int xt =
x0 +
Tab(i);
335 osd->DrawText(xt, y, s, ColorFg, ColorBg, font,
x2 - xt);
360 int w = font->
Width(buffer);
361 osd->DrawText(
x3 - w, y, buffer,
Theme.Color(clrMenuEventVpsFg),
Theme.Color(clrMenuEventVpsBg), font, w);
367 int w = font->
Width(buffer);
368 osd->DrawText(
x3 - w, y, buffer,
Theme.Color(clrMenuEventVpsFg),
Theme.Color(clrMenuEventVpsBg), font, w);
400 int w = font->
Width(buffer);
401 osd->DrawText(xt - w, y, buffer,
Theme.Color(clrMenuEventVpsFg),
Theme.Color(clrMenuEventVpsBg), font, w);
407 int w = font->
Width(buffer);
408 osd->DrawText(xt - w, y, buffer,
Theme.Color(clrMenuEventVpsFg),
Theme.Color(clrMenuEventVpsBg), font, w);
412 const char *Title = Info->
Title();
414 Title = Recording->
Name();
452 int w = font->
Width(date);
471 virtual void SetTitle(
const char *Title);
472 virtual void SetMode(
bool Play,
bool Forward,
int Speed);
475 virtual void SetTotal(
const char *Total);
476 virtual void SetJump(
const char *Jump);
478 virtual void Flush(
void);
484 int lineHeight = font->
Height();
494 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
495 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
498 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
515 if (
Setup.ShowReplayMode) {
517 if (Speed == -1) Mode = Play ?
" > " :
" || ";
518 else if (Play) Mode = Forward ?
" X>> " :
" <<X ";
519 else Mode = Forward ?
" X|> " :
" <|X ";
522 char *p = strchr(buf,
'X');
524 *p = Speed > 0 ?
'1' + Speed - 1 :
' ';
546 int w = font->
Width(Total);
563 osd->RestoreRegion();
580 virtual void Flush(
void);
586 int lineHeight = font->
Height();
589 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
590 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
593 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
611 const char *Prompt =
tr(
"Volume ");
612 int l = font->
Width(Prompt);
615 osd->DrawRectangle(l, 0, l + p - 1,
osd->Height() - 1,
Theme.Color(clrVolumeBarLower));
616 osd->DrawRectangle(l + p, 0,
osd->Width() - 1,
osd->Height() - 1,
Theme.Color(clrVolumeBarUpper));
638 virtual void SetTrack(
int Index,
const char *
const *Tracks);
640 virtual void Flush(
void);
648 int ItemsWidth = font->
Width(Title);
649 for (
int i = 0; i < NumTracks; i++)
650 ItemsWidth =
max(ItemsWidth, font->
Width(Tracks[i]));
655 if (d > ItemsWidth) {
656 d = (d - ItemsWidth) & ~0x07;
664 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
665 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
668 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
670 osd->DrawText(
x0,
y0, Title,
Theme.Color(clrMenuTitleFg),
Theme.Color(clrMenuTitleBg), font,
x1 -
x0);
671 for (
int i = 0; i < NumTracks; i++)
685 ColorFg =
Theme.Color(clrMenuItemCurrentFg);
686 ColorBg =
Theme.Color(clrMenuItemCurrentBg);
690 ColorFg =
Theme.Color(clrMenuItemSelectable);
694 osd->DrawText(
x0, y, Text, ColorFg, ColorBg, font,
x1 -
x0);
701 SetItem(Tracks[Index], Index,
true);
718 virtual void Flush(
void);
724 int lineHeight = font->
Height();
727 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
728 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
731 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
760 return tr(
"Classic VDR");
cString ChannelString(const cChannel *Channel, int Number)
const char * ShortText(void) const
cString GetDateString(void) const
const char * Description(void) const
int ParentalRating(void) const
time_t StartTime(void) const
cString GetTimeString(void) const
const char * Title(void) const
cString GetEndTimeString(void) const
cString GetVpsString(void) const
cString GetParentalRatingString(void) const
virtual int Width(void) const =0
Returns the original character width as requested when the font was created, or 0 if the default widt...
virtual int Height(void) const =0
Returns the height of this font in pixel (all characters have the same height).
static const cFont * GetFont(eDvbFont Font)
Gets the given Font, which was previously set by a call to SetFont().
static cOsd * NewOsd(int Left, int Top, uint Level=OSD_LEVEL_DEFAULT)
Returns a pointer to a newly created cOsd object, which will be located at the given coordinates.
The cOsd class is the interface to the "On Screen Display".
static int OsdHeight(void)
static int OsdWidth(void)
const char * ChannelName(void) const
const cEvent * GetEvent(void) const
const char * ShortText(void) const
const char * Title(void) const
const char * Description(void) const
const char * Name(void) const
Returns the full name of the recording (without the video directory).
cRecordingInfo * Info(void) const
cSkinClassicDisplayChannel(bool WithInfo)
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual ~cSkinClassicDisplayChannel()
virtual void SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
virtual ~cSkinClassicDisplayMessage()
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
cSkinClassicDisplayMessage(void)
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual void SetTitle(const char *Title)
Sets the title of the recording.
virtual void SetCurrent(const char *Current)
Sets the current position within the recording, as a user readable string if the form "h:mm:ss....
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
virtual void SetProgress(int Current, int Total)
This function will be called whenever the position in or the total length of the recording has change...
virtual void SetMode(bool Play, bool Forward, int Speed)
Sets the current replay mode, which can be used to display some indicator, showing the user whether w...
cSkinClassicDisplayReplay(bool ModeOnly)
virtual ~cSkinClassicDisplayReplay()
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
virtual void SetTotal(const char *Total)
Sets the total length of the recording, as a user readable string if the form "h:mm:ss".
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual ~cSkinClassicDisplayTracks()
void SetItem(const char *Text, int Index, bool Current)
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
cSkinClassicDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
virtual ~cSkinClassicDisplayVolume()
virtual void Flush(void)
Actually draws the OSD display to the output device.
cSkinClassicDisplayVolume(void)
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Creates and returns a new object for displaying the available tracks.
virtual const char * Description(void)
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
cSkinDisplayChannel(void)
const cMarks * marks
< This class implements the progress display used during replay of a recording.
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
void SetEditableWidth(int Width)
If an item is set through a call to cSkinDisplayMenu::SetItem(), this function shall be called to set...
cSkin(const char *Name, cTheme *Theme=NULL)
Creates a new skin class, with the given Name and Theme.
static cString sprintf(const char *fmt,...) __attribute__((format(printf
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
static bool HasChanged(int &State)
Returns true if the usage of the video disk space has changed since the last call to this function wi...
static cString String(void)
Returns a localized string of the form "Disk nn% - hh:mm free".
#define THEME_CLR(Theme, Subject, Color)