-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheventdetails_v3.diff
107 lines (102 loc) · 3.64 KB
/
eventdetails_v3.diff
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
diff -Nur vdr-1.7.35.orig/epg.c vdr-1.7.35/epg.c
--- vdr-1.7.35.orig/epg.c 2012-10-04 14:21:24.000000000 +0200
+++ vdr-1.7.35/epg.c 2013-01-06 15:51:18.777840972 +0100
@@ -429,6 +429,21 @@
return buf;
}
+void cEvent::AddDetail(char* value)
+{
+ std::string strValue = std::string(value);
+ int delim = strValue.find_first_of(' ');
+ AddDetail(strValue.substr(0, delim), strValue.substr(delim+1));
+}
+
+void cEvent::AddDetail(std::string key, std::string value)
+{
+ tEpgDetail detail;
+ detail.key = key;
+ detail.value = value;
+ details.push_back(detail);
+}
+
void cEvent::Dump(FILE *f, const char *Prefix, bool InfoOnly) const
{
if (InfoOnly || startTime + duration + Setup.EPGLinger * 60 >= time(NULL)) {
@@ -442,6 +457,12 @@
fprintf(f, "%sD %s\n", Prefix, description);
strreplace(description, '|', '\n');
}
+ for(int i=0;i<(int)details.size();i++) {
+ char* value = (char*)details[i].value.c_str();
+ strreplace(value, '\n', '|');
+ fprintf(f, "K %s %s\n", details[i].key.c_str(), value);
+ strreplace(value, '|', '\n');
+ }
if (contents[0]) {
fprintf(f, "%sG", Prefix);
for (int i = 0; Contents(i); i++)
@@ -474,6 +495,9 @@
case 'D': strreplace(t, '|', '\n');
SetDescription(t);
break;
+ case 'K': strreplace(t, '|', '\n');
+ AddDetail(t);
+ break;
case 'G': {
memset(contents, 0, sizeof(contents));
for (int i = 0; i < MaxEventContents; i++) {
@@ -538,6 +562,7 @@
}
}
}
+ if (Event != NULL) { Event->ClearDetails(); }
break;
case 'e': if (Event && !Event->Title())
Event->SetTitle(tr("No title"));
diff -Nur vdr-1.7.35.orig/epg.h vdr-1.7.35/epg.h
--- vdr-1.7.35.orig/epg.h 2012-09-24 14:53:53.000000000 +0200
+++ vdr-1.7.35/epg.h 2013-01-06 15:51:18.777840972 +0100
@@ -17,6 +17,8 @@
#include "libsi/section.h"
#include "thread.h"
#include "tools.h"
+#include <string>
+#include <vector>
#define MAXEPGBUGFIXLEVEL 3
@@ -64,6 +66,12 @@
// In case of an audio stream the 'type' check actually just distinguishes between "normal" and "Dolby Digital"
};
+#define EPG_DETAILS_PATCH
+struct tEpgDetail {
+ std::string key;
+ std::string value;
+ };
+
class cSchedule;
typedef u_int32_t tEventID;
@@ -87,6 +95,7 @@
int duration; // Duration of this event in seconds
time_t vps; // Video Programming Service timestamp (VPS, aka "Programme Identification Label", PIL)
time_t seen; // When this event was last seen in the data stream
+ std::vector< struct tEpgDetail > details; // additional information provided by epg source
public:
cEvent(tEventID EventID);
~cEvent();
@@ -117,6 +126,7 @@
cString GetTimeString(void) const;
cString GetEndTimeString(void) const;
cString GetVpsString(void) const;
+ const std::vector< struct tEpgDetail >& Details(void) const { return details; };
void SetEventID(tEventID EventID);
void SetTableID(uchar TableID);
void SetVersion(uchar Version);
@@ -131,6 +141,9 @@
void SetDuration(int Duration);
void SetVps(time_t Vps);
void SetSeen(void);
+ void AddDetail(char* value);
+ void AddDetail(std::string key, std::string value);
+ void ClearDetails() { details.erase(details.begin(), details.end()); };
cString ToDescr(void) const;
void Dump(FILE *f, const char *Prefix = "", bool InfoOnly = false) const;
bool Parse(char *s);