34 #include "symbols/arrowdown.xpm" 35 #include "symbols/arrowup.xpm" 36 #include "symbols/audio.xpm" 37 #include "symbols/audioleft.xpm" 38 #include "symbols/audioright.xpm" 39 #include "symbols/audiostereo.xpm" 40 #include "symbols/dolbydigital.xpm" 41 #include "symbols/encrypted.xpm" 42 #include "symbols/ffwd.xpm" 43 #include "symbols/ffwd1.xpm" 44 #include "symbols/ffwd2.xpm" 45 #include "symbols/ffwd3.xpm" 46 #include "symbols/frew.xpm" 47 #include "symbols/frew1.xpm" 48 #include "symbols/frew2.xpm" 49 #include "symbols/frew3.xpm" 50 #include "symbols/mute.xpm" 51 #include "symbols/pause.xpm" 52 #include "symbols/play.xpm" 53 #include "symbols/radio.xpm" 54 #include "symbols/recording.xpm" 55 #include "symbols/sfwd.xpm" 56 #include "symbols/sfwd1.xpm" 57 #include "symbols/sfwd2.xpm" 58 #include "symbols/sfwd3.xpm" 59 #include "symbols/srew.xpm" 60 #include "symbols/srew1.xpm" 61 #include "symbols/srew2.xpm" 62 #include "symbols/srew3.xpm" 63 #include "symbols/teletext.xpm" 64 #include "symbols/volume.xpm" 66 #define Gap (Setup.FontOsdSize / 5 & ~1) // must be even 67 #define TextFrame (Setup.FontOsdSize / TEXT_ALIGN_BORDER) 68 #define TextSpacing (2 * TextFrame) 69 #define SymbolSpacing TextSpacing 70 #define ShowSeenExtent (Setup.FontOsdSize / 5) // pixels by which the "seen" bar extends out of the frame 72 #define DISKUSAGEALERTLIMIT 95 // percent of disk usage above which the display goes into alert mode 73 #define SIGNALDISPLAYDELTA 2 // seconds between subsequent device signal displays 79 #define CLR_BACKGROUND 0x99000000 80 #define CLR_MAIN_FRAME 0xFFFF9966 81 #define CLR_CHANNEL_FRAME 0xFF8A9EC9 82 #define CLR_REPLAY_FRAME 0xFFCC6666 83 #define CLR_DATE 0xFF99CCFF 84 #define CLR_MENU_ITEMS 0xFF9999FF 85 #define CLR_TIMER 0xFF99CCFF 86 #define CLR_DEVICE 0xFFF1B1AF 87 #define CLR_CHANNEL_NAME 0xFF99CCFF 88 #define CLR_EVENT_TITLE 0xFF99CCFF 89 #define CLR_EVENT_TIME 0xFFFFCC66 90 #define CLR_EVENT_SHORTTEXT 0xFFFFCC66 91 #define CLR_TEXT 0xFF99CCFF 92 #define CLR_TRACK 0xFFFFCC66 93 #define CLR_SEEN 0xFFCC99CC 94 #define CLR_ALERT 0xFFFF0000 95 #define CLR_EXPOSED 0xFF990000 96 #define CLR_WHITE 0xFFFFFFFF 97 #define CLR_RED 0xFFCC6666 98 #define CLR_GREEN 0xFFA0FF99 99 #define CLR_YELLOW 0xFFF1DF60 100 #define CLR_BLUE 0xFF9A99FF 101 #define CLR_BLACK 0xFF000000 208 int Bpp[] = { 32, 8, 4, 2, 1 };
209 tArea Area = { x0, y0, x1, y1, 0 };
210 for (
unsigned int i = 0; i <
sizeof(Bpp) /
sizeof(
int); i++) {
215 TwoColors = Area.
bpp == 1;
226 int Height = LineHeight;
229 if (Height < 2 || TinyFont->Height() <= LineHeight)
236 static bool DrawDeviceData(
cOsd *Osd,
const cDevice *Device,
int x0,
int y0,
int x1,
int y1,
int &xs,
const cFont *TinyFont,
cString &LastDeviceType,
cCamSlot *&LastCamSlot,
bool Initial)
240 if (Initial || strcmp(DeviceType, LastDeviceType) || CamSlot != LastCamSlot) {
248 int w =
max(font->
Width(Nr), y1 - y0);
252 Osd->
DrawText(x, y0, DeviceType, ColorFg, ColorBg, TinyFont);
253 xs =
max(xs, x + TinyFont->
Width(DeviceType));
254 LastDeviceType = DeviceType;
258 Osd->
DrawText(x, y1 - TinyFont->
Height(), s, ColorFg, ColorBg, TinyFont);
259 xs =
max(xs, x + TinyFont->
Width(s));
261 LastCamSlot = CamSlot;
267 static void DrawDeviceSignal(
cOsd *Osd,
const cDevice *Device,
int x0,
int y0,
int x1,
int y1,
int &LastSignalStrength,
int &LastSignalQuality,
bool Initial)
271 int d =
max((y1 - y0) / 10, 1);
274 int h = (y1 - y0 - 3 * d) / 2;
280 tColor ColorSignalValue, ColorSignalRest;
283 ColorSignalRest = Theme.
Color(clrMenuFrameBg);
286 ColorSignalValue = Theme.
Color(clrSignalValue);
287 ColorSignalRest = Theme.
Color(clrSignalRest);
289 if (SignalStrength >= 0 && (Initial || SignalStrength != LastSignalStrength)) {
290 int s = SignalStrength * w / 100;
291 Osd->
DrawRectangle(x00, y00, x00 + s - 1, y01 - 1, ColorSignalValue);
292 Osd->
DrawRectangle(x00 + s, y00, x01 - 1, y01 - 1, ColorSignalRest);
293 LastSignalStrength = SignalStrength;
295 if (SignalQuality >= 0 && (Initial || SignalQuality != LastSignalQuality)) {
296 int q = SignalQuality * w / 100;
297 Osd->
DrawRectangle(x00, y02, x00 + q - 1, y03 - 1, ColorSignalValue);
298 Osd->
DrawRectangle(x00 + q, y02, x01 - 1, y03 - 1, ColorSignalRest);
299 LastSignalQuality = SignalQuality;
312 int d = (y1 - y0) / 2;
313 int w = x1 - x0 - 2 * d;
314 int l =
max(x0 + d, x0 + d + w * HardLimitLeft / HorizonDelta);
315 int r =
min(x1 - d, x1 - d - w * HardLimitRight / HorizonDelta) - 1;
316 int c =
constrain(x0 + d + w * Current / HorizonDelta, l, r);
317 int t =
constrain(x0 + d + w * Target / HorizonDelta, l, r);
318 if (c == LastCurrent)
322 tColor ColorRange, ColorMove;
324 ColorRange = Theme.
Color(clrChannelFrameBg);
328 ColorRange = Theme.
Color(clrChannelFrameBg);
329 ColorMove = Theme.
Color(clrDeviceBg);
332 Osd->
DrawEllipse(l - d, y0, l, y1 - 1, ColorRange, 7);
334 Osd->
DrawEllipse(r, y0, r + d, y1 - 1, ColorRange, 5);
335 Osd->
DrawEllipse(c - d, y0, c, y1 - 1, ColorMove, 7);
337 Osd->
DrawEllipse(t, y0, t + d, y1 - 1, ColorMove, 5);
346 int xc00,
xc01,
xc02,
xc03,
xc04,
xc05,
xc06,
xc07,
xc08,
xc09,
xc10,
xc11,
xc12,
xc13,
xc14,
xc15;
347 int yc00,
yc01,
yc02,
yc03,
yc04,
yc05,
yc06,
yc07,
yc08,
yc09,
yc10,
yc11,
yc12;
380 virtual void Flush(
void);
436 yc12 =
yc07 + 3 * lineHeight + Gap / 2;
505 int Seen = (Total > 0) ?
min(
xc07 -
xc06,
int((
xc07 -
xc06) *
double(Current) / Total)) : 0;
518 if (
DrawDeviceData(
osd, Device,
xc10,
yc11,
xc11,
yc12,
xs,
tinyFont,
lastDeviceType,
lastCamSlot, Device->
DeviceNumber() !=
lastDeviceNumber)) {
529 time_t Now = time(NULL);
546 if (Channel && !Channel->
GroupSep()) {
556 if (Channel->
Vpid()) {
560 else if (Channel->
Apid(0)) {
568 ChName = Channel->
Name();
595 for (
int i = 0; i < 2; i++) {
596 const cEvent *e = !i ? Present : Following;
613 int x0, x1, y0, y1, y2;
664 time_t t = time(NULL);
681 int xa00, xa01, xa02, xa03, xa04, xa05, xa06, xa07, xa08,
xa09;
682 int yt00, yt01, yt02, yt03, yt04, yt05,
yt06;
683 int yc00,
yc01,
yc02,
yc03,
yc04,
yc05,
yc06,
yc07,
yc08,
yc09,
yc10,
yc11;
684 int yb00, yb01, yb02, yb03, yb04, yb05, yb06, yb07, yb08, yb09, yb10, yb11, yb12, yb13, yb14,
yb15;
685 int xm00, xm01, xm02, xm03, xm04, xm05, xm06, xm07,
xm08;
686 int ym00, ym01, ym02, ym03, ym04, ym05, ym06,
ym07;
687 int xs00, xs01, xs02, xs03, xs04, xs05, xs06, xs07, xs08, xs09, xs10, xs11, xs12,
xs13;
688 int ys00, ys01, ys02, ys03, ys04,
ys05;
691 int xb00, xb01, xb02, xb03, xb04, xb05, xb06, xb07, xb08, xb09, xb10, xb11, xb12, xb13, xb14,
xb15;
692 int xd00, xd01, xd02, xd03, xd04, xd05, xd06,
xd07;
693 int yd00, yd01, yd02, yd03, yd04,
yd05;
724 void DrawMainFrameUpper(
tColor Color);
725 void DrawMainFrameLower(
void);
726 void DrawMainButton(
const char *Text,
int x0,
int x1,
int x2,
int x3,
int y0,
int y1,
tColor ColorFg,
tColor ColorBg,
const cFont *
Font);
727 void DrawMenuFrame(
void);
728 void DrawMainBracket(
void);
729 void DrawStatusElbows(
void);
733 void DrawFrameDisplay(
void);
734 void DrawScrollbar(
int Total,
int Offset,
int Shown,
bool CanScrollUp,
bool CanScrollDown);
735 void DrawTimer(
const cTimer *Timer,
int y,
bool MultiRec);
736 void DrawTimers(
void);
738 void DrawDevices(
void);
739 void DrawLiveIndicator(
void);
740 void DrawSignals(
void);
741 void DrawLive(
const cChannel *Channel);
743 void DrawInfo(
const cEvent *Event,
bool WithTime);
745 void DrawTextScrollbar(
void);
749 virtual void Scroll(
bool Up,
bool Page);
750 virtual int MaxItems(
void);
751 virtual void Clear(
void);
753 virtual void SetTitle(
const char *Title);
754 virtual void SetButtons(
const char *Red,
const char *Green = NULL,
const char *Yellow = NULL,
const char *Blue = NULL);
756 virtual void SetItem(
const char *Text,
int Index,
bool Current,
bool Selectable);
757 virtual void SetScrollbar(
int Total,
int Offset);
758 virtual void SetEvent(
const cEvent *Event);
759 virtual void SetRecording(
const cRecording *Recording);
760 virtual void SetText(
const char *Text,
bool FixedFont);
761 virtual int GetTextAreaWidth(
void)
const;
762 virtual const cFont *GetTextAreaFont(
bool FixedFont)
const;
763 virtual void Flush(
void);
774 lastMode = cmUnknown;
777 lastRecording = NULL;
780 lastLiveIndicatorY = -1;
781 lastLiveIndicatorTransferring =
false;
782 lastDiskUsageState = -1;
783 lastDiskAlert =
false;
812 yc05 =
yc00 + 3 * lineHeight + Gap / 2;
823 yc11 =
yc06 + 3 * lineHeight + Gap / 2;
844 if (yb09 - yb08 < 2 * lineHeight) {
848 if (yb09 - yb08 < 2 * lineHeight) {
852 if (yb05 - yb04 < 2 * lineHeight) {
856 if (yb03 - yb02 < 2 * lineHeight) {
866 xm08 = (xa09 + xa00) / 2;
868 xm06 = xm07 - lineHeight / 2;
869 xm05 = xm06 - lineHeight / 2;
873 ym01 = ym00 + lineHeight / 2;
874 ym02 = ym01 + lineHeight / 2;
877 ym06 = ym07 - lineHeight / 2;
878 ym05 = ym06 - lineHeight / 2;
882 xs00 = xm08 + Gap + lineHeight +
Gap;
886 xs05 = (xs00 + xs11 +
Gap) / 2;
887 xs04 = xs05 - lineHeight / 2;
888 xs03 = xs04 - lineHeight / 2;
892 xs07 = xs06 + lineHeight / 2;
893 xs08 = xs07 + lineHeight / 2;
898 ys02 = ys01 + lineHeight / 2;
915 int w = (xa08 - xa06) / 4;
916 xb01 = xb00 + lineHeight / 2;
920 xb05 = xb04 + lineHeight / 2;
924 xb09 = xb08 + lineHeight / 2;
928 xb13 = xb12 + lineHeight / 2;
966 if (MenuCategory ==
mcMain) {
973 timersStateKey.Reset();
974 DrawMainFrameLower();
1063 tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg };
1078 const char *t = strrchr(s,
' ');
1092 tColor ColorFg = DiskAlert ? Theme.
Color(clrAlertFg) : Theme.
Color(clrMenuFrameFg);
1094 if (
initial || DiskAlert != lastDiskAlert)
1097 osd->
DrawText(xa00, yb03 -
lineHeight,
cString::sprintf(
"%02d:%02d",
cVideoDiskUsage::FreeMinutes() / 60,
cVideoDiskUsage::FreeMinutes() % 60), ColorFg, ColorBg, font, xa02 - xa00, 0,
taBottom |
taRight |
taBorder);
1098 lastDiskAlert = DiskAlert;
1111 if (getloadavg(&SystemLoad, 1) > 0) {
1112 if (
initial || SystemLoad != lastSystemLoad) {
1114 lastSystemLoad = SystemLoad;
1172 if (MenuCategory() ==
mcMain) {
1177 ClearColor = Theme.
Color(clrMenuMainBracket);
1195 if (Total > 0 && Total > Shown) {
1197 int sh =
max(
int((tb - tt) *
double(Shown) / Total + 0.5), sw);
1198 int st =
min(
int(tt + (tb - tt) *
double(Offset) / Total + 0.5), tb - sh);
1199 int sb =
min(st + sh, tb);
1203 else if (MenuCategory() !=
mcMain)
1211 tColor ColorFg = Alert ? Theme.
Color(clrAlertFg) : Theme.
Color(clrTimerFg);
1212 tColor ColorBg = Alert ? Theme.
Color(clrAlertBg) : Theme.
Color(clrTimerBg);
1218 time_t Now = time(NULL);
1224 else if (strcmp(Day, Today) != 0)
1251 deviceRecording.Clear();
1263 for (
int i = 0; i < SortedTimers.
Size(); i++) {
1266 if (
const cTimer *Timer = SortedTimers[i]) {
1267 if (Timer->Recording()) {
1268 if (Timer->Remote()) {
1269 if (!Device && Timer->HasFlags(
tfActive)) {
1270 DrawTimer(Timer, y,
false);
1271 FreeDeviceSlots.
Append(y);
1278 if (!Device || Device == RecordControl->Device()) {
1279 DrawTimer(Timer, y, NumTimers > 0);
1282 Device = RecordControl->Device();
1288 FreeDeviceSlots.
Append(y);
1294 SortedTimers[i] = NULL;
1296 else if (!Device && Timer->HasFlags(
tfActive)) {
1297 DrawTimer(Timer, y,
false);
1298 FreeDeviceSlots.
Append(y);
1300 SortedTimers[i] = NULL;
1311 if (Device->NumProvidedSystems()) {
1312 if (!deviceRecording[Device->DeviceNumber()]) {
1313 if (Slot < FreeDeviceSlots.
Size()) {
1314 y = FreeDeviceSlots[Slot];
1319 deviceOffset[Device->DeviceNumber()] = y;
1328 for (
const cTimer *Timer = Timers->First(); Timer; Timer = Timers->
Next(Timer)) {
1336 timersStateKey.Remove();
1343 int y = deviceOffset[dn];
1345 if (
DrawDeviceData(
osd, Device, xs08, y, xs11, y +
lineHeight,
xs,
tinyFont,
lastDeviceType[dn],
lastCamSlot[dn],
initial)) {
1352 if (deviceRecording[dn])
1361 if (Device->NumProvidedSystems())
1372 if (!Device->
Replaying() || Transferring)
1374 if (
initial || y != lastLiveIndicatorY || Transferring != lastLiveIndicatorTransferring) {
1375 if (lastLiveIndicatorY >= 0)
1382 int w = bmTransferMode.Width();
1383 int h = bmTransferMode.Height();
1384 int b = w * w + h * h;
1386 const cBitmap *bm = &bmTransferMode;
1389 double f = sqrt(
double(c) / (2 * b));
1390 bm = bmTransferMode.
Scaled(f, f);
1393 if (bm != &bmTransferMode)
1397 lastLiveIndicatorY = y;
1398 lastLiveIndicatorTransferring = Transferring;
1404 time_t Now = time(NULL);
1408 if (Device->NumProvidedSystems()) {
1409 if (
int y = deviceOffset[i])
1420 if (lastMode != cmLive) {
1425 DrawMainFrameUpper(Theme.
Color(clrChannelFrameBg));
1430 if (
initial || Channel != lastChannel || strcmp(Channel->
Name(), lastChannelName)) {
1435 lastChannel = Channel;
1436 lastChannelName = Channel->
Name();
1441 if (
const cSchedule *Schedule = Schedules->GetSchedule(Channel)) {
1442 const cEvent *Event = Schedule->GetPresentEvent();
1443 if (
initial || Event != lastEvent) {
1444 DrawInfo(Event,
true);
1451 time_t t = time(NULL);
1462 if (lastMode != cmPlay) {
1467 DrawMainFrameUpper(Theme.
Color(clrReplayFrameBg));
1473 if (Control->
GetIndex(Current, Total))
1477 if (
initial || Recording != lastRecording) {
1481 DrawInfo(Info->GetEvent(),
false);
1487 lastRecording = Recording;
1492 if (!*lastHeader || strcmp(Header, lastHeader)) {
1494 lastHeader = Header;
1516 int Seen = (Total > 0) ?
min(xm08 - xm02,
int((xm08 - xm02) *
double(Current) / Total)) : 0;
1528 if (textScroller.CanScroll())
1529 DrawScrollbar(textScroller.Total(), textScroller.Offset(), textScroller.Shown(), textScroller.CanScrollUp(), textScroller.CanScrollDown());
1535 DrawTextScrollbar();
1540 if (MenuCategory() ==
mcMain)
1548 textScroller.Reset();
1554 if (MenuCategory() !=
mcMain) {
1556 int w =
min(font->
Width(Title), xa07 - xa06 -
Gap);
1564 const char *lutText[] = { Red, Green, Yellow, Blue };
1565 tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg };
1566 tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg };
1568 if (MenuCategory() ==
mcMain) {
1575 int h = yb15 - yb14;
1600 ColorBg = Theme.
Color(clrMenuFrameBg);
1603 ColorFg = Theme.
Color(clrMenuItemCurrentFg);
1604 ColorBg = Theme.
Color(clrMenuItemCurrentBg);
1607 osd->
DrawRectangle(xi02, y, xi02 + lineHeight / 2 - 1, y + lineHeight - 1, ColorBg);
1608 osd->
DrawEllipse (xi02 + lineHeight / 2, y, xi03 - 1, y + lineHeight - 1, ColorBg, 5);
1609 currentIndex = Index;
1612 ColorFg = Theme.
Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable);
1614 if (currentIndex == Index)
1618 for (
int i = 0; i < MaxTabs; i++) {
1619 const char *s = GetTabbedText(Text, i);
1622 osd->
DrawText(xt, y, s, ColorFg, ColorBg, font, xi01 - xt);
1632 DrawScrollbar(Total, Offset, MaxItems(), Offset > 0, Offset + MaxItems() < Total);
1648 int w = font->Width(buffer);
1650 int yb = y + font->Height();
1658 int w = font->Width(buffer);
1660 int yb = y + font->Height();
1677 DrawTextScrollbar();
1696 int w = font->Width(buffer);
1698 int yb = y + font->Height();
1703 const char *Title = Info->
Title();
1705 Title = Recording->
Name();
1718 DrawTextScrollbar();
1724 textScroller.Set(
osd, xi00, yi00, GetTextAreaWidth(), yi01 - yi00, Text, GetTextAreaFont(FixedFont), Theme.
Color(clrMenuText), Theme.
Color(
clrBackground));
1725 DrawTextScrollbar();
1742 if (MenuCategory() ==
mcMain) {
1753 DrawLiveIndicator();
1766 int xp00, xp01, xp02, xp03, xp04, xp05, xp06, xp07, xp08, xp09, xp10, xp11, xp12, xp13, xp14,
xp15;
1767 int yp00, yp01, yp02, yp03, yp04, yp05, yp06, yp07, yp08,
yp09;
1780 virtual void SetRecording(
const cRecording *Recording);
1781 virtual void SetTitle(
const char *Title);
1782 virtual void SetMode(
bool Play,
bool Forward,
int Speed);
1783 virtual void SetProgress(
int Current,
int Total);
1784 virtual void SetCurrent(
const char *
Current);
1785 virtual void SetTotal(
const char *Total);
1786 virtual void SetJump(
const char *Jump);
1788 virtual void Flush(
void);
1794 modeOnly = ModeOnly;
1797 lastCurrentWidth = 0;
1802 xp01 = xp00 + d / 2;
1805 xp04 = xp02 + d / 4;
1811 xp07 = (xp15 + xp00) / 2;
1815 xp11 = (xp10 + xp13 +
Gap) / 2;
1824 yp09 = yp04 + 3 * lineHeight + Gap / 2;
1827 yp06 = yp08 - d / 4;
1828 yp05 = yp09 - d / 2;
1882 SetTitle(RecordingInfo->
Title());
1894 { { pause_xpm, srew_xpm, srew1_xpm, srew2_xpm, srew3_xpm },
1895 { pause_xpm, sfwd_xpm, sfwd1_xpm, sfwd2_xpm, sfwd3_xpm }, },
1896 { { play_xpm, frew_xpm, frew1_xpm, frew2_xpm, frew3_xpm },
1897 { play_xpm, ffwd_xpm, ffwd1_xpm, ffwd2_xpm, ffwd3_xpm } }
1903 cBitmap bm(ReplaySymbols[Play][Forward][Speed + 1]);
1909 cProgressBar pb(xp13 - xp03,
lineHeight, Current, Total, marks, Theme.
Color(clrReplayProgressSeen), Theme.
Color(clrReplayProgressRest), Theme.
Color(clrReplayProgressSelected), Theme.
Color(clrReplayProgressMark), Theme.
Color(clrReplayProgressCurrent));
1916 int w = font->
Width(Current);
1918 lastCurrentWidth = w;
1924 int w = font->
Width(Total);
1958 int x0, x1, x2, x3, x4, x5, x6,
x7;
1965 virtual void SetVolume(
int Current,
int Total,
bool Mute);
1966 virtual void Flush(
void);
1976 x1 = lineHeight / 2;
1980 x6 = x7 - lineHeight / 2;
1981 x5 = x6 - lineHeight / 2;
2011 cBitmap bm(Mute ? mute_xpm : volume_xpm);
2015 int w = (y1 - y0) / 3;
2017 int n = (xr - xl + d) / (w + d);
2018 int x = xr - n * (w + d);
2020 for (
int i = 0; i < n; i++) {
2021 if (Total * i >= Current * n)
2022 Color = Theme.
Color(clrVolumeBarUpper);
2039 int xt00, xt01, xt02, xt03, xt04, xt05, xt06, xt07, xt08, xt09, xt10, xt11,
xt12;
2040 int yt00, yt01, yt02, yt03, yt04, yt05, yt06,
yt07;
2045 void SetItem(
const char *Text,
int Index,
bool Current);
2049 virtual void SetTrack(
int Index,
const char *
const *Tracks);
2050 virtual void SetAudioChannel(
int AudioChannel);
2051 virtual void Flush(
void);
2068 int ItemsWidth = font->
Width(Title) + xt03 - xt02;
2069 for (
int i = 0; i < NumTracks; i++)
2071 xt04 = xt02 + ItemsWidth;
2077 xt10 = xt09 + lineHeight / 2;
2084 yt04 = yt03 + NumTracks * lineHeight + (NumTracks - 1) * Gap;
2089 yt04 -= lineHeight +
Gap;
2108 for (
int i = 0; i < NumTracks; i++)
2109 SetItem(Tracks[i], i,
false);
2135 ColorFg = Theme.
Color(clrTrackItemCurrentFg);
2136 ColorBg = Theme.
Color(clrTrackItemCurrentBg);
2140 osd->
DrawEllipse (xt05 + lineHeight / 2, y0, xt07 - 1, y1 - 1, ColorBg, 5);
2141 currentIndex = Index;
2144 ColorFg = Theme.
Color(clrTrackItemFg);
2145 ColorBg = Theme.
Color(clrTrackItemBg);
2148 if (currentIndex == Index)
2157 if (currentIndex >= 0)
2158 SetItem(Tracks[currentIndex], currentIndex,
false);
2159 SetItem(Tracks[Index], Index,
true);
2165 switch (AudioChannel) {
2166 case 0: bm = &bmAudioStereo;
break;
2167 case 1: bm = &bmAudioLeft;
break;
2168 case 2: bm = &bmAudioRight;
break;
2187 int x0, x1, x2, x3, x4, x5, x6,
x7;
2193 virtual void Flush(
void);
2201 x1 = lineHeight / 2;
2205 x6 = x7 - lineHeight / 2;
2206 x5 = x6 - lineHeight / 2;
2220 tColor ColorFg = Theme.
Color(clrMessageStatusFg + 2 * Type);
2221 tColor ColorBg = Theme.
Color(clrMessageStatusBg + 2 * Type);
2240 :
cSkin(
"lcars", &::Theme)
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
static cBitmap bmAudioLeft
static cString ToString(int Code)
bool Replaying(void) const
Returns true if we are currently replaying.
static int OsdHeight(void)
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
static cBitmap bmAudioRight
virtual void SetTotal(const char *Total)
Sets the total length of the recording, as a user readable string if the form "h:mm:ss".
static cFont * CreateTinyFont(int LineHeight)
static cOsd * CreateOsd(int Left, int Top, int x0, int y0, int x1, int y1)
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
int MasterSlotNumber(void)
Returns the number of this CAM's master slot within the whole system.
static void DrawDeviceSignal(cOsd *Osd, const cDevice *Device, int x0, int y0, int x1, int y1, int &LastSignalStrength, int &LastSignalQuality, bool Initial)
bool GetIndex(int &Current, int &Total, bool SnapToIFrame=false) const
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
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 ~cSkinLCARSDisplayTracks()
static int NormalizeAngle(int Angle)
Normalizes the given Angle into the range -1800...1800.
const cRecordingInfo * Info(void) const
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
static cBitmap bmEncrypted
const char * ShortText(void) const
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
int Ca(int Index=0) const
virtual const cRecording * GetRecording(void)
Returns the cRecording that is currently being replayed, or NULL if this player is not playing a cRec...
cString GetParentalRatingString(void) const
virtual void SetRecording(const cRecording *Recording)
Sets the recording that is currently being played.
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 ...
static cString sprintf(const char *fmt,...) __attribute__((format(printf
int TargetLongitude(void) const
Returns the longitude the dish is supposed to be moved to.
virtual void Append(T Data)
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...
virtual void Flush(void)
Actually draws the OSD display to the output device.
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
cSkinLCARSDisplayMessage(void)
const cEvent * Event(void) const
cString & Truncate(int Index)
Truncate the string at the given Index (if Index is < 0 it is counted from the end of the string)...
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
static cDevice * GetDevice(int Index)
Gets the device with the given Index.
static cControl * Control(bool Hidden=false)
Returns the current replay control (if any) in case it is currently visible.
virtual void SetTitle(const char *Title)
Sets the title of the recording.
bool GroupSep(void) const
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
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 int NumDevices(void)
Returns the total number of devices.
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
time_t StartTime(void) const
time_t StartTime(void) const
#define CLR_EVENT_SHORTTEXT
cString ChannelString(const cChannel *Channel, int Number)
void DrawSeen(int Current, int Total)
virtual ~cSkinLCARSDisplayReplay()
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
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.
virtual int Width(void) const =0
Returns the original character width as requested when the font was created, or 0 if the default widt...
const cChannel * Channel(void) const
A steerable satellite dish generally points to the south on the northern hemisphere, and to the north on the southern hemisphere (unless you're located directly on the equator, in which case the general direction is "up").
cCamSlot * CamSlot(void) const
Returns the CAM slot that is currently used with this device, or NULL if no CAM slot is in use...
bool Transferring(void) const
Returns true if we are currently in Transfer Mode.
cString GetVpsString(void) const
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
bool Recording(void) const
int ParentalRating(void) const
const char * Name(void) const
virtual void Flush(void)
Actually draws the OSD display to the output device.
#define DISKUSAGEALERTLIMIT
virtual void SetCurrent(const char *Current)
Sets the current position within the recording, as a user readable string if the form "h:mm:ss...
static int OsdWidth(void)
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
cListObject * Next(void) const
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
#define LOCK_CHANNELS_READ
char FontOsd[MAXFONTNAME]
virtual const char * Description(void)
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
static cBitmap bmDolbyDigital
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 void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
tColor RgbShade(tColor Color, double Factor)
Returns a brighter (Factor > 0) or darker (Factor < 0) version of the given Color.
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Creates and returns a new object for displaying the available tracks.
static const cCursesFont Font
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
cSkinLCARSDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
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 SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
const char * Remote(void) const
static const char *const * ReplaySymbols[2][2][5]
static cFont * CreateFont(const char *Name, int CharHeight, int CharWidth=0)
Creates a new font object with the given Name and makes its characters CharHeight pixels high...
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...
static cBitmap bmAudioStereo
virtual int CurrentLongitude(void) const
Returns the longitude the dish currently points to.
cSkinLCARSDisplayReplay(bool ModeOnly)
cBitmap * Scaled(double FactorX, double FactorY, bool AntiAlias=false) const
Creates a copy of this bitmap, scaled by the given factors.
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
static bool DrawDeviceData(cOsd *Osd, const cDevice *Device, int x0, int y0, int x1, int y1, int &xs, const cFont *TinyFont, cString &LastDeviceType, cCamSlot *&LastCamSlot, bool Initial)
virtual cString DeviceType(void) const
Returns a string identifying the type of this device (like "DVB-S").
static cBitmap bmRecording
cString GetEndTimeString(void) const
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
virtual ~cSkinLCARSDisplayVolume()
time_t StopTime(void) const
static cDevice * PrimaryDevice(void)
Returns the primary device.
virtual void Flush(void)
Actually draws the OSD display to the output device.
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
const tTrackId * GetTrack(eTrackType Type)
Returns a pointer to the given track id, or NULL if Type is not less than ttMaxTrackTypes.
virtual ~cSkinLCARSDisplayChannel()
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).
void SetItem(const char *Text, int Index, bool Current)
static cRecordControl * GetRecordControl(const char *FileName)
const char * Title(void) const
const char * Description(void) const
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise...
THEME_CLR(Theme, clrBackground, CLR_BACKGROUND)
#define SIGNALDISPLAYDELTA
virtual cString GetHeader(void)
This can be used by players that don't play a cRecording, but rather do something completely differen...
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
virtual void Flush(void)
Actually draws the OSD display to the output device.
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().
static cBitmap bmTeletext
static int HorizonLongitude(ePositionerDirection Direction)
Returns the longitude of the satellite position that is just at the horizon when looking in the given...
void SetAntiAliasGranularity(uint FixedColors, uint BlendColors)
Allows the system to optimize utilization of the limited color palette entries when generating blende...
const char * ChannelName(void) const
cSkinLCARSDisplayVolume(void)
static int FreeMinutes(void)
Returns the number of minutes that can still be recorded on the video disk.
static void DrawDevicePosition(cOsd *Osd, const cPositioner *Positioner, int x0, int y0, int x1, int y1, int &LastCurrent)
cString GetDateString(void) const
#define LOCK_SCHEDULES_READ
const char * ShortText(void) const
#define CLR_CHANNEL_FRAME
static const cTimers * GetTimersRead(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of timers for read access.
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().
int HardLimitLongitude(ePositionerDirection Direction) const
Returns the longitude of the positioner's hard limit in the given Direction.
cSkinLCARSDisplayChannel(bool WithInfo)
tColor Color(int Subject)
Returns the color for the given Subject.
virtual ~cSkinLCARSDisplayMessage()
virtual void SetPositioner(const cPositioner *Positioner)
Sets the Positioner used to move the satellite dish.
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...
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...
static int UsedPercent(void)
Returns the used space of the video disk in percent.