-
Notifications
You must be signed in to change notification settings - Fork 3
/
event.h
244 lines (237 loc) · 5.11 KB
/
event.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
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
/*
* event.h: A plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef _EVENT_H
#define _EVENT_H
#include <time.h>
#include <vdr/epg.h>
class cXMLTVStringList : public cVector<char *>
{
private:
char *buf;
public:
cXMLTVStringList(int Allocated = 10): cVector<char *>(Allocated)
{
buf=NULL;
}
virtual ~cXMLTVStringList();
void Sort(void)
{
cVector<char *>::Sort(CompareStrings);
}
const char *toString();
virtual void Clear(void);
};
class cXMLTVEvent
{
private:
char *title;
char *alttitle;
char *shorttext;
char *description;
char *eitdescription;
char *country;
char *origtitle;
char *audio;
char *sql_insert;
char *sql_update;
char *channelid;
char *source;
int year;
time_t starttime;
int duration;
int season;
int episode;
int episodeoverall;
bool weakid;
tEventID eventid;
tEventID eiteventid;
cXMLTVStringList video;
cXMLTVStringList credits;
cXMLTVStringList category;
cXMLTVStringList review;
cXMLTVStringList rating;
cXMLTVStringList starrating;
cXMLTVStringList pics;
int parentalRating;
char *removechar(char *s, char what);
public:
cXMLTVEvent();
~cXMLTVEvent();
void Clear();
void SetSource(const char *Source);
void SetChannelID(const char *ChannelID);
void SetTitle(const char *Title);
void SetAltTitle(const char *AltTitle);
void SetOrigTitle(const char *OrigTitle);
void SetShortText(const char *ShortText);
void SetDescription(const char *Description);
void SetEITDescription(const char *EITDescription);
void SetCountry(const char *Country);
void SetAudio(const char *Audio);
void AddDescription(const char *Description);
void AddVideo(const char *VType, const char *VContent);
void AddCredits(const char *CreditType, const char *Credit, const char *Addendum=NULL);
void AddCategory(const char *Category);
void AddReview(const char *Review);
void AddRating(const char *System, const char *Rating);
void AddStarRating(const char *System, const char *Rating);
void AddPics(const char *Pic);
void SetCredits(const char *Credits);
void SetCategory(const char *Category);
void SetReview(const char *Review);
void SetRating(const char *Rating);
void SetStarRating(const char *StarRating);
void SetVideo(const char *Video);
void SetPics(const char *Pics);
void CreateEventID(time_t StartTime);
void GetSQL(const char *Source, int SrcIdx, const char *ChannelID, char **Insert, char **Update);
bool WeakID()
{
return weakid;
}
cXMLTVStringList *Credits()
{
return &credits;
}
cXMLTVStringList *Category()
{
return &category;
}
cXMLTVStringList *Review()
{
return &review;
}
cXMLTVStringList *Rating()
{
return &rating;
}
cXMLTVStringList *StarRating()
{
return &starrating;
}
cXMLTVStringList *Video()
{
return &video;
}
cXMLTVStringList *Pics()
{
return &pics;
}
void SetSeason(int Season)
{
season=Season;
}
void SetEpisode(int Episode)
{
episode=Episode;
}
void SetEpisodeOverall(int EpisodeOverall)
{
episodeoverall=EpisodeOverall;
}
void SetYear(int Year)
{
year=Year;
}
void SetStartTime(time_t StartTime)
{
starttime=StartTime;
}
void SetDuration(int Duration)
{
duration=Duration;
}
void SetEventID(tEventID EventID)
{
eventid=EventID;
}
void SetEITEventID(tEventID EventID)
{
eiteventid=EventID;
}
int ParentalRating() const
{
return parentalRating;
}
int Duration() const
{
return duration;
}
time_t StartTime() const
{
return starttime;
}
bool HasTitle(void)
{
return (title!=NULL);
}
const char *ChannelID(void) const
{
return channelid;
}
const char *Source(void) const
{
return source;
}
const char *Title(void) const
{
return title;
}
const char *AltTitle(void) const
{
return alttitle;
}
const char *ShortText(void) const
{
return shorttext;
}
const char *Description(void) const
{
return description;
}
const char *EITDescription(void) const
{
return eitdescription;
}
const char *Country(void) const
{
return country;
}
int Year() const
{
return year;
}
const char *OrigTitle(void) const
{
return origtitle;
}
const char *Audio(void) const
{
return audio;
}
tEventID EventID(void) const
{
return eventid;
}
tEventID EITEventID(void) const
{
return eiteventid;
}
int Season(void)
{
return season;
}
int Episode(void)
{
return episode;
}
int EpisodeOverall(void)
{
return episodeoverall;
}
};
#endif