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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
#include "displaymenu.h"
cSDDisplayMenu::cSDDisplayMenu(cViewMenu *menuView) {
view = menuView;
bool ok = false;
if (view)
ok = view->Init();
if (ok) {
SetCurrentRecording();
} else {
esyslog("skindesigner: Error initiating displaymenu view - aborting");
}
}
cSDDisplayMenu::~cSDDisplayMenu() {
if (view)
view->Close();
}
void cSDDisplayMenu::Scroll(bool Up, bool Page) {
if (view)
view->KeyDetailView(Up, Page);
}
int cSDDisplayMenu::MaxItems(void) {
if (view)
return view->NumListItems();
return 0;
}
void cSDDisplayMenu::Clear(void) {
if (view)
view->Clear();
}
void cSDDisplayMenu::SetMenuCategory(eMenuCategory MenuCat) {
if (view)
view->SetSubView(MenuCat);
}
void cSDDisplayMenu::SetMenuSortMode(eMenuSortMode MenuSortMode) {
if (view)
view->SetSortMode(MenuSortMode);
}
eMenuOrientation cSDDisplayMenu::MenuOrientation(void) {
if (view)
return view->MenuOrientation();
return moVertical;
}
void cSDDisplayMenu::SetPluginMenu(int plugId, int menuId, int type, bool init) {
if (view)
view->SetPluginMenu(plugId, menuId);
}
void cSDDisplayMenu::SetTitle(const char *Title) {
if (view)
view->SetTitleHeader(Title);
}
void cSDDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) {
if (view)
view->SetMenuButtons(Red, Green, Yellow, Blue);
}
void cSDDisplayMenu::SetMessage(eMessageType Type, const char *Text) {
if (view)
view->SetMessage(Type, Text);
}
bool cSDDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch, bool TimerActive) {
if (!view)
return false;
if (Index == 0) {
view->SetChannelHeader(Event);
}
return view->SetItemEvent(Event, Index, Current, Selectable, Channel, WithDate, TimerMatch);
}
bool cSDDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable) {
if (!view)
return false;
return view->SetItemTimer(Timer, Index, Current, Selectable);
}
bool cSDDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider) {
if (!view)
return false;
return view->SetItemChannel(Channel, Index, Current, Selectable, WithProvider);
}
bool cSDDisplayMenu::SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New) {
if (!view)
return false;
return view->SetItemRecording(Recording, Index, Current, Selectable, Level, Total, New);
}
void cSDDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) {
if (!view)
return;
view->SetItem(Text, Index, Current, Selectable);
SetEditableWidth(view->GetListWidth() / 2);
}
bool cSDDisplayMenu::SetItemPlugin(skindesignerapi::cTokenContainer *tk, int Index, bool Current, bool Selectable) {
if (!view)
return false;
bool ok = view->SetItemPlugin(tk, Index, Current, Selectable);
return ok;
}
void cSDDisplayMenu::SetTabs(int Tab1, int Tab2, int Tab3, int Tab4, int Tab5) {
if (view)
view->SetTabs(Tab1, Tab2, Tab3, Tab4, Tab5);
}
int cSDDisplayMenu::GetTextAreaWidth(void) const {
if (view)
return view->GetTextAreaWidth();
return 0;
}
const cFont *cSDDisplayMenu::GetTextAreaFont(bool FixedFont) const {
if (view)
return view->GetTextAreaFont();
return NULL;
}
void cSDDisplayMenu::SetScrollbar(int Total, int Offset) {
if (view)
view->SetScrollbar(Total, Offset);
}
void cSDDisplayMenu::SetEvent(const cEvent *Event) {
if (view) {
if (view->MenuCat() != mcEvent)
view->SetSubView(mcEvent);
view->SetEvent(Event);
}
}
void cSDDisplayMenu::SetRecording(const cRecording *Recording) {
if (view) {
if (view->MenuCat() != mcRecordingInfo)
view->SetSubView(mcRecordingInfo);
view->SetRecording(Recording);
}
}
void cSDDisplayMenu::SetText(const char *Text, bool FixedFont) {
if (view) {
if (view->MenuCat() != mcText)
view->SetSubView(mcText);
view->SetText(Text);
}
}
bool cSDDisplayMenu::SetPluginText(skindesignerapi::cTokenContainer *tk) {
bool ok = false;
if (view)
ok = view->SetPluginText(tk);
return ok;
}
void cSDDisplayMenu::Flush(void) {
if (view)
view->Flush();
}
void cSDDisplayMenu::SetCurrentRecording(void) {
cControl *control = cControl::Control();
if (!control) {
view->SetCurrentRecording(NULL);
return;
}
const cRecording *recording = control->GetRecording();
if (!recording) {
view->SetCurrentRecording(NULL);
return;
}
view->SetCurrentRecording(recording->FileName());
}
|