17#define ScrollWidth (Setup.FontOsdSize / 4)
18#define TextFrame (Setup.FontOsdSize / 10)
19#define TextSpacing (Setup.FontOsdSize / 4)
91 virtual void Flush(
void);
96 int Lines = WithInfo ? 5 : 1;
103 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
104 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
107 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
128 for (
int i = 0; i < 2; i++) {
129 const cEvent *e = !i ? Present : Following;
143 osd->DrawText(0, 0, Text,
Theme.Color(clrMessageStatusFg + 2 * Type),
Theme.Color(clrMessageStatusBg + 2 * Type), font,
osd->Width(), 0,
taCenter);
147 osd->RestoreRegion();
158 int w = font->
Width(date);
179 void DrawScrollbar(
int Total,
int Offset,
int Shown,
int Top,
int Height,
bool CanScrollUp,
bool CanScrollDown);
184 virtual void Scroll(
bool Up,
bool Page);
186 virtual void Clear(
void);
187 virtual void SetTitle(
const char *Title);
188 virtual void SetButtons(
const char *Red,
const char *Green = NULL,
const char *Yellow = NULL,
const char *Blue = NULL);
190 virtual void SetItem(
const char *Text,
int Index,
bool Current,
bool Selectable);
194 virtual void SetText(
const char *Text,
bool FixedFont);
197 virtual void Flush(
void);
218 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
219 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
222 if (
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
223 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
229 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
242 if (Total > 0 && Total > Shown) {
244 int yb = yt + Height;
247 int th =
max(
int((sb - st) *
double(Shown) / Total + 0.5),
ScrollWidth);
248 int tt =
min(
int(st + (sb - st) *
double(Offset) / Total + 0.5), sb - th);
249 int tb =
min(tt + th, sb);
251 osd->DrawRectangle(xl, st,
x3 - 1, sb - 1,
Theme.Color(clrMenuScrollbarTotal));
252 osd->DrawRectangle(xl, tt,
x3 - 1, tb - 1,
Theme.Color(clrMenuScrollbarShown));
295 const char *lutText[] = { Red, Green, Yellow, Blue };
296 tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg };
297 tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg };
314 osd->DrawText(
x0,
y3, Text,
Theme.Color(clrMessageStatusFg + 2 * Type),
Theme.Color(clrMessageStatusBg + 2 * Type), font,
x3 -
x0, 0,
taCenter);
324 ColorFg =
Theme.Color(clrMenuItemCurrentFg);
325 ColorBg =
Theme.Color(clrMenuItemCurrentBg);
328 ColorFg =
Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable);
332 for (
int i = 0; i <
MaxTabs; i++) {
335 int xt =
x0 +
Tab(i);
336 osd->DrawText(xt, y, s, ColorFg, ColorBg, font,
x2 - xt);
361 int w = font->
Width(buffer);
362 osd->DrawText(
x3 - w, y, buffer,
Theme.Color(clrMenuEventVpsFg),
Theme.Color(clrMenuEventVpsBg), font, w);
368 int w = font->
Width(buffer);
369 osd->DrawText(
x3 - w, y, buffer,
Theme.Color(clrMenuEventVpsFg),
Theme.Color(clrMenuEventVpsBg), font, w);
401 int w = font->
Width(buffer);
402 osd->DrawText(xt - w, y, buffer,
Theme.Color(clrMenuEventVpsFg),
Theme.Color(clrMenuEventVpsBg), font, w);
409 int w = font->
Width(buffer);
410 osd->DrawText(xt - w, y, buffer,
Theme.Color(clrMenuEventVpsFg),
Theme.Color(clrMenuEventVpsBg), font, w);
414 const char *Title = Info->
Title();
416 Title = Recording->
Name();
460 int w = font->
Width(date);
479 virtual void SetTitle(
const char *Title);
480 virtual void SetMode(
bool Play,
bool Forward,
int Speed);
483 virtual void SetTotal(
const char *Total);
484 virtual void SetJump(
const char *Jump);
486 virtual void Flush(
void);
492 int lineHeight = font->
Height();
502 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
503 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
506 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
523 if (
Setup.ShowReplayMode) {
525 if (Speed == -1) Mode = Play ?
" > " :
" || ";
526 else if (Play) Mode = Forward ?
" X>> " :
" <<X ";
527 else Mode = Forward ?
" X|> " :
" <|X ";
530 char *p = strchr(buf,
'X');
532 *p = Speed > 0 ?
'1' + Speed - 1 :
' ';
539 cProgressBar pb(
x1 -
x0,
y2 -
y1,
Current, Total,
marks,
errors,
Theme.Color(clrReplayProgressSeen),
Theme.Color(clrReplayProgressRest),
Theme.Color(clrReplayProgressSelected),
Theme.Color(clrReplayProgressMark),
Theme.Color(clrReplayProgressCurrent),
Theme.Color(clrReplayProgressError));
554 int w = font->
Width(Total);
571 osd->RestoreRegion();
588 virtual void Flush(
void);
594 int lineHeight = font->
Height();
597 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
598 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
601 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
619 const char *Prompt =
tr(
"Volume ");
620 int l = font->
Width(Prompt);
623 osd->DrawRectangle(l, 0, l + p - 1,
osd->Height() - 1,
Theme.Color(clrVolumeBarLower));
624 osd->DrawRectangle(l + p, 0,
osd->Width() - 1,
osd->Height() - 1,
Theme.Color(clrVolumeBarUpper));
646 virtual void SetTrack(
int Index,
const char *
const *Tracks);
648 virtual void Flush(
void);
656 int ItemsWidth = font->
Width(Title);
657 for (
int i = 0; i < NumTracks; i++)
658 ItemsWidth =
max(ItemsWidth, font->
Width(Tracks[i]));
663 if (d > ItemsWidth) {
664 d = (d - ItemsWidth) & ~0x07;
672 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
673 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
676 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
678 osd->DrawText(
x0,
y0, Title,
Theme.Color(clrMenuTitleFg),
Theme.Color(clrMenuTitleBg), font,
x1 -
x0);
679 for (
int i = 0; i < NumTracks; i++)
693 ColorFg =
Theme.Color(clrMenuItemCurrentFg);
694 ColorBg =
Theme.Color(clrMenuItemCurrentBg);
698 ColorFg =
Theme.Color(clrMenuItemSelectable);
702 osd->DrawText(
x0, y, Text, ColorFg, ColorBg, font,
x1 -
x0);
709 SetItem(Tracks[Index], Index,
true);
726 virtual void Flush(
void);
732 int lineHeight = font->
Height();
735 if (
Setup.AntiAlias &&
osd->CanHandleAreas(Areas,
sizeof(Areas) /
sizeof(
tArea)) ==
oeOk)
736 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
739 osd->SetAreas(Areas,
sizeof(Areas) /
sizeof(
tArea));
768 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
cString FrameParams(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 in 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 in 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
cString & Append(const char *String)
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)