//_________________________________________________________ static char *makeErrString (char *s, SlotRefNum ref, int errCode, short in) { static char out[1024]; char buff[kGetErrorTextBuf]; TSlotInfos infos; if(in) midiInGetErrorText(errCode, buff, kGetErrorTextBuf); else midiOutGetErrorText(errCode, buff, kGetErrorTextBuf); infos.name[0] = 0; MidiGetSlotInfos (ref, &infos); wsprintf (out, "%s %s : %s error %d\n\t%s\n", DateString(), infos.name, s, errCode, buff); return out; }
void cSkinClassicDisplayMenu::SetRecording(const cRecording *Recording) { if (!Recording) return; const cRecordingInfo *Info = Recording->Info(); const cFont *font = cFont::GetFont(fontOsd); int y = y2; cTextScroller ts; char t[32]; snprintf(t, sizeof(t), "%s %s", *DateString(Recording->start), *TimeString(Recording->start)); ts.Set(osd, x1, y, x2 - x1, y3 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground)); y += ts.Height(); if (Info->GetEvent()->ParentalRating()) { cString buffer = cString::sprintf(" %s ", *Info->GetEvent()->GetParentalRatingString()); const cFont *font = cFont::GetFont(fontSml); int w = font->Width(buffer); osd->DrawText(x3 - w, y, buffer, Theme.Color(clrMenuEventVpsFg), Theme.Color(clrMenuEventVpsBg), font, w); } y += font->Height(); const char *Title = Info->Title(); if (isempty(Title)) Title = Recording->Name(); ts.Set(osd, x1, y, x2 - x1, y3 - 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, x1, y, x2 - x1, y3 - y, Info->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground)); y += ts.Height(); } for (int i = 0; Info->GetEvent()->Contents(i); i++) { const char *s = Info->GetEvent()->ContentToString(Info->GetEvent()->Contents(i)); if (!isempty(s)) { const cFont *font = cFont::GetFont(fontSml); ts.Set(osd, x1, y, x2 - x1, y3 - y, s, font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground)); y += ts.Height(); } } y += font->Height(); if (!isempty(Info->Description())) { textScroller.Set(osd, x1, y, x2 - x1, y3 - y, Info->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground)); SetTextScrollbar(); } }
cString cPluginSvdrpdemo::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) { if (strcasecmp(Command, "DATE") == 0) { // we use the default reply code here return DateString(time(NULL)); } else if (strcasecmp(Command, "TIME") == 0) { ReplyCode = 901; if (*Option) { if (strcasecmp(Option, "RAW") == 0) return cString::sprintf("%ld\nThis is the number of seconds since the epoch\nand a demo of a multi-line reply", time(NULL)); else { ReplyCode = 504; return cString::sprintf("Unknown option: \"%s\"", Option); } } return TimeString(time(NULL)); } return NULL; }
void cSkinCursesDisplayMenu::SetRecording(const cRecording *Recording) { if (!Recording) return; const cRecordingInfo *Info = Recording->Info(); int y = 2; cTextScroller ts; char t[32]; snprintf(t, sizeof(t), "%s %s", *DateString(Recording->Start()), *TimeString(Recording->Start())); ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, t, &Font, clrYellow, clrBackground); y += ts.Height(); if (Info->GetEvent()->ParentalRating()) { cString buffer = cString::sprintf(" %s ", *Info->GetEvent()->GetParentalRatingString()); osd->DrawText(ScOsdWidth - Utf8StrLen(buffer), y, buffer, clrBlack, clrYellow, &Font); } y += 1; const char *Title = Info->Title(); if (isempty(Title)) Title = Recording->Name(); ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, Title, &Font, clrCyan, clrBackground); y += ts.Height(); if (!isempty(Info->ShortText())) { ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, Info->ShortText(), &Font, clrYellow, clrBackground); y += ts.Height(); } for (int i = 0; Info->GetEvent()->Contents(i); i++) { const char *s = Info->GetEvent()->ContentToString(Info->GetEvent()->Contents(i)); if (!isempty(s)) { ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, s, &Font, clrYellow, clrBackground); y += 1; } } y += 1; if (!isempty(Info->Description())) { textScroller.Set(osd, 0, y, ScOsdWidth - 2, ScOsdHeight - y - 2, Info->Description(), &Font, clrCyan, clrBackground); SetTextScrollbar(); } }
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(); } }
cString cEvent::GetDateString(void) const { return DateString(startTime); }