d224c183de311f9f42119657afec2e4e5c5d3f4a
[vuplus_dvbapp] / lib / service / event.h
1 #ifndef __lib_service_event_h
2 #define __lib_service_event_h
3
4 #ifndef SWIG
5 #include <time.h>
6 #include <lib/base/object.h>
7 #include <list>
8 #include <string>
9 class Event;
10 #endif
11
12 struct eComponentData
13 {
14 DECLARE_REF(eComponentData);
15 #ifndef SWIG
16         uint8_t m_streamContent;
17         uint8_t m_componentType;
18         uint8_t m_componentTag;
19         std::string m_iso639LanguageCode;
20         std::string m_text;
21 #endif
22         int getStreamContent(void) const { return m_streamContent; }
23         int getComponentType(void) const { return m_componentType; }
24         int getComponentTag(void) const { return m_componentTag; }
25         std::string getIso639LanguageCode(void) const { return m_iso639LanguageCode; }
26         std::string getText(void) const { return m_text; }
27 };
28
29 TEMPLATE_TYPEDEF(ePtr<eComponentData>, eComponentDataPtr);
30
31 struct linkage_service
32 {
33         uint16_t m_sid;
34         uint16_t m_onid;
35         uint16_t m_tsid;
36         std::string m_description;
37 };
38
39 class eServiceEvent: public iObject
40 {
41 DECLARE_REF(eServiceEvent);
42 #ifndef SWIG
43         bool loadLanguage(Event *event, std::string lang, int tsidonid);
44         std::list<eComponentData> m_component_data;
45 #endif
46 public:
47 #ifndef SWIG
48         std::list<linkage_service> m_linkage_services;
49         time_t m_begin;
50         int m_duration;
51         std::string m_event_name, m_short_description, m_extended_description;
52         // .. additional info
53         RESULT parseFrom(Event *evt, int tsidonid=0);
54 #endif
55         time_t getBeginTime() const { return m_begin; }
56         int getDuration() const { return m_duration; }
57         std::string getEventName() const { return m_event_name; }
58         std::string getShortDescription() const { return m_short_description; }
59         std::string getExtendedDescription() const { return m_extended_description; }
60         std::string getBeginTimeString() const;
61         SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
62 };
63
64 TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
65 #ifndef SWIG
66
67 class eDebugClass: public iObject
68 {
69         DECLARE_REF(eDebugClass);
70 public:
71         int x;
72         static void getDebug(ePtr<eDebugClass> &ptr, int x) { ptr = new eDebugClass(x); }
73         eDebugClass(int i) { printf("build debug class %d\n", i); x = i; }
74         ~eDebugClass() { printf("remove debug class %d\n", x); }
75 };
76
77 // TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);
78 #endif
79
80 #endif