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;
127 for (
int i = 0; i < 2; i++) {
128 const cEvent *e = !i ? Present : Following;
157 int w = font->
Width(date);
171 int y0, y1, y2, y3, y4,
y5;
177 void DrawTitle(
void);
178 void DrawScrollbar(
int Total,
int Offset,
int Shown,
int Top,
int Height,
bool CanScrollUp,
bool CanScrollDown);
179 void SetTextScrollbar(
void);
183 virtual void Scroll(
bool Up,
bool Page);
184 virtual int MaxItems(
void);
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);
190 virtual void SetScrollbar(
int Total,
int Offset);
191 virtual void SetEvent(
const cEvent *Event);
192 virtual void SetRecording(
const cRecording *Recording);
193 virtual void SetText(
const char *Text,
bool FixedFont);
194 virtual int GetTextAreaWidth(
void)
const;
195 virtual const cFont *GetTextAreaFont(
bool FixedFont)
const;
196 virtual void Flush(
void);
203 lastDiskUsageState = -1;
216 tArea Areas[] = { { x0, y0, x3 - 1, y5 - 1, 8 } };
220 tArea Areas[] = { { x0, y0, x3 - 1, y5 - 1, 4 } };
224 tArea Areas[] = { { x0, y0, x3 - 1, y1 - 1, 2 },
225 { x0, y1, x3 - 1, y3 - 1, 2 },
226 { x0, y3, x3 - 1, y5 - 1, 4 }
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);
257 if (textScroller.CanScroll())
258 DrawScrollbar(textScroller.Total(), textScroller.Offset(), textScroller.Shown(), textScroller.Top(), textScroller.Height(), textScroller.CanScrollUp(), textScroller.CanScrollDown());
274 textScroller.Reset();
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++) {
332 const char *s = GetTabbedText(Text, i);
334 int xt = x0 + Tab(i);
335 osd->
DrawText(xt, y, s, ColorFg, ColorBg, font, x2 - xt);
345 DrawScrollbar(Total, Offset, MaxItems(), y2, MaxItems() *
lineHeight, Offset > 0, Offset + MaxItems() < Total);
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);
400 int w = font->Width(buffer);
401 osd->
DrawText(x3 - w, y, buffer, Theme.
Color(clrMenuEventVpsFg), Theme.
Color(clrMenuEventVpsBg), font, w);
404 const char *Title = Info->
Title();
406 Title = Recording->
Name();
423 textScroller.Set(
osd, x1, y2, GetTextAreaWidth(), y3 - y2, Text, GetTextAreaFont(FixedFont), Theme.
Color(clrMenuText), Theme.
Color(
clrBackground));
444 int w = font->
Width(date);
463 virtual void SetTitle(
const char *Title);
464 virtual void SetMode(
bool Play,
bool Forward,
int Speed);
465 virtual void SetProgress(
int Current,
int Total);
466 virtual void SetCurrent(
const char *
Current);
467 virtual void SetTotal(
const char *Total);
468 virtual void SetJump(
const char *Jump);
470 virtual void Flush(
void);
477 lastCurrentWidth = 0;
485 tArea Areas[] = { { x0, y0, x1 - 1, y3 - 1, 8 } };
489 tArea Areas[] = { { x0, y0, x1 - 1, y3 - 1, 4 } };
509 if (Speed == -1) Mode = Play ?
" > " :
" || ";
510 else if (Play) Mode = Forward ?
" X>> " :
" <<X ";
511 else Mode = Forward ?
" X|> " :
" <|X ";
514 char *p = strchr(buf,
'X');
516 *p = Speed > 0 ?
'1' + Speed - 1 :
' ';
523 cProgressBar pb(x1 - x0, y2 - y1, Current, Total, marks, Theme.
Color(clrReplayProgressSeen), Theme.
Color(clrReplayProgressRest), Theme.
Color(clrReplayProgressSelected), Theme.
Color(clrReplayProgressMark), Theme.
Color(clrReplayProgressCurrent));
530 int w = font->
Width(Current);
532 lastCurrentWidth = w;
538 int w = font->
Width(Total);
552 osd->
DrawText(x0, y2, Text, Theme.
Color(clrMessageStatusFg + 2 * Type), Theme.
Color(clrMessageStatusBg + 2 * Type), font, x1 - x0, y3 - y2,
taCenter);
571 virtual void SetVolume(
int Current,
int Total,
bool Mute);
572 virtual void Flush(
void);
603 const char *Prompt =
tr(
"Volume ");
604 int l = font->
Width(Prompt);
605 int p = (
osd->
Width() - l) * Current / Total;
626 void SetItem(
const char *Text,
int Index,
bool Current);
630 virtual void SetTrack(
int Index,
const char *
const *Tracks);
632 virtual void Flush(
void);
640 int ItemsWidth = font->
Width(Title);
641 for (
int i = 0; i < NumTracks; i++)
642 ItemsWidth =
max(ItemsWidth, font->
Width(Tracks[i]));
647 if (d > ItemsWidth) {
648 d = (d - ItemsWidth) & ~0x07;
655 tArea Areas[] = { { x0, y0, x1 - 1, y2 - 1, 8 } };
659 tArea Areas[] = { { x0, y0, x1 - 1, y2 - 1, 4 } };
662 osd->
DrawText(x0, y0, Title, Theme.
Color(clrMenuTitleFg), Theme.
Color(clrMenuTitleBg), font, x1 - x0);
663 for (
int i = 0; i < NumTracks; i++)
664 SetItem(Tracks[i], i,
false);
677 ColorFg = Theme.
Color(clrMenuItemCurrentFg);
678 ColorBg = Theme.
Color(clrMenuItemCurrentBg);
679 currentIndex = Index;
682 ColorFg = Theme.
Color(clrMenuItemSelectable);
686 osd->
DrawText(x0, y, Text, ColorFg, ColorBg, font, x1 - x0);
691 if (currentIndex >= 0)
692 SetItem(Tracks[currentIndex], currentIndex,
false);
693 SetItem(Tracks[Index], Index,
true);
710 virtual void Flush(
void);
746 :
cSkin(
"classic", &::Theme)
752 return tr(
"Classic VDR");
void SetItem(const char *Text, int Index, bool Current)
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
static int OsdHeight(void)
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Creates and returns a new object for displaying the available tracks.
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
static cString String(void)
Returns a localized string of the form "Disk nn% - hh:mm free".
const cRecordingInfo * Info(void) const
cSkinClassicDisplayMessage(void)
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
const char * ShortText(void) const
virtual void SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
cString GetParentalRatingString(void) const
virtual void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool ReplacePalette=false, bool Overlay=false)
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the ...
virtual void Flush(void)
Actually draws the OSD display to the output device.
static cString sprintf(const char *fmt,...) __attribute__((format(printf
virtual ~cSkinClassicDisplayMessage()
cSkinClassicDisplayReplay(bool ModeOnly)
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the...
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
virtual void Flush(void)
Actually draws the OSD display to the output device.
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
time_t StartTime(void) const
cString ChannelString(const cChannel *Channel, int Number)
virtual void SetButtons(const char *Red, const char *Green=NULL, const char *Yellow=NULL, const char *Blue=NULL)
Sets the color buttons to the given strings, provided this cSkinDisplay actually has a color button d...
virtual void Flush(void)
Actually commits all data to the OSD hardware.
cString GetVpsString(void) const
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...
virtual ~cSkinClassicDisplayVolume()
int ParentalRating(void) const
virtual void SetTitle(const char *Title)
Sets the title of the recording.
static int OsdWidth(void)
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
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...
The cOsd class is the interface to the "On Screen Display".
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
virtual ~cSkinClassicDisplayChannel()
virtual void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width=0, int Height=0, int Alignment=taDefault)
Draws the given string at coordinates (x, y) with the given foreground and background color and font...
virtual void SetTotal(const char *Total)
Sets the total length of the recording, as a user readable string if the form "h:mm:ss".
void SetEditableWidth(int Width)
If an item is set through a call to cSkinDisplayMenu::SetItem(), this function shall be called to set...
const char * Title(void) const
virtual ~cSkinClassicDisplayTracks()
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
cString GetEndTimeString(void) const
cSkinClassicDisplayChannel(bool WithInfo)
virtual ~cSkinClassicDisplayReplay()
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 int Width(uint c) const =0
Returns the width of the given character in pixel.
virtual const char * Description(void)
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
cString GetTimeString(void) const
const cEvent * GetEvent(void) const
const char * Description(void) const
const char * Name(void) const
Returns the full name of the recording (without the video directory.
cSkinClassicDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
const char * Title(void) const
const char * Description(void) const
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 int Height(void) const =0
Returns the height of this font in pixel (all characters have the same height).
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
const char * ChannelName(void) const
cString GetDateString(void) const
const char * ShortText(void) const
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
virtual void SaveRegion(int x1, int y1, int x2, int y2)
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
tColor Color(int Subject)
Returns the color for the given Subject.
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
static const cFont * GetFont(eDvbFont Font)
Gets the given Font, which was previously set by a call to SetFont().
cSkinClassicDisplayVolume(void)
THEME_CLR(Theme, clrBackground, clrGray50)
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...