MythTV master
eitfixup.h
Go to the documentation of this file.
1/*
2 * Copyright 2004 - Taylor Jacob (rtjacob at earthlink.net)
3 */
4
5#ifndef EITFIXUP_H
6#define EITFIXUP_H
7
8#include "programdata.h"
9
12{
13 protected:
14 // max length of subtitle field in db.
15 static const uint kSubtitleMaxLen = 128;
16 // max number of words included in a subtitle
17 static const uint kMaxToTitle = 14;
18 // max number of words up to a period, question mark
19 static const uint kDotToTitle = 9;
20 // max number of question/exclamation marks
21 static const uint kMaxQuestionExclamation = 2;
22 // max number of difference in words between a period and a colon
23 static const uint kMaxDotToColon = 5;
24 // minimum duration of an event to consider it as movie
25 static const int kMinMovieDuration = 75*60;
26
27 public:
29 {
30 kFixNone = 0, // no bits set
31
32 // Regular fixups
33 kFixGenericDVB = 1 << 0, // LSB set
34 kFixBell = 1 << 1,
35 kFixUK = 1 << 2,
36 kFixPBS = 1 << 3,
37 kFixComHem = 1 << 4,
38 kFixSubtitle = 1 << 5,
39 kFixAUStar = 1 << 6,
40 kFixMCA = 1 << 7,
41 kFixRTL = 1 << 8,
42 kFixFI = 1 << 9,
43 kFixPremiere = 1 << 10,
44 kFixHDTV = 1 << 11,
45 kFixNL = 1 << 12,
46 kFixCategory = 1 << 13,
47 kFixNO = 1 << 14,
48 kFixNRK_DVBT = 1 << 15,
49 kFixDish = 1 << 16,
50 kFixDK = 1 << 17,
51 kFixAUFreeview = 1 << 18,
52 kFixAUDescription = 1 << 19,
53 kFixAUNine = 1 << 20,
54 kFixAUSeven = 1 << 21,
55 kFixP7S1 = 1 << 26,
56 kFixHTML = 1 << 27,
57 kFixUnitymedia = 1ULL << 32,
58 kFixATV = 1ULL << 33,
59 kFixDisneyChannel = 1ULL << 34,
60
61 // Early fixups
62 kEFixForceISO8859_1 = 1 << 22,
63 kEFixForceISO8859_2 = 1 << 23,
64 kEFixForceISO8859_9 = 1 << 24,
65 kEFixForceISO8859_15 = 1 << 25,
66 kEFixForceISO8859_7 = 1 << 28,
67
68 kFixGreekSubtitle = 1 << 29,
69 kFixGreekEIT = 1 << 30,
70 kFixGreekCategories = 1U << 31,
71 };
72
73 EITFixUp() = default;
74
75 static void Fix(DBEventEIT &event);
76
77 static int parseRoman (QString roman);
78
83 static void TimeFix(QDateTime &dt)
84 {
85 int secs = dt.time().second();
86 if (secs < 4)
87 dt = dt.addSecs(-secs);
88 if (secs > 56)
89 dt = dt.addSecs(60 - secs);
90 }
91
92 private:
93 static void FixBellExpressVu(DBEventEIT &event);// Canada DVB-S
94 static void SetUKSubtitle(DBEventEIT &event);
95 static void FixUK(DBEventEIT &event); // UK DVB-T
96 static void FixPBS(DBEventEIT &event); // USA ATSC
97 static void FixComHem(DBEventEIT &event,
98 bool process_subtitle); // Sweden DVB-C
99 static void FixAUStar(DBEventEIT &event); // Australia DVB-S
100 static void FixAUFreeview(DBEventEIT &event); // Australia DVB-T
101 static void FixAUNine(DBEventEIT &event);
102 static void FixAUSeven(DBEventEIT &event);
103 static void FixAUDescription(DBEventEIT &event);
104 static void FixMCA(DBEventEIT &event); // MultiChoice Africa DVB-S
105 static void FixRTL(DBEventEIT &event); // RTL group DVB
106 static void FixPRO7(DBEventEIT &event); // Pro7/Sat1 Group
107 static void FixDisneyChannel(DBEventEIT &event);// Disney Channel
108 static void FixATV(DBEventEIT &event); // ATV/ATV2
109 static void FixFI(DBEventEIT &event); // Finland DVB-T
110 static void FixPremiere(DBEventEIT &event); // german pay-tv Premiere
111 static void FixNL(DBEventEIT &event); // Netherlands DVB-C
112 static void FixCategory(DBEventEIT &event); // Generic Category fixes
113 static void FixNO(DBEventEIT &event); // Norwegian DVB-S
114 static void FixNRK_DVBT(DBEventEIT &event); // Norwegian NRK DVB-T
115 static void FixDK(DBEventEIT &event); // Danish YouSee DVB-C
116 static void FixStripHTML(DBEventEIT &event); // Strip HTML tags
117 static void FixGreekSubtitle(DBEventEIT &event);// Greek Nat TV fix
118 static void FixGreekEIT(DBEventEIT &event);
119 static void FixGreekCategories(DBEventEIT &event);// Greek categories from descr.
120 static void FixUnitymedia(DBEventEIT &event); // handle cast/crew from Unitymedia
121
122 static QString AddDVBEITAuthority(uint chanid, const QString &id);
123};
124
125#endif // EITFIXUP_H
EIT Fix Up Functions.
Definition: eitfixup.h:12
static void TimeFix(QDateTime &dt)
Corrects starttime to the multiple of a minute.
Definition: eitfixup.h:83
EITFixUp()=default
uint64_t FixupValue
Definition: eithelper.h:81
unsigned int uint
Definition: freesurround.h:24
#define MTV_PUBLIC
Definition: mythtvexp.h:15