vdr 2.7.2
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.4 2024/09/21 10:53:07 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);
125THEME_CLR(Theme, clrReplayProgressError, clrBlack);
126
127// --- cSkinSTTNGDisplayChannel ----------------------------------------------
128
130private:
132 int x0, x1, x2, x3, x4, x5, x6, x7;
133 int y0, y1, y2, y3, y4, y5, y6, y7;
147public:
148 cSkinSTTNGDisplayChannel(bool WithInfo);
150 virtual void SetChannel(const cChannel *Channel, int Number);
151 virtual void SetEvents(const cEvent *Present, const cEvent *Following);
152 virtual void SetMessage(eMessageType Type, const char *Text);
153 virtual void Flush(void);
154 };
155
162
164{
165 present = NULL;
166 lastSeen = -1;
167 lastDeviceNumber = -1;
171 memset(&lastTrackId, 0, sizeof(lastTrackId));
172 const cFont *font = cFont::GetFont(fontOsd);
173 withInfo = WithInfo;
174 lineHeight = font->Height();
175 frameColor = Theme.Color(clrChannelFrame);
176 message = false;
177 if (withInfo) {
178 x0 = 0;
179 x1 = x0 + font->Width("00:00") + 2 * TextFrame;
180 x2 = x1 + Roundness;
181 x3 = x2 + Gap;
182 x7 = cOsd::OsdWidth();
183 x6 = x7 - lineHeight / 2;
184 x5 = x6 - lineHeight / 2;
185 x4 = x5 - Gap;
186 y0 = 0;
187 y1 = lineHeight;
188 y2 = y1 + Roundness;
189 y3 = y2 + Gap;
190 y4 = y3 + 4 * lineHeight;
191 y5 = y4 + Gap;
192 y6 = y5 + Roundness;
193 y7 = y6 + cFont::GetFont(fontSml)->Height();
194 int yt = (y0 + y1) / 2;
195 int yb = (y6 + y7) / 2;
197 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor
198 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
199 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
200 else {
201 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; // 256 colors
202 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
203 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
204 else {
205 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors
206 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
207 }
208 }
210 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
211 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
212 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
213 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
214 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
215 osd->DrawRectangle(x1, y0, x4 - 1, y1 - 1, frameColor);
216 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
217 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
218 osd->DrawRectangle(x0, y1, x1 - 1, y2 - 1, frameColor);
219 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
220 osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
221 osd->DrawRectangle(x0, y5, x1 - 1, y6 - 1, frameColor);
222 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
223 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
224 osd->DrawRectangle(x1, y6, x4 - 1, y7 - 1, frameColor);
225 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
226 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
227 }
228 else {
229 x0 = 0;
230 x1 = lineHeight / 2;
231 x2 = lineHeight;
232 x3 = x2 + Gap;
233 x7 = cOsd::OsdWidth();
234 x6 = x7 - lineHeight / 2;
235 x5 = x6 - lineHeight / 2;
236 x4 = x5 - Gap;
237 y0 = 0;
238 y1 = lineHeight;
240 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
241 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
242 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
243 else {
244 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
245 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
246 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
247 else {
248 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors
249 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
250 }
251 }
252 osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
253 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
254 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
255 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
256 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
257 }
258}
259
264
265void cSkinSTTNGDisplayChannel::SetChannel(const cChannel *Channel, int Number)
266{
267 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
268 int x = x4 - SymbolSpacing;
269 if (Channel && !Channel->GroupSep()) {
270 bool rec = cRecordControls::Active();
272 osd->DrawBitmap(x, y0 + (y1 - y0 - bmRecording.Height()) / 2, bmRecording, Theme.Color(rec ? clrChannelSymbolRecFg : clrChannelSymbolOff), rec ? Theme.Color(clrChannelSymbolRecBg) : frameColor);
274 osd->DrawBitmap(x, y0 + (y1 - y0 - bmEncrypted.Height()) / 2, bmEncrypted, Theme.Color(Channel->Ca() ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
276 osd->DrawBitmap(x, y0 + (y1 - y0 - bmDolbyDigital.Height()) / 2, bmDolbyDigital, Theme.Color(Channel->Dpid(0) ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
277 x -= bmAudio.Width() + SymbolSpacing;
278 osd->DrawBitmap(x, y0 + (y1 - y0 - bmAudio.Height()) / 2, bmAudio, Theme.Color(Channel->Apid(1) ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
279 if (Channel->Vpid()) {
281 osd->DrawBitmap(x, y0 + (y1 - y0 - bmTeletext.Height()) / 2, bmTeletext, Theme.Color(Channel->Tpid() ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
282 }
283 else if (Channel->Apid(0)) {
284 x -= bmRadio.Width() + SymbolSpacing;
285 osd->DrawBitmap(x, y0 + (y1 - y0 - bmRadio.Height()) / 2, bmRadio, Theme.Color(clrChannelSymbolOn), frameColor);
286 }
287 }
288 osd->DrawText(x3 + TextFrame, y0, ChannelString(Channel, Number), Theme.Color(clrChannelName), frameColor, cFont::GetFont(fontOsd), x - x3 - TextFrame);
290}
291
292void cSkinSTTNGDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
293{
294 if (!withInfo)
295 return;
296 if (present != Present)
297 lastSeen = -1;
298 present = Present;
299 osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
301 for (int i = 0; i < 2; i++) {
302 const cEvent *e = !i ? Present : Following;
303 if (e) {
304 osd->DrawText(x0 + TextFrame, y3 + 2 * i * lineHeight, e->GetTimeString(), Theme.Color(clrChannelEpgTime), frameColor, cFont::GetFont(fontOsd));
305 osd->DrawText(x3 + TextFrame, y3 + 2 * i * lineHeight, e->Title(), Theme.Color(clrChannelEpgTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd), x4 - x3 - TextFrame);
306 osd->DrawText(x3 + TextFrame, y3 + (2 * i + 1) * lineHeight, e->ShortText(), Theme.Color(clrChannelEpgShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml), x4 - x3 - TextFrame);
307 }
308 }
309}
310
312{
313 const cFont *font = cFont::GetFont(withInfo ? fontSml : fontOsd);
314 if (Text) {
315 int yt = withInfo ? y6 : y0;
316 int yb = withInfo ? y7 : y1;
317 osd->SaveRegion(x2, yt, x4 - 1, yb - 1);
318 if (withInfo)
319 osd->DrawRectangle(x2, yt, x3 - 1, yb - 1, Theme.Color(clrBackground));
320 osd->DrawText(x3, yt, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
321 message = true;
322 }
323 else {
325 message = false;
326 }
327}
328
330{
331 if (withInfo) {
332 if (!message) {
333 const cFont *font = cFont::GetFont(fontSml);
334 cString date = DayDateTime();
335 int w = font->Width(date);
336 if (!*lastDate || strcmp(date, lastDate)) {
337 osd->DrawText(x4 - w - TextFrame, y7 - font->Height(), date, Theme.Color(clrChannelDate), frameColor, font, w);
338 lastDate = date;
339 }
341 const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack());
342 if (Track ? strcmp(lastTrackId.description, Track->description) : *lastTrackId.description) {
343 osd->DrawText(x3 + TextFrame, y6, Track ? Track->description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 2 * TextFrame);
344 strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description));
345 }
346 int DeviceNumber = cDevice::ActualDevice()->DeviceNumber() + 1;
347 if (DeviceNumber != lastDeviceNumber || time(NULL) != lastSignalDisplay) {
348 int SignalStrength = cDevice::ActualDevice()->SignalStrength();
349 int SignalQuality = cDevice::ActualDevice()->SignalQuality();
350 if (DeviceNumber != lastDeviceNumber || SignalStrength != lastSignalStrength || SignalQuality != lastSignalQuality) {
351 int d = 3;
352 int h = ((y7 - y6 + 1) - 3 * d) / 2;
353 int w = (x4 - x3) / 5;
354 int x = (x3 + x4) / 2 - w / 2;
355 if (SignalStrength >= 0) {
356 int s = SignalStrength * w / 100;
357 osd->DrawRectangle(x, y6 + d, x + s - 1, y6 + d + h - 1, Theme.Color(clrChannelSignalValue));
358 osd->DrawRectangle(x + s, y6 + d, x + w - 1, y6 + d + h - 1, Theme.Color(clrChannelSignalRest));
359 }
360 else if (DeviceNumber != lastDeviceNumber)
361 osd->DrawRectangle(x, y6 + d, x + w - 1, y6 + d + h - 1, Theme.Color(clrChannelFrame));
362 if (SignalQuality >= 0) {
363 int q = SignalQuality * w / 100;
364 osd->DrawRectangle(x, y7 - d - h + 1, x + q - 1, y7 - d, Theme.Color(clrChannelSignalValue));
365 osd->DrawRectangle(x + q, y7 - d - h + 1, x + w - 1, y7 - d, Theme.Color(clrChannelSignalRest));
366 }
367 else if (DeviceNumber != lastDeviceNumber)
368 osd->DrawRectangle(x, y7 - d - h + 1, x + w - 1, y7 - d, Theme.Color(clrChannelFrame));
369 cString dn = cString::sprintf(" %d ", DeviceNumber);
370 const cFont *font = cFont::GetFont(fontSml);
371 int dw = font->Width(dn);
372 osd->DrawText(x - 2 * d - dw, y6, dn, Theme.Color(clrChannelDate), frameColor, font, dw);
373 lastDeviceNumber = DeviceNumber;
374 lastSignalStrength = SignalStrength;
375 lastSignalQuality = SignalQuality;
376 }
377 lastSignalDisplay = time(NULL);
378 }
379 }
380 int seen = 0;
381 if (present) {
382 time_t t = time(NULL);
383 if (t > present->StartTime())
384 seen = min(y4 - y3 - 1, int((y4 - y3) * double(t - present->StartTime()) / present->Duration()));
385 }
386 if (seen != lastSeen) {
387 osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y4 - 1, Theme.Color(clrChannelTimebarRest));
388 if (seen)
389 osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y3 + seen, Theme.Color(clrChannelTimebarSeen));
390 lastSeen = seen;
391 }
392 }
393 osd->Flush();
394}
395
396// --- cSkinSTTNGDisplayMenu -------------------------------------------------
397
399private:
401 int x0, x1, x2, x3, x4, x5, x6, x7;
402 int y0, y1, y2, y3, y4, y5, y6, y7;
410 void DrawTitle(void);
411 void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown);
412 void SetTextScrollbar(void);
413public:
415 virtual ~cSkinSTTNGDisplayMenu();
416 virtual void Scroll(bool Up, bool Page);
417 virtual int MaxItems(void);
418 virtual void Clear(void);
419 virtual void SetTitle(const char *Title);
420 virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL);
421 virtual void SetMessage(eMessageType Type, const char *Text);
422 virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable);
423 virtual void SetScrollbar(int Total, int Offset);
424 virtual void SetEvent(const cEvent *Event);
425 virtual void SetRecording(const cRecording *Recording);
426 virtual void SetText(const char *Text, bool FixedFont);
427 virtual int GetTextAreaWidth(void) const;
428 virtual const cFont *GetTextAreaFont(bool FixedFont) const;
429 virtual void Flush(void);
430 };
431
433{
434 const cFont *font = cFont::GetFont(fontOsd);
435 lineHeight = font->Height();
436 frameColor = Theme.Color(clrMenuFrame);
438 currentIndex = -1;
439 message = false;
440 x0 = 0;
441 x1 = lineHeight / 2;
442 x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
443 x2 = x3 - Gap;
444 x7 = cOsd::OsdWidth();
445 x6 = x7 - lineHeight / 2;
446 x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
447 x5 = x4 + Gap;
448 y0 = 0;
449 y1 = lineHeight;
450 y2 = y1 + Roundness;
451 y3 = y2 + Gap;
453 y6 = y7 - cFont::GetFont(fontSml)->Height();
454 y5 = y6 - Roundness;
455 y4 = y5 - Gap;
456 int yt = (y0 + y1) / 2;
457 int yb = (y6 + y7) / 2;
459 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor
460 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
461 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
462 else {
463 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors
464 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
465 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
466 else {
467 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors
468 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
469 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
470 else {
471 tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors
472 { x0, y3, x3 - 1, y4 - 1, 1 },
473 { x3, y3, x4 - 1, y4 - 1, 2 },
474 { x4, y3, x7 - 1, y4 - 1, 2 },
475 { x0, y4, x7 - 1, y7 - 1, 4 }
476 };
477 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
478 }
479 }
480 }
482 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
483 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
484 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
485 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
486 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
487 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
488 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
489 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
490 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
491 osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
492 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
493 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
494 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
495 osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
496 osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
497 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
498 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
499}
500
505
506void cSkinSTTNGDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
507{
508 if (Total > 0 && Total > Shown) {
509 int h = lineHeight;
510 int yt = Top;
511 int yb = yt + Height;
512 int st = yt + h + Gap;
513 int sb = yb - h - Gap;
514 int th = max(int((sb - st) * double(Shown) / Total + 0.5), ScrollWidth);
515 int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th);
516 int tb = min(tt + th, sb);
517 osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal));
518 osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb - 1, Theme.Color(clrMenuScrollbarShown));
519 osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor);
520 osd->DrawEllipse (x6, yt, x7 - 1, yt + h - 1, frameColor, 5);
521 osd->DrawRectangle(x5, yb - h, x6 - 1, yb - 1, frameColor);
522 osd->DrawEllipse (x6, yb - h, x7 - 1, yb - 1, frameColor, 5);
523 if (CanScrollUp) {
524 cBitmap bm(arrowup_xpm);
525 osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yt + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor);
526 }
527 if (CanScrollDown) {
528 cBitmap bm(arrowdown_xpm);
529 osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yb - h + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor);
530 }
531 }
532}
533
539
540void cSkinSTTNGDisplayMenu::Scroll(bool Up, bool Page)
541{
542 cSkinDisplayMenu::Scroll(Up, Page);
544}
545
547{
548 return (y4 - y3 - 2 * Roundness) / lineHeight;
549}
550
556
558{
559 const cFont *font = cFont::GetFont(fontOsd);
560 const char *VDR = " VDR";
561 bool WithDisk = MenuCategory() == mcMain || MenuCategory() == mcRecording;
562 int w = font->Width(VDR);
563 osd->DrawText(x3 + TextSpacing, y0, WithDisk ? cString::sprintf("%s - %s", *title, *cVideoDiskUsage::String()) : title, Theme.Color(clrMenuTitle), frameColor, font, x4 - w - x3 - TextSpacing);
564 osd->DrawText(x4 - w, y0, VDR, frameColor, clrBlack, font, w, lineHeight);
565}
566
567void cSkinSTTNGDisplayMenu::SetTitle(const char *Title)
568{
569 title = Title;
570 DrawTitle();
571}
572
573void cSkinSTTNGDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
574{
575 const char *lutText[] = { Red, Green, Yellow, Blue };
576 tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg };
577 tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg };
578 cString date = DayDateTime();
579 const cFont *font = cFont::GetFont(fontSml);
580 int d = 2 * Gap;
581 int d2 = d / 2;
582 int t4 = x4 - font->Width(date) - TextFrame;
583 int w = t4 - x3;
584 int t0 = x3 + d2;
585 int t1 = x3 + w / 4;
586 int t2 = x3 + w / 2;
587 int t3 = t4 - w / 4;
588 osd->DrawRectangle(t0 + d2, y6, t1 - d2, y7 - 1, clrBlack);
589 osd->DrawRectangle(t1 + d2, y6, t2 - d2, y7 - 1, clrBlack);
590 osd->DrawRectangle(t2 + d2, y6, t3 - d2, y7 - 1, clrBlack);
591 osd->DrawRectangle(t3 + d2, y6, t4 - d2, y7 - 1, clrBlack);
592 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);
593 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);
594 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);
595 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);
596}
597
599{
600 const cFont *font = cFont::GetFont(fontSml);
601 if (Text) {
602 osd->SaveRegion(x3, y6, x4 - 1, y7 - 1);
603 osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
604 message = true;
605 }
606 else {
608 message = false;
609 }
610}
611
612void cSkinSTTNGDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable)
613{
614 int y = y3 + Roundness + Index * lineHeight;
615 tColor ColorFg, ColorBg;
616 if (Current) {
617 ColorFg = Theme.Color(clrMenuItemCurrentFg);
618 ColorBg = Theme.Color(clrMenuItemCurrentBg);
619 osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3);
620 osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor);
621 osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
622 osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg);
623 currentIndex = Index;
624 }
625 else {
626 ColorFg = Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable);
627 ColorBg = Theme.Color(clrBackground);
628 if (currentIndex == Index) {
631 }
632 }
633 const cFont *font = cFont::GetFont(fontOsd);
634 for (int i = 0; i < MaxTabs; i++) {
635 const char *s = GetTabbedText(Text, i);
636 if (s) {
637 int xt = x3 + TextSpacing + Tab(i);
638 osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x4 - xt);
639 }
640 if (!Tab(i + 1))
641 break;
642 }
644}
645
646void cSkinSTTNGDisplayMenu::SetScrollbar(int Total, int Offset)
647{
648 DrawScrollbar(Total, Offset, MaxItems(), y3 + Roundness, MaxItems() * lineHeight, Offset > 0, Offset + MaxItems() < Total);
649}
650
652{
653 if (!Event)
654 return;
655 const cFont *font = cFont::GetFont(fontOsd);
656 int xl = x3 + TextSpacing;
657 int y = y3;
658 cTextScroller ts;
659 cString t = cString::sprintf("%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);
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 int xt = x4;
714 if (Info->GetEvent()->ParentalRating()) {
715 cString buffer = cString::sprintf(" %s ", *Info->GetEvent()->GetParentalRatingString());
716 const cFont *font = cFont::GetFont(fontSml);
717 int w = font->Width(buffer);
718 osd->DrawText(xt - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
719 xt -= w + x5 - x4;
720 }
721 if (Info->Errors() > 0) {
722 // TRANSLATORS: note the plural/singular!
723 cString buffer = cString::sprintf(" %d %s ", Info->Errors(), Info->Errors() > 1 ? tr("errors") : tr("error"));
724 const cFont *font = cFont::GetFont(fontSml);
725 int w = font->Width(buffer);
726 osd->DrawText(xt - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
727 xt -= w + x5 - x4;
728 }
729 if (xt != x4) {
730 const cFont *font = cFont::GetFont(fontSml);
731 int yb = y + font->Height();
732 osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
733 osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
734 }
735 y += font->Height();
736 const char *Title = Info->Title();
737 if (isempty(Title))
738 Title = Recording->Name();
739 ts.Set(osd, xl, y, x4 - xl, y4 - y, Title, font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
740 y += ts.Height();
741 if (!isempty(Info->ShortText())) {
742 const cFont *font = cFont::GetFont(fontSml);
743 ts.Set(osd, xl, y, x4 - xl, y4 - y, Info->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
744 y += ts.Height();
745 }
746 y += font->Height();
747 if (!isempty(Info->Description())) {
748 int yt = y;
749 int yb = y4 - Roundness;
750 cString d = Info->Description();
751 cString f = Info->FrameParams();
752 if (*f) {
753 d.Append("\n\n");
754 d.Append(f);
755 }
756 textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, d, font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
757 yb = yt + textScroller.Height();
758 osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3);
759 osd->DrawRectangle(x1, yt, x2, yb, frameColor);
760 osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2);
762 }
763}
764
765void cSkinSTTNGDisplayMenu::SetText(const char *Text, bool FixedFont)
766{
767 textScroller.Set(osd, x3, y3, GetTextAreaWidth(), y4 - y3, Text, GetTextAreaFont(FixedFont), Theme.Color(clrMenuText), Theme.Color(clrBackground));
769}
770
772{
773 return x4 - x3;
774}
775
777{
778 const cFont *font = cFont::GetFont(FixedFont ? fontFix : fontOsd);
779 //XXX -> make a way to let the text define which font to use
780 return font;
781}
782
784{
786 DrawTitle();
787 if (!message) {
788 cString date = DayDateTime();
789 if (!*lastDate || strcmp(date, lastDate)) {
790 const cFont *font = cFont::GetFont(fontSml);
791 int w = font->Width(date);
792 osd->DrawText(x4 - w - TextFrame, y7 - font->Height(), date, Theme.Color(clrMenuDate), frameColor, font, w);
793 lastDate = date;
794 }
795 }
796 osd->Flush();
797}
798
799// --- cSkinSTTNGDisplayReplay -----------------------------------------------
800
802private:
804 int x0, x1, x2, x3, x4, x5, x6, x7;
805 int y0, y1, y2, y3, y4, y5, y6, y7;
808public:
809 cSkinSTTNGDisplayReplay(bool ModeOnly);
810 virtual ~cSkinSTTNGDisplayReplay();
811 virtual void SetTitle(const char *Title);
812 virtual void SetMode(bool Play, bool Forward, int Speed);
813 virtual void SetProgress(int Current, int Total);
814 virtual void SetCurrent(const char *Current);
815 virtual void SetTotal(const char *Total);
816 virtual void SetJump(const char *Jump);
817 virtual void SetMessage(eMessageType Type, const char *Text);
818 virtual void Flush(void);
819 };
820
822{
823 const cFont *font = cFont::GetFont(fontSml);
824 int lineHeight = font->Height();
825 frameColor = Theme.Color(clrReplayFrame);
827 cBitmap bm(play_xpm);
828 x0 = 0;
829 x1 = max(lineHeight * 2, bm.Width());
830 x2 = x1 + Roundness;
831 x3 = x2 + Gap;
832 x7 = cOsd::OsdWidth();
833 x6 = x7 - lineHeight / 2;
834 x5 = x6 - lineHeight / 2;
835 x4 = x5 - Gap;
836 y0 = 0;
837 y1 = lineHeight;
838 y2 = y1 + Roundness;
839 y3 = y2 + Gap;
840 y4 = y3 + max(lineHeight, bm.Height());
841 y5 = y4 + Gap;
842 y6 = y5 + Roundness;
843 y7 = y6 + font->Height();
844 int yt = (y0 + y1) / 2;
845 int yb = (y6 + y7) / 2;
847 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor
848 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
849 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
850 else {
851 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; // 256 colors
852 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
853 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
854 else {
855 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors
856 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
857 }
858 }
859 osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, ModeOnly ? clrTransparent : Theme.Color(clrBackground));
860 if (!ModeOnly) {
861 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
862 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
863 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
864 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
865 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
866 osd->DrawRectangle(x1, y0, x4 - 1, y1 - 1, frameColor);
867 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
868 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
869 osd->DrawRectangle(x0, y1, x1 - 1, y2 - 1, frameColor);
870 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
871 }
872 osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
873 if (!ModeOnly) {
874 osd->DrawRectangle(x0, y5, x1 - 1, y6 - 1, frameColor);
875 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
876 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
877 osd->DrawRectangle(x1, y6, x4 - 1, y7 - 1, frameColor);
878 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
879 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
880 }
881}
882
887
889{
890 osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrReplayTitle), frameColor, cFont::GetFont(fontSml), x4 - x3 - TextSpacing);
891}
892
893static const char *const *ReplaySymbols[2][2][5] = {
894 { { pause_xpm, srew_xpm, srew1_xpm, srew2_xpm, srew3_xpm },
895 { pause_xpm, sfwd_xpm, sfwd1_xpm, sfwd2_xpm, sfwd3_xpm }, },
896 { { play_xpm, frew_xpm, frew1_xpm, frew2_xpm, frew3_xpm },
897 { play_xpm, ffwd_xpm, ffwd1_xpm, ffwd2_xpm, ffwd3_xpm } }
898 };
899
900void cSkinSTTNGDisplayReplay::SetMode(bool Play, bool Forward, int Speed)
901{
902 Speed = constrain(Speed, -1, 3);
903 cBitmap bm(ReplaySymbols[Play][Forward][Speed + 1]);
904 osd->DrawBitmap(x0 + (x1 - x0 - bm.Width()) / 2, y3 + (y4 - y3 - bm.Height()) / 2, bm, Theme.Color(clrReplayMode), frameColor);
905}
906
907void cSkinSTTNGDisplayReplay::SetProgress(int Current, int Total)
908{
909 cProgressBar pb(x4 - x3, y4 - y3, Current, Total, marks, errors, Theme.Color(clrReplayProgressSeen), Theme.Color(clrReplayProgressRest), Theme.Color(clrReplayProgressSelected), Theme.Color(clrReplayProgressMark), Theme.Color(clrReplayProgressCurrent), Theme.Color(clrReplayProgressError));
910 osd->DrawBitmap(x3, y3, pb);
911}
912
913void cSkinSTTNGDisplayReplay::SetCurrent(const char *Current)
914{
915 const cFont *font = cFont::GetFont(fontSml);
916 int w = font->Width(Current);
917 osd->DrawText(x3, y6, Current, Theme.Color(clrReplayCurrent), frameColor, font, lastCurrentWidth > w ? lastCurrentWidth : w);
919}
920
922{
923 const cFont *font = cFont::GetFont(fontSml);
924 int w = font->Width(Total);
925 osd->DrawText(x4 - w - TextSpacing, y6, Total, Theme.Color(clrReplayTotal), frameColor, font, w);
926}
927
929{
930 osd->DrawText(x0 + (x4 - x0) / 4, y6, Jump, Theme.Color(clrReplayJump), frameColor, cFont::GetFont(fontSml), (x4 - x3) / 2, 0, taCenter);
931}
932
934{
935 const cFont *font = cFont::GetFont(fontSml);
936 if (Text) {
937 osd->SaveRegion(x2, y6, x4 - 1, y7 - 1);
939 osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
940 }
941 else
943}
944
946{
947 osd->Flush();
948}
949
950// --- cSkinSTTNGDisplayVolume -----------------------------------------------
951
953private:
955 int x0, x1, x2, x3, x4, x5, x6, x7;
956 int y0, y1;
958 int mute;
959public:
961 virtual ~cSkinSTTNGDisplayVolume();
962 virtual void SetVolume(int Current, int Total, bool Mute);
963 virtual void Flush(void);
964 };
965
967{
968 const cFont *font = cFont::GetFont(fontOsd);
969 int lineHeight = font->Height();
970 frameColor = Theme.Color(clrVolumeFrame);
971 mute = -1;
972 x0 = 0;
973 x1 = lineHeight / 2;
974 x2 = lineHeight;
975 x3 = x2 + Gap;
976 x7 = cOsd::OsdWidth();
977 x6 = x7 - lineHeight / 2;
978 x5 = x6 - lineHeight / 2;
979 x4 = x5 - Gap;
980 y0 = 0;
981 y1 = lineHeight;
983 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
984 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
985 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
986 else {
987 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
988 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
989 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
990 else {
991 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors
992 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
993 }
994 }
995 osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
996 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
997 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
998 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
999 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1000 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1001}
1002
1007
1008void cSkinSTTNGDisplayVolume::SetVolume(int Current, int Total, bool Mute)
1009{
1010 int xl = x3 + TextSpacing;
1011 int xr = x4 - TextSpacing;
1012 int yt = y0 + TextFrame;
1013 int yb = y1 - TextFrame;
1014 if (mute != Mute) {
1015 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1016 mute = Mute;
1017 }
1018 cBitmap bm(Mute ? mute_xpm : volume_xpm);
1019 osd->DrawBitmap(xl, y0 + (y1 - y0 - bm.Height()) / 2, bm, Theme.Color(clrVolumeSymbol), frameColor);
1020 if (!Mute) {
1021 xl += bm.Width() + TextSpacing;
1022 int w = (y1 - y0) / 3;
1023 int d = TextFrame;
1024 int n = (xr - xl + d) / (w + d);
1025 int x = xr - n * (w + d);
1026 tColor Color = Theme.Color(clrVolumeBarLower);
1027 for (int i = 0; i < n; i++) {
1028 if (Total * i >= Current * n)
1029 Color = Theme.Color(clrVolumeBarUpper);
1030 osd->DrawRectangle(x, yt, x + w - 1, yb - 1, Color);
1031 x += w + d;
1032 }
1033 }
1034}
1035
1037{
1038 osd->Flush();
1039}
1040
1041// --- cSkinSTTNGDisplayTracks -----------------------------------------------
1042
1044private:
1046 int x0, x1, x2, x3, x4, x5, x6, x7;
1047 int y0, y1, y2, y3, y4, y5, y6, y7;
1052 void SetItem(const char *Text, int Index, bool Current);
1053public:
1054 cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
1055 virtual ~cSkinSTTNGDisplayTracks();
1056 virtual void SetTrack(int Index, const char * const *Tracks);
1057 virtual void SetAudioChannel(int AudioChannel);
1058 virtual void Flush(void);
1059 };
1060
1064
1065cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1066{
1067 const cFont *font = cFont::GetFont(fontOsd);
1068 lineHeight = font->Height();
1069 frameColor = Theme.Color(clrMenuFrame);
1070 currentIndex = -1;
1071 int ItemsWidth = font->Width(Title);
1072 for (int i = 0; i < NumTracks; i++)
1073 ItemsWidth = max(ItemsWidth, font->Width(Tracks[i]));
1074 ItemsWidth += 2 * TextSpacing;
1075 x0 = 0;
1076 x1 = lineHeight / 2;
1077 x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
1078 x2 = x3 - Gap;
1079 x7 = cOsd::OsdWidth();
1080 x6 = x7 - lineHeight / 2;
1081 x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
1082 x5 = x4 + Gap;
1083 int d = x4 - x3;
1084 if (d > ItemsWidth) {
1085 d = (d - ItemsWidth) & ~0x07; // must be multiple of 8
1086 x4 -= d;
1087 x5 -= d;
1088 x6 -= d;
1089 x7 -= d;
1090 }
1091 y0 = 0;
1092 y1 = lineHeight;
1093 y2 = y1 + Roundness;
1094 y3 = y2 + Gap;
1095 // limit to cOsd::OsdHeight()? - what if height is too big???
1096 y4 = y3 + NumTracks * lineHeight + 2 * Roundness;
1097 y5 = y4 + Gap;
1098 y6 = y5 + Roundness;
1099 y7 = y6 + cFont::GetFont(fontSml)->Height();
1100 int yt = (y0 + y1) / 2;
1101 int yb = (y6 + y7) / 2;
1103 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor
1104 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1105 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1106 else {
1107 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors
1108 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1109 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1110 else {
1111 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors
1112 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1113 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1114 else {
1115 tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors
1116 { x0, y3, x3 - 1, y4 - 1, 1 },
1117 { x3, y3, x4 - 1, y4 - 1, 2 },
1118 { x4, y3, x7 - 1, y4 - 1, 2 },
1119 { x0, y4, x7 - 1, y7 - 1, 4 }
1120 };
1121 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1122 }
1123 }
1124 }
1126 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
1127 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
1128 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
1129 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
1130 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
1131 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1132 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1133 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1134 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1135 osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
1136 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
1137 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
1138 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
1139 osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
1140 osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1141 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
1142 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
1143 osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrMenuTitle), frameColor, font, x4 - x3 - TextSpacing);
1144 for (int i = 0; i < NumTracks; i++)
1145 SetItem(Tracks[i], i, false);
1146}
1147
1152
1153void cSkinSTTNGDisplayTracks::SetItem(const char *Text, int Index, bool Current)
1154{
1155 int y = y3 + Roundness + Index * lineHeight;
1156 tColor ColorFg, ColorBg;
1157 if (Current) {
1158 ColorFg = Theme.Color(clrMenuItemCurrentFg);
1159 ColorBg = Theme.Color(clrMenuItemCurrentBg);
1160 osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3);
1161 osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor);
1162 osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
1163 osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg);
1164 currentIndex = Index;
1165 }
1166 else {
1167 ColorFg = Theme.Color(clrMenuItemSelectable);
1168 ColorBg = Theme.Color(clrBackground);
1169 if (currentIndex == Index) {
1172 }
1173 }
1174 const cFont *font = cFont::GetFont(fontOsd);
1175 int xt = x3 + TextSpacing;
1176 osd->DrawText(xt, y, Text, ColorFg, ColorBg, font, x4 - xt);
1177}
1178
1179void cSkinSTTNGDisplayTracks::SetTrack(int Index, const char * const *Tracks)
1180{
1181 if (currentIndex >= 0)
1182 SetItem(Tracks[currentIndex], currentIndex, false);
1183 SetItem(Tracks[Index], Index, true);
1184}
1185
1187{
1188 cBitmap *bm = NULL;
1189 switch (AudioChannel) {
1190 case 0: bm = &bmAudioStereo; break;
1191 case 1: bm = &bmAudioLeft; break;
1192 case 2: bm = &bmAudioRight; break;
1193 default: ;
1194 }
1195 if (bm)
1196 osd->DrawBitmap(x3 + TextSpacing, y6 + (y7 - y6 - bm->Height()) / 2, *bm, Theme.Color(clrChannelSymbolOn), frameColor);
1197 else
1198 osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1199}
1200
1202{
1203 osd->Flush();
1204}
1205
1206// --- cSkinSTTNGDisplayMessage ----------------------------------------------
1207
1209private:
1211 int x0, x1, x2, x3, x4, x5, x6, x7;
1212 int y0, y1;
1213public:
1215 virtual ~cSkinSTTNGDisplayMessage();
1216 virtual void SetMessage(eMessageType Type, const char *Text);
1217 virtual void Flush(void);
1218 };
1219
1221{
1222 const cFont *font = cFont::GetFont(fontOsd);
1223 int lineHeight = font->Height();
1224 tColor frameColor = Theme.Color(clrMessageFrame);
1225 x0 = 0;
1226 x1 = lineHeight / 2;
1227 x2 = lineHeight;
1228 x3 = x2 + Gap;
1229 x7 = cOsd::OsdWidth();
1230 x6 = x7 - lineHeight / 2;
1231 x5 = x6 - lineHeight / 2;
1232 x4 = x5 - Gap;
1233 y0 = 0;
1234 y1 = lineHeight;
1236 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
1237 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1238 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1239 else {
1240 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
1241 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1242 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1243 else {
1244 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 2 } }; // 4 colors
1245 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1246 }
1247 }
1248 osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
1249 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
1250 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1251 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1252 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1253}
1254
1259
1261{
1262 const cFont *font = cFont::GetFont(fontOsd);
1263 osd->DrawText(x3, y0, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
1264}
1265
1267{
1268 osd->Flush();
1269}
1270
1271// --- cSkinSTTNG ------------------------------------------------------------
1272
1274:cSkin("sttng", &::Theme)//XXX naming problem???
1275{
1276}
1277
1279{
1280 return tr("ST:TNG Panels");
1281}
1282
1284{
1285 return new cSkinSTTNGDisplayChannel(WithInfo);
1286}
1287
1292
1294{
1295 return new cSkinSTTNGDisplayReplay(ModeOnly);
1296}
1297
1302
1303cSkinDisplayTracks *cSkinSTTNG::DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1304{
1305 return new cSkinSTTNGDisplayTracks(Title, NumTracks, Tracks);
1306}
1307
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:593
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:431
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:436
const char * Title(void) const
Definition epg.h:105
cString GetEndTimeString(void) const
Definition epg.c:441
int Duration(void) const
Definition epg.h:113
cString GetVpsString(void) const
Definition epg.c:446
cString GetParentalRatingString(void) const
Definition epg.c:424
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:5678
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:322
int ColorKey2
Definition config.h:322
int AntiAlias
Definition config.h:334
int ColorKey0
Definition config.h:322
int ChannelInfoPos
Definition config.h:327
int ColorKey1
Definition config.h:322
virtual void Scroll(bool Up, bool Page)
If this menu contains a text area that can be scrolled, this function will be called to actually scro...
Definition skins.c:107
cTextScroller textScroller
Definition skins.h:173
int Tab(int n)
Returns the offset of the given tab from the left border of the item display area.
Definition skins.h:174
eMenuCategory MenuCategory(void) const
Returns the menu category, set by a previous call to SetMenuCategory().
Definition skins.h:183
const char * GetTabbedText(const char *s, int Tab)
Returns the part of the given string that follows the given Tab (where 0 indicates the beginning of t...
Definition skins.c:112
const cErrors * errors
Definition skins.h:314
const cMarks * marks
< This class implements the progress display used during replay of a recording.
Definition skins.h:313
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:146
static cBitmap bmRecording
Definition skinsttng.c:146
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
Definition skinsttng.c:265
static cBitmap bmRadio
Definition skinsttng.c:146
static cBitmap bmEncrypted
Definition skinsttng.c:146
virtual void SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
Definition skinsttng.c:292
static cBitmap bmTeletext
Definition skinsttng.c:146
static cBitmap bmDolbyDigital
Definition skinsttng.c:146
cSkinSTTNGDisplayChannel(bool WithInfo)
Definition skinsttng.c:163
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:329
const cEvent * present
Definition skinsttng.c:138
virtual ~cSkinSTTNGDisplayChannel()
Definition skinsttng.c:260
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition skinsttng.c:311
virtual const cFont * GetTextAreaFont(bool FixedFont) const
Returns a pointer to the font which is used to display text with SetText().
Definition skinsttng.c:776
virtual void Clear(void)
Clears the entire central area of the menu.
Definition skinsttng.c:551
virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable)
Sets the item at the given Index to Text.
Definition skinsttng.c:612
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:573
virtual ~cSkinSTTNGDisplayMenu()
Definition skinsttng.c:501
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:783
virtual void SetTitle(const char *Title)
Sets the title of this menu to Title.
Definition skinsttng.c:567
virtual int GetTextAreaWidth(void) const
Returns the width in pixel of the area which is used to display text with SetText().
Definition skinsttng.c:771
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition skinsttng.c:598
virtual void SetEvent(const cEvent *Event)
Sets the Event that shall be displayed, using the entire central area of the menu.
Definition skinsttng.c:651
void SetTextScrollbar(void)
Definition skinsttng.c:534
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:646
void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
Definition skinsttng.c:506
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:765
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
virtual int MaxItems(void)
Returns the maximum number of items the menu can display.
Definition skinsttng.c:546
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:540
virtual ~cSkinSTTNGDisplayMessage()
Definition skinsttng.c:1255
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
Definition skinsttng.c:1260
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:1266
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition skinsttng.c:933
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:913
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
Definition skinsttng.c:928
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:907
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:945
cSkinSTTNGDisplayReplay(bool ModeOnly)
Definition skinsttng.c:821
virtual ~cSkinSTTNGDisplayReplay()
Definition skinsttng.c:883
virtual void SetTitle(const char *Title)
Sets the title of the recording.
Definition skinsttng.c:888
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:900
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:921
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:1201
virtual ~cSkinSTTNGDisplayTracks()
Definition skinsttng.c:1148
static cBitmap bmAudioLeft
Definition skinsttng.c:1051
static cBitmap bmAudioStereo
Definition skinsttng.c:1051
cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Definition skinsttng.c:1065
void SetItem(const char *Text, int Index, bool Current)
Definition skinsttng.c:1153
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
Definition skinsttng.c:1179
static cBitmap bmAudioRight
Definition skinsttng.c:1051
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
Definition skinsttng.c:1186
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
Definition skinsttng.c:1008
virtual ~cSkinSTTNGDisplayVolume()
Definition skinsttng.c:1003
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition skinsttng.c:1036
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
Definition skinsttng.c:1293
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
Definition skinsttng.c:1288
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:1278
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
Definition skinsttng.c:1283
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
Definition skinsttng.c:1298
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
Definition skinsttng.c:1308
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:1303
cSkinSTTNG(void)
Definition skinsttng.c:1273
Definition skins.h:398
static cString sprintf(const char *fmt,...) __attribute__((format(printf
Definition tools.c:1188
cString & Append(const char *String)
Definition tools.c:1141
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:893
#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:1294
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:1274
cString DayDateTime(time_t t)
Converts the given time to a string of the form "www dd.mm. hh:mm".
Definition tools.c:1253
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