This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
osd_status.h
86 lines (70 loc) · 2.45 KB
/
osd_status.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef VDR_LIVE_OSD_STATUS_H
#define VDR_LIVE_OSD_STATUS_H
// STL headers need to be before VDR tools.h (included by <vdr/status.h>)
#include <string>
#include <vdr/status.h>
namespace vdrlive {
class cLiveOsdItem: public cListObject {
private:
std::string text;
bool selected;
public:
std::string Text() const { return text; }
int isSelected() const {return selected;}
void Select(const bool doSelect) { selected= doSelect; };
void Update(const char* Text) { text = Text ? Text : ""; };
cLiveOsdItem(const char* Text):text(),selected(false) { text = Text ? Text : ""; };
~cLiveOsdItem() { }
};
class OsdStatusMonitor: public cStatus
{
friend OsdStatusMonitor& LiveOsdStatusMonitor();
public:
enum { MaxTabs = 6 };
private:
OsdStatusMonitor();
OsdStatusMonitor( OsdStatusMonitor const& );
std::string title;
std::string message;
std::string red;
std::string green;
std::string yellow;
std::string blue;
std::string text;
int selected;
cList<cLiveOsdItem> items;
unsigned short tabs[MaxTabs];
clock_t lastUpdate;
protected:
// static void append(char *&tail, char type, const char *src, int max);
public:
std::string const GetTitle() const {return title;}
std::string const GetMessage() const {return message;}
std::string const GetRed() const {return red;}
std::string const GetGreen() const {return green;}
std::string const GetYellow() const {return yellow;}
std::string const GetBlue() const {return blue;}
std::string const GetText() const {return text;}
virtual std::string const GetHtml();
virtual std::string const GetTitleHtml();
virtual std::string const GetMessageHtml();
virtual std::string const GetRedHtml();
virtual std::string const GetGreenHtml();
virtual std::string const GetYellowHtml();
virtual std::string const GetBlueHtml();
virtual std::string const GetTextHtml();
virtual std::string const GetButtonsHtml();
virtual std::string const GetItemsHtml();
virtual void OsdClear();
virtual void OsdTitle(const char *Title);
virtual void OsdStatusMessage(const char *Message);
virtual void OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue);
virtual void OsdTextItem(const char *Text, bool Scroll);
virtual void OsdItem(const char *Text, int Index);
virtual void OsdCurrentItem(const char *Text);
virtual ~OsdStatusMonitor();
std::string const EncodeHtml(const std::string& html);
};
OsdStatusMonitor& LiveOsdStatusMonitor();
} // namespace vdrlive
#endif // VDR_LIVE_STATUS_H