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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
/*
* $Id: string.h,v 1.18 2005/05/30 13:03:13 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_XML_STRING_H
#define VDR_TEXT2SKIN_XML_STRING_H
#include "xml/type.h"
#include <string>
#include <vector>
enum exToken {
tDateTime,
tFreeDiskSpace,
tAudioTrack,
tAudioChannel,
// Channel Display
tChannelNumber,
tChannelName,
tChannelShortName,
tChannelBouquet,
tChannelPortal,
tChannelSource,
tTChannelID, // (name clash)
// next 9 also in Menu
tPresentStartDateTime,
tPresentVPSDateTime,
tCurrentEventsTitle1,
tCurrentEventsStartDateTime1,
tCurrentEventsStopDateTime1,
tCurrentEventsChannelNumber1,
tCurrentEventsChannelName1,
tCurrentEventsIsRecording1,
tCurrentEventsTitle2,
tCurrentEventsStartDateTime2,
tCurrentEventsStopDateTime2,
tCurrentEventsChannelNumber2,
tCurrentEventsChannelName2,
tCurrentEventsIsRecording2,
tCurrentEventsTitle3,
tCurrentEventsStartDateTime3,
tCurrentEventsStopDateTime3,
tCurrentEventsChannelNumber3,
tCurrentEventsChannelName3,
tCurrentEventsIsRecording3,
tTimerConflicts,
tPresentEndDateTime,
tPresentDuration,
tPresentProgress,
tPresentRemaining,
tPresentLanguageCode,
tPresentLanguageDescription,
tPresentVideoAR,
tPresentEventID,
tPresentTitle,
tPresentShortText,
tPresentDescription,
tFollowingStartDateTime,
tFollowingVPSDateTime,
tFollowingEndDateTime,
tFollowingDuration,
tFollowingTitle,
tFollowingShortText,
tFollowingDescription,
tLanguage,
tHasTeletext,
tChannelHasTeletext, // alias
tHasMultilang,
tChannelHasMultilang, // alias
tHasDolby,
tChannelHasDolby, // alias
tIsEncrypted,
tChannelIsEncrypted, // alias
tIsRadio,
tChannelIsRadio, // alias
// next 2 also in all other displays
tIsRecording,
tCurrentRecording,
// next 3 also in Menu
tHasVPS,
tHasTimer,
tIsRunning,
tChannelHasVPS, // alias
// next 3 also in Menu
tPresentHasTimer, // alias
tPresentIsRunning, // alias
tPresentHasVPS,
tFollowingHasTimer,
tFollowingIsRunning,
tFollowingHasVPS,
// VolumeDisplay
tVolumeCurrent,
tVolumeTotal,
tIsMute,
tVolumeIsMute, // alias
// Message Display (also in all other displays)
tMessage,
tMessageStatus,
tMessageInfo,
tMessageWarning,
tMessageError,
// Replay Display
tReplayTitle,
tReplayPositionIndex,
tReplayDurationIndex,
tReplayPrompt,
tReplayName,
tReplayDateTime,
tReplayShortText,
tReplayDescription,
tReplayLanguageCode,
tReplayLanguageDescription,
tReplayVideoAR,
tIsPlaying,
tReplayIsPlaying, // alias
tIsFastForward,
tReplayIsFastForward, // alias
tIsFastRewind,
tReplayIsFastRewind, // alias
tIsSlowForward,
tReplayIsSlowForward, // alias
tIsSlowRewind,
tReplayIsSlowRewind, // alias
tIsPausing,
tReplayIsPausing, // alias
tReplayPosition,
tReplayDuration,
tReplayRemaining,
tReplayMode,
tReplayIsShuffle,
tReplayIsLoop,
// Menu Page
tMenuTitle,
tMenuGroup,
tIsMenuGroup,
tMenuItem,
tIsMenuItem,
tMenuCurrent,
tIsMenuCurrent,
tMenuText,
// Recordings Page
tRecordingName,
tRecordingFilename,
tRecordingDateTime,
tRecordingTitle,
tRecordingShortText,
tRecordingDescription,
tRecordingLanguageCode,
tFrontendSTR,
tFrontendSNR,
tFrontendHasLock,
tFrontendHasSignal,
tRecordingPriority,
tRecordingLifetime,
tRecordingVideoAR,
tRecordingSize,
tRecordingLength,
tRecordingCuttedLength,
tOsdWidth,
tOsdHeight,
tRecordingLanguageDescription,
// next four also in Channel and Replay display (if supported by vdr/plugin)
tButtonRed,
tButtonGreen,
tButtonYellow,
tButtonBlue,
tCanScrollUp,
tCanScrollDown,
#define __COUNT_TOKEN__ (tCanScrollDown + 1)
};
enum exAttrib {
aNone,
aNumber,
aString,
aClean,
aRest
#define __COUNT_ATTRIB__ (aRest + 1)
};
struct txAttrib {
exAttrib Type;
std::string Text;
int Number;
txAttrib(const std::string &a): Type(aString), Text(a), Number(0) {}
txAttrib(int n): Type(aNumber), Text(""), Number(n) {}
txAttrib(exAttrib t): Type(t), Text(""), Number(0) {}
txAttrib(void): Type(aNone), Text(""), Number(0) {}
friend bool operator== (const txAttrib &A, const txAttrib &B);
friend bool operator< (const txAttrib &A, const txAttrib &B);
};
inline bool operator== (const txAttrib &A, const txAttrib &B)
{
return A.Type == B.Type
&& A.Text == B.Text
&& A.Number == B.Number;
}
inline bool operator< (const txAttrib &A, const txAttrib &B)
{
return A.Type == B.Type
? A.Text == B.Text
? A.Number < B.Number
: A.Text < B.Text
: A.Type < B.Type;
}
struct txToken {
exToken Type;
uint Offset;
txAttrib Attrib;
int Index;
int Tab;
txToken(void): Index(-1), Tab(-1) {}
txToken(exToken t, uint o, const std::string &a):
Type(t), Offset(o), Attrib(a), Index(-1), Tab(-1) {}
friend bool operator< (const txToken &A, const txToken &B);
static std::string Token(const txToken &Token);
};
inline bool operator< (const txToken &A, const txToken &B)
{
return A.Type == B.Type
? A.Attrib == B.Attrib
? A.Index == B.Index
? A.Tab < B.Tab
: A.Index < B.Index
: A.Attrib < B.Attrib
: A.Type < B.Type;
}
class cxObject;
class cxSkin;
class cxString {
private:
typedef std::vector<cxString*> tStringList;
static tStringList mStrings;
cxObject *mObject;
cxSkin *mSkin;
std::string mText;
std::string mOriginal;
std::vector<txToken> mTokens;
bool mTranslate;
public:
static void Reparse(void);
cxString(cxObject *Parent, bool Translate);
~cxString();
bool Parse(const std::string &Text, bool Translate = false);
cxType Evaluate(void) const;
void SetListIndex(uint Index, int Tab);
cxObject *Object(void) const { return mObject; }
cxSkin *Skin(void) const { return mSkin; }
};
inline void cxString::SetListIndex(uint Index, int Tab)
{
for (uint i = 0; i < mTokens.size(); ++i) {
mTokens[i].Index = Index;
mTokens[i].Tab = Tab;
}
}
#endif // VDR_TEXT2SKIN_XML_STRING_H
|