87 for (
int i = 1; i <
MaxTabs; i++)
100 static char buffer[1000];
102 const char *b = strchrnul(a,
'\t');
103 while (*b && Tab-- > 0) {
105 b = strchrnul(a,
'\t');
108 return (Tab <= 0) ? a : NULL;
109 unsigned int n = b - a;
110 if (n >=
sizeof(buffer))
111 n =
sizeof(buffer) - 1;
112 strncpy(buffer, a, n);
138 int p =
Pos(Current);
144 int p1 =
Pos(m->Position());
151 Mark(p1, Start, m->Position() ==
Current, ColorMark, ColorCurrent);
160 DrawRectangle(x, 0, x, Height() - 1, ColorMark);
161 const int d = Height() / (Current ? 3 : 9);
162 for (
int i = 0; i < d; i++) {
163 int h = Start ? i : Height() - 1 - i;
164 DrawRectangle(x - d + i, h, x + d - i, h, Current ? ColorCurrent : ColorMark);
219 if (strcmp(Skin->Name(), Name) == 0) {
220 isyslog(
"setting current skin to \"%s\"", Name);
228 isyslog(
"skin \"%s\" not available - using \"%s\" instead", Name,
current->Name());
230 esyslog(
"ERROR: no skin available");
237 dsyslog(
"cSkins::Message() called from background thread - ignored! (Use cSkins::QueueMessage() instead)");
280 dsyslog(
"cSkins::QueueMessage() called with mtStatus - ignored!");
293 dsyslog(
"cSkins::QueueMessage() called with empty message from main thread - ignored!");
299 dsyslog(
"cSkins::QueueMessage() called from main thread with Timeout = %d - ignored!", Timeout);
304 SkinQueuedMessages.
Add(m);
320 if (m->state == 0 && m->timeout == -1)
336 dsyslog(
"cSkins::ProcessQueuedMessages() called from background thread - ignored!");
353 if (msg->
state == 1) {
366 if (m && m->
state == 2) {
367 SkinQueuedMessages.
Del(m);
static int AvgCharWidth(void)
Returns the average width of a character in pixel (just a raw estimate).
void Add(cListObject *Object, cListObject *After=NULL)
const char * Title(char Delimiter= ' ', bool NewIndicator=false, int Level=-1) const
int QueueMessage(eMessageType Type, const char *s, int Seconds=0, int Timeout=0)
Like Message(), but this function may be called from a background thread.
void ProcessQueuedMessages(void)
Processes the first queued message, if any.
static tThreadId IsMainThread(void)
cSkinDisplayMessage * displayMessage
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
cSkinQueuedMessage(eMessageType Type, const char *s, int Seconds, int Timeout)
cProgressBar(int Width, int Height, int Current, int Total, const cMarks *Marks, tColor ColorSeen, tColor ColorRest, tColor ColorSelected, tColor ColorMark, tColor ColorCurrent)
virtual void SetRecording(const cRecording *Recording)
Sets the recording that is currently being played.
cList< cSkinQueuedMessage > SkinQueuedMessages
void Scroll(bool Up, bool Page)
static cSkinDisplay * current
virtual void SetMarks(const cMarks *Marks)
Sets the editing marks to Marks, which shall be used to display the progress bar through a cProgressB...
eKeys Wait(int Seconds=0, bool KeepChar=false)
T * Next(const T *object) const
static void Save(const char *SkinName, cTheme *Theme)
virtual void Flush(void)
Actually draws the OSD display to the output device.
static void MsgOsdStatusMessage(const char *Message)
virtual void Clear(void)
Free up all registered skins.
cSkin(const char *Name, cTheme *Theme=NULL)
Creates a new skin class, with the given Name and Theme.
void Flush(void)
Flushes the currently active cSkinDisplay, if any.
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...
static tThreadId ThreadId(void)
bool TimedWait(cMutex &Mutex, int TimeoutMs)
eKeys Message(eMessageType Type, const char *s, int Seconds=0)
Displays the given message, either through a currently visible display object that is capable of doin...
void Del(cListObject *Object, bool DeleteObject=true)
static void MsgOsdClear(void)
void Mark(int x, bool Start, bool Current, tColor ColorMark, tColor ColorCurrent)
const cMarks * marks
< This class implements the progress display used during replay of a recording.
virtual void SetTitle(const char *Title)=0
Sets the title of the recording.
cSkin * Current(void)
Returns a pointer to the current skin.
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
T * Prev(const T *object) const
bool SetCurrent(const char *Name=NULL)
Sets the current skin to the one indicated by name.
virtual ~cSkinQueuedMessage()