-
Notifications
You must be signed in to change notification settings - Fork 342
/
eitfixup.h
236 lines (220 loc) · 7.88 KB
/
eitfixup.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
/*
* Copyright 2004 - Taylor Jacob (rtjacob at earthlink.net)
*/
#ifndef EITFIXUP_H
#define EITFIXUP_H
#include <QRegExp>
#include "programdata.h"
typedef QMap<uint,uint> QMap_uint_t;
/// EIT Fix Up Functions
class EITFixUp
{
protected:
// max length of subtitle field in db.
static const uint SUBTITLE_MAX_LEN = 128;
// max number of words included in a subtitle
static const uint kMaxToTitle = 14;
// max number of words up to a period, question mark
static const uint kDotToTitle = 9;
// max number of question/exclamation marks
static const uint kMaxQuestionExclamation = 2;
// max number of difference in words between a period and a colon
static const uint kMaxDotToColon = 5;
// minimum duration of an event to consider it as movie
static const int kMinMovieDuration = 75*60;
public:
enum FixUpType
{
kFixNone = 0x0000,
// Regular fixups
kFixGenericDVB = 0x0001,
kFixBell = 0x0002,
kFixUK = 0x0004,
kFixPBS = 0x0008,
kFixComHem = 0x0010,
kFixSubtitle = 0x0020,
kFixAUStar = 0x0040,
kFixMCA = 0x0080,
kFixRTL = 0x0100,
kFixFI = 0x0200,
kFixPremiere = 0x0400,
kFixHDTV = 0x0800,
kFixNL = 0x1000,
kFixCategory = 0x8000,
kFixNO = 0x10000,
kFixNRK_DVBT = 0x20000,
kFixDish = 0x40000,
kFixDK = 0x80000,
kFixAUFreeview = 0x100000,
kFixAUDescription = 0x200000,
kFixAUNine = 0x400000,
kFixAUSeven = 0x800000,
// Early fixups
kEFixForceISO8859_1 = 0x2000,
kEFixForceISO8859_15 = 0x4000,
kEFixForceISO8859_9 = 0x80000,
};
EITFixUp();
void Fix(DBEventEIT &event) const;
/** Corrects starttime to the multiple of a minute.
* Used for providers who fail to handle leap seconds timely. Changes the
* starttime not more than 3 seconds. Sshould only be used if the
* duration is the multiple of a minute. */
static void TimeFix(QDateTime &dt)
{
int secs = dt.time().second();
if (secs < 4)
dt = dt.addSecs(-secs);
if (secs > 56)
dt = dt.addSecs(60 - secs);
}
private:
void FixBellExpressVu(DBEventEIT &event) const; // Canada DVB-S
void SetUKSubtitle(DBEventEIT &event) const;
void FixUK(DBEventEIT &event) const; // UK DVB-T
void FixPBS(DBEventEIT &event) const; // USA ATSC
void FixComHem(DBEventEIT &event,
bool parse_subtitle) const; // Sweden DVB-C
void FixAUStar(DBEventEIT &event) const; // Australia DVB-S
void FixAUFreeview(DBEventEIT &event) const; // Australia DVB-T
void FixAUNine(DBEventEIT &event) const;
void FixAUSeven(DBEventEIT &event) const;
void FixAUDescription(DBEventEIT &event) const;
void FixMCA(DBEventEIT &event) const; // MultiChoice Africa DVB-S
void FixRTL(DBEventEIT &event) const; // RTL group DVB
void FixFI(DBEventEIT &event) const; // Finland DVB-T
void FixPremiere(DBEventEIT &event) const; // german pay-tv Premiere
void FixNL(DBEventEIT &event) const; // Netherlands DVB-C
void FixCategory(DBEventEIT &event) const; // Generic Category fixes
void FixNO(DBEventEIT &event) const; // Norwegian DVB-S
void FixNRK_DVBT(DBEventEIT &event) const; // Norwegian NRK DVB-T
void FixDK(DBEventEIT &event) const; // Danish YouSee DVB-C
static QString AddDVBEITAuthority(uint chanid, const QString &id);
const QRegExp m_bellYear;
const QRegExp m_bellActors;
const QRegExp m_bellPPVTitleAllDayHD;
const QRegExp m_bellPPVTitleAllDay;
const QRegExp m_bellPPVTitleHD;
const QRegExp m_bellPPVSubtitleAllDay;
const QRegExp m_bellPPVDescriptionAllDay;
const QRegExp m_bellPPVDescriptionAllDay2;
const QRegExp m_bellPPVDescriptionEventId;
const QRegExp m_dishPPVTitleHD;
const QRegExp m_dishPPVTitleColon;
const QRegExp m_dishPPVSpacePerenEnd;
const QRegExp m_dishDescriptionNew;
const QRegExp m_dishDescriptionFinale;
const QRegExp m_dishDescriptionFinale2;
const QRegExp m_dishDescriptionPremiere;
const QRegExp m_dishDescriptionPremiere2;
const QRegExp m_dishPPVCode;
const QRegExp m_ukThen;
const QRegExp m_ukNew;
const QRegExp m_ukNewTitle;
const QRegExp m_ukCEPQ;
const QRegExp m_ukColonPeriod;
const QRegExp m_ukDotSpaceStart;
const QRegExp m_ukDotEnd;
const QRegExp m_ukSpaceColonStart;
const QRegExp m_ukSpaceStart;
const QRegExp m_ukSeries;
const QRegExp m_ukCC;
const QRegExp m_ukYear;
const QRegExp m_uk24ep;
const QRegExp m_ukStarring;
const QRegExp m_ukBBC7rpt;
const QRegExp m_ukDescriptionRemove;
const QRegExp m_ukTitleRemove;
const QRegExp m_ukDoubleDotEnd;
const QRegExp m_ukDoubleDotStart;
const QRegExp m_ukTime;
const QRegExp m_ukBBC34;
const QRegExp m_ukYearColon;
const QRegExp m_ukExclusionFromSubtitle;
const QRegExp m_ukCompleteDots;
const QRegExp m_ukQuotedSubtitle;
const QRegExp m_ukAllNew;
const QRegExp m_comHemCountry;
const QRegExp m_comHemDirector;
const QRegExp m_comHemActor;
const QRegExp m_comHemHost;
const QRegExp m_comHemSub;
const QRegExp m_comHemRerun1;
const QRegExp m_comHemRerun2;
const QRegExp m_comHemTT;
const QRegExp m_comHemPersSeparator;
const QRegExp m_comHemPersons;
const QRegExp m_comHemSubEnd;
const QRegExp m_comHemSeries1;
const QRegExp m_comHemSeries2;
const QRegExp m_comHemTSub;
const QRegExp m_mcaIncompleteTitle;
const QRegExp m_mcaCompleteTitlea;
const QRegExp m_mcaCompleteTitleb;
const QRegExp m_mcaSubtitle;
const QRegExp m_mcaSeries;
const QRegExp m_mcaCredits;
const QRegExp m_mcaAvail;
const QRegExp m_mcaActors;
const QRegExp m_mcaActorsSeparator;
const QRegExp m_mcaYear;
const QRegExp m_mcaCC;
const QRegExp m_mcaDD;
const QRegExp m_RTLrepeat;
const QRegExp m_RTLSubtitle;
const QRegExp m_RTLSubtitle1;
const QRegExp m_RTLSubtitle2;
const QRegExp m_RTLSubtitle3;
const QRegExp m_RTLSubtitle4;
const QRegExp m_RTLSubtitle5;
const QRegExp m_RTLEpisodeNo1;
const QRegExp m_RTLEpisodeNo2;
const QRegExp m_fiRerun;
const QRegExp m_fiRerun2;
const QRegExp m_dePremiereInfos;
const QRegExp m_dePremiereOTitle;
const QRegExp m_nlTxt;
const QRegExp m_nlWide;
const QRegExp m_nlRepeat;
const QRegExp m_nlHD;
const QRegExp m_nlSub;
const QRegExp m_nlSub2;
const QRegExp m_nlActors;
const QRegExp m_nlPres;
const QRegExp m_nlPersSeparator;
const QRegExp m_nlRub;
const QRegExp m_nlYear1;
const QRegExp m_nlYear2;
const QRegExp m_nlDirector;
const QRegExp m_nlCat;
const QRegExp m_nlOmroep;
const QRegExp m_noRerun;
const QRegExp m_noHD;
const QRegExp m_noColonSubtitle;
const QRegExp m_noNRKCategories;
const QRegExp m_noPremiere;
const QRegExp m_Stereo;
const QRegExp m_dkEpisode;
const QRegExp m_dkPart;
const QRegExp m_dkSubtitle1;
const QRegExp m_dkSubtitle2;
const QRegExp m_dkSeason1;
const QRegExp m_dkSeason2;
const QRegExp m_dkFeatures;
const QRegExp m_dkWidescreen;
const QRegExp m_dkDolby;
const QRegExp m_dkSurround;
const QRegExp m_dkStereo;
const QRegExp m_dkReplay;
const QRegExp m_dkTxt;
const QRegExp m_dkHD;
const QRegExp m_dkActors;
const QRegExp m_dkPersonsSeparator;
const QRegExp m_dkDirector;
const QRegExp m_dkYear;
const QRegExp m_AUFreeviewSY;//subtitle, year
const QRegExp m_AUFreeviewY;//year
const QRegExp m_AUFreeviewYC;//year, cast
const QRegExp m_AUFreeviewSYC;//subtitle, year, cast
};
#endif // EITFIXUP_H