void cSkinSTTNGDisplayMenu::SetScrollbar(void) { if (textScroller.CanScroll()) { int h = lineHeight; int yt = textScroller.Top(); int yb = yt + textScroller.Height(); int st = yt + h + Gap; int sb = yb - h - Gap; int tt = st + (sb - st) * textScroller.Offset() / textScroller.Total(); int tb = tt + (sb - st) * textScroller.Shown() / textScroller.Total(); osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb, Theme.Color(clrMenuScrollbarTotal)); osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb, Theme.Color(clrMenuScrollbarShown)); osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor); osd->DrawEllipse (x6, yt, x7 - 1, yt + h - 1, frameColor, 5); osd->DrawRectangle(x5, yb - h, x6 - 1, yb - 1, frameColor); osd->DrawEllipse (x6, yb - h, x7 - 1, yb - 1, frameColor, 5); if (textScroller.CanScrollUp()) { cBitmap bm(arrowup_xpm); osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yt + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor); } if (textScroller.CanScrollDown()) { cBitmap bm(arrowdown_xpm); osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yb - h + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor); } } }
void cSkinSTTNGDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { int y = y3 + Roundness + Index * lineHeight; tColor ColorFg, ColorBg; if (Current) { ColorFg = Theme.Color(clrMenuItemCurrentFg); ColorBg = Theme.Color(clrMenuItemCurrentBg); osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3); osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor); osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2); osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg); currentIndex = Index; } else { ColorFg = Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable); ColorBg = Theme.Color(clrBackground); if (currentIndex == Index) { osd->DrawRectangle(x1, y - Roundness, x2 - 1, y + lineHeight + Roundness - 1, Theme.Color(clrBackground)); osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, Theme.Color(clrBackground)); } } const cFont *font = cFont::GetFont(fontOsd); for (int i = 0; i < MaxTabs; i++) { const char *s = GetTabbedText(Text, i); if (s) { int xt = x3 + 5 + Tab(i); osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x4 - xt); } if (!Tab(i + 1)) break; } SetEditableWidth(x4 - x3 - 5 - Tab(1)); }
void cSkinSTTNGDisplayChannel::Flush(void) { if (withInfo) { if (!message) { const cFont *font = cFont::GetFont(fontSml); cString date = DayDateTime(); int w = font->Width(date); osd->DrawText(x4 - w - 2, y7 - font->Height(date), date, Theme.Color(clrChannelDate), frameColor, font); cDevice *Device = cDevice::PrimaryDevice(); const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack()); if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) { osd->DrawText(x3 + 2, y6, Track ? Track->description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 4); strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description)); } } int seen = 0; if (present) { time_t t = time(NULL); if (t > present->StartTime()) seen = min(y4 - y3 - 1, int((y4 - y3) * double(t - present->StartTime()) / present->Duration())); } if (seen != lastSeen) { osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y4 - 1, Theme.Color(clrChannelTimebarRest)); if (seen) osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y3 + seen, Theme.Color(clrChannelTimebarSeen)); lastSeen = seen; } } osd->Flush(); }
void cSkinSTTNGDisplayVolume::SetVolume(int Current, int Total, bool Mute) { int xl = x3 + 5; int xr = x4 - 5; int yt = y0 + 3; int yb = y1 - 3; if (mute != Mute) { osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor); mute = Mute; } cBitmap bm(Mute ? mute_xpm : volume_xpm); osd->DrawBitmap(xl, y0 + (y1 - y0 - bm.Height()) / 2, bm, Theme.Color(clrVolumeSymbol), frameColor); if (!Mute) { xl += bm.Width() + 5; int w = (y1 - y0) / 3; int d = 3; int n = (xr - xl + d) / (w + d); int x = xr - n * (w + d); tColor Color = Theme.Color(clrVolumeBarLower); for (int i = 0; i < n; i++) { if (Total * i >= Current * n) Color = Theme.Color(clrVolumeBarUpper); osd->DrawRectangle(x, yt, x + w - 1, yb - 1, Color); x += w + d; } } }
void cSkinSTTNGDisplayTracks::SetItem(const char *Text, int Index, bool Current) { int y = y3 + Roundness + Index * lineHeight; tColor ColorFg, ColorBg; if (Current) { ColorFg = Theme.Color(clrMenuItemCurrentFg); ColorBg = Theme.Color(clrMenuItemCurrentBg); osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3); osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor); osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2); osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg); currentIndex = Index; } else { ColorFg = Theme.Color(clrMenuItemSelectable); ColorBg = Theme.Color(clrBackground); if (currentIndex == Index) { osd->DrawRectangle(x1, y - Roundness, x2 - 1, y + lineHeight + Roundness - 1, Theme.Color(clrBackground)); osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, Theme.Color(clrBackground)); } } const cFont *font = cFont::GetFont(fontOsd); int xt = x3 + 5; osd->DrawText(xt, y, Text, ColorFg, ColorBg, font, x4 - xt); }
void cSkinClassicDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) { osd->DrawRectangle(0, lineHeight, timeWidth - 1, osd->Height(), Theme.Color(clrChannelEpgTimeBg)); osd->DrawRectangle(timeWidth, lineHeight, osd->Width() - 1, osd->Height(), Theme.Color(clrBackground)); for (int i = 0; i < 2; i++) { const cEvent *e = !i ? Present : Following; if (e) { osd->DrawText( TextFrame, (2 * i + 1) * lineHeight, e->GetTimeString(), Theme.Color(clrChannelEpgTimeFg), Theme.Color(clrChannelEpgTimeBg), cFont::GetFont(fontOsd)); osd->DrawText(timeWidth + 2 * TextSpacing, (2 * i + 1) * lineHeight, e->Title(), Theme.Color(clrChannelEpgTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd)); osd->DrawText(timeWidth + 2 * TextSpacing, (2 * i + 2) * lineHeight, e->ShortText(), Theme.Color(clrChannelEpgShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml)); } } }
void cSkinCursesDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) { osd->DrawRectangle(0, 1, timeWidth - 1, 4, clrRed); osd->DrawRectangle(timeWidth, 1, ScOsdWidth - 1, 4, clrBackground); for (int i = 0; i < 2; i++) { const cEvent *e = !i ? Present : Following; if (e) { osd->DrawText( 0, 2 * i + 1, e->GetTimeString(), clrWhite, clrRed, &Font); osd->DrawText(timeWidth + 1, 2 * i + 1, e->Title(), clrCyan, clrBackground, &Font); osd->DrawText(timeWidth + 1, 2 * i + 2, e->ShortText(), clrYellow, clrBackground, &Font); } } }
void cSkinCursesDisplayVolume::SetVolume(int Current, int Total, bool Mute) { if (Mute) { osd->DrawRectangle(0, 0, ScOsdWidth - 1, 0, clrTransparent); osd->DrawText(0, 0, tr("Key$Mute"), clrGreen, clrBackground, &Font); } else { const char *Prompt = tr("Volume "); int l = Utf8StrLen(Prompt); int p = (ScOsdWidth - l) * Current / Total; osd->DrawText(0, 0, Prompt, clrGreen, clrBackground, &Font); osd->DrawRectangle(l, 0, l + p - 1, 0, clrGreen); osd->DrawRectangle(l + p, 0, ScOsdWidth - 1, 0, clrWhite); } }
void cSkinCursesDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown) { if (Total > 0 && Total > Shown) { int yt = Top; int yb = yt + Height; int st = yt; int sb = yb; int th = max(int((sb - st) * double(Shown) / Total + 0.5), 1); int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th); int tb = min(tt + th, sb); int xl = ScOsdWidth - 1; osd->DrawRectangle(xl, st, xl, sb - 1, clrWhite); osd->DrawRectangle(xl, tt, xl, tb - 1, clrCyan); } }
eOSState cLineGame::ProcessKey(eKeys Key) { eOSState state = cOsdObject::ProcessKey(Key); if (state == osUnknown) { const int d = 4; switch (Key & ~k_Repeat) { case kUp: y = max(0, y - d); break; case kDown: y = min(osd->Height() - d, y + d); break; case kLeft: x = max(0, x - d); break; case kRight: x = min(osd->Width() - d, x + d); break; case kRed: color = clrRed; break; case kGreen: color = clrGreen; break; case kYellow: color = clrYellow; break; case kBlue: color = clrBlue; break; case k1: DrawEllipses(osd); return osContinue; case k2: DrawSlopes(osd); return osContinue; case kBack: case kOk: return osEnd; default: return state; } osd->DrawRectangle(x, y, x + d - 1, y + d - 1, color); osd->Flush(); state = osContinue; } return state; }
void cSkinCursesDisplayMenu::SetMessage(eMessageType Type, const char *Text) { if (Text) osd->DrawText(0, ScOsdHeight - 2, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, ScOsdWidth, 0, taCenter); else osd->DrawRectangle(0, ScOsdHeight - 2, ScOsdWidth - 1, ScOsdHeight - 2, clrBackground); }
void cSkinSTTNGDisplayChannel::SetChannel(const cChannel *Channel, int Number) { osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor); int x = x4 - 5; if (Channel && !Channel->GroupSep()) { int d = 3; bool rec = cRecordControls::Active(); x -= bmRecording.Width() + d; osd->DrawBitmap(x, y0 + (y1 - y0 - bmRecording.Height()) / 2, bmRecording, Theme.Color(rec ? clrChannelSymbolRecFg : clrChannelSymbolOff), rec ? Theme.Color(clrChannelSymbolRecBg) : frameColor); x -= bmEncrypted.Width() + d; osd->DrawBitmap(x, y0 + (y1 - y0 - bmEncrypted.Height()) / 2, bmEncrypted, Theme.Color(Channel->Ca() ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor); x -= bmDolbyDigital.Width() + d; osd->DrawBitmap(x, y0 + (y1 - y0 - bmDolbyDigital.Height()) / 2, bmDolbyDigital, Theme.Color(Channel->Dpid(0) ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor); x -= bmAudio.Width() + d; osd->DrawBitmap(x, y0 + (y1 - y0 - bmAudio.Height()) / 2, bmAudio, Theme.Color(Channel->Apid(1) ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor); if (Channel->Vpid()) { x -= bmTeletext.Width() + d; osd->DrawBitmap(x, y0 + (y1 - y0 - bmTeletext.Height()) / 2, bmTeletext, Theme.Color(Channel->Tpid() ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor); } else if (Channel->Apid(0)) { x -= bmRadio.Width() + d; osd->DrawBitmap(x, y0 + (y1 - y0 - bmRadio.Height()) / 2, bmRadio, Theme.Color(clrChannelSymbolOn), frameColor); } } osd->DrawText(x3 + 2, y0, ChannelString(Channel, Number), Theme.Color(clrChannelName), frameColor, cFont::GetFont(fontOsd), x - x3 - 2); }
void cSkinClassicDisplayVolume::SetVolume(int Current, int Total, bool Mute) { const cFont *font = cFont::GetFont(fontOsd); if (Mute) { osd->DrawRectangle(0, 0, osd->Width() - 1, osd->Height() - 1, clrTransparent); osd->DrawText(0, 0, tr("Key$Mute"), Theme.Color(clrVolumePrompt), Theme.Color(clrBackground), font); } else { // TRANSLATORS: note the trailing blank! const char *Prompt = tr("Volume "); int l = font->Width(Prompt); int p = (osd->Width() - l) * Current / Total; osd->DrawText(0, 0, Prompt, Theme.Color(clrVolumePrompt), Theme.Color(clrBackground), font); osd->DrawRectangle(l, 0, l + p - 1, osd->Height() - 1, Theme.Color(clrVolumeBarLower)); osd->DrawRectangle(l + p, 0, osd->Width() - 1, osd->Height() - 1, Theme.Color(clrVolumeBarUpper)); } }
void cSkinClassicDisplayMenu::SetMessage(eMessageType Type, const char *Text) { const cFont *font = cFont::GetFont(fontOsd); if (Text) osd->DrawText(x0, y3, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x3 - x0, 0, taCenter); else osd->DrawRectangle(x0, y3, x3 - 1, y4 - 1, Theme.Color(clrBackground)); }
void cSkinSTTNGDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) { if (!withInfo) return; if (present != Present) lastSeen = -1; present = Present; osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor); osd->DrawRectangle(x3, y3, x7 - 1, y4 - 1, Theme.Color(clrBackground)); for (int i = 0; i < 2; i++) { const cEvent *e = !i ? Present : Following; if (e) { osd->DrawText(x0 + 2, y3 + 2 * i * lineHeight, e->GetTimeString(), Theme.Color(clrChannelEpgTime), frameColor, cFont::GetFont(fontOsd)); osd->DrawText(x3 + 2, y3 + 2 * i * lineHeight, e->Title(), Theme.Color(clrChannelEpgTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd), x4 - x3 - 2); osd->DrawText(x3 + 2, y3 + (2 * i + 1) * lineHeight, e->ShortText(), Theme.Color(clrChannelEpgShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml), x4 - x3 - 2); } } }
void cLineGame::Show(void) { osd = cOsdProvider::NewOsd(100, 50, 50); if (osd) { tArea Area = { 0, 0, 99, 199, 4 }; osd->SetAreas(&Area, 1); osd->DrawRectangle(0, 0, 99, 199, clrGray50); osd->Flush(); } }
void cSkinSTTNGDisplayMenu::SetEvent(const cEvent *Event) { if (!Event) return; const cFont *font = cFont::GetFont(fontOsd); int xl = x3 + 5; int y = y3; cTextScroller ts; char t[32]; snprintf(t, sizeof(t), "%s %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString()); ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground)); if (Event->Vps() && Event->Vps() != Event->StartTime()) { char *buffer; asprintf(&buffer, " VPS: %s", *Event->GetVpsString()); const cFont *font = cFont::GetFont(fontSml); osd->DrawText(x4 - font->Width(buffer), y, buffer, Theme.Color(clrMenuEventVps), frameColor, font); int yb = y + font->Height(); osd->DrawRectangle(x5, y, x6 - 1, yb - 1, frameColor); osd->DrawEllipse (x6, y, x7 - 1, yb - 1, frameColor, 5); free(buffer); } y += ts.Height(); y += font->Height(); ts.Set(osd, xl, y, x4 - xl, y4 - y, Event->Title(), font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground)); y += ts.Height(); if (!isempty(Event->ShortText())) { const cFont *font = cFont::GetFont(fontSml); ts.Set(osd, xl, y, x4 - xl, y4 - y, Event->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground)); y += ts.Height(); } y += font->Height(); if (!isempty(Event->Description())) { int yt = y; int yb = y4 - Roundness; textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, Event->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground)); yb = yt + textScroller.Height(); osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3); osd->DrawRectangle(x1, yt, x2, yb, frameColor); osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2); SetScrollbar(); } }
void cTrueColorDemo::Show(void) { osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop()); if (osd) { if (SetArea()) { osd->DrawRectangle(0, 0, osd->Width() - 1, osd->Height() - 1, clrGray50); osd->Flush(); Start(); } } }
void cSkinSTTNGDisplayReplay::SetMessage(eMessageType Type, const char *Text) { const cFont *font = cFont::GetFont(fontSml); if (Text) { osd->SaveRegion(x2, y6, x4 - 1, y7 - 1); osd->DrawRectangle(x2, y6, x3 - 1, y7 - 1, Theme.Color(clrBackground)); osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter); } else osd->RestoreRegion(); }
void cTrueColorDemo::Show(void) { osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop(), 50); if (osd) { tArea Area = { 0, 0, cOsd::OsdWidth() - 1, cOsd::OsdHeight() - 1, 32 }; if (osd->SetAreas(&Area, 1) == oeOk) { osd->DrawRectangle(0, 0, osd->Width() -1 , osd->Height() - 1, clrGray50); osd->Flush(); Start(); } } }
void cSkinSTTNGDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { cString date = DayDateTime(); const cFont *font = cFont::GetFont(fontSml); int d = 10; int d2 = d / 2; int t4 = x4 - font->Width(date) - 2; int w = t4 - x3; int t0 = x3 + d2; int t1 = x3 + w / 4; int t2 = x3 + w / 2; int t3 = t4 - w / 4; osd->DrawRectangle(t0 + d2, y6, t1 - d2, y7 - 1, clrBlack); osd->DrawRectangle(t1 + d2, y6, t2 - d2, y7 - 1, clrBlack); osd->DrawRectangle(t2 + d2, y6, t3 - d2, y7 - 1, clrBlack); osd->DrawRectangle(t3 + d2, y6, t4 - d2, y7 - 1, clrBlack); osd->DrawText(t0 + d, y6, Red, Theme.Color(clrButtonRedFg), Theme.Color(clrButtonRedBg), font, t1 - t0 - 2 * d, 0, taCenter); osd->DrawText(t1 + d, y6, Green, Theme.Color(clrButtonGreenFg), Theme.Color(clrButtonGreenBg), font, t2 - t1 - 2 * d, 0, taCenter); osd->DrawText(t2 + d, y6, Yellow, Theme.Color(clrButtonYellowFg), Theme.Color(clrButtonYellowBg), font, t3 - t2 - 2 * d, 0, taCenter); osd->DrawText(t3 + d, y6, Blue, Theme.Color(clrButtonBlueFg), Theme.Color(clrButtonBlueBg), font, t4 - t3 - 2 * d, 0, taCenter); }
void cSkinSTTNGDisplayTracks::SetAudioChannel(int AudioChannel) { cBitmap *bm = NULL; switch (AudioChannel) { case 0: bm = &bmAudioStereo; break; case 1: bm = &bmAudioLeft; break; case 2: bm = &bmAudioRight; break; } if (bm) osd->DrawBitmap(x3 + 5, y6 + (y7 - y6 - bm->Height()) / 2, *bm, Theme.Color(clrChannelSymbolOn), frameColor); else osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor); }
void cSkinClassicDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown) { if (Total > 0 && Total > Shown) { int yt = Top; int yb = yt + Height; int st = yt; int sb = yb; int th = max(int((sb - st) * double(Shown) / Total + 0.5), ScrollWidth); int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th); int tb = min(tt + th, sb); int xl = x3 - ScrollWidth; osd->DrawRectangle(xl, st, x3 - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal)); osd->DrawRectangle(xl, tt, x3 - 1, tb - 1, Theme.Color(clrMenuScrollbarShown)); } }
void cSkinSTTNGDisplayChannel::SetMessage(eMessageType Type, const char *Text) { const cFont *font = cFont::GetFont(withInfo ? fontSml : fontOsd); if (Text) { int yt = withInfo ? y6 : y0; int yb = withInfo ? y7 : y1; osd->SaveRegion(x2, yt, x4 - 1, yb - 1); if (withInfo) osd->DrawRectangle(x2, yt, x3 - 1, yb - 1, Theme.Color(clrBackground)); osd->DrawText(x3, yt, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter); message = true; } else { osd->RestoreRegion(); message = false; } }
void cLineGame::Show(void) { osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop()); if (osd) { int x1 = cOsd::OsdWidth() - 1; int y1 = cOsd::OsdHeight() - 1; while (x1 > 0 && y1 > 0) { tArea Area = { 0, 0, x1, y1, 4 }; if (osd->CanHandleAreas(&Area, 1) == oeOk) { osd->SetAreas(&Area, 1); osd->DrawRectangle(0, 0, osd->Width() - 1, osd->Height() - 1, clrGray50); osd->Flush(); x = osd->Width() / 2; y = osd->Height() / 2; break; } x1 = x1 * 9 / 10; y1 = y1 * 9 / 10; } } }
eOSState cLineGame::ProcessKey(eKeys Key) { eOSState state = cOsdObject::ProcessKey(Key); if (state == osUnknown) { switch (Key & ~k_Repeat) { case kUp: if (y > 0) y--; break; case kDown: if (y < 196) y++; break; case kLeft: if (x > 0) x--; break; case kRight: if (x < 96) x++; break; case kRed: color = clrRed; break; case kGreen: color = clrGreen; break; case kYellow: color = clrYellow; break; case kBlue: color = clrBlue; break; case kOk: return osEnd; default: return state; } osd->DrawRectangle(x, y, x + 3, y + 3, color); osd->Flush(); state = osContinue; } return state; }
void cSkinSTTNGDisplayMenu::SetRecording(const cRecording *Recording) { if (!Recording) return; const cRecordingInfo *Info = Recording->Info(); const cFont *font = cFont::GetFont(fontOsd); int xl = x3 + 5; int y = y3; cTextScroller ts; char t[32]; snprintf(t, sizeof(t), "%s %s", *DateString(Recording->start), *TimeString(Recording->start)); ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground)); y += ts.Height(); y += font->Height(); const char *Title = Info->Title(); if (isempty(Title)) Title = Recording->Name(); ts.Set(osd, xl, y, x4 - xl, y4 - y, Title, font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground)); y += ts.Height(); if (!isempty(Info->ShortText())) { const cFont *font = cFont::GetFont(fontSml); ts.Set(osd, xl, y, x4 - xl, y4 - y, Info->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground)); y += ts.Height(); } y += font->Height(); if (!isempty(Info->Description())) { int yt = y; int yb = y4 - Roundness; textScroller.Set(osd, xl, yt, x4 - xl, yb - yt, Info->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground)); yb = yt + textScroller.Height(); osd->DrawEllipse (x1, yt - Roundness, x2, yt, frameColor, -3); osd->DrawRectangle(x1, yt, x2, yb, frameColor); osd->DrawEllipse (x1, yb, x2, yb + Roundness, frameColor, -2); SetScrollbar(); } }
void cSkinCursesDisplayReplay::SetProgress(int Current, int Total) { int p = Total > 0 ? ScOsdWidth * Current / Total : 0; osd->DrawRectangle(0, 1, p, 1, clrGreen); osd->DrawRectangle(p, 1, ScOsdWidth, 1, clrWhite); }
void cSkinCursesDisplayMenu::Clear(void) { osd->DrawRectangle(0, 1, ScOsdWidth - 1, ScOsdHeight - 2, clrBackground); textScroller.Reset(); }
void cSkinSTTNGDisplayMenu::Clear(void) { textScroller.Reset(); osd->DrawRectangle(x1, y3, x7 - 1, y4 - 1, Theme.Color(clrBackground)); }