00001
00002
00003
00004
00005 #ifndef EITFIXUP_H
00006 #define EITFIXUP_H
00007
00008 #include <qregexp.h>
00009
00010 #include "eit.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 public:
00030 enum FixUpType
00031 {
00032 kFixNone = 0x0000,
00033
00034
00035 kFixGenericDVB = 0x0001,
00036 kFixBell = 0x0002,
00037 kFixUK = 0x0004,
00038 kFixPBS = 0x0008,
00039 kFixComHem = 0x0010,
00040 kFixSubtitle = 0x0020,
00041 kFixAUStar = 0x0040,
00042 kFixMCA = 0x0080,
00043 kFixRTL = 0x0100,
00044 kFixFI = 0x0200,
00045 kFixPremiere = 0x0400,
00046 kFixHDTV = 0x0800,
00047 kFixNL = 0x1000,
00048
00049
00050 kEFixForceISO8859_1 = 0x2000,
00051 kEFixForceISO8859_15 = 0x4000,
00052 };
00053
00054 EITFixUp();
00055
00056 void Fix(DBEvent &event) const;
00057
00062 static void TimeFix(QDateTime &dt)
00063 {
00064 int secs = dt.time().second();
00065 if (secs < 4)
00066 dt = dt.addSecs(-secs);
00067 if (secs > 56)
00068 dt = dt.addSecs(60 - secs);
00069 }
00070
00071 private:
00072 void FixBellExpressVu(DBEvent &event) const;
00073 void SetUKSubtitle(DBEvent &event) const;
00074 void FixUK(DBEvent &event) const;
00075 void FixPBS(DBEvent &event) const;
00076 void FixComHem(DBEvent &event, bool parse_subtitle) const;
00077 void FixAUStar(DBEvent &event) const;
00078 void FixMCA(DBEvent &event) const;
00079 void FixRTL(DBEvent &event) const;
00080 void FixFI(DBEvent &event) const;
00081 void FixPremiere(DBEvent &event) const;
00082 void FixNL(DBEvent &event) const;
00083
00084 const QRegExp m_bellYear;
00085 const QRegExp m_bellActors;
00086 const QRegExp m_bellPPVTitleAllDay;
00087 const QRegExp m_bellPPVTitleHD;
00088 const QRegExp m_bellPPVSubtitleAllDay;
00089 const QRegExp m_bellPPVDescriptionAllDay;
00090 const QRegExp m_bellPPVDescriptionAllDay2;
00091 const QRegExp m_bellPPVDescriptionEventId;
00092 const QRegExp m_ukThen;
00093 const QRegExp m_ukNew;
00094 const QRegExp m_ukCEPQ;
00095 const QRegExp m_ukColonPeriod;
00096 const QRegExp m_ukDotSpaceStart;
00097 const QRegExp m_ukDotEnd;
00098 const QRegExp m_ukSpaceColonStart;
00099 const QRegExp m_ukSpaceStart;
00100 const QRegExp m_ukSeries;
00101 const QRegExp m_ukCC;
00102 const QRegExp m_ukYear;
00103 const QRegExp m_uk24ep;
00104 const QRegExp m_ukStarring;
00105 const QRegExp m_ukBBC7rpt;
00106 const QRegExp m_ukDescriptionRemove;
00107 const QRegExp m_ukTitleRemove;
00108 const QRegExp m_ukDoubleDotEnd;
00109 const QRegExp m_ukDoubleDotStart;
00110 const QRegExp m_ukTime;
00111 const QRegExp m_ukBBC34;
00112 const QRegExp m_ukYearColon;
00113 const QRegExp m_ukExclusionFromSubtitle;
00114 const QRegExp m_ukCompleteDots;
00115 const QRegExp m_comHemCountry;
00116 const QRegExp m_comHemDirector;
00117 const QRegExp m_comHemActor;
00118 const QRegExp m_comHemHost;
00119 const QRegExp m_comHemSub;
00120 const QRegExp m_comHemRerun1;
00121 const QRegExp m_comHemRerun2;
00122 const QRegExp m_comHemTT;
00123 const QRegExp m_comHemPersSeparator;
00124 const QRegExp m_comHemPersons;
00125 const QRegExp m_comHemSubEnd;
00126 const QRegExp m_comHemSeries1;
00127 const QRegExp m_comHemSeries2;
00128 const QRegExp m_comHemTSub;
00129 const QRegExp m_mcaIncompleteTitle;
00130 const QRegExp m_mcaCompleteTitlea;
00131 const QRegExp m_mcaCompleteTitleb;
00132 const QRegExp m_mcaSubtitle;
00133 const QRegExp m_mcaSeries;
00134 const QRegExp m_mcaCredits;
00135 const QRegExp m_mcaAvail;
00136 const QRegExp m_mcaActors;
00137 const QRegExp m_mcaActorsSeparator;
00138 const QRegExp m_mcaYear;
00139 const QRegExp m_mcaCC;
00140 const QRegExp m_mcaDD;
00141 const QRegExp m_RTLrepeat;
00142 const QRegExp m_RTLSubtitle;
00143 const QRegExp m_RTLSubtitle1;
00144 const QRegExp m_RTLSubtitle2;
00145 const QRegExp m_RTLSubtitle3;
00146 const QRegExp m_RTLSubtitle4;
00147 const QRegExp m_RTLSubtitle5;
00148 const QRegExp m_RTLEpisodeNo1;
00149 const QRegExp m_RTLEpisodeNo2;
00150 const QRegExp m_fiRerun;
00151 const QRegExp m_Stereo;
00152 const QRegExp m_dePremiereInfos;
00153 const QRegExp m_dePremiereOTitle;
00154 const QRegExp m_nlStereo;
00155 const QRegExp m_nlTxt;
00156 const QRegExp m_nlWide;
00157 const QRegExp m_nlRepeat;
00158 const QRegExp m_nlHD;
00159 const QRegExp m_nlSub;
00160 const QRegExp m_nlActors;
00161 const QRegExp m_nlPres;
00162 const QRegExp m_nlPersSeparator;
00163 const QRegExp m_nlRub;
00164 const QRegExp m_nlYear1;
00165 const QRegExp m_nlYear2;
00166 const QRegExp m_nlDirector;
00167 const QRegExp m_nlCat;
00168 const QRegExp m_nlOmroep;
00169 };
00170
00171 #endif // EITFIXUP_H