vdr  2.2.0
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 3.1 2013/11/15 15:33:14 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  }
208  osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, Theme.Color(clrBackground));
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);
299  osd->DrawRectangle(x3, y3, x7 - 1, y4 - 1, Theme.Color(clrBackground));
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  }
480  osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, Theme.Color(clrBackground));
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())
536  DrawScrollbar(textScroller.Total(), textScroller.Offset(), textScroller.Shown(), textScroller.Top(), textScroller.Height(), textScroller.CanScrollUp(), textScroller.CanScrollDown());
537 }
538 
539 void cSkinSTTNGDisplayMenu::Scroll(bool Up, bool Page)
540 {
541  cSkinDisplayMenu::Scroll(Up, Page);
542  SetTextScrollbar();
543 }
544 
546 {
547  return (y4 - y3 - 2 * Roundness) / lineHeight;
548 }
549 
551 {
552  textScroller.Reset();
553  osd->DrawRectangle(x1, y3, x7 - 1, y4 - 1, Theme.Color(clrBackground));
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) {
628  osd->DrawRectangle(x1, y - Roundness, x2 - 1, y + lineHeight + Roundness - 1, Theme.Color(clrBackground));
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  }
642  SetEditableWidth(x4 - x3 - TextSpacing - Tab(1));
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  char t[32];
659  snprintf(t, sizeof(t), "%s %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
660  ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
661  if (Event->Vps() && Event->Vps() != Event->StartTime()) {
662  cString buffer = cString::sprintf(" VPS: %s ", *Event->GetVpsString());
663  const cFont *font = cFont::GetFont(fontSml);
664  int w = font->Width(buffer);
665  osd->DrawText(x4 - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
666  int yb = y + font->Height();
667  osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
668  osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
669  }
670  y += ts.Height();
671  if (Event->ParentalRating()) {
672  cString buffer = cString::sprintf(" %s ", *Event->GetParentalRatingString());
673  const cFont *font = cFont::GetFont(fontSml);
674  int w = font->Width(buffer);
675  osd->DrawText(x4 - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
676  int yb = y + font->Height();
677  osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
678  osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
679  }
680  y += font->Height();
681  ts.Set(osd, xl, y, x4 - xl, y4 - y, Event->Title(), font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
682  y += ts.Height();
683  if (!isempty(Event->ShortText())) {
684  const cFont *font = cFont::GetFont(fontSml);
685  ts.Set(osd, xl, y, x4 - xl, y4 - y, Event->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
686  y += ts.Height();
687  }
688  y += font->Height();
689  if (!isempty(Event->Description())) {
690  int yt = y;
691  int yb = y4 - Roundness;
692  textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, Event->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
693  yb = yt + textScroller.Height();
694  osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3);
695  osd->DrawRectangle(x1, yt, x2, yb, frameColor);
696  osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2);
697  SetTextScrollbar();
698  }
699 }
700 
702 {
703  if (!Recording)
704  return;
705  const cRecordingInfo *Info = Recording->Info();
706  const cFont *font = cFont::GetFont(fontOsd);
707  int xl = x3 + TextSpacing;
708  int y = y3;
709  cTextScroller ts;
710  cString t = cString::sprintf("%s %s %s", *DateString(Recording->Start()), *TimeString(Recording->Start()), Info->ChannelName() ? Info->ChannelName() : "");
711  ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
712  y += ts.Height();
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(x4 - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
718  int yb = y + font->Height();
719  osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
720  osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
721  }
722  y += font->Height();
723  const char *Title = Info->Title();
724  if (isempty(Title))
725  Title = Recording->Name();
726  ts.Set(osd, xl, y, x4 - xl, y4 - y, Title, font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
727  y += ts.Height();
728  if (!isempty(Info->ShortText())) {
729  const cFont *font = cFont::GetFont(fontSml);
730  ts.Set(osd, xl, y, x4 - xl, y4 - y, Info->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
731  y += ts.Height();
732  }
733  y += font->Height();
734  if (!isempty(Info->Description())) {
735  int yt = y;
736  int yb = y4 - Roundness;
737  textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, Info->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
738  yb = yt + textScroller.Height();
739  osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3);
740  osd->DrawRectangle(x1, yt, x2, yb, frameColor);
741  osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2);
742  SetTextScrollbar();
743  }
744 }
745 
746 void cSkinSTTNGDisplayMenu::SetText(const char *Text, bool FixedFont)
747 {
748  textScroller.Set(osd, x3, y3, GetTextAreaWidth(), y4 - y3, Text, GetTextAreaFont(FixedFont), Theme.Color(clrMenuText), Theme.Color(clrBackground));
749  SetTextScrollbar();
750 }
751 
753 {
754  return x4 - x3;
755 }
756 
757 const cFont *cSkinSTTNGDisplayMenu::GetTextAreaFont(bool FixedFont) const
758 {
759  const cFont *font = cFont::GetFont(FixedFont ? fontFix : fontOsd);
760  //XXX -> make a way to let the text define which font to use
761  return font;
762 }
763 
765 {
766  if (cVideoDiskUsage::HasChanged(lastDiskUsageState))
767  DrawTitle();
768  if (!message) {
769  cString date = DayDateTime();
770  if (!*lastDate || strcmp(date, lastDate)) {
771  const cFont *font = cFont::GetFont(fontSml);
772  int w = font->Width(date);
773  osd->DrawText(x4 - w - TextFrame, y7 - font->Height(), date, Theme.Color(clrMenuDate), frameColor, font, w);
774  lastDate = date;
775  }
776  }
777  osd->Flush();
778 }
779 
780 // --- cSkinSTTNGDisplayReplay -----------------------------------------------
781 
783 private:
785  int x0, x1, x2, x3, x4, x5, x6, x7;
786  int y0, y1, y2, y3, y4, y5, y6, y7;
789 public:
790  cSkinSTTNGDisplayReplay(bool ModeOnly);
791  virtual ~cSkinSTTNGDisplayReplay();
792  virtual void SetTitle(const char *Title);
793  virtual void SetMode(bool Play, bool Forward, int Speed);
794  virtual void SetProgress(int Current, int Total);
795  virtual void SetCurrent(const char *Current);
796  virtual void SetTotal(const char *Total);
797  virtual void SetJump(const char *Jump);
798  virtual void SetMessage(eMessageType Type, const char *Text);
799  virtual void Flush(void);
800  };
801 
803 {
804  const cFont *font = cFont::GetFont(fontSml);
805  int lineHeight = font->Height();
806  frameColor = Theme.Color(clrReplayFrame);
807  lastCurrentWidth = 0;
808  cBitmap bm(play_xpm);
809  x0 = 0;
810  x1 = max(lineHeight * 2, bm.Width());
811  x2 = x1 + Roundness;
812  x3 = x2 + Gap;
813  x7 = cOsd::OsdWidth();
814  x6 = x7 - lineHeight / 2;
815  x5 = x6 - lineHeight / 2;
816  x4 = x5 - Gap;
817  y0 = 0;
818  y1 = lineHeight;
819  y2 = y1 + Roundness;
820  y3 = y2 + Gap;
821  y4 = y3 + max(lineHeight, bm.Height());
822  y5 = y4 + Gap;
823  y6 = y5 + Roundness;
824  y7 = y6 + font->Height();
825  int yt = (y0 + y1) / 2;
826  int yb = (y6 + y7) / 2;
828  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor
829  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
830  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
831  else {
832  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; // 256 colors
833  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
834  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
835  else {
836  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors
837  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
838  }
839  }
840  osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, ModeOnly ? clrTransparent : Theme.Color(clrBackground));
841  if (!ModeOnly) {
842  osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
843  osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
844  osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
845  osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
846  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
847  osd->DrawRectangle(x1, y0, x4 - 1, y1 - 1, frameColor);
848  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
849  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
850  osd->DrawRectangle(x0, y1, x1 - 1, y2 - 1, frameColor);
851  osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
852  }
853  osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
854  if (!ModeOnly) {
855  osd->DrawRectangle(x0, y5, x1 - 1, y6 - 1, frameColor);
856  osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
857  osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
858  osd->DrawRectangle(x1, y6, x4 - 1, y7 - 1, frameColor);
859  osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
860  osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
861  }
862 }
863 
865 {
866  delete osd;
867 }
868 
869 void cSkinSTTNGDisplayReplay::SetTitle(const char *Title)
870 {
871  osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrReplayTitle), frameColor, cFont::GetFont(fontSml), x4 - x3 - TextSpacing);
872 }
873 
874 static const char *const *ReplaySymbols[2][2][5] = {
875  { { pause_xpm, srew_xpm, srew1_xpm, srew2_xpm, srew3_xpm },
876  { pause_xpm, sfwd_xpm, sfwd1_xpm, sfwd2_xpm, sfwd3_xpm }, },
877  { { play_xpm, frew_xpm, frew1_xpm, frew2_xpm, frew3_xpm },
878  { play_xpm, ffwd_xpm, ffwd1_xpm, ffwd2_xpm, ffwd3_xpm } }
879  };
880 
881 void cSkinSTTNGDisplayReplay::SetMode(bool Play, bool Forward, int Speed)
882 {
883  Speed = constrain(Speed, -1, 3);
884  cBitmap bm(ReplaySymbols[Play][Forward][Speed + 1]);
885  osd->DrawBitmap(x0 + (x1 - x0 - bm.Width()) / 2, y3 + (y4 - y3 - bm.Height()) / 2, bm, Theme.Color(clrReplayMode), frameColor);
886 }
887 
889 {
890  cProgressBar pb(x4 - x3, y4 - y3, Current, Total, marks, Theme.Color(clrReplayProgressSeen), Theme.Color(clrReplayProgressRest), Theme.Color(clrReplayProgressSelected), Theme.Color(clrReplayProgressMark), Theme.Color(clrReplayProgressCurrent));
891  osd->DrawBitmap(x3, y3, pb);
892 }
893 
895 {
896  const cFont *font = cFont::GetFont(fontSml);
897  int w = font->Width(Current);
898  osd->DrawText(x3, y6, Current, Theme.Color(clrReplayCurrent), frameColor, font, lastCurrentWidth > w ? lastCurrentWidth : w);
899  lastCurrentWidth = w;
900 }
901 
902 void cSkinSTTNGDisplayReplay::SetTotal(const char *Total)
903 {
904  const cFont *font = cFont::GetFont(fontSml);
905  int w = font->Width(Total);
906  osd->DrawText(x4 - w - TextSpacing, y6, Total, Theme.Color(clrReplayTotal), frameColor, font, w);
907 }
908 
909 void cSkinSTTNGDisplayReplay::SetJump(const char *Jump)
910 {
911  osd->DrawText(x0 + (x4 - x0) / 4, y6, Jump, Theme.Color(clrReplayJump), frameColor, cFont::GetFont(fontSml), (x4 - x3) / 2, 0, taCenter);
912 }
913 
915 {
916  const cFont *font = cFont::GetFont(fontSml);
917  if (Text) {
918  osd->SaveRegion(x2, y6, x4 - 1, y7 - 1);
919  osd->DrawRectangle(x2, y6, x3 - 1, y7 - 1, Theme.Color(clrBackground));
920  osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
921  }
922  else
923  osd->RestoreRegion();
924 }
925 
927 {
928  osd->Flush();
929 }
930 
931 // --- cSkinSTTNGDisplayVolume -----------------------------------------------
932 
934 private:
936  int x0, x1, x2, x3, x4, x5, x6, x7;
937  int y0, y1;
939  int mute;
940 public:
942  virtual ~cSkinSTTNGDisplayVolume();
943  virtual void SetVolume(int Current, int Total, bool Mute);
944  virtual void Flush(void);
945  };
946 
948 {
949  const cFont *font = cFont::GetFont(fontOsd);
950  int lineHeight = font->Height();
951  frameColor = Theme.Color(clrVolumeFrame);
952  mute = -1;
953  x0 = 0;
954  x1 = lineHeight / 2;
955  x2 = lineHeight;
956  x3 = x2 + Gap;
957  x7 = cOsd::OsdWidth();
958  x6 = x7 - lineHeight / 2;
959  x5 = x6 - lineHeight / 2;
960  x4 = x5 - Gap;
961  y0 = 0;
962  y1 = lineHeight;
964  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
965  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
966  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
967  else {
968  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
969  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
970  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
971  else {
972  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors
973  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
974  }
975  }
976  osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
977  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
978  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
979  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
980  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
981  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
982 }
983 
985 {
986  delete osd;
987 }
988 
989 void cSkinSTTNGDisplayVolume::SetVolume(int Current, int Total, bool Mute)
990 {
991  int xl = x3 + TextSpacing;
992  int xr = x4 - TextSpacing;
993  int yt = y0 + TextFrame;
994  int yb = y1 - TextFrame;
995  if (mute != Mute) {
996  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
997  mute = Mute;
998  }
999  cBitmap bm(Mute ? mute_xpm : volume_xpm);
1000  osd->DrawBitmap(xl, y0 + (y1 - y0 - bm.Height()) / 2, bm, Theme.Color(clrVolumeSymbol), frameColor);
1001  if (!Mute) {
1002  xl += bm.Width() + TextSpacing;
1003  int w = (y1 - y0) / 3;
1004  int d = TextFrame;
1005  int n = (xr - xl + d) / (w + d);
1006  int x = xr - n * (w + d);
1007  tColor Color = Theme.Color(clrVolumeBarLower);
1008  for (int i = 0; i < n; i++) {
1009  if (Total * i >= Current * n)
1010  Color = Theme.Color(clrVolumeBarUpper);
1011  osd->DrawRectangle(x, yt, x + w - 1, yb - 1, Color);
1012  x += w + d;
1013  }
1014  }
1015 }
1016 
1018 {
1019  osd->Flush();
1020 }
1021 
1022 // --- cSkinSTTNGDisplayTracks -----------------------------------------------
1023 
1025 private:
1027  int x0, x1, x2, x3, x4, x5, x6, x7;
1028  int y0, y1, y2, y3, y4, y5, y6, y7;
1032  static cBitmap bmAudioLeft, bmAudioRight, bmAudioStereo;
1033  void SetItem(const char *Text, int Index, bool Current);
1034 public:
1035  cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
1036  virtual ~cSkinSTTNGDisplayTracks();
1037  virtual void SetTrack(int Index, const char * const *Tracks);
1038  virtual void SetAudioChannel(int AudioChannel);
1039  virtual void Flush(void);
1040  };
1041 
1045 
1046 cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1047 {
1048  const cFont *font = cFont::GetFont(fontOsd);
1049  lineHeight = font->Height();
1050  frameColor = Theme.Color(clrMenuFrame);
1051  currentIndex = -1;
1052  int ItemsWidth = font->Width(Title);
1053  for (int i = 0; i < NumTracks; i++)
1054  ItemsWidth = max(ItemsWidth, font->Width(Tracks[i]));
1055  ItemsWidth += 2 * TextSpacing;
1056  x0 = 0;
1057  x1 = lineHeight / 2;
1058  x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
1059  x2 = x3 - Gap;
1060  x7 = cOsd::OsdWidth();
1061  x6 = x7 - lineHeight / 2;
1062  x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
1063  x5 = x4 + Gap;
1064  int d = x4 - x3;
1065  if (d > ItemsWidth) {
1066  d = (d - ItemsWidth) & ~0x07; // must be multiple of 8
1067  x4 -= d;
1068  x5 -= d;
1069  x6 -= d;
1070  x7 -= d;
1071  }
1072  y0 = 0;
1073  y1 = lineHeight;
1074  y2 = y1 + Roundness;
1075  y3 = y2 + Gap;
1076  // limit to cOsd::OsdHeight()? - what if height is too big???
1077  y4 = y3 + NumTracks * lineHeight + 2 * Roundness;
1078  y5 = y4 + Gap;
1079  y6 = y5 + Roundness;
1080  y7 = y6 + cFont::GetFont(fontSml)->Height();
1081  int yt = (y0 + y1) / 2;
1082  int yb = (y6 + y7) / 2;
1084  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor
1085  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1086  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1087  else {
1088  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors
1089  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1090  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1091  else {
1092  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors
1093  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1094  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1095  else {
1096  tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors
1097  { x0, y3, x3 - 1, y4 - 1, 1 },
1098  { x3, y3, x4 - 1, y4 - 1, 2 },
1099  { x4, y3, x7 - 1, y4 - 1, 2 },
1100  { x0, y4, x7 - 1, y7 - 1, 4 }
1101  };
1102  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1103  }
1104  }
1105  }
1106  osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, Theme.Color(clrBackground));
1107  osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
1108  osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
1109  osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
1110  osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
1111  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
1112  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1113  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1114  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1115  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1116  osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
1117  osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
1118  osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
1119  osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
1120  osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
1121  osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1122  osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
1123  osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
1124  osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrMenuTitle), frameColor, font, x4 - x3 - TextSpacing);
1125  for (int i = 0; i < NumTracks; i++)
1126  SetItem(Tracks[i], i, false);
1127 }
1128 
1130 {
1131  delete osd;
1132 }
1133 
1134 void cSkinSTTNGDisplayTracks::SetItem(const char *Text, int Index, bool Current)
1135 {
1136  int y = y3 + Roundness + Index * lineHeight;
1137  tColor ColorFg, ColorBg;
1138  if (Current) {
1139  ColorFg = Theme.Color(clrMenuItemCurrentFg);
1140  ColorBg = Theme.Color(clrMenuItemCurrentBg);
1141  osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3);
1142  osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor);
1143  osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
1144  osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg);
1145  currentIndex = Index;
1146  }
1147  else {
1148  ColorFg = Theme.Color(clrMenuItemSelectable);
1149  ColorBg = Theme.Color(clrBackground);
1150  if (currentIndex == Index) {
1151  osd->DrawRectangle(x1, y - Roundness, x2 - 1, y + lineHeight + Roundness - 1, Theme.Color(clrBackground));
1152  osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, Theme.Color(clrBackground));
1153  }
1154  }
1155  const cFont *font = cFont::GetFont(fontOsd);
1156  int xt = x3 + TextSpacing;
1157  osd->DrawText(xt, y, Text, ColorFg, ColorBg, font, x4 - xt);
1158 }
1159 
1160 void cSkinSTTNGDisplayTracks::SetTrack(int Index, const char * const *Tracks)
1161 {
1162  if (currentIndex >= 0)
1163  SetItem(Tracks[currentIndex], currentIndex, false);
1164  SetItem(Tracks[Index], Index, true);
1165 }
1166 
1168 {
1169  cBitmap *bm = NULL;
1170  switch (AudioChannel) {
1171  case 0: bm = &bmAudioStereo; break;
1172  case 1: bm = &bmAudioLeft; break;
1173  case 2: bm = &bmAudioRight; break;
1174  default: ;
1175  }
1176  if (bm)
1177  osd->DrawBitmap(x3 + TextSpacing, y6 + (y7 - y6 - bm->Height()) / 2, *bm, Theme.Color(clrChannelSymbolOn), frameColor);
1178  else
1179  osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1180 }
1181 
1183 {
1184  osd->Flush();
1185 }
1186 
1187 // --- cSkinSTTNGDisplayMessage ----------------------------------------------
1188 
1190 private:
1192  int x0, x1, x2, x3, x4, x5, x6, x7;
1193  int y0, y1;
1194 public:
1196  virtual ~cSkinSTTNGDisplayMessage();
1197  virtual void SetMessage(eMessageType Type, const char *Text);
1198  virtual void Flush(void);
1199  };
1200 
1202 {
1203  const cFont *font = cFont::GetFont(fontOsd);
1204  int lineHeight = font->Height();
1205  tColor frameColor = Theme.Color(clrMessageFrame);
1206  x0 = 0;
1207  x1 = lineHeight / 2;
1208  x2 = lineHeight;
1209  x3 = x2 + Gap;
1210  x7 = cOsd::OsdWidth();
1211  x6 = x7 - lineHeight / 2;
1212  x5 = x6 - lineHeight / 2;
1213  x4 = x5 - Gap;
1214  y0 = 0;
1215  y1 = lineHeight;
1217  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
1218  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1219  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1220  else {
1221  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
1222  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1223  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1224  else {
1225  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 2 } }; // 4 colors
1226  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1227  }
1228  }
1229  osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
1230  osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
1231  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1232  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1233  osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1234 }
1235 
1237 {
1238  delete osd;
1239 }
1240 
1242 {
1243  const cFont *font = cFont::GetFont(fontOsd);
1244  osd->DrawText(x3, y0, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
1245 }
1246 
1248 {
1249  osd->Flush();
1250 }
1251 
1252 // --- cSkinSTTNG ------------------------------------------------------------
1253 
1255 :cSkin("sttng", &::Theme)//XXX naming problem???
1256 {
1257 }
1258 
1259 const char *cSkinSTTNG::Description(void)
1260 {
1261  return tr("ST:TNG Panels");
1262 }
1263 
1265 {
1266  return new cSkinSTTNGDisplayChannel(WithInfo);
1267 }
1268 
1270 {
1271  return new cSkinSTTNGDisplayMenu;
1272 }
1273 
1275 {
1276  return new cSkinSTTNGDisplayReplay(ModeOnly);
1277 }
1278 
1280 {
1281  return new cSkinSTTNGDisplayVolume;
1282 }
1283 
1284 cSkinDisplayTracks *cSkinSTTNG::DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1285 {
1286  return new cSkinSTTNGDisplayTracks(Title, NumTracks, Tracks);
1287 }
1288 
1290 {
1291  return new cSkinSTTNGDisplayMessage;
1292 }
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
Definition: device.c:677
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
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
int AntiAlias
Definition: config.h:323
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:1182
static int OsdHeight(void)
Definition: osd.h:789
Definition: epg.h:71
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
Definition: device.c:161
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:328
Definition: osd.h:36
eMessageType
Definition: skins.h:24
int Vpid(void) const
Definition: channels.h:170
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
Definition: skinsttng.c:1167
void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
Definition: skinsttng.c:505
bool isempty(const char *s)
Definition: tools.c:297
void SetTextScrollbar(void)
Definition: skinsttng.c:533
Definition: font.h:23
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:902
time_t Start(void) const
Definition: recording.h:128
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:1259
static cString String(void)
Returns a localized string of the form "Disk nn% - hh:mm free".
Definition: videodir.c:220
const cRecordingInfo * Info(void) const
Definition: recording.h:149
time_t Vps(void) const
Definition: epg.h:109
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
Definition: osd.c:1823
THEME_CLR(Theme, clrBackground, clrGray50)
const char * ShortText(void) const
Definition: recording.h:86
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:1017
char description[32]
Definition: device.h:90
int Ca(int Index=0) const
Definition: channels.h:191
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:764
int Dpid(int i) const
Definition: channels.h:177
cString GetParentalRatingString(void) const
Definition: epg.c:402
virtual const cFont * GetTextAreaFont(bool FixedFont) const
Returns a pointer to the font which is used to display text with SetText().
Definition: skinsttng.c:757
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:1922
virtual int MaxItems(void)
Returns the maximum number of items the menu can display.
Definition: skinsttng.c:545
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
Definition: skinsttng.c:1289
static const char *const * ReplaySymbols[2][2][5]
Definition: skinsttng.c:874
static cString sprintf(const char *fmt,...) __attribute__((format(printf
Definition: tools.c:1080
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:1962
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:2137
virtual ~cSkinSTTNGDisplayChannel()
Definition: skinsttng.c:259
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 ~cSkinSTTNGDisplayVolume()
Definition: skinsttng.c:984
int Duration(void) const
Definition: epg.h:108
static cBitmap bmEncrypted
Definition: skinsttng.c:145
#define TextSpacing
Definition: skinsttng.c:57
char * strn0cpy(char *dest, const char *src, size_t n)
Definition: tools.c:131
T max(T a, T b)
Definition: tools.h:55
bool GroupSep(void) const
Definition: channels.h:199
cSkinSTTNG(void)
Definition: skinsttng.c:1254
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:1952
static cBitmap bmAudioLeft
Definition: skinsttng.c:1032
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
Definition: skins.h:48
virtual void SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
Definition: skinsttng.c:291
time_t StartTime(void) const
Definition: epg.h:106
int ColorKey2
Definition: config.h:311
T min(T a, T b)
Definition: tools.h:54
cString ChannelString(const cChannel *Channel, int Number)
Definition: channels.c:1147
virtual void Clear(void)
Clears the entire central area of the menu.
Definition: skinsttng.c:550
static cBitmap bmAudioRight
Definition: skinsttng.c:1032
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
Definition: skinsttng.c:909
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...
Definition: skins.h:40
static cBitmap bmAudioStereo
Definition: skinsttng.c:1032
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
Definition: skinsttng.c:1269
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition: osd.c:1982
Definition: osd.h:158
Definition: osd.h:169
int Width(void) const
Definition: osd.h:188
Definition: osd.h:34
int Height(void)
Definition: osd.h:1035
#define clrBackground
Definition: skincurses.c:34
#define ScrollWidth
Definition: skinsttng.c:55
virtual int GetTextAreaWidth(void) const
Returns the width in pixel of the area which is used to display text with SetText().
Definition: skinsttng.c:752
void DrawTitle(void)
Definition: skinsttng.c:556
cString GetVpsString(void) const
Definition: epg.c:424
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
Definition: device.c:672
cSkinSTTNGDisplayReplay(bool ModeOnly)
Definition: skinsttng.c:802
Definition: osd.h:33
static cBitmap bmTeletext
Definition: skinsttng.c:145
int ParentalRating(void) const
Definition: epg.h:105
Definition: themes.h:17
virtual ~cSkinSTTNGDisplayMessage()
Definition: skinsttng.c:1236
Definition: font.h:22
T constrain(T v, T l, T h)
Definition: tools.h:60
static int OsdWidth(void)
Definition: osd.h:788
virtual ~cSkinSTTNGDisplayTracks()
Definition: skinsttng.c:1129
int ChannelInfoPos
Definition: config.h:316
int Height(void) const
Definition: osd.h:189
Definition: osd.h:37
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
virtual void SetRecording(const cRecording *Recording)
Sets the Recording that shall be displayed, using the entire central area of the menu.
Definition: skinsttng.c:701
Definition: osd.h:39
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
Definition: osd.c:1801
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skinsttng.c:310
int Tpid(void) const
Definition: channels.h:187
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:197
static cTheme Theme
Definition: skinsttng.c:60
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
Definition: skinsttng.c:1279
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
Definition: skinsttng.c:264
The cOsd class is the interface to the "On Screen Display".
Definition: osd.h:720
static bool Active(void)
Definition: menu.c:5321
Definition: osd.h:40
Definition: skins.h:94
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:1247
cSetup Setup
Definition: config.c:373
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:881
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
Definition: skinsttng.c:1274
cString DayDateTime(time_t t)
Converts the given time to a string of the form "www dd.mm. hh:mm".
Definition: tools.c:1145
#define Roundness
Definition: skinsttng.c:53
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:1942
int ColorKey3
Definition: config.h:311
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
Definition: skinsttng.c:1160
Definition: skins.h:370
static int OsdTop(void)
Definition: osd.h:787
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:36
const char * Title(void) const
Definition: epg.h:100
static int OsdLeft(void)
Definition: osd.h:786
Definition: osd.h:41
cSkinSTTNGDisplayChannel(bool WithInfo)
Definition: skinsttng.c:162
cString GetEndTimeString(void) const
Definition: epg.c:419
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skinsttng.c:597
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:894
virtual ~cSkinSTTNGDisplayReplay()
Definition: skinsttng.c:864
Definition: osd.h:298
void SetItem(const char *Text, int Index, bool Current)
Definition: skinsttng.c:1134
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
Definition: skinsttng.c:989
int ColorKey1
Definition: config.h:311
static cDevice * PrimaryDevice(void)
Returns the primary device.
Definition: device.h:137
virtual int Width(uint c) const =0
Returns the width of the given character in pixel.
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
static cBitmap bmRecording
Definition: skinsttng.c:145
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
Definition: skinsttng.c:1264
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:987
int Apid(int i) const
Definition: channels.h:176
#define tr(s)
Definition: i18n.h:85
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
Definition: skinsttng.c:1241
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:1284
static cBitmap bmAudio
Definition: skinsttng.c:145
cString GetTimeString(void) const
Definition: epg.c:414
const cEvent * present
Definition: skinsttng.c:137
const cEvent * GetEvent(void) const
Definition: recording.h:84
const char * Description(void) const
Definition: recording.h:87
const char * Name(void) const
Returns the full name of the recording (without the video directory.
Definition: recording.h:142
cString TimeString(time_t t)
Converts the given time to a string of the form "hh:mm".
Definition: tools.c:1186
virtual void SetTitle(const char *Title)
Sets the title of the recording.
Definition: skinsttng.c:869
cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Definition: skinsttng.c:1046
virtual void SetTitle(const char *Title)
Sets the title of this menu to Title.
Definition: skinsttng.c:566
const char * Title(void) const
Definition: recording.h:85
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skinsttng.c:926
const char * Description(void) const
Definition: epg.h:102
int ColorKey0
Definition: config.h:311
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise...
Definition: device.c:215
Definition: osd.h:44
virtual ~cSkinSTTNGDisplayMenu()
Definition: skinsttng.c:500
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().
Definition: osd.c:1871
const char * ChannelName(void) const
Definition: recording.h:83
static cBitmap bmDolbyDigital
Definition: skinsttng.c:145
#define Gap
Definition: skinsttng.c:54
cString GetDateString(void) const
Definition: epg.c:409
const char * ShortText(void) const
Definition: epg.h:101
static cBitmap bmRadio
Definition: skinsttng.c:145
eTrackType GetCurrentAudioTrack(void) const
Definition: device.h:542
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:1855
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:746
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
Definition: osd.h:35
tColor Color(int Subject)
Returns the color for the given Subject.
Definition: themes.c:201
Definition: font.h:37
The cDevice class is the base from which actual devices can be derived.
Definition: device.h:109
Definition: tools.h:168
static const cFont * GetFont(eDvbFont Font)
Gets the given Font, which was previously set by a call to SetFont().
Definition: font.c:406
cString DateString(time_t t)
Converts the given time to a string of the form "www dd.mm.yyyy".
Definition: tools.c:1166
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:888
#define SymbolSpacing
Definition: skinsttng.c:58
uint32_t tColor
Definition: font.h:29
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skinsttng.c:914
#define TextFrame
Definition: skinsttng.c:56
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:2006