vdr  2.6.1
skinsttng.c
Go to the documentation of this file.
1 /*
2  * skinsttng.c: A VDR skin with ST:TNG Panels
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: skinsttng.c 5.1 2021/07/01 15:40:46 kls Exp $
8  */
9 
10 // "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures
11 // registered in the United States Patent and Trademark Office.
12 // No infringement intended.
13 
14 #include "skinsttng.h"
15 #include "font.h"
16 #include "osd.h"
17 #include "menu.h"
18 #include "themes.h"
19 #include "videodir.h"
20 
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"
52 
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)
59 
60 static cTheme Theme;
61 
63 THEME_CLR(Theme, clrButtonRedFg, clrWhite);
64 THEME_CLR(Theme, clrButtonRedBg, clrRed);
65 THEME_CLR(Theme, clrButtonGreenFg, clrBlack);
66 THEME_CLR(Theme, clrButtonGreenBg, clrGreen);
67 THEME_CLR(Theme, clrButtonYellowFg, clrBlack);
68 THEME_CLR(Theme, clrButtonYellowBg, clrYellow);
69 THEME_CLR(Theme, clrButtonBlueFg, clrWhite);
70 THEME_CLR(Theme, clrButtonBlueBg, clrBlue);
71 THEME_CLR(Theme, clrMessageFrame, clrYellow);
72 THEME_CLR(Theme, clrMessageStatusFg, clrBlack);
73 THEME_CLR(Theme, clrMessageStatusBg, clrCyan);
74 THEME_CLR(Theme, clrMessageInfoFg, clrBlack);
75 THEME_CLR(Theme, clrMessageInfoBg, clrGreen);
76 THEME_CLR(Theme, clrMessageWarningFg, clrBlack);
77 THEME_CLR(Theme, clrMessageWarningBg, clrYellow);
78 THEME_CLR(Theme, clrMessageErrorFg, clrWhite);
79 THEME_CLR(Theme, clrMessageErrorBg, clrRed);
80 THEME_CLR(Theme, clrVolumeFrame, clrYellow);
81 THEME_CLR(Theme, clrVolumeSymbol, clrBlack);
82 THEME_CLR(Theme, clrVolumeBarUpper, 0xFFBC8024);
83 THEME_CLR(Theme, clrVolumeBarLower, 0xFF248024);
84 THEME_CLR(Theme, clrChannelFrame, clrYellow);
85 THEME_CLR(Theme, clrChannelName, clrBlack);
86 THEME_CLR(Theme, clrChannelDate, clrBlack);
87 THEME_CLR(Theme, clrChannelSymbolOn, clrBlack);
88 THEME_CLR(Theme, clrChannelSymbolOff, 0xFFBC8024);
89 THEME_CLR(Theme, clrChannelSymbolRecFg, clrWhite);
90 THEME_CLR(Theme, clrChannelSymbolRecBg, clrRed);
91 THEME_CLR(Theme, clrChannelEpgTime, clrBlack);
92 THEME_CLR(Theme, clrChannelEpgTitle, clrCyan);
93 THEME_CLR(Theme, clrChannelEpgShortText, clrYellow);
94 THEME_CLR(Theme, clrChannelTimebarSeen, clrYellow);
95 THEME_CLR(Theme, clrChannelTimebarRest, clrGray50);
96 THEME_CLR(Theme, clrChannelSignalValue, clrGreen);
97 THEME_CLR(Theme, clrChannelSignalRest, clrRed);
98 THEME_CLR(Theme, clrMenuFrame, clrYellow);
99 THEME_CLR(Theme, clrMenuTitle, clrBlack);
100 THEME_CLR(Theme, clrMenuDate, clrBlack);
101 THEME_CLR(Theme, clrMenuItemCurrentFg, clrBlack);
102 THEME_CLR(Theme, clrMenuItemCurrentBg, clrYellow);
103 THEME_CLR(Theme, clrMenuItemSelectable, clrYellow);
104 THEME_CLR(Theme, clrMenuItemNonSelectable, clrCyan);
105 THEME_CLR(Theme, clrMenuEventTime, clrYellow);
106 THEME_CLR(Theme, clrMenuEventVps, clrBlack);
107 THEME_CLR(Theme, clrMenuEventTitle, clrCyan);
108 THEME_CLR(Theme, clrMenuEventShortText, clrYellow);
109 THEME_CLR(Theme, clrMenuEventDescription, clrCyan);
110 THEME_CLR(Theme, clrMenuScrollbarTotal, clrYellow);
111 THEME_CLR(Theme, clrMenuScrollbarShown, clrCyan);
112 THEME_CLR(Theme, clrMenuScrollbarArrow, clrBlack);
113 THEME_CLR(Theme, clrMenuText, clrCyan);
114 THEME_CLR(Theme, clrReplayFrame, clrYellow);
115 THEME_CLR(Theme, clrReplayTitle, clrBlack);
116 THEME_CLR(Theme, clrReplayMode, clrBlack);
117 THEME_CLR(Theme, clrReplayCurrent, clrBlack);
118 THEME_CLR(Theme, clrReplayTotal, clrBlack);
119 THEME_CLR(Theme, clrReplayJump, clrBlack);
120 THEME_CLR(Theme, clrReplayProgressSeen, clrGreen);
121 THEME_CLR(Theme, clrReplayProgressRest, clrWhite);
122 THEME_CLR(Theme, clrReplayProgressSelected, clrRed);
123 THEME_CLR(Theme, clrReplayProgressMark, clrBlack);
124 THEME_CLR(Theme, clrReplayProgressCurrent, clrRed);
125 
126 // --- cSkinSTTNGDisplayChannel ----------------------------------------------
127 
129 private:
131  int x0, x1, x2, x3, x4, x5, x6, x7;
132  int y0, y1, y2, y3, y4, y5, y6, y7;
133  bool withInfo;
136  bool message;
137  const cEvent *present;
139  int lastSeen;
146 public:
147  cSkinSTTNGDisplayChannel(bool WithInfo);
148  virtual ~cSkinSTTNGDisplayChannel();
149  virtual void SetChannel(const cChannel *Channel, int Number);
150  virtual void SetEvents(const cEvent *Present, const cEvent *Following);
151  virtual void SetMessage(eMessageType Type, const char *Text);
152  virtual void Flush(void);
153  };
154 
161 
163 {
164  present = NULL;
165  lastSeen = -1;
166  lastDeviceNumber = -1;
167  lastSignalStrength = -1;
168  lastSignalQuality = -1;
169  lastSignalDisplay = 0;
170  memset(&lastTrackId, 0, sizeof(lastTrackId));
171  const cFont *font = cFont::GetFont(fontOsd);
172  withInfo = WithInfo;
173  lineHeight = font->Height();
174  frameColor = Theme.Color(clrChannelFrame);
175  message = false;
176  if (withInfo) {
177  x0 = 0;
178  x1 = x0 + font->Width("00:00") + 2 * TextFrame;
179  x2 = x1 + Roundness;
180  x3 = x2 + Gap;
181  x7 = cOsd::OsdWidth();
182  x6 = x7 - lineHeight / 2;
183  x5 = x6 - lineHeight / 2;
184  x4 = x5 - Gap;
185  y0 = 0;
186  y1 = lineHeight;
187  y2 = y1 + Roundness;
188  y3 = y2 + Gap;
189  y4 = y3 + 4 * lineHeight;
190  y5 = y4 + Gap;
191  y6 = y5 + Roundness;
192  y7 = y6 + cFont::GetFont(fontSml)->Height();
193  int yt = (y0 + y1) / 2;
194  int yb = (y6 + y7) / 2;
196  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor
197  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
198  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
199  else {
200  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; // 256 colors
201  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
202  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
203  else {
204  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors
205  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
206  }
207  }
209  osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
210  osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
211  osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
212  osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
213  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
214  osd->DrawRectangle(x1, y0, x4 - 1, y1 - 1, frameColor);
215  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
216  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
217  osd->DrawRectangle(x0, y1, x1 - 1, y2 - 1, frameColor);
218  osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
219  osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
220  osd->DrawRectangle(x0, y5, x1 - 1, y6 - 1, frameColor);
221  osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
222  osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
223  osd->DrawRectangle(x1, y6, x4 - 1, y7 - 1, frameColor);
224  osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
225  osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
226  }
227  else {
228  x0 = 0;
229  x1 = lineHeight / 2;
230  x2 = lineHeight;
231  x3 = x2 + Gap;
232  x7 = cOsd::OsdWidth();
233  x6 = x7 - lineHeight / 2;
234  x5 = x6 - lineHeight / 2;
235  x4 = x5 - Gap;
236  y0 = 0;
237  y1 = lineHeight;
239  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
240  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
241  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
242  else {
243  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
244  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
245  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
246  else {
247  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors
248  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
249  }
250  }
251  osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
252  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
253  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
254  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
255  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
256  }
257 }
258 
260 {
261  delete osd;
262 }
263 
264 void cSkinSTTNGDisplayChannel::SetChannel(const cChannel *Channel, int Number)
265 {
266  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
267  int x = x4 - SymbolSpacing;
268  if (Channel && !Channel->GroupSep()) {
269  bool rec = cRecordControls::Active();
271  osd->DrawBitmap(x, y0 + (y1 - y0 - bmRecording.Height()) / 2, bmRecording, Theme.Color(rec ? clrChannelSymbolRecFg : clrChannelSymbolOff), rec ? Theme.Color(clrChannelSymbolRecBg) : frameColor);
273  osd->DrawBitmap(x, y0 + (y1 - y0 - bmEncrypted.Height()) / 2, bmEncrypted, Theme.Color(Channel->Ca() ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
275  osd->DrawBitmap(x, y0 + (y1 - y0 - bmDolbyDigital.Height()) / 2, bmDolbyDigital, Theme.Color(Channel->Dpid(0) ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
276  x -= bmAudio.Width() + SymbolSpacing;
277  osd->DrawBitmap(x, y0 + (y1 - y0 - bmAudio.Height()) / 2, bmAudio, Theme.Color(Channel->Apid(1) ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
278  if (Channel->Vpid()) {
279  x -= bmTeletext.Width() + SymbolSpacing;
280  osd->DrawBitmap(x, y0 + (y1 - y0 - bmTeletext.Height()) / 2, bmTeletext, Theme.Color(Channel->Tpid() ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
281  }
282  else if (Channel->Apid(0)) {
283  x -= bmRadio.Width() + SymbolSpacing;
284  osd->DrawBitmap(x, y0 + (y1 - y0 - bmRadio.Height()) / 2, bmRadio, Theme.Color(clrChannelSymbolOn), frameColor);
285  }
286  }
287  osd->DrawText(x3 + TextFrame, y0, ChannelString(Channel, Number), Theme.Color(clrChannelName), frameColor, cFont::GetFont(fontOsd), x - x3 - TextFrame);
288  lastSignalDisplay = 0;
289 }
290 
291 void cSkinSTTNGDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
292 {
293  if (!withInfo)
294  return;
295  if (present != Present)
296  lastSeen = -1;
297  present = Present;
298  osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
300  for (int i = 0; i < 2; i++) {
301  const cEvent *e = !i ? Present : Following;
302  if (e) {
303  osd->DrawText(x0 + TextFrame, y3 + 2 * i * lineHeight, e->GetTimeString(), Theme.Color(clrChannelEpgTime), frameColor, cFont::GetFont(fontOsd));
304  osd->DrawText(x3 + TextFrame, y3 + 2 * i * lineHeight, e->Title(), Theme.Color(clrChannelEpgTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd), x4 - x3 - TextFrame);
305  osd->DrawText(x3 + TextFrame, y3 + (2 * i + 1) * lineHeight, e->ShortText(), Theme.Color(clrChannelEpgShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml), x4 - x3 - TextFrame);
306  }
307  }
308 }
309 
311 {
312  const cFont *font = cFont::GetFont(withInfo ? fontSml : fontOsd);
313  if (Text) {
314  int yt = withInfo ? y6 : y0;
315  int yb = withInfo ? y7 : y1;
316  osd->SaveRegion(x2, yt, x4 - 1, yb - 1);
317  if (withInfo)
318  osd->DrawRectangle(x2, yt, x3 - 1, yb - 1, Theme.Color(clrBackground));
319  osd->DrawText(x3, yt, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
320  message = true;
321  }
322  else {
323  osd->RestoreRegion();
324  message = false;
325  }
326 }
327 
329 {
330  if (withInfo) {
331  if (!message) {
332  const cFont *font = cFont::GetFont(fontSml);
333  cString date = DayDateTime();
334  int w = font->Width(date);
335  if (!*lastDate || strcmp(date, lastDate)) {
336  osd->DrawText(x4 - w - TextFrame, y7 - font->Height(), date, Theme.Color(clrChannelDate), frameColor, font, w);
337  lastDate = date;
338  }
339  cDevice *Device = cDevice::PrimaryDevice();
340  const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack());
341  if (Track ? strcmp(lastTrackId.description, Track->description) : *lastTrackId.description) {
342  osd->DrawText(x3 + TextFrame, y6, Track ? Track->description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 2 * TextFrame);
343  strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description));
344  }
345  int DeviceNumber = cDevice::ActualDevice()->DeviceNumber() + 1;
346  if (DeviceNumber != lastDeviceNumber || time(NULL) != lastSignalDisplay) {
347  int SignalStrength = cDevice::ActualDevice()->SignalStrength();
348  int SignalQuality = cDevice::ActualDevice()->SignalQuality();
349  if (DeviceNumber != lastDeviceNumber || SignalStrength != lastSignalStrength || SignalQuality != lastSignalQuality) {
350  int d = 3;
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;
356  osd->DrawRectangle(x, y6 + d, x + s - 1, y6 + d + h - 1, Theme.Color(clrChannelSignalValue));
357  osd->DrawRectangle(x + s, y6 + d, x + w - 1, y6 + d + h - 1, Theme.Color(clrChannelSignalRest));
358  }
359  else if (DeviceNumber != lastDeviceNumber)
360  osd->DrawRectangle(x, y6 + d, x + w - 1, y6 + d + h - 1, Theme.Color(clrChannelFrame));
361  if (SignalQuality >= 0) {
362  int q = SignalQuality * w / 100;
363  osd->DrawRectangle(x, y7 - d - h + 1, x + q - 1, y7 - d, Theme.Color(clrChannelSignalValue));
364  osd->DrawRectangle(x + q, y7 - d - h + 1, x + w - 1, y7 - d, Theme.Color(clrChannelSignalRest));
365  }
366  else if (DeviceNumber != lastDeviceNumber)
367  osd->DrawRectangle(x, y7 - d - h + 1, x + w - 1, y7 - d, Theme.Color(clrChannelFrame));
368  cString dn = cString::sprintf(" %d ", DeviceNumber);
369  const cFont *font = cFont::GetFont(fontSml);
370  int dw = font->Width(dn);
371  osd->DrawText(x - 2 * d - dw, y6, dn, Theme.Color(clrChannelDate), frameColor, font, dw);
372  lastDeviceNumber = DeviceNumber;
373  lastSignalStrength = SignalStrength;
374  lastSignalQuality = SignalQuality;
375  }
376  lastSignalDisplay = time(NULL);
377  }
378  }
379  int seen = 0;
380  if (present) {
381  time_t t = time(NULL);
382  if (t > present->StartTime())
383  seen = min(y4 - y3 - 1, int((y4 - y3) * double(t - present->StartTime()) / present->Duration()));
384  }
385  if (seen != lastSeen) {
386  osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y4 - 1, Theme.Color(clrChannelTimebarRest));
387  if (seen)
388  osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y3 + seen, Theme.Color(clrChannelTimebarSeen));
389  lastSeen = seen;
390  }
391  }
392  osd->Flush();
393 }
394 
395 // --- cSkinSTTNGDisplayMenu -------------------------------------------------
396 
398 private:
400  int x0, x1, x2, x3, x4, x5, x6, x7;
401  int y0, y1, y2, y3, y4, y5, y6, y7;
406  bool message;
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);
412 public:
413  cSkinSTTNGDisplayMenu(void);
414  virtual ~cSkinSTTNGDisplayMenu();
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);
420  virtual void SetMessage(eMessageType Type, const char *Text);
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);
429  };
430 
432 {
433  const cFont *font = cFont::GetFont(fontOsd);
434  lineHeight = font->Height();
435  frameColor = Theme.Color(clrMenuFrame);
436  lastDiskUsageState = -1;
437  currentIndex = -1;
438  message = false;
439  x0 = 0;
440  x1 = lineHeight / 2;
441  x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
442  x2 = x3 - Gap;
443  x7 = cOsd::OsdWidth();
444  x6 = x7 - lineHeight / 2;
445  x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
446  x5 = x4 + Gap;
447  y0 = 0;
448  y1 = lineHeight;
449  y2 = y1 + Roundness;
450  y3 = y2 + Gap;
451  y7 = cOsd::OsdHeight();
452  y6 = y7 - cFont::GetFont(fontSml)->Height();
453  y5 = y6 - Roundness;
454  y4 = y5 - Gap;
455  int yt = (y0 + y1) / 2;
456  int yb = (y6 + y7) / 2;
458  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor
459  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
460  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
461  else {
462  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors
463  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
464  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
465  else {
466  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors
467  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
468  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
469  else {
470  tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors
471  { x0, y3, x3 - 1, y4 - 1, 1 },
472  { x3, y3, x4 - 1, y4 - 1, 2 },
473  { x4, y3, x7 - 1, y4 - 1, 2 },
474  { x0, y4, x7 - 1, y7 - 1, 4 }
475  };
476  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
477  }
478  }
479  }
481  osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
482  osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
483  osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
484  osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
485  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
486  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
487  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
488  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
489  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
490  osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
491  osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
492  osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
493  osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
494  osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
495  osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
496  osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
497  osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
498 }
499 
501 {
502  delete osd;
503 }
504 
505 void cSkinSTTNGDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
506 {
507  if (Total > 0 && Total > Shown) {
508  int h = lineHeight;
509  int yt = Top;
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);
516  osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal));
517  osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb - 1, Theme.Color(clrMenuScrollbarShown));
518  osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor);
519  osd->DrawEllipse (x6, yt, x7 - 1, yt + h - 1, frameColor, 5);
520  osd->DrawRectangle(x5, yb - h, x6 - 1, yb - 1, frameColor);
521  osd->DrawEllipse (x6, yb - h, x7 - 1, yb - 1, frameColor, 5);
522  if (CanScrollUp) {
523  cBitmap bm(arrowup_xpm);
524  osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yt + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor);
525  }
526  if (CanScrollDown) {
527  cBitmap bm(arrowdown_xpm);
528  osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yb - h + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor);
529  }
530  }
531 }
532 
534 {
535  if (textScroller.CanScroll())
537 }
538 
539 void cSkinSTTNGDisplayMenu::Scroll(bool Up, bool Page)
540 {
541  cSkinDisplayMenu::Scroll(Up, Page);
543 }
544 
546 {
547  return (y4 - y3 - 2 * Roundness) / lineHeight;
548 }
549 
551 {
554 }
555 
557 {
558  const cFont *font = cFont::GetFont(fontOsd);
559  const char *VDR = " VDR";
560  bool WithDisk = MenuCategory() == mcMain || MenuCategory() == mcRecording;
561  int w = font->Width(VDR);
562  osd->DrawText(x3 + TextSpacing, y0, WithDisk ? cString::sprintf("%s - %s", *title, *cVideoDiskUsage::String()) : title, Theme.Color(clrMenuTitle), frameColor, font, x4 - w - x3 - TextSpacing);
563  osd->DrawText(x4 - w, y0, VDR, frameColor, clrBlack, font, w, lineHeight);
564 }
565 
566 void cSkinSTTNGDisplayMenu::SetTitle(const char *Title)
567 {
568  title = Title;
569  DrawTitle();
570 }
571 
572 void cSkinSTTNGDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
573 {
574  const char *lutText[] = { Red, Green, Yellow, Blue };
575  tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg };
576  tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg };
577  cString date = DayDateTime();
578  const cFont *font = cFont::GetFont(fontSml);
579  int d = 2 * Gap;
580  int d2 = d / 2;
581  int t4 = x4 - font->Width(date) - TextFrame;
582  int w = t4 - x3;
583  int t0 = x3 + d2;
584  int t1 = x3 + w / 4;
585  int t2 = x3 + w / 2;
586  int t3 = t4 - w / 4;
587  osd->DrawRectangle(t0 + d2, y6, t1 - d2, y7 - 1, clrBlack);
588  osd->DrawRectangle(t1 + d2, y6, t2 - d2, y7 - 1, clrBlack);
589  osd->DrawRectangle(t2 + d2, y6, t3 - d2, y7 - 1, clrBlack);
590  osd->DrawRectangle(t3 + d2, y6, t4 - d2, y7 - 1, clrBlack);
591  osd->DrawText(t0 + d, y6, lutText[Setup.ColorKey0], Theme.Color(lutFg[Setup.ColorKey0]), Theme.Color(lutBg[Setup.ColorKey0]), font, t1 - t0 - 2 * d, 0, taCenter);
592  osd->DrawText(t1 + d, y6, lutText[Setup.ColorKey1], Theme.Color(lutFg[Setup.ColorKey1]), Theme.Color(lutBg[Setup.ColorKey1]), font, t2 - t1 - 2 * d, 0, taCenter);
593  osd->DrawText(t2 + d, y6, lutText[Setup.ColorKey2], Theme.Color(lutFg[Setup.ColorKey2]), Theme.Color(lutBg[Setup.ColorKey2]), font, t3 - t2 - 2 * d, 0, taCenter);
594  osd->DrawText(t3 + d, y6, lutText[Setup.ColorKey3], Theme.Color(lutFg[Setup.ColorKey3]), Theme.Color(lutBg[Setup.ColorKey3]), font, t4 - t3 - 2 * d, 0, taCenter);
595 }
596 
598 {
599  const cFont *font = cFont::GetFont(fontSml);
600  if (Text) {
601  osd->SaveRegion(x3, y6, x4 - 1, y7 - 1);
602  osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
603  message = true;
604  }
605  else {
606  osd->RestoreRegion();
607  message = false;
608  }
609 }
610 
611 void cSkinSTTNGDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable)
612 {
613  int y = y3 + Roundness + Index * lineHeight;
614  tColor ColorFg, ColorBg;
615  if (Current) {
616  ColorFg = Theme.Color(clrMenuItemCurrentFg);
617  ColorBg = Theme.Color(clrMenuItemCurrentBg);
618  osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3);
619  osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor);
620  osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
621  osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg);
622  currentIndex = Index;
623  }
624  else {
625  ColorFg = Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable);
626  ColorBg = Theme.Color(clrBackground);
627  if (currentIndex == Index) {
629  osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, Theme.Color(clrBackground));
630  }
631  }
632  const cFont *font = cFont::GetFont(fontOsd);
633  for (int i = 0; i < MaxTabs; i++) {
634  const char *s = GetTabbedText(Text, i);
635  if (s) {
636  int xt = x3 + TextSpacing + Tab(i);
637  osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x4 - xt);
638  }
639  if (!Tab(i + 1))
640  break;
641  }
643 }
644 
645 void cSkinSTTNGDisplayMenu::SetScrollbar(int Total, int Offset)
646 {
647  DrawScrollbar(Total, Offset, MaxItems(), y3 + Roundness, MaxItems() * lineHeight, Offset > 0, Offset + MaxItems() < Total);
648 }
649 
651 {
652  if (!Event)
653  return;
654  const cFont *font = cFont::GetFont(fontOsd);
655  int xl = x3 + TextSpacing;
656  int y = y3;
657  cTextScroller ts;
658  cString t = cString::sprintf("%s %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
659  ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
660  if (Event->Vps() && Event->Vps() != Event->StartTime()) {
661  cString buffer = cString::sprintf(" VPS: %s ", *Event->GetVpsString());
662  const cFont *font = cFont::GetFont(fontSml);
663  int w = font->Width(buffer);
664  osd->DrawText(x4 - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
665  int yb = y + font->Height();
666  osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
667  osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
668  }
669  y += ts.Height();
670  if (Event->ParentalRating()) {
671  cString buffer = cString::sprintf(" %s ", *Event->GetParentalRatingString());
672  const cFont *font = cFont::GetFont(fontSml);
673  int w = font->Width(buffer);
674  osd->DrawText(x4 - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
675  int yb = y + font->Height();
676  osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
677  osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
678  }
679  y += font->Height();
680  ts.Set(osd, xl, y, x4 - xl, y4 - y, Event->Title(), font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
681  y += ts.Height();
682  if (!isempty(Event->ShortText())) {
683  const cFont *font = cFont::GetFont(fontSml);
684  ts.Set(osd, xl, y, x4 - xl, y4 - y, Event->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
685  y += ts.Height();
686  }
687  y += font->Height();
688  if (!isempty(Event->Description())) {
689  int yt = y;
690  int yb = y4 - Roundness;
691  textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, Event->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
692  yb = yt + textScroller.Height();
693  osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3);
694  osd->DrawRectangle(x1, yt, x2, yb, frameColor);
695  osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2);
697  }
698 }
699 
701 {
702  if (!Recording)
703  return;
704  const cRecordingInfo *Info = Recording->Info();
705  const cFont *font = cFont::GetFont(fontOsd);
706  int xl = x3 + TextSpacing;
707  int y = y3;
708  cTextScroller ts;
709  cString t = cString::sprintf("%s %s %s", *DateString(Recording->Start()), *TimeString(Recording->Start()), Info->ChannelName() ? Info->ChannelName() : "");
710  ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
711  y += ts.Height();
712  int xt = x4;
713  if (Info->GetEvent()->ParentalRating()) {
714  cString buffer = cString::sprintf(" %s ", *Info->GetEvent()->GetParentalRatingString());
715  const cFont *font = cFont::GetFont(fontSml);
716  int w = font->Width(buffer);
717  osd->DrawText(xt - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
718  xt -= w + x5 - x4;
719  }
720  if (Info->Errors() > 0) {
721  cString buffer = cString::sprintf(" %d %s ", Info->Errors(), tr("errors"));
722  const cFont *font = cFont::GetFont(fontSml);
723  int w = font->Width(buffer);
724  osd->DrawText(xt - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
725  xt -= w + x5 - x4;
726  }
727  if (xt != x4) {
728  const cFont *font = cFont::GetFont(fontSml);
729  int yb = y + font->Height();
730  osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
731  osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
732  }
733  y += font->Height();
734  const char *Title = Info->Title();
735  if (isempty(Title))
736  Title = Recording->Name();
737  ts.Set(osd, xl, y, x4 - xl, y4 - y, Title, font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
738  y += ts.Height();
739  if (!isempty(Info->ShortText())) {
740  const cFont *font = cFont::GetFont(fontSml);
741  ts.Set(osd, xl, y, x4 - xl, y4 - y, Info->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
742  y += ts.Height();
743  }
744  y += font->Height();
745  if (!isempty(Info->Description())) {
746  int yt = y;
747  int yb = y4 - Roundness;
748  textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, Info->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
749  yb = yt + textScroller.Height();
750  osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3);
751  osd->DrawRectangle(x1, yt, x2, yb, frameColor);
752  osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2);
754  }
755 }
756 
757 void cSkinSTTNGDisplayMenu::SetText(const char *Text, bool FixedFont)
758 {
759  textScroller.Set(osd, x3, y3, GetTextAreaWidth(), y4 - y3, Text, GetTextAreaFont(FixedFont), Theme.Color(clrMenuText), Theme.Color(clrBackground));
761 }
762 
764 {
765  return x4 - x3;
766 }
767 
768 const cFont *cSkinSTTNGDisplayMenu::GetTextAreaFont(bool FixedFont) const
769 {
770  const cFont *font = cFont::GetFont(FixedFont ? fontFix : fontOsd);
771  //XXX -> make a way to let the text define which font to use
772  return font;
773 }
774 
776 {
778  DrawTitle();
779  if (!message) {
780  cString date = DayDateTime();
781  if (!*lastDate || strcmp(date, lastDate)) {
782  const cFont *font = cFont::GetFont(fontSml);
783  int w = font->Width(date);
784  osd->DrawText(x4 - w - TextFrame, y7 - font->Height(), date, Theme.Color(clrMenuDate), frameColor, font, w);
785  lastDate = date;
786  }
787  }
788  osd->Flush();
789 }
790 
791 // --- cSkinSTTNGDisplayReplay -----------------------------------------------
792 
794 private:
796  int x0, x1, x2, x3, x4, x5, x6, x7;
797  int y0, y1, y2, y3, y4, y5, y6, y7;
800 public:
801  cSkinSTTNGDisplayReplay(bool ModeOnly);
802  virtual ~cSkinSTTNGDisplayReplay();
803  virtual void SetTitle(const char *Title);
804  virtual void SetMode(bool Play, bool Forward, int Speed);
805  virtual void SetProgress(int Current, int Total);
806  virtual void SetCurrent(const char *Current);
807  virtual void SetTotal(const char *Total);
808  virtual void SetJump(const char *Jump);
809  virtual void SetMessage(eMessageType Type, const char *Text);
810  virtual void Flush(void);
811  };
812 
814 {
815  const cFont *font = cFont::GetFont(fontSml);
816  int lineHeight = font->Height();
817  frameColor = Theme.Color(clrReplayFrame);
818  lastCurrentWidth = 0;
819  cBitmap bm(play_xpm);
820  x0 = 0;
821  x1 = max(lineHeight * 2, bm.Width());
822  x2 = x1 + Roundness;
823  x3 = x2 + Gap;
824  x7 = cOsd::OsdWidth();
825  x6 = x7 - lineHeight / 2;
826  x5 = x6 - lineHeight / 2;
827  x4 = x5 - Gap;
828  y0 = 0;
829  y1 = lineHeight;
830  y2 = y1 + Roundness;
831  y3 = y2 + Gap;
832  y4 = y3 + max(lineHeight, bm.Height());
833  y5 = y4 + Gap;
834  y6 = y5 + Roundness;
835  y7 = y6 + font->Height();
836  int yt = (y0 + y1) / 2;
837  int yb = (y6 + y7) / 2;
839  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor
840  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
841  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
842  else {
843  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; // 256 colors
844  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
845  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
846  else {
847  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors
848  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
849  }
850  }
851  osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, ModeOnly ? clrTransparent : Theme.Color(clrBackground));
852  if (!ModeOnly) {
853  osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
854  osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
855  osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
856  osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
857  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
858  osd->DrawRectangle(x1, y0, x4 - 1, y1 - 1, frameColor);
859  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
860  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
861  osd->DrawRectangle(x0, y1, x1 - 1, y2 - 1, frameColor);
862  osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
863  }
864  osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
865  if (!ModeOnly) {
866  osd->DrawRectangle(x0, y5, x1 - 1, y6 - 1, frameColor);
867  osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
868  osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
869  osd->DrawRectangle(x1, y6, x4 - 1, y7 - 1, frameColor);
870  osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
871  osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
872  }
873 }
874 
876 {
877  delete osd;
878 }
879 
880 void cSkinSTTNGDisplayReplay::SetTitle(const char *Title)
881 {
882  osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrReplayTitle), frameColor, cFont::GetFont(fontSml), x4 - x3 - TextSpacing);
883 }
884 
885 static const char *const *ReplaySymbols[2][2][5] = {
886  { { pause_xpm, srew_xpm, srew1_xpm, srew2_xpm, srew3_xpm },
887  { pause_xpm, sfwd_xpm, sfwd1_xpm, sfwd2_xpm, sfwd3_xpm }, },
888  { { play_xpm, frew_xpm, frew1_xpm, frew2_xpm, frew3_xpm },
889  { play_xpm, ffwd_xpm, ffwd1_xpm, ffwd2_xpm, ffwd3_xpm } }
890  };
891 
892 void cSkinSTTNGDisplayReplay::SetMode(bool Play, bool Forward, int Speed)
893 {
894  Speed = constrain(Speed, -1, 3);
895  cBitmap bm(ReplaySymbols[Play][Forward][Speed + 1]);
896  osd->DrawBitmap(x0 + (x1 - x0 - bm.Width()) / 2, y3 + (y4 - y3 - bm.Height()) / 2, bm, Theme.Color(clrReplayMode), frameColor);
897 }
898 
899 void cSkinSTTNGDisplayReplay::SetProgress(int Current, int Total)
900 {
901  cProgressBar pb(x4 - x3, y4 - y3, Current, Total, marks, Theme.Color(clrReplayProgressSeen), Theme.Color(clrReplayProgressRest), Theme.Color(clrReplayProgressSelected), Theme.Color(clrReplayProgressMark), Theme.Color(clrReplayProgressCurrent));
902  osd->DrawBitmap(x3, y3, pb);
903 }
904 
905 void cSkinSTTNGDisplayReplay::SetCurrent(const char *Current)
906 {
907  const cFont *font = cFont::GetFont(fontSml);
908  int w = font->Width(Current);
909  osd->DrawText(x3, y6, Current, Theme.Color(clrReplayCurrent), frameColor, font, lastCurrentWidth > w ? lastCurrentWidth : w);
910  lastCurrentWidth = w;
911 }
912 
913 void cSkinSTTNGDisplayReplay::SetTotal(const char *Total)
914 {
915  const cFont *font = cFont::GetFont(fontSml);
916  int w = font->Width(Total);
917  osd->DrawText(x4 - w - TextSpacing, y6, Total, Theme.Color(clrReplayTotal), frameColor, font, w);
918 }
919 
920 void cSkinSTTNGDisplayReplay::SetJump(const char *Jump)
921 {
922  osd->DrawText(x0 + (x4 - x0) / 4, y6, Jump, Theme.Color(clrReplayJump), frameColor, cFont::GetFont(fontSml), (x4 - x3) / 2, 0, taCenter);
923 }
924 
926 {
927  const cFont *font = cFont::GetFont(fontSml);
928  if (Text) {
929  osd->SaveRegion(x2, y6, x4 - 1, y7 - 1);
931  osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
932  }
933  else
934  osd->RestoreRegion();
935 }
936 
938 {
939  osd->Flush();
940 }
941 
942 // --- cSkinSTTNGDisplayVolume -----------------------------------------------
943 
945 private:
947  int x0, x1, x2, x3, x4, x5, x6, x7;
948  int y0, y1;
950  int mute;
951 public:
953  virtual ~cSkinSTTNGDisplayVolume();
954  virtual void SetVolume(int Current, int Total, bool Mute);
955  virtual void Flush(void);
956  };
957 
959 {
960  const cFont *font = cFont::GetFont(fontOsd);
961  int lineHeight = font->Height();
962  frameColor = Theme.Color(clrVolumeFrame);
963  mute = -1;
964  x0 = 0;
965  x1 = lineHeight / 2;
966  x2 = lineHeight;
967  x3 = x2 + Gap;
968  x7 = cOsd::OsdWidth();
969  x6 = x7 - lineHeight / 2;
970  x5 = x6 - lineHeight / 2;
971  x4 = x5 - Gap;
972  y0 = 0;
973  y1 = lineHeight;
975  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
976  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
977  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
978  else {
979  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
980  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
981  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
982  else {
983  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors
984  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
985  }
986  }
987  osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
988  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
989  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
990  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
991  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
992  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
993 }
994 
996 {
997  delete osd;
998 }
999 
1000 void cSkinSTTNGDisplayVolume::SetVolume(int Current, int Total, bool Mute)
1001 {
1002  int xl = x3 + TextSpacing;
1003  int xr = x4 - TextSpacing;
1004  int yt = y0 + TextFrame;
1005  int yb = y1 - TextFrame;
1006  if (mute != Mute) {
1007  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1008  mute = Mute;
1009  }
1010  cBitmap bm(Mute ? mute_xpm : volume_xpm);
1011  osd->DrawBitmap(xl, y0 + (y1 - y0 - bm.Height()) / 2, bm, Theme.Color(clrVolumeSymbol), frameColor);
1012  if (!Mute) {
1013  xl += bm.Width() + TextSpacing;
1014  int w = (y1 - y0) / 3;
1015  int d = TextFrame;
1016  int n = (xr - xl + d) / (w + d);
1017  int x = xr - n * (w + d);
1018  tColor Color = Theme.Color(clrVolumeBarLower);
1019  for (int i = 0; i < n; i++) {
1020  if (Total * i >= Current * n)
1021  Color = Theme.Color(clrVolumeBarUpper);
1022  osd->DrawRectangle(x, yt, x + w - 1, yb - 1, Color);
1023  x += w + d;
1024  }
1025  }
1026 }
1027 
1029 {
1030  osd->Flush();
1031 }
1032 
1033 // --- cSkinSTTNGDisplayTracks -----------------------------------------------
1034 
1036 private:
1038  int x0, x1, x2, x3, x4, x5, x6, x7;
1039  int y0, y1, y2, y3, y4, y5, y6, y7;
1044  void SetItem(const char *Text, int Index, bool Current);
1045 public:
1046  cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
1047  virtual ~cSkinSTTNGDisplayTracks();
1048  virtual void SetTrack(int Index, const char * const *Tracks);
1049  virtual void SetAudioChannel(int AudioChannel);
1050  virtual void Flush(void);
1051  };
1052 
1056 
1057 cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1058 {
1059  const cFont *font = cFont::GetFont(fontOsd);
1060  lineHeight = font->Height();
1061  frameColor = Theme.Color(clrMenuFrame);
1062  currentIndex = -1;
1063  int ItemsWidth = font->Width(Title);
1064  for (int i = 0; i < NumTracks; i++)
1065  ItemsWidth = max(ItemsWidth, font->Width(Tracks[i]));
1066  ItemsWidth += 2 * TextSpacing;
1067  x0 = 0;
1068  x1 = lineHeight / 2;
1069  x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
1070  x2 = x3 - Gap;
1071  x7 = cOsd::OsdWidth();
1072  x6 = x7 - lineHeight / 2;
1073  x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
1074  x5 = x4 + Gap;
1075  int d = x4 - x3;
1076  if (d > ItemsWidth) {
1077  d = (d - ItemsWidth) & ~0x07; // must be multiple of 8
1078  x4 -= d;
1079  x5 -= d;
1080  x6 -= d;
1081  x7 -= d;
1082  }
1083  y0 = 0;
1084  y1 = lineHeight;
1085  y2 = y1 + Roundness;
1086  y3 = y2 + Gap;
1087  // limit to cOsd::OsdHeight()? - what if height is too big???
1088  y4 = y3 + NumTracks * lineHeight + 2 * Roundness;
1089  y5 = y4 + Gap;
1090  y6 = y5 + Roundness;
1091  y7 = y6 + cFont::GetFont(fontSml)->Height();
1092  int yt = (y0 + y1) / 2;
1093  int yb = (y6 + y7) / 2;
1095  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor
1096  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1097  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1098  else {
1099  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors
1100  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1101  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1102  else {
1103  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors
1104  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1105  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1106  else {
1107  tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors
1108  { x0, y3, x3 - 1, y4 - 1, 1 },
1109  { x3, y3, x4 - 1, y4 - 1, 2 },
1110  { x4, y3, x7 - 1, y4 - 1, 2 },
1111  { x0, y4, x7 - 1, y7 - 1, 4 }
1112  };
1113  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1114  }
1115  }
1116  }
1117  osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, Theme.Color(clrBackground));
1118  osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
1119  osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
1120  osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
1121  osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
1122  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
1123  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1124  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1125  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1126  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1127  osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
1128  osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
1129  osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
1130  osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
1131  osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
1132  osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1133  osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
1134  osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
1135  osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrMenuTitle), frameColor, font, x4 - x3 - TextSpacing);
1136  for (int i = 0; i < NumTracks; i++)
1137  SetItem(Tracks[i], i, false);
1138 }
1139 
1141 {
1142  delete osd;
1143 }
1144 
1145 void cSkinSTTNGDisplayTracks::SetItem(const char *Text, int Index, bool Current)
1146 {
1147  int y = y3 + Roundness + Index * lineHeight;
1148  tColor ColorFg, ColorBg;
1149  if (Current) {
1150  ColorFg = Theme.Color(clrMenuItemCurrentFg);
1151  ColorBg = Theme.Color(clrMenuItemCurrentBg);
1152  osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3);
1153  osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor);
1154  osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
1155  osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg);
1156  currentIndex = Index;
1157  }
1158  else {
1159  ColorFg = Theme.Color(clrMenuItemSelectable);
1160  ColorBg = Theme.Color(clrBackground);
1161  if (currentIndex == Index) {
1163  osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, Theme.Color(clrBackground));
1164  }
1165  }
1166  const cFont *font = cFont::GetFont(fontOsd);
1167  int xt = x3 + TextSpacing;
1168  osd->DrawText(xt, y, Text, ColorFg, ColorBg, font, x4 - xt);
1169 }
1170 
1171 void cSkinSTTNGDisplayTracks::SetTrack(int Index, const char * const *Tracks)
1172 {
1173  if (currentIndex >= 0)
1174  SetItem(Tracks[currentIndex], currentIndex, false);
1175  SetItem(Tracks[Index], Index, true);
1176 }
1177 
1179 {
1180  cBitmap *bm = NULL;
1181  switch (AudioChannel) {
1182  case 0: bm = &bmAudioStereo; break;
1183  case 1: bm = &bmAudioLeft; break;
1184  case 2: bm = &bmAudioRight; break;
1185  default: ;
1186  }
1187  if (bm)
1188  osd->DrawBitmap(x3 + TextSpacing, y6 + (y7 - y6 - bm->Height()) / 2, *bm, Theme.Color(clrChannelSymbolOn), frameColor);
1189  else
1190  osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1191 }
1192 
1194 {
1195  osd->Flush();
1196 }
1197 
1198 // --- cSkinSTTNGDisplayMessage ----------------------------------------------
1199 
1201 private:
1203  int x0, x1, x2, x3, x4, x5, x6, x7;
1204  int y0, y1;
1205 public:
1207  virtual ~cSkinSTTNGDisplayMessage();
1208  virtual void SetMessage(eMessageType Type, const char *Text);
1209  virtual void Flush(void);
1210  };
1211 
1213 {
1214  const cFont *font = cFont::GetFont(fontOsd);
1215  int lineHeight = font->Height();
1216  tColor frameColor = Theme.Color(clrMessageFrame);
1217  x0 = 0;
1218  x1 = lineHeight / 2;
1219  x2 = lineHeight;
1220  x3 = x2 + Gap;
1221  x7 = cOsd::OsdWidth();
1222  x6 = x7 - lineHeight / 2;
1223  x5 = x6 - lineHeight / 2;
1224  x4 = x5 - Gap;
1225  y0 = 0;
1226  y1 = lineHeight;
1228  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
1229  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1230  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1231  else {
1232  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
1233  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1234  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1235  else {
1236  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 2 } }; // 4 colors
1237  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1238  }
1239  }
1240  osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
1241  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
1242  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1243  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1244  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1245 }
1246 
1248 {
1249  delete osd;
1250 }
1251 
1253 {
1254  const cFont *font = cFont::GetFont(fontOsd);
1255  osd->DrawText(x3, y0, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
1256 }
1257 
1259 {
1260  osd->Flush();
1261 }
1262 
1263 // --- cSkinSTTNG ------------------------------------------------------------
1264 
1266 :cSkin("sttng", &::Theme)//XXX naming problem???
1267 {
1268 }
1269 
1270 const char *cSkinSTTNG::Description(void)
1271 {
1272  return tr("ST:TNG Panels");
1273 }
1274 
1276 {
1277  return new cSkinSTTNGDisplayChannel(WithInfo);
1278 }
1279 
1281 {
1282  return new cSkinSTTNGDisplayMenu;
1283 }
1284 
1286 {
1287  return new cSkinSTTNGDisplayReplay(ModeOnly);
1288 }
1289 
1291 {
1292  return new cSkinSTTNGDisplayVolume;
1293 }
1294 
1295 cSkinDisplayTracks *cSkinSTTNG::DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1296 {
1297  return new cSkinSTTNGDisplayTracks(Title, NumTracks, Tracks);
1298 }
1299 
1301 {
1302  return new cSkinSTTNGDisplayMessage;
1303 }
cString ChannelString(const cChannel *Channel, int Number)
Definition: channels.c:1139
Definition: osd.h:169
int Height(void) const
Definition: osd.h:189
int Width(void) const
Definition: osd.h:188
int Tpid(void) const
Definition: channels.h:170
int Vpid(void) const
Definition: channels.h:153
int Dpid(int i) const
Definition: channels.h:160
int Apid(int i) const
Definition: channels.h:159
bool GroupSep(void) const
Definition: channels.h:180
int Ca(int Index=0) const
Definition: channels.h:172
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise.
Definition: device.c:220
eTrackType GetCurrentAudioTrack(void) const
Definition: device.h:581
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
Definition: device.c:165
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
Definition: device.c:787
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
Definition: device.c:782
const tTrackId * GetTrack(eTrackType Type)
Returns a pointer to the given track id, or NULL if Type is not less than ttMaxTrackTypes.
Definition: device.c:1108
static cDevice * PrimaryDevice(void)
Returns the primary device.
Definition: device.h:148
Definition: epg.h:73
time_t Vps(void) const
Definition: epg.h:114
cString GetDateString(void) const
Definition: epg.c:428
int ParentalRating(void) const
Definition: epg.h:110
time_t StartTime(void) const
Definition: epg.h:111
cString GetTimeString(void) const
Definition: epg.c:433
const char * Title(void) const
Definition: epg.h:105
cString GetEndTimeString(void) const
Definition: epg.c:438
int Duration(void) const
Definition: epg.h:113
cString GetVpsString(void) const
Definition: epg.c:443
const char * ShortText(void) const
Definition: epg.h:106
cString GetParentalRatingString(void) const
Definition: epg.c:421
const char * Description(void) const
Definition: epg.h:107
Definition: font.h:37
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().
Definition: font.c:411
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.
Definition: osd.c:2215
The cOsd class is the interface to the "On Screen Display".
Definition: osd.h:729
static int OsdHeight(void)
Definition: osd.h:807
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
Definition: osd.c:2029
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 ...
Definition: osd.c:2131
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...
Definition: osd.c:2171
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
Definition: osd.c:2007
static int OsdTop(void)
Definition: osd.h:805
virtual void SaveRegion(int x1, int y1, int x2, int y2)
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
Definition: osd.c:2064
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition: osd.c:2191
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...
Definition: osd.c:2161
static int OsdLeft(void)
Definition: osd.h:804
static int OsdWidth(void)
Definition: osd.h:806
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition: osd.c:2080
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.
Definition: osd.c:2151
static bool Active(void)
Definition: menu.c:5712
int Errors(void) const
Definition: recording.h:92
const cEvent * GetEvent(void) const
Definition: recording.h:83
const char * ChannelName(void) const
Definition: recording.h:82
const char * Title(void) const
Definition: recording.h:84
const char * Description(void) const
Definition: recording.h:86
const char * ShortText(void) const
Definition: recording.h:85
const char * Name(void) const
Returns the full name of the recording (without the video directory).
Definition: recording.h:149
time_t Start(void) const
Definition: recording.h:134
cRecordingInfo * Info(void) const
Definition: recording.h:156
int ColorKey3
Definition: config.h:322
int ColorKey2
Definition: config.h:322
int AntiAlias
Definition: config.h:334
int ColorKey0
Definition: config.h:322
int ChannelInfoPos
Definition: config.h:327
int ColorKey1
Definition: config.h:322
virtual void Scroll(bool Up, bool Page)
If this menu contains a text area that can be scrolled, this function will be called to actually scro...
Definition: skins.c:107
cTextScroller textScroller
Definition: skins.h:173
int Tab(int n)
Returns the offset of the given tab from the left border of the item display area.
Definition: skins.h:174
eMenuCategory MenuCategory(void) const
Returns the menu category, set by a previous call to SetMenuCategory().
Definition: skins.h:183
const char * GetTabbedText(const char *s, int Tab)
Returns the part of the given string that follows the given Tab (where 0 indicates the beginning of t...
Definition: skins.c:112
const cMarks * marks
< This class implements the progress display used during replay of a recording.
Definition: skins.h:323
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
Definition: skins.h:61
void SetEditableWidth(int Width)
If an item is set through a call to cSkinDisplayMenu::SetItem(), this function shall be called to set...
Definition: skins.h:49
static cBitmap bmAudio
Definition: skinsttng.c:145
static cBitmap bmRecording
Definition: skinsttng.c:145
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
Definition: skinsttng.c:264
static cBitmap bmRadio
Definition: skinsttng.c:145
static cBitmap bmEncrypted
Definition: skinsttng.c:145
virtual void SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
Definition: skinsttng.c:291
static cBitmap bmTeletext
Definition: skinsttng.c:145
static cBitmap bmDolbyDigital
Definition: skinsttng.c:145
cSkinSTTNGDisplayChannel(bool WithInfo)
Definition: skinsttng.c:162
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:328
const cEvent * present
Definition: skinsttng.c:137
virtual ~cSkinSTTNGDisplayChannel()
Definition: skinsttng.c:259
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skinsttng.c:310
virtual const cFont * GetTextAreaFont(bool FixedFont) const
Returns a pointer to the font which is used to display text with SetText().
Definition: skinsttng.c:768
virtual void Clear(void)
Clears the entire central area of the menu.
Definition: skinsttng.c:550
virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable)
Sets the item at the given Index to Text.
Definition: skinsttng.c:611
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.
Definition: skinsttng.c:572
void DrawTitle(void)
Definition: skinsttng.c:556
virtual ~cSkinSTTNGDisplayMenu()
Definition: skinsttng.c:500
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:775
virtual void SetTitle(const char *Title)
Sets the title of this menu to Title.
Definition: skinsttng.c:566
virtual int GetTextAreaWidth(void) const
Returns the width in pixel of the area which is used to display text with SetText().
Definition: skinsttng.c:763
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skinsttng.c:597
virtual void SetEvent(const cEvent *Event)
Sets the Event that shall be displayed, using the entire central area of the menu.
Definition: skinsttng.c:650
void SetTextScrollbar(void)
Definition: skinsttng.c:533
virtual void SetScrollbar(int Total, int Offset)
Sets the Total number of items in the currently displayed list, and the Offset of the first item that...
Definition: skinsttng.c:645
void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
Definition: skinsttng.c:505
virtual void SetText(const char *Text, bool FixedFont)
Sets the Text that shall be displayed, using the entire central area of the menu.
Definition: skinsttng.c:757
virtual void SetRecording(const cRecording *Recording)
Sets the Recording that shall be displayed, using the entire central area of the menu.
Definition: skinsttng.c:700
virtual int MaxItems(void)
Returns the maximum number of items the menu can display.
Definition: skinsttng.c:545
virtual void Scroll(bool Up, bool Page)
If this menu contains a text area that can be scrolled, this function will be called to actually scro...
Definition: skinsttng.c:539
virtual ~cSkinSTTNGDisplayMessage()
Definition: skinsttng.c:1247
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
Definition: skinsttng.c:1252
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:1258
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skinsttng.c:925
virtual void SetCurrent(const char *Current)
Sets the current position within the recording, as a user readable string if the form "h:mm:ss....
Definition: skinsttng.c:905
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
Definition: skinsttng.c:920
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...
Definition: skinsttng.c:899
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:937
cSkinSTTNGDisplayReplay(bool ModeOnly)
Definition: skinsttng.c:813
virtual ~cSkinSTTNGDisplayReplay()
Definition: skinsttng.c:875
virtual void SetTitle(const char *Title)
Sets the title of the recording.
Definition: skinsttng.c:880
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...
Definition: skinsttng.c:892
virtual void SetTotal(const char *Total)
Sets the total length of the recording, as a user readable string if the form "h:mm:ss".
Definition: skinsttng.c:913
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:1193
virtual ~cSkinSTTNGDisplayTracks()
Definition: skinsttng.c:1140
static cBitmap bmAudioLeft
Definition: skinsttng.c:1043
static cBitmap bmAudioStereo
Definition: skinsttng.c:1043
cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Definition: skinsttng.c:1057
void SetItem(const char *Text, int Index, bool Current)
Definition: skinsttng.c:1145
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
Definition: skinsttng.c:1171
static cBitmap bmAudioRight
Definition: skinsttng.c:1043
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
Definition: skinsttng.c:1178
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
Definition: skinsttng.c:1000
virtual ~cSkinSTTNGDisplayVolume()
Definition: skinsttng.c:995
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:1028
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
Definition: skinsttng.c:1285
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
Definition: skinsttng.c:1280
virtual const char * Description(void)
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
Definition: skinsttng.c:1270
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
Definition: skinsttng.c:1275
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
Definition: skinsttng.c:1290
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
Definition: skinsttng.c:1300
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Creates and returns a new object for displaying the available tracks.
Definition: skinsttng.c:1295
cSkinSTTNG(void)
Definition: skinsttng.c:1265
Definition: skins.h:402
Definition: tools.h:178
static cString sprintf(const char *fmt,...) __attribute__((format(printf
Definition: tools.c:1149
int Height(void)
Definition: osd.h:1051
bool CanScroll(void)
Definition: osd.h:1055
int Total(void)
Definition: osd.h:1052
int Top(void)
Definition: osd.h:1049
int Offset(void)
Definition: osd.h:1053
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
Definition: osd.c:2346
void Reset(void)
Definition: osd.c:2363
int Shown(void)
Definition: osd.h:1054
bool CanScrollDown(void)
Definition: osd.h:1057
bool CanScrollUp(void)
Definition: osd.h:1056
Definition: themes.h:17
tColor Color(int Subject)
Returns the color for the given Subject.
Definition: themes.c:201
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...
Definition: videodir.c:210
static cString String(void)
Returns a localized string of the form "Disk nn% - hh:mm free".
Definition: videodir.c:234
cSetup Setup
Definition: config.c:372
@ fontOsd
Definition: font.h:22
@ fontFix
Definition: font.h:23
uint32_t tColor
Definition: font.h:29
#define tr(s)
Definition: i18n.h:85
@ taCenter
Definition: osd.h:158
@ oeOk
Definition: osd.h:44
@ clrBlue
Definition: osd.h:39
@ clrWhite
Definition: osd.h:41
@ clrRed
Definition: osd.h:35
@ clrYellow
Definition: osd.h:37
@ clrCyan
Definition: osd.h:40
@ clrBlack
Definition: osd.h:34
@ clrGray50
Definition: osd.h:33
@ clrTransparent
Definition: osd.h:32
@ clrGreen
Definition: osd.h:36
#define clrBackground
Definition: skincurses.c:35
@ mcMain
Definition: skins.h:107
@ mcRecording
Definition: skins.h:115
eMessageType
Definition: skins.h:37
static cTheme Theme
Definition: skinsttng.c:60
static const char *const * ReplaySymbols[2][2][5]
Definition: skinsttng.c:885
THEME_CLR(Theme, clrBackground, clrGray50)
#define Roundness
Definition: skinsttng.c:53
#define TextFrame
Definition: skinsttng.c:56
#define ScrollWidth
Definition: skinsttng.c:55
#define SymbolSpacing
Definition: skinsttng.c:58
#define TextSpacing
Definition: skinsttng.c:57
#define Gap
Definition: skinsttng.c:54
Definition: osd.h:298
char description[32]
Definition: device.h:83
cString TimeString(time_t t)
Converts the given time to a string of the form "hh:mm".
Definition: tools.c:1255
bool isempty(const char *s)
Definition: tools.c:349
cString DateString(time_t t)
Converts the given time to a string of the form "www dd.mm.yyyy".
Definition: tools.c:1235
char * strn0cpy(char *dest, const char *src, size_t n)
Definition: tools.c:131
cString DayDateTime(time_t t)
Converts the given time to a string of the form "www dd.mm. hh:mm".
Definition: tools.c:1214
T constrain(T v, T l, T h)
Definition: tools.h:70
T min(T a, T b)
Definition: tools.h:63
T max(T a, T b)
Definition: tools.h:64