vdr 2.6.8
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.2 2023/12/29 10:48:40 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
61
63THEME_CLR(Theme, clrButtonRedFg, clrWhite);
64THEME_CLR(Theme, clrButtonRedBg, clrRed);
65THEME_CLR(Theme, clrButtonGreenFg, clrBlack);
66THEME_CLR(Theme, clrButtonGreenBg, clrGreen);
67THEME_CLR(Theme, clrButtonYellowFg, clrBlack);
68THEME_CLR(Theme, clrButtonYellowBg, clrYellow);
69THEME_CLR(Theme, clrButtonBlueFg, clrWhite);
70THEME_CLR(Theme, clrButtonBlueBg, clrBlue);
71THEME_CLR(Theme, clrMessageFrame, clrYellow);
72THEME_CLR(Theme, clrMessageStatusFg, clrBlack);
73THEME_CLR(Theme, clrMessageStatusBg, clrCyan);
74THEME_CLR(Theme, clrMessageInfoFg, clrBlack);
75THEME_CLR(Theme, clrMessageInfoBg, clrGreen);
76THEME_CLR(Theme, clrMessageWarningFg, clrBlack);
77THEME_CLR(Theme, clrMessageWarningBg, clrYellow);
78THEME_CLR(Theme, clrMessageErrorFg, clrWhite);
79THEME_CLR(Theme, clrMessageErrorBg, clrRed);
80THEME_CLR(Theme, clrVolumeFrame, clrYellow);
81THEME_CLR(Theme, clrVolumeSymbol, clrBlack);
82THEME_CLR(Theme, clrVolumeBarUpper, 0xFFBC8024);
83THEME_CLR(Theme, clrVolumeBarLower, 0xFF248024);
84THEME_CLR(Theme, clrChannelFrame, clrYellow);
85THEME_CLR(Theme, clrChannelName, clrBlack);
86THEME_CLR(Theme, clrChannelDate, clrBlack);
87THEME_CLR(Theme, clrChannelSymbolOn, clrBlack);
88THEME_CLR(Theme, clrChannelSymbolOff, 0xFFBC8024);
89THEME_CLR(Theme, clrChannelSymbolRecFg, clrWhite);
90THEME_CLR(Theme, clrChannelSymbolRecBg, clrRed);
91THEME_CLR(Theme, clrChannelEpgTime, clrBlack);
92THEME_CLR(Theme, clrChannelEpgTitle, clrCyan);
93THEME_CLR(Theme, clrChannelEpgShortText, clrYellow);
94THEME_CLR(Theme, clrChannelTimebarSeen, clrYellow);
95THEME_CLR(Theme, clrChannelTimebarRest, clrGray50);
96THEME_CLR(Theme, clrChannelSignalValue, clrGreen);
97THEME_CLR(Theme, clrChannelSignalRest, clrRed);
98THEME_CLR(Theme, clrMenuFrame, clrYellow);
99THEME_CLR(Theme, clrMenuTitle, clrBlack);
100THEME_CLR(Theme, clrMenuDate, clrBlack);
101THEME_CLR(Theme, clrMenuItemCurrentFg, clrBlack);
102THEME_CLR(Theme, clrMenuItemCurrentBg, clrYellow);
103THEME_CLR(Theme, clrMenuItemSelectable, clrYellow);
104THEME_CLR(Theme, clrMenuItemNonSelectable, clrCyan);
105THEME_CLR(Theme, clrMenuEventTime, clrYellow);
106THEME_CLR(Theme, clrMenuEventVps, clrBlack);
107THEME_CLR(Theme, clrMenuEventTitle, clrCyan);
108THEME_CLR(Theme, clrMenuEventShortText, clrYellow);
109THEME_CLR(Theme, clrMenuEventDescription, clrCyan);
110THEME_CLR(Theme, clrMenuScrollbarTotal, clrYellow);
111THEME_CLR(Theme, clrMenuScrollbarShown, clrCyan);
112THEME_CLR(Theme, clrMenuScrollbarArrow, clrBlack);
113THEME_CLR(Theme, clrMenuText, clrCyan);
114THEME_CLR(Theme, clrReplayFrame, clrYellow);
115THEME_CLR(Theme, clrReplayTitle, clrBlack);
116THEME_CLR(Theme, clrReplayMode, clrBlack);
117THEME_CLR(Theme, clrReplayCurrent, clrBlack);
118THEME_CLR(Theme, clrReplayTotal, clrBlack);
119THEME_CLR(Theme, clrReplayJump, clrBlack);
120THEME_CLR(Theme, clrReplayProgressSeen, clrGreen);
121THEME_CLR(Theme, clrReplayProgressRest, clrWhite);
122THEME_CLR(Theme, clrReplayProgressSelected, clrRed);
123THEME_CLR(Theme, clrReplayProgressMark, clrBlack);
124THEME_CLR(Theme, clrReplayProgressCurrent, clrRed);
125
126// --- cSkinSTTNGDisplayChannel ----------------------------------------------
127
129private:
131 int x0, x1, x2, x3, x4, x5, x6, x7;
132 int y0, y1, y2, y3, y4, y5, y6, y7;
146public:
147 cSkinSTTNGDisplayChannel(bool WithInfo);
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;
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
263
264void 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()) {
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);
289}
290
291void 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 {
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 }
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
398private:
400 int x0, x1, x2, x3, x4, x5, x6, x7;
401 int y0, y1, y2, y3, y4, y5, y6, y7;
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);
412public:
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);
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;
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
504
505void 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
538
539void cSkinSTTNGDisplayMenu::Scroll(bool Up, bool Page)
540{
541 cSkinDisplayMenu::Scroll(Up, Page);
543}
544
546{
547 return (y4 - y3 - 2 * Roundness) / lineHeight;
548}
549
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
566void cSkinSTTNGDisplayMenu::SetTitle(const char *Title)
567{
568 title = Title;
569 DrawTitle();
570}
571
572void 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 {
607 message = false;
608 }
609}
610
611void 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) {
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
645void 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 cString d = Info->Description();
749 cString f = Info->FrameParams();
750 if (*f) {
751 d.Append("\n\n");
752 d.Append(f);
753 }
754 textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, d, font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
755 yb = yt + textScroller.Height();
756 osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3);
757 osd->DrawRectangle(x1, yt, x2, yb, frameColor);
758 osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2);
760 }
761}
762
763void cSkinSTTNGDisplayMenu::SetText(const char *Text, bool FixedFont)
764{
765 textScroller.Set(osd, x3, y3, GetTextAreaWidth(), y4 - y3, Text, GetTextAreaFont(FixedFont), Theme.Color(clrMenuText), Theme.Color(clrBackground));
767}
768
770{
771 return x4 - x3;
772}
773
775{
776 const cFont *font = cFont::GetFont(FixedFont ? fontFix : fontOsd);
777 //XXX -> make a way to let the text define which font to use
778 return font;
779}
780
782{
784 DrawTitle();
785 if (!message) {
786 cString date = DayDateTime();
787 if (!*lastDate || strcmp(date, lastDate)) {
788 const cFont *font = cFont::GetFont(fontSml);
789 int w = font->Width(date);
790 osd->DrawText(x4 - w - TextFrame, y7 - font->Height(), date, Theme.Color(clrMenuDate), frameColor, font, w);
791 lastDate = date;
792 }
793 }
794 osd->Flush();
795}
796
797// --- cSkinSTTNGDisplayReplay -----------------------------------------------
798
800private:
802 int x0, x1, x2, x3, x4, x5, x6, x7;
803 int y0, y1, y2, y3, y4, y5, y6, y7;
806public:
807 cSkinSTTNGDisplayReplay(bool ModeOnly);
808 virtual ~cSkinSTTNGDisplayReplay();
809 virtual void SetTitle(const char *Title);
810 virtual void SetMode(bool Play, bool Forward, int Speed);
811 virtual void SetProgress(int Current, int Total);
812 virtual void SetCurrent(const char *Current);
813 virtual void SetTotal(const char *Total);
814 virtual void SetJump(const char *Jump);
815 virtual void SetMessage(eMessageType Type, const char *Text);
816 virtual void Flush(void);
817 };
818
820{
821 const cFont *font = cFont::GetFont(fontSml);
822 int lineHeight = font->Height();
823 frameColor = Theme.Color(clrReplayFrame);
825 cBitmap bm(play_xpm);
826 x0 = 0;
827 x1 = max(lineHeight * 2, bm.Width());
828 x2 = x1 + Roundness;
829 x3 = x2 + Gap;
830 x7 = cOsd::OsdWidth();
831 x6 = x7 - lineHeight / 2;
832 x5 = x6 - lineHeight / 2;
833 x4 = x5 - Gap;
834 y0 = 0;
835 y1 = lineHeight;
836 y2 = y1 + Roundness;
837 y3 = y2 + Gap;
838 y4 = y3 + max(lineHeight, bm.Height());
839 y5 = y4 + Gap;
840 y6 = y5 + Roundness;
841 y7 = y6 + font->Height();
842 int yt = (y0 + y1) / 2;
843 int yb = (y6 + y7) / 2;
845 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor
846 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
847 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
848 else {
849 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; // 256 colors
850 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
851 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
852 else {
853 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors
854 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
855 }
856 }
857 osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, ModeOnly ? clrTransparent : Theme.Color(clrBackground));
858 if (!ModeOnly) {
859 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
860 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
861 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
862 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
863 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
864 osd->DrawRectangle(x1, y0, x4 - 1, y1 - 1, frameColor);
865 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
866 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
867 osd->DrawRectangle(x0, y1, x1 - 1, y2 - 1, frameColor);
868 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
869 }
870 osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
871 if (!ModeOnly) {
872 osd->DrawRectangle(x0, y5, x1 - 1, y6 - 1, frameColor);
873 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
874 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
875 osd->DrawRectangle(x1, y6, x4 - 1, y7 - 1, frameColor);
876 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
877 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
878 }
879}
880
885
887{
888 osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrReplayTitle), frameColor, cFont::GetFont(fontSml), x4 - x3 - TextSpacing);
889}
890
891static const char *const *ReplaySymbols[2][2][5] = {
892 { { pause_xpm, srew_xpm, srew1_xpm, srew2_xpm, srew3_xpm },
893 { pause_xpm, sfwd_xpm, sfwd1_xpm, sfwd2_xpm, sfwd3_xpm }, },
894 { { play_xpm, frew_xpm, frew1_xpm, frew2_xpm, frew3_xpm },
895 { play_xpm, ffwd_xpm, ffwd1_xpm, ffwd2_xpm, ffwd3_xpm } }
896 };
897
898void cSkinSTTNGDisplayReplay::SetMode(bool Play, bool Forward, int Speed)
899{
900 Speed = constrain(Speed, -1, 3);
901 cBitmap bm(ReplaySymbols[Play][Forward][Speed + 1]);
902 osd->DrawBitmap(x0 + (x1 - x0 - bm.Width()) / 2, y3 + (y4 - y3 - bm.Height()) / 2, bm, Theme.Color(clrReplayMode), frameColor);
903}
904
905void cSkinSTTNGDisplayReplay::SetProgress(int Current, int Total)
906{
907 cProgressBar pb(x4 - x3, y4 - y3, Current, Total, marks, Theme.Color(clrReplayProgressSeen), Theme.Color(clrReplayProgressRest), Theme.Color(clrReplayProgressSelected), Theme.Color(clrReplayProgressMark), Theme.Color(clrReplayProgressCurrent));
908 osd->DrawBitmap(x3, y3, pb);
909}
910
911void cSkinSTTNGDisplayReplay::SetCurrent(const char *Current)
912{
913 const cFont *font = cFont::GetFont(fontSml);
914 int w = font->Width(Current);
915 osd->DrawText(x3, y6, Current, Theme.Color(clrReplayCurrent), frameColor, font, lastCurrentWidth > w ? lastCurrentWidth : w);
917}
918
920{
921 const cFont *font = cFont::GetFont(fontSml);
922 int w = font->Width(Total);
923 osd->DrawText(x4 - w - TextSpacing, y6, Total, Theme.Color(clrReplayTotal), frameColor, font, w);
924}
925
927{
928 osd->DrawText(x0 + (x4 - x0) / 4, y6, Jump, Theme.Color(clrReplayJump), frameColor, cFont::GetFont(fontSml), (x4 - x3) / 2, 0, taCenter);
929}
930
932{
933 const cFont *font = cFont::GetFont(fontSml);
934 if (Text) {
935 osd->SaveRegion(x2, y6, x4 - 1, y7 - 1);
937 osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
938 }
939 else
941}
942
944{
945 osd->Flush();
946}
947
948// --- cSkinSTTNGDisplayVolume -----------------------------------------------
949
951private:
953 int x0, x1, x2, x3, x4, x5, x6, x7;
954 int y0, y1;
956 int mute;
957public:
959 virtual ~cSkinSTTNGDisplayVolume();
960 virtual void SetVolume(int Current, int Total, bool Mute);
961 virtual void Flush(void);
962 };
963
965{
966 const cFont *font = cFont::GetFont(fontOsd);
967 int lineHeight = font->Height();
968 frameColor = Theme.Color(clrVolumeFrame);
969 mute = -1;
970 x0 = 0;
971 x1 = lineHeight / 2;
972 x2 = lineHeight;
973 x3 = x2 + Gap;
974 x7 = cOsd::OsdWidth();
975 x6 = x7 - lineHeight / 2;
976 x5 = x6 - lineHeight / 2;
977 x4 = x5 - Gap;
978 y0 = 0;
979 y1 = lineHeight;
981 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
982 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
983 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
984 else {
985 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
986 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
987 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
988 else {
989 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors
990 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
991 }
992 }
993 osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
994 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
995 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
996 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
997 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
998 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
999}
1000
1005
1006void cSkinSTTNGDisplayVolume::SetVolume(int Current, int Total, bool Mute)
1007{
1008 int xl = x3 + TextSpacing;
1009 int xr = x4 - TextSpacing;
1010 int yt = y0 + TextFrame;
1011 int yb = y1 - TextFrame;
1012 if (mute != Mute) {
1013 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1014 mute = Mute;
1015 }
1016 cBitmap bm(Mute ? mute_xpm : volume_xpm);
1017 osd->DrawBitmap(xl, y0 + (y1 - y0 - bm.Height()) / 2, bm, Theme.Color(clrVolumeSymbol), frameColor);
1018 if (!Mute) {
1019 xl += bm.Width() + TextSpacing;
1020 int w = (y1 - y0) / 3;
1021 int d = TextFrame;
1022 int n = (xr - xl + d) / (w + d);
1023 int x = xr - n * (w + d);
1024 tColor Color = Theme.Color(clrVolumeBarLower);
1025 for (int i = 0; i < n; i++) {
1026 if (Total * i >= Current * n)
1027 Color = Theme.Color(clrVolumeBarUpper);
1028 osd->DrawRectangle(x, yt, x + w - 1, yb - 1, Color);
1029 x += w + d;
1030 }
1031 }
1032}
1033
1035{
1036 osd->Flush();
1037}
1038
1039// --- cSkinSTTNGDisplayTracks -----------------------------------------------
1040
1042private:
1044 int x0, x1, x2, x3, x4, x5, x6, x7;
1045 int y0, y1, y2, y3, y4, y5, y6, y7;
1050 void SetItem(const char *Text, int Index, bool Current);
1051public:
1052 cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
1053 virtual ~cSkinSTTNGDisplayTracks();
1054 virtual void SetTrack(int Index, const char * const *Tracks);
1055 virtual void SetAudioChannel(int AudioChannel);
1056 virtual void Flush(void);
1057 };
1058
1062
1063cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1064{
1065 const cFont *font = cFont::GetFont(fontOsd);
1066 lineHeight = font->Height();
1067 frameColor = Theme.Color(clrMenuFrame);
1068 currentIndex = -1;
1069 int ItemsWidth = font->Width(Title);
1070 for (int i = 0; i < NumTracks; i++)
1071 ItemsWidth = max(ItemsWidth, font->Width(Tracks[i]));
1072 ItemsWidth += 2 * TextSpacing;
1073 x0 = 0;
1074 x1 = lineHeight / 2;
1075 x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
1076 x2 = x3 - Gap;
1077 x7 = cOsd::OsdWidth();
1078 x6 = x7 - lineHeight / 2;
1079 x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
1080 x5 = x4 + Gap;
1081 int d = x4 - x3;
1082 if (d > ItemsWidth) {
1083 d = (d - ItemsWidth) & ~0x07; // must be multiple of 8
1084 x4 -= d;
1085 x5 -= d;
1086 x6 -= d;
1087 x7 -= d;
1088 }
1089 y0 = 0;
1090 y1 = lineHeight;
1091 y2 = y1 + Roundness;
1092 y3 = y2 + Gap;
1093 // limit to cOsd::OsdHeight()? - what if height is too big???
1094 y4 = y3 + NumTracks * lineHeight + 2 * Roundness;
1095 y5 = y4 + Gap;
1096 y6 = y5 + Roundness;
1097 y7 = y6 + cFont::GetFont(fontSml)->Height();
1098 int yt = (y0 + y1) / 2;
1099 int yb = (y6 + y7) / 2;
1101 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor
1102 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1103 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1104 else {
1105 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors
1106 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1107 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1108 else {
1109 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors
1110 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1111 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1112 else {
1113 tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors
1114 { x0, y3, x3 - 1, y4 - 1, 1 },
1115 { x3, y3, x4 - 1, y4 - 1, 2 },
1116 { x4, y3, x7 - 1, y4 - 1, 2 },
1117 { x0, y4, x7 - 1, y7 - 1, 4 }
1118 };
1119 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1120 }
1121 }
1122 }
1124 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
1125 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
1126 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
1127 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
1128 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
1129 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1130 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1131 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1132 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1133 osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
1134 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
1135 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
1136 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
1137 osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
1138 osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1139 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
1140 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
1141 osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrMenuTitle), frameColor, font, x4 - x3 - TextSpacing);
1142 for (int i = 0; i < NumTracks; i++)
1143 SetItem(Tracks[i], i, false);
1144}
1145
1150
1151void cSkinSTTNGDisplayTracks::SetItem(const char *Text, int Index, bool Current)
1152{
1153 int y = y3 + Roundness + Index * lineHeight;
1154 tColor ColorFg, ColorBg;
1155 if (Current) {
1156 ColorFg = Theme.Color(clrMenuItemCurrentFg);
1157 ColorBg = Theme.Color(clrMenuItemCurrentBg);
1158 osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3);
1159 osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor);
1160 osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
1161 osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg);
1162 currentIndex = Index;
1163 }
1164 else {
1165 ColorFg = Theme.Color(clrMenuItemSelectable);
1166 ColorBg = Theme.Color(clrBackground);
1167 if (currentIndex == Index) {
1170 }
1171 }
1172 const cFont *font = cFont::GetFont(fontOsd);
1173 int xt = x3 + TextSpacing;
1174 osd->DrawText(xt, y, Text, ColorFg, ColorBg, font, x4 - xt);
1175}
1176
1177void cSkinSTTNGDisplayTracks::SetTrack(int Index, const char * const *Tracks)
1178{
1179 if (currentIndex >= 0)
1180 SetItem(Tracks[currentIndex], currentIndex, false);
1181 SetItem(Tracks[Index], Index, true);
1182}
1183
1185{
1186 cBitmap *bm = NULL;
1187 switch (AudioChannel) {
1188 case 0: bm = &bmAudioStereo; break;
1189 case 1: bm = &bmAudioLeft; break;
1190 case 2: bm = &bmAudioRight; break;
1191 default: ;
1192 }
1193 if (bm)
1194 osd->DrawBitmap(x3 + TextSpacing, y6 + (y7 - y6 - bm->Height()) / 2, *bm, Theme.Color(clrChannelSymbolOn), frameColor);
1195 else
1196 osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1197}
1198
1200{
1201 osd->Flush();
1202}
1203
1204// --- cSkinSTTNGDisplayMessage ----------------------------------------------
1205
1207private:
1209 int x0, x1, x2, x3, x4, x5, x6, x7;
1210 int y0, y1;
1211public:
1213 virtual ~cSkinSTTNGDisplayMessage();
1214 virtual void SetMessage(eMessageType Type, const char *Text);
1215 virtual void Flush(void);
1216 };
1217
1219{
1220 const cFont *font = cFont::GetFont(fontOsd);
1221 int lineHeight = font->Height();
1222 tColor frameColor = Theme.Color(clrMessageFrame);
1223 x0 = 0;
1224 x1 = lineHeight / 2;
1225 x2 = lineHeight;
1226 x3 = x2 + Gap;
1227 x7 = cOsd::OsdWidth();
1228 x6 = x7 - lineHeight / 2;
1229 x5 = x6 - lineHeight / 2;
1230 x4 = x5 - Gap;
1231 y0 = 0;
1232 y1 = lineHeight;
1234 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
1235 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1236 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1237 else {
1238 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
1239 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1240 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1241 else {
1242 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 2 } }; // 4 colors
1243 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1244 }
1245 }
1246 osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
1247 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
1248 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1249 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1250 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1251}
1252
1257
1259{
1260 const cFont *font = cFont::GetFont(fontOsd);
1261 osd->DrawText(x3, y0, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
1262}
1263
1265{
1266 osd->Flush();
1267}
1268
1269// --- cSkinSTTNG ------------------------------------------------------------
1270
1272:cSkin("sttng", &::Theme)//XXX naming problem???
1273{
1274}
1275
1277{
1278 return tr("ST:TNG Panels");
1279}
1280
1282{
1283 return new cSkinSTTNGDisplayChannel(WithInfo);
1284}
1285
1290
1292{
1293 return new cSkinSTTNGDisplayReplay(ModeOnly);
1294}
1295
1300
1301cSkinDisplayTracks *cSkinSTTNG::DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1302{
1303 return new cSkinSTTNGDisplayTracks(Title, NumTracks, Tracks);
1304}
1305
cString ChannelString(const cChannel *Channel, int Number)
Definition channels.c:1140
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:171
int Vpid(void) const
Definition channels.h:154
int Dpid(int i) const
Definition channels.h:161
int Apid(int i) const
Definition channels.h:160
bool GroupSep(void) const
Definition channels.h:181
int Ca(int Index=0) const
Definition channels.h:173
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise.
Definition device.c:222
static cDevice * PrimaryDevice(void)
Returns the primary device.
Definition device.h:148
eTrackType GetCurrentAudioTrack(void) const
Definition device.h:599
int DeviceNumber(void) const
Returns the number of this device (0 ... numDevices - 1).
Definition device.c:167
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
Definition device.c:795
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
Definition device.c:790
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:1143
Definition epg.h:73
const char * ShortText(void) const
Definition epg.h:106
time_t Vps(void) const
Definition epg.h:114
cString GetDateString(void) const
Definition epg.c:428
const char * Description(void) const
Definition epg.h:107
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
cString GetParentalRatingString(void) const
Definition epg.c:421
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:412
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:2290
The cOsd class is the interface to the "On Screen Display".
Definition osd.h:753
static int OsdHeight(void)
Definition osd.h:831
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
Definition osd.c:2092
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:2206
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:2246
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
Definition osd.c:2070
static int OsdTop(void)
Definition osd.h:829
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:2127
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition osd.c:2266
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:2236
static int OsdLeft(void)
Definition osd.h:828
static int OsdWidth(void)
Definition osd.h:830
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition osd.c:2143
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:2226
static bool Active(void)
Definition menu.c:5718
const char * ChannelName(void) const
Definition recording.h:87
const cEvent * GetEvent(void) const
Definition recording.h:88
int Errors(void) const
Definition recording.h:105
const char * ShortText(void) const
Definition recording.h:90
const char * Title(void) const
Definition recording.h:89
cString FrameParams(void) const
Definition recording.c:629
const char * Description(void) const
Definition recording.h:91
const char * Name(void) const
Returns the full name of the recording (without the video directory).
Definition recording.h:162
time_t Start(void) const
Definition recording.h:147
cRecordingInfo * Info(void) const
Definition recording.h:169
int ColorKey3
Definition config.h:324
int ColorKey2
Definition config.h:324
int AntiAlias
Definition config.h:336
int ColorKey0
Definition config.h:324
int ChannelInfoPos
Definition config.h:329
int ColorKey1
Definition config.h:324
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:774
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
virtual ~cSkinSTTNGDisplayMenu()
Definition skinsttng.c:500
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:781
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:769
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:763
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:1253
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
Definition skinsttng.c:1258
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:1264
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition skinsttng.c:931
virtual void SetCurrent(const char *Current)
Sets the current position within the recording, as a user readable string in the form "h:mm:ss....
Definition skinsttng.c:911
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
Definition skinsttng.c:926
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:905
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:943
cSkinSTTNGDisplayReplay(bool ModeOnly)
Definition skinsttng.c:819
virtual ~cSkinSTTNGDisplayReplay()
Definition skinsttng.c:881
virtual void SetTitle(const char *Title)
Sets the title of the recording.
Definition skinsttng.c:886
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:898
virtual void SetTotal(const char *Total)
Sets the total length of the recording, as a user readable string in the form "h:mm:ss".
Definition skinsttng.c:919
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:1199
virtual ~cSkinSTTNGDisplayTracks()
Definition skinsttng.c:1146
static cBitmap bmAudioLeft
Definition skinsttng.c:1049
static cBitmap bmAudioStereo
Definition skinsttng.c:1049
cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Definition skinsttng.c:1063
void SetItem(const char *Text, int Index, bool Current)
Definition skinsttng.c:1151
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
Definition skinsttng.c:1177
static cBitmap bmAudioRight
Definition skinsttng.c:1049
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
Definition skinsttng.c:1184
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
Definition skinsttng.c:1006
virtual ~cSkinSTTNGDisplayVolume()
Definition skinsttng.c:1001
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:1034
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
Definition skinsttng.c:1291
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
Definition skinsttng.c:1286
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:1276
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
Definition skinsttng.c:1281
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
Definition skinsttng.c:1296
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
Definition skinsttng.c:1306
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:1301
cSkinSTTNG(void)
Definition skinsttng.c:1271
Definition skins.h:402
static cString sprintf(const char *fmt,...) __attribute__((format(printf
Definition tools.c:1180
cString & Append(const char *String)
Definition tools.c:1133
int Height(void)
Definition osd.h:1088
bool CanScroll(void)
Definition osd.h:1092
int Total(void)
Definition osd.h:1089
int Top(void)
Definition osd.h:1086
int Offset(void)
Definition osd.h:1090
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:2421
void Reset(void)
Definition osd.c:2438
int Shown(void)
Definition osd.h:1091
bool CanScrollDown(void)
Definition osd.h:1094
bool CanScrollUp(void)
Definition osd.h:1093
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:30
#define tr(s)
Definition i18n.h:85
@ taCenter
Definition osd.h:158
@ oeOk
Definition osd.h:44
@ clrGray50
Definition osd.h:33
#define clrBlue
Definition skincurses.c:41
#define clrTransparent
Definition skincurses.c:36
#define clrBlack
Definition skincurses.c:37
#define clrWhite
Definition skincurses.c:44
#define clrGreen
Definition skincurses.c:39
#define clrRed
Definition skincurses.c:38
#define clrYellow
Definition skincurses.c:40
#define clrBackground
Definition skincurses.c:35
#define clrCyan
Definition skincurses.c:43
@ 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:891
#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
#define THEME_CLR(Theme, Subject, Color)
Definition themes.h:59
cString TimeString(time_t t)
Converts the given time to a string of the form "hh:mm".
Definition tools.c:1286
bool isempty(const char *s)
Definition tools.c:354
cString DateString(time_t t)
Converts the given time to a string of the form "www dd.mm.yyyy".
Definition tools.c:1266
cString DayDateTime(time_t t)
Converts the given time to a string of the form "www dd.mm. hh:mm".
Definition tools.c:1245
char * strn0cpy(char *dest, const char *src, size_t n)
Definition tools.c:131
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