vdr 2.8.3
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.10 2026/08/21 09:41:51 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);
149 virtual ~cSkinSTTNGDisplayChannel() override;
150 virtual void SetChannel(const cChannel *Channel, int Number) override;
151 virtual void SetEvents(const cEvent *Present, const cEvent *Following) override;
152 virtual void SetMessage(eMessageType Type, const char *Text) override;
153 virtual void Flush(void) override;
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 tTrackId TrackId;
342 bool Track = Device->GetTrackId(Device->GetCurrentAudioTrack(), TrackId);
343 if (Track ? strcmp(lastTrackId.description, TrackId.description) : *lastTrackId.description) {
344 osd->DrawText(x3 + TextFrame, y6, Track ? TrackId.description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 2 * TextFrame);
345 strn0cpy(lastTrackId.description, Track ? TrackId.description : "", sizeof(lastTrackId.description));
346 }
347 int DeviceNumber = cDevice::ActualDevice()->DeviceNumber() + 1;
348 if (DeviceNumber != lastDeviceNumber || time(NULL) != lastSignalDisplay) {
349 int SignalStrength = cDevice::ActualDevice()->SignalStrength();
350 int SignalQuality = cDevice::ActualDevice()->SignalQuality();
351 if (DeviceNumber != lastDeviceNumber || SignalStrength != lastSignalStrength || SignalQuality != lastSignalQuality) {
352 int d = 3;
353 int h = ((y7 - y6 + 1) - 3 * d) / 2;
354 int w = (x4 - x3) / 5;
355 int x = (x3 + x4) / 2 - w / 2;
356 if (SignalStrength >= 0) {
357 int s = SignalStrength * w / 100;
358 osd->DrawRectangle(x, y6 + d, x + s - 1, y6 + d + h - 1, Theme.Color(clrChannelSignalValue));
359 osd->DrawRectangle(x + s, y6 + d, x + w - 1, y6 + d + h - 1, Theme.Color(clrChannelSignalRest));
360 }
361 else if (DeviceNumber != lastDeviceNumber)
362 osd->DrawRectangle(x, y6 + d, x + w - 1, y6 + d + h - 1, Theme.Color(clrChannelFrame));
363 if (SignalQuality >= 0) {
364 int q = SignalQuality * w / 100;
365 osd->DrawRectangle(x, y7 - d - h + 1, x + q - 1, y7 - d, Theme.Color(clrChannelSignalValue));
366 osd->DrawRectangle(x + q, y7 - d - h + 1, x + w - 1, y7 - d, Theme.Color(clrChannelSignalRest));
367 }
368 else if (DeviceNumber != lastDeviceNumber)
369 osd->DrawRectangle(x, y7 - d - h + 1, x + w - 1, y7 - d, Theme.Color(clrChannelFrame));
370 cString dn = cString::sprintf(" %d ", DeviceNumber);
371 const cFont *font = cFont::GetFont(fontSml);
372 int dw = font->Width(dn);
373 osd->DrawText(x - 2 * d - dw, y6, dn, Theme.Color(clrChannelDate), frameColor, font, dw);
374 lastDeviceNumber = DeviceNumber;
375 lastSignalStrength = SignalStrength;
376 lastSignalQuality = SignalQuality;
377 }
378 lastSignalDisplay = time(NULL);
379 }
380 }
381 int seen = 0;
382 if (present) {
384 time_t t = time(NULL);
385 if (t > present->StartTime() && present->Duration() > 0)
386 seen = min(y4 - y3 - 1, int((y4 - y3) * double(t - present->StartTime()) / present->Duration()));
387 }
388 if (seen != lastSeen) {
389 osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y4 - 1, Theme.Color(clrChannelTimebarRest));
390 if (seen)
391 osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y3 + seen, Theme.Color(clrChannelTimebarSeen));
392 lastSeen = seen;
393 }
394 }
395 osd->Flush();
396}
397
398// --- cSkinSTTNGDisplayMenu -------------------------------------------------
399
401private:
403 int x0, x1, x2, x3, x4, x5, x6, x7;
404 int y0, y1, y2, y3, y4, y5, y6, y7;
412 void DrawTitle(void);
413 void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown);
414 void SetTextScrollbar(void);
415public:
417 virtual ~cSkinSTTNGDisplayMenu() override;
418 virtual void Scroll(bool Up, bool Page) override;
419 virtual int MaxItems(void) override;
420 virtual void Clear(void) override;
421 virtual void SetTitle(const char *Title) override;
422 virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL) override;
423 virtual void SetMessage(eMessageType Type, const char *Text) override;
424 virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable) override;
425 virtual void SetScrollbar(int Total, int Offset) override;
426 virtual void SetEvent(const cEvent *Event) override;
427 virtual void SetRecording(const cRecording *Recording) override;
428 virtual void SetText(const char *Text, bool FixedFont) override;
429 virtual int GetTextAreaWidth(void) const override;
430 virtual const cFont *GetTextAreaFont(bool FixedFont) const override;
431 virtual void Flush(void) override;
432 };
433
435{
436 const cFont *font = cFont::GetFont(fontOsd);
437 lineHeight = font->Height();
438 frameColor = Theme.Color(clrMenuFrame);
440 currentIndex = -1;
441 message = false;
442 x0 = 0;
443 x1 = lineHeight / 2;
444 x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
445 x2 = x3 - Gap;
446 x7 = cOsd::OsdWidth();
447 x6 = x7 - lineHeight / 2;
448 x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
449 x5 = x4 + Gap;
450 y0 = 0;
451 y1 = lineHeight;
452 y2 = y1 + Roundness;
453 y3 = y2 + Gap;
455 y6 = y7 - cFont::GetFont(fontSml)->Height();
456 y5 = y6 - Roundness;
457 y4 = y5 - Gap;
458 int yt = (y0 + y1) / 2;
459 int yb = (y6 + y7) / 2;
461 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor
462 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
463 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
464 else {
465 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors
466 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
467 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
468 else {
469 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors
470 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
471 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
472 else {
473 tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors
474 { x0, y3, x3 - 1, y4 - 1, 1 },
475 { x3, y3, x4 - 1, y4 - 1, 2 },
476 { x4, y3, x7 - 1, y4 - 1, 2 },
477 { x0, y4, x7 - 1, y7 - 1, 4 }
478 };
479 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
480 }
481 }
482 }
484 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
485 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
486 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
487 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
488 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
489 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
490 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
491 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
492 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
493 osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
494 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
495 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
496 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
497 osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
498 osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
499 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
500 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
501}
502
507
508void cSkinSTTNGDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
509{
510 if (Total > 0 && Total > Shown) {
511 int h = lineHeight;
512 int yt = Top;
513 int yb = yt + Height;
514 int st = yt + h + Gap;
515 int sb = yb - h - Gap;
516 int th = max(int((sb - st) * double(Shown) / Total + 0.5), ScrollWidth);
517 int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th);
518 int tb = min(tt + th, sb);
519 osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal));
520 osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb - 1, Theme.Color(clrMenuScrollbarShown));
521 osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor);
522 osd->DrawEllipse (x6, yt, x7 - 1, yt + h - 1, frameColor, 5);
523 osd->DrawRectangle(x5, yb - h, x6 - 1, yb - 1, frameColor);
524 osd->DrawEllipse (x6, yb - h, x7 - 1, yb - 1, frameColor, 5);
525 if (CanScrollUp) {
526 cBitmap bm(arrowup_xpm);
527 osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yt + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor);
528 }
529 if (CanScrollDown) {
530 cBitmap bm(arrowdown_xpm);
531 osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yb - h + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor);
532 }
533 }
534}
535
541
542void cSkinSTTNGDisplayMenu::Scroll(bool Up, bool Page)
543{
544 cSkinDisplayMenu::Scroll(Up, Page);
546}
547
549{
550 return (y4 - y3 - 2 * Roundness) / lineHeight;
551}
552
558
560{
561 const cFont *font = cFont::GetFont(fontOsd);
562 const char *VDR = " VDR";
563 bool WithDisk = MenuCategory() == mcMain || MenuCategory() == mcRecording || MenuCategory() == mcRecordingDel;
564 int w = font->Width(VDR);
565 osd->DrawText(x3 + TextSpacing, y0, WithDisk ? cString::sprintf("%s - %s", *title, *cVideoDiskUsage::String()) : title, Theme.Color(clrMenuTitle), frameColor, font, x4 - w - x3 - TextSpacing);
566 osd->DrawText(x4 - w, y0, VDR, frameColor, clrBlack, font, w, lineHeight);
567}
568
569void cSkinSTTNGDisplayMenu::SetTitle(const char *Title)
570{
571 title = Title;
572 DrawTitle();
573}
574
575void cSkinSTTNGDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
576{
577 const char *lutText[] = { Red, Green, Yellow, Blue };
578 tColor lutFg[] = { clrButtonRedFg, clrButtonGreenFg, clrButtonYellowFg, clrButtonBlueFg };
579 tColor lutBg[] = { clrButtonRedBg, clrButtonGreenBg, clrButtonYellowBg, clrButtonBlueBg };
580 cString date = DayDateTime();
581 const cFont *font = cFont::GetFont(fontSml);
582 int d = 2 * Gap;
583 int d2 = d / 2;
584 int t4 = x4 - font->Width(date) - TextFrame;
585 int w = t4 - x3;
586 int t0 = x3 + d2;
587 int t1 = x3 + w / 4;
588 int t2 = x3 + w / 2;
589 int t3 = t4 - w / 4;
590 osd->DrawRectangle(t0 + d2, y6, t1 - d2, y7 - 1, clrBlack);
591 osd->DrawRectangle(t1 + d2, y6, t2 - d2, y7 - 1, clrBlack);
592 osd->DrawRectangle(t2 + d2, y6, t3 - d2, y7 - 1, clrBlack);
593 osd->DrawRectangle(t3 + d2, y6, t4 - d2, y7 - 1, clrBlack);
594 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);
595 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);
596 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);
597 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);
598}
599
601{
602 const cFont *font = cFont::GetFont(fontSml);
603 if (Text) {
604 osd->SaveRegion(x3, y6, x4 - 1, y7 - 1);
605 osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
606 message = true;
607 }
608 else {
610 message = false;
611 }
612}
613
614void cSkinSTTNGDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable)
615{
616 int y = y3 + Roundness + Index * lineHeight;
617 tColor ColorFg, ColorBg;
618 if (Current) {
619 ColorFg = Theme.Color(clrMenuItemCurrentFg);
620 ColorBg = Theme.Color(clrMenuItemCurrentBg);
621 osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3);
622 osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor);
623 osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
624 osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg);
625 currentIndex = Index;
626 }
627 else {
628 ColorFg = Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable);
629 ColorBg = Theme.Color(clrBackground);
630 if (currentIndex == Index) {
633 }
634 }
635 const cFont *font = cFont::GetFont(fontOsd);
636 for (int i = 0; i < MaxTabs; i++) {
637 const char *s = GetTabbedText(Text, i);
638 if (s) {
639 int xt = x3 + TextSpacing + Tab(i);
640 osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x4 - xt);
641 }
642 if (!Tab(i + 1))
643 break;
644 }
646}
647
648void cSkinSTTNGDisplayMenu::SetScrollbar(int Total, int Offset)
649{
650 DrawScrollbar(Total, Offset, MaxItems(), y3 + Roundness, MaxItems() * lineHeight, Offset > 0, Offset + MaxItems() < Total);
651}
652
654{
655 if (!Event)
656 return;
657 const cFont *font = cFont::GetFont(fontOsd);
658 int xl = x3 + TextSpacing;
659 int y = y3;
660 cTextScroller ts;
661 cString t = cString::sprintf("%s %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
662 ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
663 if (Event->Vps() && Event->Vps() != Event->StartTime()) {
664 cString buffer = cString::sprintf(" VPS: %s ", *Event->GetVpsString());
665 const cFont *font = cFont::GetFont(fontSml);
666 int w = font->Width(buffer);
667 osd->DrawText(x4 - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
668 int yb = y + font->Height();
669 osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
670 osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
671 }
672 y += ts.Height();
673 if (Event->ParentalRating()) {
674 cString buffer = cString::sprintf(" %s ", *Event->GetParentalRatingString());
675 const cFont *font = cFont::GetFont(fontSml);
676 int w = font->Width(buffer);
677 osd->DrawText(x4 - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
678 int yb = y + font->Height();
679 osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
680 osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
681 }
682 y += font->Height();
683 ts.Set(osd, xl, y, x4 - xl, y4 - y, Event->Title(), font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
684 y += ts.Height();
685 if (!isempty(Event->ShortText())) {
686 const cFont *font = cFont::GetFont(fontSml);
687 ts.Set(osd, xl, y, x4 - xl, y4 - y, Event->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
688 y += ts.Height();
689 }
690 y += font->Height();
691 if (!isempty(Event->Description())) {
692 int yt = y;
693 int yb = y4 - Roundness;
694 textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, Event->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
695 yb = yt + textScroller.Height();
696 osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3);
697 osd->DrawRectangle(x1, yt, x2, yb, frameColor);
698 osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2);
700 }
701}
702
704{
705 if (!Recording)
706 return;
707 const cRecordingInfo *Info = Recording->Info();
708 const cFont *font = cFont::GetFont(fontOsd);
709 int xl = x3 + TextSpacing;
710 int y = y3;
711 cTextScroller ts;
712 cString t = cString::sprintf("%s %s %s", *DateString(Recording->Start()), *TimeString(Recording->Start()), Info->ChannelName() ? Info->ChannelName() : "");
713 ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
714 y += ts.Height();
715 int xt = x4;
716 if (Info->GetEvent()->ParentalRating()) {
717 cString buffer = cString::sprintf(" %s ", *Info->GetEvent()->GetParentalRatingString());
718 const cFont *font = cFont::GetFont(fontSml);
719 int w = font->Width(buffer);
720 osd->DrawText(xt - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
721 xt -= w + x5 - x4;
722 }
723 if (Info->Errors() > 0) {
724 // TRANSLATORS: note the plural/singular!
725 cString buffer = cString::sprintf(" %d %s ", Info->Errors(), Info->Errors() > 1 ? tr("errors") : tr("error"));
726 const cFont *font = cFont::GetFont(fontSml);
727 int w = font->Width(buffer);
728 osd->DrawText(xt - w, y, buffer, Theme.Color(clrMenuEventVps), frameColor, font, w);
729 xt -= w + x5 - x4;
730 }
731 if (xt != x4) {
732 const cFont *font = cFont::GetFont(fontSml);
733 int yb = y + font->Height();
734 osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor);
735 osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5);
736 }
737 y += font->Height();
738 const char *Title = Info->Title();
739 if (isempty(Title))
740 Title = Recording->Name();
741 ts.Set(osd, xl, y, x4 - xl, y4 - y, Title, font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
742 y += ts.Height();
743 if (!isempty(Info->ShortText())) {
744 const cFont *font = cFont::GetFont(fontSml);
745 ts.Set(osd, xl, y, x4 - xl, y4 - y, Info->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
746 y += ts.Height();
747 }
748 y += font->Height();
749 if (!isempty(Info->Description())) {
750 int yt = y;
751 int yb = y4 - Roundness;
752 cString d = Info->Description();
753 cString f = Info->FrameParams();
754 if (*f) {
755 d.Append("\n\n");
756 d.Append(f);
757 }
758 textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, d, font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
759 yb = yt + textScroller.Height();
760 osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3);
761 osd->DrawRectangle(x1, yt, x2, yb, frameColor);
762 osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2);
764 }
765}
766
767void cSkinSTTNGDisplayMenu::SetText(const char *Text, bool FixedFont)
768{
769 textScroller.Set(osd, x3, y3, GetTextAreaWidth(), y4 - y3, Text, GetTextAreaFont(FixedFont), Theme.Color(clrMenuText), Theme.Color(clrBackground));
771}
772
774{
775 return x4 - x3;
776}
777
779{
780 const cFont *font = cFont::GetFont(FixedFont ? fontFix : fontOsd);
781 //XXX -> make a way to let the text define which font to use
782 return font;
783}
784
786{
788 DrawTitle();
789 if (!message) {
790 cString date = DayDateTime();
791 if (!*lastDate || strcmp(date, lastDate)) {
792 const cFont *font = cFont::GetFont(fontSml);
793 int w = font->Width(date);
794 osd->DrawText(x4 - w - TextFrame, y7 - font->Height(), date, Theme.Color(clrMenuDate), frameColor, font, w);
795 lastDate = date;
796 }
797 }
798 osd->Flush();
799}
800
801// --- cSkinSTTNGDisplayReplay -----------------------------------------------
802
804private:
806 int x0, x1, x2, x3, x4, x5, x6, x7;
807 int y0, y1, y2, y3, y4, y5, y6, y7;
810public:
811 cSkinSTTNGDisplayReplay(bool ModeOnly);
812 virtual ~cSkinSTTNGDisplayReplay() override;
813 virtual void SetTitle(const char *Title) override;
814 virtual void SetMode(bool Play, bool Forward, int Speed) override;
815 virtual void SetProgress(int Current, int Total) override;
816 virtual void SetCurrent(const char *Current) override;
817 virtual void SetTotal(const char *Total) override;
818 virtual void SetJump(const char *Jump) override;
819 virtual void SetMessage(eMessageType Type, const char *Text) override;
820 virtual void Flush(void) override;
821 };
822
824{
825 const cFont *font = cFont::GetFont(fontSml);
826 int lineHeight = font->Height();
827 frameColor = Theme.Color(clrReplayFrame);
829 cBitmap bm(play_xpm);
830 x0 = 0;
831 x1 = max(lineHeight * 2, bm.Width());
832 x2 = x1 + Roundness;
833 x3 = x2 + Gap;
834 x7 = cOsd::OsdWidth();
835 x6 = x7 - lineHeight / 2;
836 x5 = x6 - lineHeight / 2;
837 x4 = x5 - Gap;
838 y0 = 0;
839 y1 = lineHeight;
840 y2 = y1 + Roundness;
841 y3 = y2 + Gap;
842 y4 = y3 + max(lineHeight, bm.Height());
843 y5 = y4 + Gap;
844 y6 = y5 + Roundness;
845 y7 = y6 + font->Height();
846 int yt = (y0 + y1) / 2;
847 int yb = (y6 + y7) / 2;
849 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor
850 if (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, 8 } }; // 256 colors
854 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
855 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
856 else {
857 tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors
858 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
859 }
860 }
861 osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, ModeOnly ? clrTransparent : Theme.Color(clrBackground));
862 if (!ModeOnly) {
863 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
864 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
865 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
866 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
867 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
868 osd->DrawRectangle(x1, y0, x4 - 1, y1 - 1, frameColor);
869 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
870 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
871 osd->DrawRectangle(x0, y1, x1 - 1, y2 - 1, frameColor);
872 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
873 }
874 osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
875 if (!ModeOnly) {
876 osd->DrawRectangle(x0, y5, x1 - 1, y6 - 1, frameColor);
877 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
878 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
879 osd->DrawRectangle(x1, y6, x4 - 1, y7 - 1, frameColor);
880 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
881 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
882 }
883}
884
889
891{
892 osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrReplayTitle), frameColor, cFont::GetFont(fontSml), x4 - x3 - TextSpacing);
893}
894
895static const char *const *ReplaySymbols[2][2][5] = {
896 { { pause_xpm, srew_xpm, srew1_xpm, srew2_xpm, srew3_xpm },
897 { pause_xpm, sfwd_xpm, sfwd1_xpm, sfwd2_xpm, sfwd3_xpm }, },
898 { { play_xpm, frew_xpm, frew1_xpm, frew2_xpm, frew3_xpm },
899 { play_xpm, ffwd_xpm, ffwd1_xpm, ffwd2_xpm, ffwd3_xpm } }
900 };
901
902void cSkinSTTNGDisplayReplay::SetMode(bool Play, bool Forward, int Speed)
903{
904 Speed = constrain(Speed, -1, 3);
905 cBitmap bm(ReplaySymbols[Play][Forward][Speed + 1]);
906 osd->DrawBitmap(x0 + (x1 - x0 - bm.Width()) / 2, y3 + (y4 - y3 - bm.Height()) / 2, bm, Theme.Color(clrReplayMode), frameColor);
907}
908
910{
911 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));
912 osd->DrawBitmap(x3, y3, pb);
913}
914
916{
917 const cFont *font = cFont::GetFont(fontSml);
918 int w = font->Width(Current);
919 osd->DrawText(x3, y6, Current, Theme.Color(clrReplayCurrent), frameColor, font, lastCurrentWidth > w ? lastCurrentWidth : w);
921}
922
924{
925 const cFont *font = cFont::GetFont(fontSml);
926 int w = font->Width(Total);
927 osd->DrawText(x4 - w - TextSpacing, y6, Total, Theme.Color(clrReplayTotal), frameColor, font, w);
928}
929
931{
932 if (Jump)
933 osd->DrawText(x0 + (x4 - x0) / 4, y6, Jump, Theme.Color(clrReplayJump), frameColor, cFont::GetFont(fontSml), (x4 - x3) / 2, 0, taCenter);
934 else
935 osd->DrawRectangle(x0 + (x4 - x0) / 4, y6, x4 - (x4 - x0) / 4, y7, frameColor);
936}
937
939{
940 const cFont *font = cFont::GetFont(fontSml);
941 if (Text) {
942 osd->SaveRegion(x2, y6, x4 - 1, y7 - 1);
944 osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
945 }
946 else
948}
949
951{
952 osd->Flush();
953}
954
955// --- cSkinSTTNGDisplayVolume -----------------------------------------------
956
958private:
960 int x0, x1, x2, x3, x4, x5, x6, x7;
961 int y0, y1;
963 int mute;
964public:
966 virtual ~cSkinSTTNGDisplayVolume() override;
967 virtual void SetVolume(int Current, int Total, bool Mute) override;
968 virtual void Flush(void) override;
969 };
970
972{
973 const cFont *font = cFont::GetFont(fontOsd);
974 int lineHeight = font->Height();
975 frameColor = Theme.Color(clrVolumeFrame);
976 mute = -1;
977 x0 = 0;
978 x1 = lineHeight / 2;
979 x2 = lineHeight;
980 x3 = x2 + Gap;
981 x7 = cOsd::OsdWidth();
982 x6 = x7 - lineHeight / 2;
983 x5 = x6 - lineHeight / 2;
984 x4 = x5 - Gap;
985 y0 = 0;
986 y1 = lineHeight;
988 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
989 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
990 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
991 else {
992 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
993 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
994 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
995 else {
996 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors
997 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
998 }
999 }
1000 osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
1001 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
1002 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1003 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1004 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1005 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1006}
1007
1012
1013void cSkinSTTNGDisplayVolume::SetVolume(int Current, int Total, bool Mute)
1014{
1015 int xl = x3 + TextSpacing;
1016 int xr = x4 - TextSpacing;
1017 int yt = y0 + TextFrame;
1018 int yb = y1 - TextFrame;
1019 if (mute != Mute) {
1020 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1021 mute = Mute;
1022 }
1023 cBitmap bm(Mute ? mute_xpm : volume_xpm);
1024 osd->DrawBitmap(xl, y0 + (y1 - y0 - bm.Height()) / 2, bm, Theme.Color(clrVolumeSymbol), frameColor);
1025 if (!Mute) {
1026 xl += bm.Width() + TextSpacing;
1027 int w = (y1 - y0) / 3;
1028 int d = TextFrame;
1029 int n = (xr - xl + d) / (w + d);
1030 int x = xr - n * (w + d);
1031 tColor Color = Theme.Color(clrVolumeBarLower);
1032 for (int i = 0; i < n; i++) {
1033 if (Total * i >= Current * n)
1034 Color = Theme.Color(clrVolumeBarUpper);
1035 osd->DrawRectangle(x, yt, x + w - 1, yb - 1, Color);
1036 x += w + d;
1037 }
1038 }
1039}
1040
1042{
1043 osd->Flush();
1044}
1045
1046// --- cSkinSTTNGDisplayTracks -----------------------------------------------
1047
1049private:
1051 int x0, x1, x2, x3, x4, x5, x6, x7;
1052 int y0, y1, y2, y3, y4, y5, y6, y7;
1057 void SetItem(const char *Text, int Index, bool Current);
1058public:
1059 cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
1060 virtual ~cSkinSTTNGDisplayTracks() override;
1061 virtual void SetTrack(int Index, const char * const *Tracks) override;
1062 virtual void SetAudioChannel(int AudioChannel) override;
1063 virtual void Flush(void) override;
1064 };
1065
1069
1070cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1071{
1072 const cFont *font = cFont::GetFont(fontOsd);
1073 lineHeight = font->Height();
1074 frameColor = Theme.Color(clrMenuFrame);
1075 currentIndex = -1;
1076 int ItemsWidth = font->Width(Title);
1077 for (int i = 0; i < NumTracks; i++)
1078 ItemsWidth = max(ItemsWidth, font->Width(Tracks[i]));
1079 ItemsWidth += 2 * TextSpacing;
1080 x0 = 0;
1081 x1 = lineHeight / 2;
1082 x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
1083 x2 = x3 - Gap;
1084 x7 = cOsd::OsdWidth();
1085 x6 = x7 - lineHeight / 2;
1086 x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
1087 x5 = x4 + Gap;
1088 int d = x4 - x3;
1089 if (d > ItemsWidth) {
1090 d = (d - ItemsWidth) & ~0x07; // must be multiple of 8
1091 x4 -= d;
1092 x5 -= d;
1093 x6 -= d;
1094 x7 -= d;
1095 }
1096 y0 = 0;
1097 y1 = lineHeight;
1098 y2 = y1 + Roundness;
1099 y3 = y2 + Gap;
1100 // limit to cOsd::OsdHeight()? - what if height is too big???
1101 y4 = y3 + NumTracks * lineHeight + 2 * Roundness;
1102 y5 = y4 + Gap;
1103 y6 = y5 + Roundness;
1104 y7 = y6 + cFont::GetFont(fontSml)->Height();
1105 int yt = (y0 + y1) / 2;
1106 int yb = (y6 + y7) / 2;
1108 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor
1109 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1110 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1111 else {
1112 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors
1113 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1114 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1115 else {
1116 tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors
1117 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1118 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1119 else {
1120 tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors
1121 { x0, y3, x3 - 1, y4 - 1, 1 },
1122 { x3, y3, x4 - 1, y4 - 1, 2 },
1123 { x4, y3, x7 - 1, y4 - 1, 2 },
1124 { x0, y4, x7 - 1, y7 - 1, 4 }
1125 };
1126 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1127 }
1128 }
1129 }
1131 osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
1132 osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
1133 osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
1134 osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
1135 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
1136 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1137 osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
1138 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1139 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1140 osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
1141 osd->DrawEllipse (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
1142 osd->DrawEllipse (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
1143 osd->DrawEllipse (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
1144 osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
1145 osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1146 osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
1147 osd->DrawEllipse (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
1148 osd->DrawText(x3 + TextSpacing, y0, Title, Theme.Color(clrMenuTitle), frameColor, font, x4 - x3 - TextSpacing);
1149 for (int i = 0; i < NumTracks; i++)
1150 SetItem(Tracks[i], i, false);
1151}
1152
1157
1158void cSkinSTTNGDisplayTracks::SetItem(const char *Text, int Index, bool Current)
1159{
1160 int y = y3 + Roundness + Index * lineHeight;
1161 tColor ColorFg, ColorBg;
1162 if (Current) {
1163 ColorFg = Theme.Color(clrMenuItemCurrentFg);
1164 ColorBg = Theme.Color(clrMenuItemCurrentBg);
1165 osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3);
1166 osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor);
1167 osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
1168 osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg);
1169 currentIndex = Index;
1170 }
1171 else {
1172 ColorFg = Theme.Color(clrMenuItemSelectable);
1173 ColorBg = Theme.Color(clrBackground);
1174 if (currentIndex == Index) {
1177 }
1178 }
1179 const cFont *font = cFont::GetFont(fontOsd);
1180 int xt = x3 + TextSpacing;
1181 osd->DrawText(xt, y, Text, ColorFg, ColorBg, font, x4 - xt);
1182}
1183
1184void cSkinSTTNGDisplayTracks::SetTrack(int Index, const char * const *Tracks)
1185{
1186 if (currentIndex >= 0)
1187 SetItem(Tracks[currentIndex], currentIndex, false);
1188 SetItem(Tracks[Index], Index, true);
1189}
1190
1192{
1193 cBitmap *bm = NULL;
1194 switch (AudioChannel) {
1195 case 0: bm = &bmAudioStereo; break;
1196 case 1: bm = &bmAudioLeft; break;
1197 case 2: bm = &bmAudioRight; break;
1198 default: ;
1199 }
1200 if (bm)
1201 osd->DrawBitmap(x3 + TextSpacing, y6 + (y7 - y6 - bm->Height()) / 2, *bm, Theme.Color(clrChannelSymbolOn), frameColor);
1202 else
1203 osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
1204}
1205
1207{
1208 osd->Flush();
1209}
1210
1211// --- cSkinSTTNGDisplayMessage ----------------------------------------------
1212
1214private:
1216 int x0, x1, x2, x3, x4, x5, x6, x7;
1217 int y0, y1;
1218public:
1220 virtual ~cSkinSTTNGDisplayMessage() override;
1221 virtual void SetMessage(eMessageType Type, const char *Text) override;
1222 virtual void Flush(void) override;
1223 };
1224
1226{
1227 const cFont *font = cFont::GetFont(fontOsd);
1228 int lineHeight = font->Height();
1229 tColor frameColor = Theme.Color(clrMessageFrame);
1230 x0 = 0;
1231 x1 = lineHeight / 2;
1232 x2 = lineHeight;
1233 x3 = x2 + Gap;
1234 x7 = cOsd::OsdWidth();
1235 x6 = x7 - lineHeight / 2;
1236 x5 = x6 - lineHeight / 2;
1237 x4 = x5 - Gap;
1238 y0 = 0;
1239 y1 = lineHeight;
1241 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor
1242 if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1243 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1244 else {
1245 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors
1246 if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
1247 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1248 else {
1249 tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 2 } }; // 4 colors
1250 osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
1251 }
1252 }
1253 osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
1254 osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
1255 osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
1256 osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
1257 osd->DrawEllipse (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
1258}
1259
1264
1266{
1267 const cFont *font = cFont::GetFont(fontOsd);
1268 osd->DrawText(x3, y0, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
1269}
1270
1272{
1273 osd->Flush();
1274}
1275
1276// --- cSkinSTTNG ------------------------------------------------------------
1277
1279:cSkin("sttng", &::Theme)//XXX naming problem???
1280{
1281}
1282
1284{
1285 return tr("ST:TNG Panels");
1286}
1287
1289{
1290 return new cSkinSTTNGDisplayChannel(WithInfo);
1291}
1292
1297
1299{
1300 return new cSkinSTTNGDisplayReplay(ModeOnly);
1301}
1302
1307
1308cSkinDisplayTracks *cSkinSTTNG::DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
1309{
1310 return new cSkinSTTNGDisplayTracks(Title, NumTracks, Tracks);
1311}
1312
cString ChannelString(const cChannel *Channel, int Number)
Definition channels.c:1140
Definition osd.h:170
int Height(void) const
Definition osd.h:190
int Width(void) const
Definition osd.h:189
int Tpid(void) const
Definition channels.h:179
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:189
int Ca(int Index=0) const
Definition channels.h:181
bool GetTrackId(eTrackType Type, tTrackId &TrackId)
Copies the given track id into TrackId and returns true, or returns false if Type is not a valid trac...
Definition device.c:1182
static cDevice * ActualDevice(void)
Returns the actual receiving device in case of Transfer Mode, or the primary device otherwise.
Definition device.c:229
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:168
virtual int SignalQuality(void) const
Returns the "quality" of the currently received signal.
Definition device.c:817
virtual int SignalStrength(void) const
Returns the "strength" of the currently received signal.
Definition device.c:812
Definition epg.h:74
const char * ShortText(void) const
Definition epg.h:109
time_t Vps(void) const
Definition epg.h:117
cString GetDateString(void) const
Definition epg.c:437
const char * Description(void) const
Definition epg.h:110
int ParentalRating(void) const
Definition epg.h:113
time_t StartTime(void) const
Definition epg.h:114
cString GetTimeString(void) const
Definition epg.c:442
const char * Title(void) const
Definition epg.h:108
cString GetEndTimeString(void) const
Definition epg.c:447
int Duration(void) const
Definition epg.h:116
cString GetVpsString(void) const
Definition epg.c:452
cString GetParentalRatingString(void) const
Definition epg.c:430
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:2318
The cOsd class is the interface to the "On Screen Display".
Definition osd.h:756
static int OsdHeight(void)
Definition osd.h:842
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
Definition osd.c:2116
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:2234
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:2274
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
Definition osd.c:2094
static int OsdTop(void)
Definition osd.h:840
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:2151
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition osd.c:2294
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:2264
static int OsdLeft(void)
Definition osd.h:839
static int OsdWidth(void)
Definition osd.h:841
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition osd.c:2169
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:2254
static void Delete(cOsd *&Osd)
Deregisters and deletes the given Osd (if any) and sets it to NULL.
Definition osd.c:1958
static bool Active(void)
Definition menu.c:5960
const char * ChannelName(void) const
Definition recording.h:95
const cEvent * GetEvent(void) const
Definition recording.h:96
int Errors(void) const
Definition recording.h:122
const char * ShortText(void) const
Definition recording.h:98
const char * Title(void) const
Definition recording.h:97
cString FrameParams(void) const
Definition recording.c:713
const char * Description(void) const
Definition recording.h:99
const char * Name(void) const
Returns the full name of the recording (without the video directory).
Definition recording.h:179
time_t Start(void) const
Definition recording.h:163
cRecordingInfo * Info(void) const
Definition recording.h:186
int ColorKey3
Definition config.h:330
int ColorKey2
Definition config.h:330
int AntiAlias
Definition config.h:345
int ColorKey0
Definition config.h:330
int ChannelInfoPos
Definition config.h:338
int ColorKey1
Definition config.h:330
cSkinDisplayChannel(void)
Definition skins.c:68
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:111
cTextScroller textScroller
Definition skins.h:174
int Tab(int n)
Returns the offset of the given tab from the left border of the item display area.
Definition skins.h:175
eMenuCategory MenuCategory(void) const
Returns the menu category, set by a previous call to SetMenuCategory().
Definition skins.h:184
cSkinDisplayMenu(void)
Definition skins.c:84
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:116
const cErrors * errors
Definition skins.h:321
cSkinDisplayReplay(void)
Definition skins.c:218
const cMarks * marks
< This class implements the progress display used during replay of a recording.
Definition skins.h:320
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 SetEvents(const cEvent *Present, const cEvent *Following) override
Sets the Present and Following EPG events.
Definition skinsttng.c:292
static cBitmap bmRadio
Definition skinsttng.c:146
virtual void SetMessage(eMessageType Type, const char *Text) override
Sets a one line message Text, with the given Type.
Definition skinsttng.c:311
static cBitmap bmEncrypted
Definition skinsttng.c:146
virtual ~cSkinSTTNGDisplayChannel() override
Definition skinsttng.c:260
static cBitmap bmTeletext
Definition skinsttng.c:146
static cBitmap bmDolbyDigital
Definition skinsttng.c:146
cSkinSTTNGDisplayChannel(bool WithInfo)
Definition skinsttng.c:163
virtual void SetChannel(const cChannel *Channel, int Number) override
Sets the current channel to Channel.
Definition skinsttng.c:265
const cEvent * present
Definition skinsttng.c:138
virtual void Flush(void) override
Actually draws the OSD display to the output device.
Definition skinsttng.c:329
virtual void Flush(void) override
Actually draws the OSD display to the output device.
Definition skinsttng.c:785
virtual int MaxItems(void) override
Returns the maximum number of items the menu can display.
Definition skinsttng.c:548
virtual void Scroll(bool Up, bool Page) override
If this menu contains a text area that can be scrolled, this function will be called to actually scro...
Definition skinsttng.c:542
virtual void Clear(void) override
Clears the entire central area of the menu.
Definition skinsttng.c:553
virtual void SetMessage(eMessageType Type, const char *Text) override
Sets a one line message Text, with the given Type.
Definition skinsttng.c:600
virtual int GetTextAreaWidth(void) const override
Returns the width in pixel of the area which is used to display text with SetText().
Definition skinsttng.c:773
virtual void SetText(const char *Text, bool FixedFont) override
Sets the Text that shall be displayed, using the entire central area of the menu.
Definition skinsttng.c:767
virtual void SetTitle(const char *Title) override
Sets the title of this menu to Title.
Definition skinsttng.c:569
virtual const cFont * GetTextAreaFont(bool FixedFont) const override
Returns a pointer to the font which is used to display text with SetText().
Definition skinsttng.c:778
virtual void SetButtons(const char *Red, const char *Green=NULL, const char *Yellow=NULL, const char *Blue=NULL) override
Sets the color buttons to the given strings.
Definition skinsttng.c:575
void SetTextScrollbar(void)
Definition skinsttng.c:536
virtual ~cSkinSTTNGDisplayMenu() override
Definition skinsttng.c:503
void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
Definition skinsttng.c:508
virtual void SetScrollbar(int Total, int Offset) override
Sets the Total number of items in the currently displayed list, and the Offset of the first item that...
Definition skinsttng.c:648
virtual void SetRecording(const cRecording *Recording) override
Sets the Recording that shall be displayed, using the entire central area of the menu.
Definition skinsttng.c:703
virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable) override
Sets the item at the given Index to Text.
Definition skinsttng.c:614
virtual void SetEvent(const cEvent *Event) override
Sets the Event that shall be displayed, using the entire central area of the menu.
Definition skinsttng.c:653
virtual void Flush(void) override
Actually draws the OSD display to the output device.
Definition skinsttng.c:1271
virtual ~cSkinSTTNGDisplayMessage() override
Definition skinsttng.c:1260
virtual void SetMessage(eMessageType Type, const char *Text) override
< This class implements a simple message display.
Definition skinsttng.c:1265
virtual void SetProgress(int Current, int Total) override
This function will be called whenever the position in or the total length of the recording has change...
Definition skinsttng.c:909
virtual void SetTitle(const char *Title) override
Sets the title of the recording.
Definition skinsttng.c:890
virtual void SetMode(bool Play, bool Forward, int Speed) override
Sets the current replay mode, which can be used to display some indicator, showing the user whether w...
Definition skinsttng.c:902
virtual void SetTotal(const char *Total) override
Sets the total length of the recording, as a user readable string in the form "h:mm:ss".
Definition skinsttng.c:923
virtual void SetCurrent(const char *Current) override
Sets the current position within the recording, as a user readable string in the form "h:mm:ss....
Definition skinsttng.c:915
virtual void Flush(void) override
Actually draws the OSD display to the output device.
Definition skinsttng.c:950
cSkinSTTNGDisplayReplay(bool ModeOnly)
Definition skinsttng.c:823
virtual ~cSkinSTTNGDisplayReplay() override
Definition skinsttng.c:885
virtual void SetMessage(eMessageType Type, const char *Text) override
Sets a one line message Text, with the given Type.
Definition skinsttng.c:938
virtual void SetJump(const char *Jump) override
Sets the prompt that allows the user to enter a jump point.
Definition skinsttng.c:930
virtual void Flush(void) override
Actually draws the OSD display to the output device.
Definition skinsttng.c:1206
static cBitmap bmAudioLeft
Definition skinsttng.c:1056
virtual void SetTrack(int Index, const char *const *Tracks) override
< This class implements the track display.
Definition skinsttng.c:1184
static cBitmap bmAudioStereo
Definition skinsttng.c:1056
cSkinSTTNGDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Definition skinsttng.c:1070
virtual void SetAudioChannel(int AudioChannel) override
Sets the audio channel indicator.
Definition skinsttng.c:1191
void SetItem(const char *Text, int Index, bool Current)
Definition skinsttng.c:1158
virtual ~cSkinSTTNGDisplayTracks() override
Definition skinsttng.c:1153
static cBitmap bmAudioRight
Definition skinsttng.c:1056
virtual ~cSkinSTTNGDisplayVolume() override
Definition skinsttng.c:1008
virtual void Flush(void) override
Actually draws the OSD display to the output device.
Definition skinsttng.c:1041
virtual void SetVolume(int Current, int Total, bool Mute) override
< This class implements the volume/mute display.
Definition skinsttng.c:1013
virtual const char * Description(void) override
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
Definition skinsttng.c:1283
virtual cSkinDisplayMessage * DisplayMessage(void) override
Creates and returns a new object for displaying a message.
Definition skinsttng.c:1313
virtual cSkinDisplayVolume * DisplayVolume(void) override
Creates and returns a new object for displaying the current volume.
Definition skinsttng.c:1303
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks) override
Creates and returns a new object for displaying the available tracks.
Definition skinsttng.c:1308
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly) override
Creates and returns a new object for displaying replay progress.
Definition skinsttng.c:1298
cSkinSTTNG(void)
Definition skinsttng.c:1278
virtual cSkinDisplayMenu * DisplayMenu(void) override
Creates and returns a new object for displaying a menu.
Definition skinsttng.c:1293
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo) override
Creates and returns a new object for displaying the current channel.
Definition skinsttng.c:1288
cTheme * Theme(void)
Definition skins.h:425
cSkin(const char *Name, cTheme *Theme=NULL)
Creates a new skin class, with the given Name and Theme.
Definition skins.c:241
static cString sprintf(const char *fmt,...) __attribute__((format(printf
Definition tools.c:1242
cString & Append(const char *String)
Definition tools.c:1195
int Height(void)
Definition osd.h:1103
bool CanScroll(void)
Definition osd.h:1107
int Total(void)
Definition osd.h:1104
int Top(void)
Definition osd.h:1101
int Offset(void)
Definition osd.h:1105
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:2449
void Reset(void)
Definition osd.c:2466
int Shown(void)
Definition osd.h:1106
bool CanScrollDown(void)
Definition osd.h:1109
bool CanScrollUp(void)
Definition osd.h:1108
tColor Color(int Subject)
Returns the color for the given Subject.
Definition themes.c:182
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:373
#define LOCK_SCHEDULES_READ
Definition epg.h:232
@ 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:159
@ oeOk
Definition osd.h:45
@ clrGray50
Definition osd.h:34
static cTheme Theme
Definition skinclassic.c:21
#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
static const char *const * ReplaySymbols[2][2][5]
Definition skinlcars.c:1923
@ mcMain
Definition skins.h:107
@ mcRecordingDel
Definition skins.h:116
@ 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:895
#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:300
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:1348
bool isempty(const char *s)
Definition tools.c:387
cString DateString(time_t t)
Converts the given time to a string of the form "www dd.mm.yyyy".
Definition tools.c:1328
cString DayDateTime(time_t t)
Converts the given time to a string of the form "www dd.mm. hh:mm".
Definition tools.c:1307
char * strn0cpy(char *dest, const char *src, size_t n)
Definition tools.c:128
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