本文整理汇总了C++中cOsd类的典型用法代码示例。如果您正苦于以下问题:C++ cOsd类的具体用法?C++ cOsd怎么用?C++ cOsd使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cOsd类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SetMessage
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);
}
开发者ID:flensrocker,项目名称:vdr,代码行数:7,代码来源:skincurses.c
示例2: ProcessKey
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;
}
开发者ID:flensrocker,项目名称:vdr-yavdr,代码行数:28,代码来源:osddemo.c
示例3: DayDateTime
void cSkinCursesDisplayChannel::Flush(void)
{
if (!message) {
cString date = DayDateTime();
osd->DrawText(ScOsdWidth - Utf8StrLen(date), 0, date, clrWhite, clrBackground, &Font);
}
osd->Flush();
}
开发者ID:flensrocker,项目名称:vdr,代码行数:8,代码来源:skincurses.c
示例4: DrawTitle
void cSkinCursesDisplayMenu::Flush(void)
{
if (cVideoDiskUsage::HasChanged(lastDiskUsageState))
DrawTitle();
cString date = DayDateTime();
osd->DrawText(ScOsdWidth - Utf8StrLen(date) - 2, 0, date, clrBlack, clrCyan, &Font);
osd->Flush();
}
开发者ID:flensrocker,项目名称:vdr,代码行数:8,代码来源:skincurses.c
示例5: Show
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();
}
}
开发者ID:MichaelE1000,项目名称:vdr,代码行数:10,代码来源:osddemo.c
示例6: Show
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();
}
}
}
开发者ID:flensrocker,项目名称:vdr-yavdr,代码行数:11,代码来源:osddemo.c
示例7: SetEvents
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);
}
}
}
开发者ID:flensrocker,项目名称:vdr,代码行数:13,代码来源:skincurses.c
示例8: SetButtons
void cSkinCursesDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
{
int w = ScOsdWidth;
int t0 = 0;
int t1 = 0 + w / 4;
int t2 = 0 + w / 2;
int t3 = w - w / 4;
int t4 = w;
int y = ScOsdHeight - 1;
osd->DrawText(t0, y, Red, clrWhite, Red ? clrRed : clrBackground, &Font, t1 - t0, 0, taCenter);
osd->DrawText(t1, y, Green, clrBlack, Green ? clrGreen : clrBackground, &Font, t2 - t1, 0, taCenter);
osd->DrawText(t2, y, Yellow, clrBlack, Yellow ? clrYellow : clrBackground, &Font, t3 - t2, 0, taCenter);
osd->DrawText(t3, y, Blue, clrWhite, Blue ? clrBlue : clrBackground, &Font, t4 - t3, 0, taCenter);
}
开发者ID:flensrocker,项目名称:vdr,代码行数:14,代码来源:skincurses.c
示例9: tr
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);
}
}
开发者ID:MichaelE1000,项目名称:vdr,代码行数:15,代码来源:skincurses.c
示例10: max
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);
}
}
开发者ID:flensrocker,项目名称:vdr,代码行数:15,代码来源:skincurses.c
示例11: ProcessKey
eOSState cTrueColorDemo::ProcessKey(eKeys Key)
{
eOSState state = cOsdObject::ProcessKey(Key);
if (state == osUnknown) {
LOCK_PIXMAPS;
LOCK_THREAD;
const int d = 80;
switch (Key & ~k_Repeat) {
case kUp: cursor.SetY(std::max(cursorLimits.Top(), cursor.Y() - d)); clockwise = false; break;
case kDown: cursor.SetY(std::min(cursorLimits.Bottom(), cursor.Y() + d)); clockwise = true; break;
case kLeft: cursor.SetX(std::max(cursorLimits.Left(), cursor.X() - d)); clockwise = false; break;
case kRight: cursor.SetX(std::min(cursorLimits.Right(), cursor.X() + d)); clockwise = true; break;
case kRed: if (destroyablePixmap) {
osd->DestroyPixmap(destroyablePixmap);
destroyablePixmap = NULL;
}
break;
case kGreen: if (toggleablePixmap)
toggleablePixmap->SetLayer(-toggleablePixmap->Layer());
break;
case kOk: return osEnd;
default: return state;
}
state = osContinue;
}
return state;
}
开发者ID:MichaelE1000,项目名称:vdr,代码行数:27,代码来源:osddemo.c
示例12: Flush
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();
}
开发者ID:BackupTheBerlios,项目名称:macvdr-svn,代码行数:31,代码来源:skinsttng.c
示例13: SetVolume
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;
}
}
}
开发者ID:BackupTheBerlios,项目名称:macvdr-svn,代码行数:27,代码来源:skinsttng.c
示例14: SetMessage
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));
}
开发者ID:Moorviper,项目名称:zen2vdr,代码行数:8,代码来源:skinclassic.c
示例15: SetTitle
void cSkinSTTNGDisplayMenu::SetTitle(const char *Title)
{
const cFont *font = cFont::GetFont(fontOsd);
const char *VDR = " VDR";
int w = font->Width(VDR);
osd->DrawText(x3 + 5, y0, Title, Theme.Color(clrMenuTitle), frameColor, font, x4 - w - x3 - 5);
osd->DrawText(x4 - w, y0, VDR, frameColor, clrBlack, font);
}
开发者ID:BackupTheBerlios,项目名称:macvdr-svn,代码行数:8,代码来源:skinsttng.c
示例16: SetMessage
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();
}
开发者ID:BackupTheBerlios,项目名称:macvdr-svn,代码行数:11,代码来源:skinsttng.c
示例17: cRect
cPixmap *cTrueColorDemo::CreateTextPixmap(const char *s, int Line, int Layer, tColor ColorFg, tColor ColorBg, const cFont *Font)
{
const int h = Font->Height(s);
int w = Font->Width(s);
cPixmap *Pixmap = osd->CreatePixmap(Layer, cRect((osd->Width() - w) / 2, Line, w, h));
if (Pixmap) {
Pixmap->Clear();
Pixmap->SetAlpha(0);
Pixmap->DrawText(cPoint(0, 0), s, ColorFg, ColorBg, Font);
}
return Pixmap;
}
开发者ID:flensrocker,项目名称:vdr-yavdr,代码行数:12,代码来源:osddemo.c
示例18: Flush
void cSkinClassicDisplayMenu::Flush(void)
{
cString date = DayDateTime();
if (!*lastDate || strcmp(date, lastDate)) {
const cFont *font = cFont::GetFont(fontOsd);
int w = font->Width(date);
osd->DrawText(x3 - w - TextFrame, y0, date, Theme.Color(clrMenuDate), Theme.Color(clrMenuTitleBg), font, w);
lastDate = date;
dateWidth = max(w + TextFrame, dateWidth);
}
osd->Flush();
}
开发者ID:Moorviper,项目名称:zen2vdr,代码行数:12,代码来源:skinclassic.c
示例19: SetAudioChannel
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);
}
开发者ID:BackupTheBerlios,项目名称:macvdr-svn,代码行数:13,代码来源:skinsttng.c
示例20: SetButtons
void cSkinClassicDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
{
const cFont *font = cFont::GetFont(fontOsd);
int w = x3 - x0;
int t0 = x0;
int t1 = x0 + w / 4;
int t2 = x0 + w / 2;
int t3 = x3 - w / 4;
int t4 = x3;
osd->DrawText(t0, y4, Red, Theme.Color(clrButtonRedFg), Red ? Theme.Color(clrButtonRedBg) : Theme.Color(clrBackground), font, t1 - t0, 0, taCenter);
osd->DrawText(t1, y4, Green, Theme.Color(clrButtonGreenFg), Green ? Theme.Color(clrButtonGreenBg) : Theme.Color(clrBackground), font, t2 - t1, 0, taCenter);
osd->DrawText(t2, y4, Yellow, Theme.Color(clrButtonYellowFg), Yellow ? Theme.Color(clrButtonYellowBg) : Theme.Color(clrBackground), font, t3 - t2, 0, taCenter);
osd->DrawText(t3, y4, Blue, Theme.Color(clrButtonBlueFg), Blue ? Theme.Color(clrButtonBlueBg) : Theme.Color(clrBackground), font, t4 - t3, 0, taCenter);
}
开发者ID:Moorviper,项目名称:zen2vdr,代码行数:14,代码来源:skinclassic.c
注:本文中的cOsd类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论