21 #include "symbols/arrowdown.xpm" 22 #include "symbols/arrowup.xpm" 23 #include "symbols/audio.xpm" 24 #include "symbols/audioleft.xpm" 25 #include "symbols/audioright.xpm" 26 #include "symbols/audiostereo.xpm" 27 #include "symbols/dolbydigital.xpm" 28 #include "symbols/encrypted.xpm" 29 #include "symbols/ffwd.xpm" 30 #include "symbols/ffwd1.xpm" 31 #include "symbols/ffwd2.xpm" 32 #include "symbols/ffwd3.xpm" 33 #include "symbols/frew.xpm" 34 #include "symbols/frew1.xpm" 35 #include "symbols/frew2.xpm" 36 #include "symbols/frew3.xpm" 37 #include "symbols/mute.xpm" 38 #include "symbols/pause.xpm" 39 #include "symbols/play.xpm" 40 #include "symbols/radio.xpm" 41 #include "symbols/recording.xpm" 42 #include "symbols/sfwd.xpm" 43 #include "symbols/sfwd1.xpm" 44 #include "symbols/sfwd2.xpm" 45 #include "symbols/sfwd3.xpm" 46 #include "symbols/srew.xpm" 47 #include "symbols/srew1.xpm" 48 #include "symbols/srew2.xpm" 49 #include "symbols/srew3.xpm" 50 #include "symbols/teletext.xpm" 51 #include "symbols/volume.xpm" 53 #define Roundness (Setup.FontOsdSize / 2) 54 #define Gap (Setup.FontOsdSize / 5) 55 #define ScrollWidth (Setup.FontOsdSize / 4) 56 #define TextFrame (Setup.FontOsdSize / 10) 57 #define TextSpacing (Setup.FontOsdSize / 4) 58 #define SymbolSpacing (Setup.FontOsdSize / 4) 82 THEME_CLR(Theme, clrVolumeBarUpper, 0xFFBC8024);
83 THEME_CLR(Theme, clrVolumeBarLower, 0xFF248024);
88 THEME_CLR(Theme, clrChannelSymbolOff, 0xFFBC8024);
152 virtual void Flush(
void);
193 int yt = (
y0 +
y1) / 2;
194 int yb = (
y6 +
y7) / 2;
196 tArea Areas[] = { { 0, 0,
x7 - 1,
y7 - 1, 32 } };
200 tArea Areas[] = { { 0, 0,
x7 - 1,
y7 - 1, 8 } };
204 tArea Areas[] = { { 0, 0,
x7 - 1,
y7 - 1, 4 } };
268 if (Channel && !Channel->
GroupSep()) {
278 if (Channel->
Vpid()) {
282 else if (Channel->
Apid(0)) {
300 for (
int i = 0; i < 2; i++) {
301 const cEvent *e = !i ? Present : Following;
334 int w = font->
Width(date);
351 int h = ((
y7 -
y6 + 1) - 3 * d) / 2;
352 int w = (
x4 -
x3) / 5;
353 int x = (
x3 +
x4) / 2 - w / 2;
354 if (SignalStrength >= 0) {
355 int s = SignalStrength * w / 100;
361 if (SignalQuality >= 0) {
362 int q = SignalQuality * w / 100;
370 int dw = font->
Width(dn);
381 time_t t = time(NULL);
409 void DrawTitle(
void);
410 void DrawScrollbar(
int Total,
int Offset,
int Shown,
int Top,
int Height,
bool CanScrollUp,
bool CanScrollDown);
411 void SetTextScrollbar(
void);
415 virtual void Scroll(
bool Up,
bool Page);
416 virtual int MaxItems(
void);
417 virtual void Clear(
void);
418 virtual void SetTitle(
const char *Title);
419 virtual void SetButtons(
const char *Red,
const char *Green = NULL,
const char *Yellow = NULL,
const char *Blue = NULL);
421 virtual void SetItem(
const char *Text,
int Index,
bool Current,
bool Selectable);
422 virtual void SetScrollbar(
int Total,
int Offset);
423 virtual void SetEvent(
const cEvent *Event);
424 virtual void SetRecording(
const cRecording *Recording);
425 virtual void SetText(
const char *Text,
bool FixedFont);
426 virtual int GetTextAreaWidth(
void)
const;
427 virtual const cFont *GetTextAreaFont(
bool FixedFont)
const;
428 virtual void Flush(
void);
436 lastDiskUsageState = -1;
455 int yt = (
y0 +
y1) / 2;
456 int yb = (
y6 +
y7) / 2;
507 if (Total > 0 && Total > Shown) {
510 int yb = yt + Height;
511 int st = yt + h +
Gap;
512 int sb = yb - h -
Gap;
513 int th =
max(
int((sb - st) *
double(Shown) / Total + 0.5),
ScrollWidth);
514 int tt =
min(
int(st + (sb - st) *
double(Offset) / Total + 0.5), sb - th);
515 int tb =
min(tt + th, sb);
535 if (textScroller.CanScroll())
536 DrawScrollbar(textScroller.Total(), textScroller.Offset(), textScroller.Shown(), textScroller.Top(), textScroller.Height(), textScroller.CanScrollUp(), textScroller.CanScrollDown());
552 textScroller.Reset();
559 const char *VDR =
" VDR";
561 int w = font->
Width(VDR);
574 const char *lutText[] = { Red, Green, Yellow, Blue };
575 tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg };
576 tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg };
616 ColorFg = Theme.
Color(clrMenuItemCurrentFg);
617 ColorBg = Theme.
Color(clrMenuItemCurrentBg);
622 currentIndex = Index;
625 ColorFg = Theme.
Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable);
627 if (currentIndex == Index) {
633 for (
int i = 0; i < MaxTabs; i++) {
634 const char *s = GetTabbedText(Text, i);
647 DrawScrollbar(Total, Offset, MaxItems(),
y3 +
Roundness, MaxItems() *
lineHeight, Offset > 0, Offset + MaxItems() < Total);
664 int w = font->Width(buffer);
666 int yb = y + font->Height();
674 int w = font->Width(buffer);
676 int yb = y + font->Height();
693 yb = yt + textScroller.Height();
716 int w = font->Width(buffer);
718 int yb = y + font->Height();
723 const char *Title = Info->
Title();
725 Title = Recording->
Name();
738 yb = yt + textScroller.Height();
772 int w = font->
Width(date);
792 virtual void SetTitle(
const char *Title);
793 virtual void SetMode(
bool Play,
bool Forward,
int Speed);
794 virtual void SetProgress(
int Current,
int Total);
795 virtual void SetCurrent(
const char *
Current);
796 virtual void SetTotal(
const char *Total);
797 virtual void SetJump(
const char *Jump);
799 virtual void Flush(
void);
807 lastCurrentWidth = 0;
814 x6 =
x7 - lineHeight / 2;
815 x5 =
x6 - lineHeight / 2;
825 int yt = (
y0 +
y1) / 2;
826 int yb = (
y6 +
y7) / 2;
828 tArea Areas[] = { { 0, 0,
x7 - 1,
y7 - 1, 32 } };
832 tArea Areas[] = { { 0, 0,
x7 - 1,
y7 - 1, 8 } };
836 tArea Areas[] = { { 0, 0,
x7 - 1,
y7 - 1, 4 } };
875 { { pause_xpm, srew_xpm, srew1_xpm, srew2_xpm, srew3_xpm },
876 { pause_xpm, sfwd_xpm, sfwd1_xpm, sfwd2_xpm, sfwd3_xpm }, },
877 { { play_xpm, frew_xpm, frew1_xpm, frew2_xpm, frew3_xpm },
878 { play_xpm, ffwd_xpm, ffwd1_xpm, ffwd2_xpm, ffwd3_xpm } }
890 cProgressBar pb(
x4 -
x3,
y4 -
y3, Current, Total, marks, Theme.
Color(clrReplayProgressSeen), Theme.
Color(clrReplayProgressRest), Theme.
Color(clrReplayProgressSelected), Theme.
Color(clrReplayProgressMark), Theme.
Color(clrReplayProgressCurrent));
897 int w = font->
Width(Current);
899 lastCurrentWidth = w;
905 int w = font->
Width(Total);
943 virtual void SetVolume(
int Current,
int Total,
bool Mute);
944 virtual void Flush(
void);
958 x6 =
x7 - lineHeight / 2;
959 x5 =
x6 - lineHeight / 2;
999 cBitmap bm(Mute ? mute_xpm : volume_xpm);
1003 int w = (
y1 -
y0) / 3;
1005 int n = (xr - xl + d) / (w + d);
1006 int x = xr - n * (w + d);
1008 for (
int i = 0; i < n; i++) {
1009 if (Total * i >= Current * n)
1010 Color = Theme.
Color(clrVolumeBarUpper);
1033 void SetItem(
const char *Text,
int Index,
bool Current);
1037 virtual void SetTrack(
int Index,
const char *
const *Tracks);
1038 virtual void SetAudioChannel(
int AudioChannel);
1039 virtual void Flush(
void);
1052 int ItemsWidth = font->
Width(Title);
1053 for (
int i = 0; i < NumTracks; i++)
1054 ItemsWidth =
max(ItemsWidth, font->
Width(Tracks[i]));
1065 if (d > ItemsWidth) {
1066 d = (d - ItemsWidth) & ~0x07;
1081 int yt = (
y0 +
y1) / 2;
1082 int yb = (
y6 +
y7) / 2;
1097 {
x0,
y3, x3 - 1,
y4 - 1, 1 },
1125 for (
int i = 0; i < NumTracks; i++)
1126 SetItem(Tracks[i], i,
false);
1139 ColorFg = Theme.
Color(clrMenuItemCurrentFg);
1140 ColorBg = Theme.
Color(clrMenuItemCurrentBg);
1145 currentIndex = Index;
1148 ColorFg = Theme.
Color(clrMenuItemSelectable);
1150 if (currentIndex == Index) {
1157 osd->
DrawText(xt, y, Text, ColorFg, ColorBg, font,
x4 - xt);
1162 if (currentIndex >= 0)
1163 SetItem(Tracks[currentIndex], currentIndex,
false);
1164 SetItem(Tracks[Index], Index,
true);
1170 switch (AudioChannel) {
1171 case 0: bm = &bmAudioStereo;
break;
1172 case 1: bm = &bmAudioLeft;
break;
1173 case 2: bm = &bmAudioRight;
break;
1198 virtual void Flush(
void);
1207 x1 = lineHeight / 2;
1211 x6 =
x7 - lineHeight / 2;
1212 x5 =
x6 - lineHeight / 2;
1255 :
cSkin(
"sttng", &::Theme)
1261 return tr(
"ST:TNG Panels");
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
virtual void Flush(void)
Actually draws the OSD display to the output device.
static int OsdHeight(void)
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
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 const char * Description(void)
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
static cString String(void)
Returns a localized string of the form "Disk nn% - hh:mm free".
const cRecordingInfo * Info(void) const
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
THEME_CLR(Theme, clrBackground, clrGray50)
const char * ShortText(void) const
virtual void Flush(void)
Actually draws the OSD display to the output device.
int Ca(int Index=0) const
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 cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
static const char *const * ReplaySymbols[2][2][5]
static cString sprintf(const char *fmt,...) __attribute__((format(printf
virtual void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants=0)
Draws a filled ellipse defined by the upper left (x1, y1) and lower right (x2, y2) corners with the g...
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
virtual ~cSkinSTTNGDisplayChannel()
virtual ~cSkinSTTNGDisplayVolume()
static cBitmap bmEncrypted
bool GroupSep(void) const
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...
static cBitmap bmAudioLeft
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
virtual void SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
time_t StartTime(void) const
cString ChannelString(const cChannel *Channel, int Number)
static cBitmap bmAudioRight
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
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...
static cBitmap bmAudioStereo
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
virtual void Flush(void)
Actually commits all data to the OSD hardware.
cString GetVpsString(void) const
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
cSkinSTTNGDisplayReplay(bool ModeOnly)
static cBitmap bmTeletext
int ParentalRating(void) const
cSkinSTTNGDisplayMessage(void)
virtual ~cSkinSTTNGDisplayMessage()
static int OsdWidth(void)
virtual ~cSkinSTTNGDisplayTracks()
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
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...
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
The cOsd class is the interface to the "On Screen Display".
virtual void Flush(void)
Actually draws the OSD display to the output device.
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 cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
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 SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
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
cSkinSTTNGDisplayChannel(bool WithInfo)
cString GetEndTimeString(void) const
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 ~cSkinSTTNGDisplayReplay()
void SetItem(const char *Text, int Index, bool Current)
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
static cDevice * PrimaryDevice(void)
Returns the primary device.
virtual int Width(uint c) const =0
Returns the width of the given character in pixel.
static cBitmap bmRecording
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
const tTrackId * GetTrack(eTrackType Type)
Returns a pointer to the given track id, or NULL if Type is not less than ttMaxTrackTypes.
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Creates and returns a new object for displaying the available tracks.
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.
virtual void SetTitle(const char *Title)
Sets the title of the recording.
cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
const char * Title(void) const
virtual void Flush(void)
Actually draws the OSD display to the output device.
const char * Description(void) const
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise...
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
static cBitmap bmDolbyDigital
cString GetDateString(void) const
const char * ShortText(void) const
cSkinSTTNGDisplayVolume(void)
eTrackType GetCurrentAudioTrack(void) const
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.
The cDevice class is the base from which actual devices can be derived.
static const cFont * GetFont(eDvbFont Font)
Gets the given Font, which was previously set by a call to SetFont().
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 SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
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...