00001
00002
00003
00004
00005 #ifndef EITFIXUP_H
00006 #define EITFIXUP_H
00007
00008 #include <QRegExp>
00009
00010 #include "programdata.h"
00011
00012 typedef QMap<uint,uint> QMap_uint_t;
00013
00015 class EITFixUp
00016 {
00017 protected:
00018
00019 static const uint SUBTITLE_MAX_LEN = 128;
00020
00021 static const uint kMaxToTitle = 14;
00022
00023 static const uint kDotToTitle = 9;
00024
00025 static const uint kMaxQuestionExclamation = 2;
00026
00027 static const uint kMaxDotToColon = 5;
00028
00029 static const int kMinMovieDuration = 75*60;
00030
00031 public:
00032 enum FixUpType
00033 {
00034 kFixNone = 0x0000,
00035
00036
00037 kFixGenericDVB = 0x0001,
00038 kFixBell = 0x0002,
00039 kFixUK = 0x0004,
00040 kFixPBS = 0x0008,
00041 kFixComHem = 0x0010,
00042 kFixSubtitle = 0x0020,
00043 kFixAUStar = 0x0040,
00044 kFixMCA = 0x0080,
00045 kFixRTL = 0x0100,
00046 kFixFI = 0x0200,
00047 kFixPremiere = 0x0400,
00048 kFixHDTV = 0x0800,
00049 kFixNL = 0x1000,
00050 kFixCategory = 0x8000,
00051 kFixNO = 0x10000,
00052 kFixNRK_DVBT = 0x20000,
00053 kFixDish = 0x40000,
00054
00055
00056 kEFixForceISO8859_1 = 0x2000,
00057 kEFixForceISO8859_15 = 0x4000,
00058 };
00059
00060 EITFixUp();
00061
00062 void Fix(DBEventEIT &event) const;
00063
00068 static void TimeFix(QDateTime &dt)
00069 {
00070 int secs = dt.time().second();
00071 if (secs < 4)
00072 dt = dt.addSecs(-secs);
00073 if (secs > 56)
00074 dt = dt.addSecs(60 - secs);
00075 }
00076
00077 private:
00078 void FixBellExpressVu(DBEventEIT &event) const;
00079 void SetUKSubtitle(DBEventEIT &event) const;
00080 void FixUK(DBEventEIT &event) const;
00081 void FixPBS(DBEventEIT &event) const;
00082 void FixComHem(DBEventEIT &event,
00083 bool parse_subtitle) const;
00084 void FixAUStar(DBEventEIT &event) const;
00085 void FixMCA(DBEventEIT &event) const;
00086 void FixRTL(DBEventEIT &event) const;
00087 void FixFI(DBEventEIT &event) const;
00088 void FixPremiere(DBEventEIT &event) const;
00089 void FixNL(DBEventEIT &event) const;
00090 void FixCategory(DBEventEIT &event) const;
00091 void FixNO(DBEventEIT &event) const;
00092 void FixNRK_DVBT(DBEventEIT &event) const;
00093
00094 static QString AddDVBEITAuthority(uint chanid, const QString &id);
00095
00096 const QRegExp m_bellYear;
00097 const QRegExp m_bellActors;
00098 const QRegExp m_bellPPVTitleAllDayHD;
00099 const QRegExp m_bellPPVTitleAllDay;
00100 const QRegExp m_bellPPVTitleHD;
00101 const QRegExp m_bellPPVSubtitleAllDay;
00102 const QRegExp m_bellPPVDescriptionAllDay;
00103 const QRegExp m_bellPPVDescriptionAllDay2;
00104 const QRegExp m_bellPPVDescriptionEventId;
00105 const QRegExp m_dishPPVTitleHD;
00106 const QRegExp m_dishPPVTitleColon;
00107 const QRegExp m_dishPPVSpacePerenEnd;
00108 const QRegExp m_dishDescriptionNew;
00109 const QRegExp m_dishDescriptionFinale;
00110 const QRegExp m_dishDescriptionFinale2;
00111 const QRegExp m_dishDescriptionPremiere;
00112 const QRegExp m_dishDescriptionPremiere2;
00113 const QRegExp m_dishPPVCode;
00114 const QRegExp m_ukThen;
00115 const QRegExp m_ukNew;
00116 const QRegExp m_ukCEPQ;
00117 const QRegExp m_ukColonPeriod;
00118 const QRegExp m_ukDotSpaceStart;
00119 const QRegExp m_ukDotEnd;
00120 const QRegExp m_ukSpaceColonStart;
00121 const QRegExp m_ukSpaceStart;
00122 const QRegExp m_ukSeries;
00123 const QRegExp m_ukCC;
00124 const QRegExp m_ukYear;
00125 const QRegExp m_uk24ep;
00126 const QRegExp m_ukStarring;
00127 const QRegExp m_ukBBC7rpt;
00128 const QRegExp m_ukDescriptionRemove;
00129 const QRegExp m_ukTitleRemove;
00130 const QRegExp m_ukDoubleDotEnd;
00131 const QRegExp m_ukDoubleDotStart;
00132 const QRegExp m_ukTime;
00133 const QRegExp m_ukBBC34;
00134 const QRegExp m_ukYearColon;
00135 const QRegExp m_ukExclusionFromSubtitle;
00136 const QRegExp m_ukCompleteDots;
00137 const QRegExp m_ukQuotedSubtitle;
00138 const QRegExp m_ukAllNew;
00139 const QRegExp m_comHemCountry;
00140 const QRegExp m_comHemDirector;
00141 const QRegExp m_comHemActor;
00142 const QRegExp m_comHemHost;
00143 const QRegExp m_comHemSub;
00144 const QRegExp m_comHemRerun1;
00145 const QRegExp m_comHemRerun2;
00146 const QRegExp m_comHemTT;
00147 const QRegExp m_comHemPersSeparator;
00148 const QRegExp m_comHemPersons;
00149 const QRegExp m_comHemSubEnd;
00150 const QRegExp m_comHemSeries1;
00151 const QRegExp m_comHemSeries2;
00152 const QRegExp m_comHemTSub;
00153 const QRegExp m_mcaIncompleteTitle;
00154 const QRegExp m_mcaCompleteTitlea;
00155 const QRegExp m_mcaCompleteTitleb;
00156 const QRegExp m_mcaSubtitle;
00157 const QRegExp m_mcaSeries;
00158 const QRegExp m_mcaCredits;
00159 const QRegExp m_mcaAvail;
00160 const QRegExp m_mcaActors;
00161 const QRegExp m_mcaActorsSeparator;
00162 const QRegExp m_mcaYear;
00163 const QRegExp m_mcaCC;
00164 const QRegExp m_mcaDD;
00165 const QRegExp m_RTLrepeat;
00166 const QRegExp m_RTLSubtitle;
00167 const QRegExp m_RTLSubtitle1;
00168 const QRegExp m_RTLSubtitle2;
00169 const QRegExp m_RTLSubtitle3;
00170 const QRegExp m_RTLSubtitle4;
00171 const QRegExp m_RTLSubtitle5;
00172 const QRegExp m_RTLEpisodeNo1;
00173 const QRegExp m_RTLEpisodeNo2;
00174 const QRegExp m_fiRerun;
00175 const QRegExp m_fiRerun2;
00176 const QRegExp m_dePremiereInfos;
00177 const QRegExp m_dePremiereOTitle;
00178 const QRegExp m_nlTxt;
00179 const QRegExp m_nlWide;
00180 const QRegExp m_nlRepeat;
00181 const QRegExp m_nlHD;
00182 const QRegExp m_nlSub;
00183 const QRegExp m_nlActors;
00184 const QRegExp m_nlPres;
00185 const QRegExp m_nlPersSeparator;
00186 const QRegExp m_nlRub;
00187 const QRegExp m_nlYear1;
00188 const QRegExp m_nlYear2;
00189 const QRegExp m_nlDirector;
00190 const QRegExp m_nlCat;
00191 const QRegExp m_nlOmroep;
00192 const QRegExp m_noRerun;
00193 const QRegExp m_noColonSubtitle;
00194 const QRegExp m_noNRKCategories;
00195 const QRegExp m_noPremiere;
00196 const QRegExp m_Stereo;
00197 };
00198
00199 #endif // EITFIXUP_H