add missing files, add ability to specify table_id mask and table_id ext mask
[enigma2.git] / lib / dvb / dvbtime.h
1 #ifndef __LIB_DVB_DVBTIME_H_
2 #define __LIB_DVB_DVBTIME_H_
3
4 #include <lib/base/eerror.h>
5 #include <lib/dvb/esection.h>
6 #include <lib/dvb_si/tdt.h>
7
8 class eDVBChannel;
9
10 time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5);
11
12 class TDT: public eGTable
13 {
14         eDVBChannel *chan;
15         ePtr<iDVBDemux> demux;
16         eTimer m_interval_timer;
17         int createTable(int nr, const __u8 *data, unsigned int max);
18         void ready(int);
19 public:
20         TDT(eDVBChannel *chan);
21         void start();
22         void startTimer(int interval);
23 };
24
25 class eDVBLocalTimeHandler: public Object
26 {
27         friend class TDT;
28         DECLARE_REF(eDVBLocalTimeHandler)
29         std::map<iDVBChannel*, TDT*> m_active_tables;
30         std::map<eDVBChannelID,int> m_timeOffsetMap;
31         ePtr<eConnection> m_chanAddedConn;
32         ePtr<eConnection> m_chanRemovedConn;
33         ePtr<eConnection> m_chanRunningConn;
34         bool m_time_ready;
35         int m_time_difference;
36         int m_last_tp_time_difference;
37         void DVBChannelAdded(eDVBChannel*);
38         void DVBChannelRemoved(eDVBChannel*);
39         void DVBChannelRunning(iDVBChannel*);
40         void readTimeOffsetData(const char*);
41         void writeTimeOffsetData(const char*);
42         void updateTime(time_t tp_time, eDVBChannel*);
43         static eDVBLocalTimeHandler *instance;
44 public:
45         PSignal0<void> m_timeUpdated;
46         eDVBLocalTimeHandler();
47         ~eDVBLocalTimeHandler();
48         bool ready() { return m_time_ready; }
49         int difference() { return m_time_difference; }
50         static eDVBLocalTimeHandler *getInstance() { return instance; }
51 };
52
53 #endif // __LIB_DVB_DVBTIME_H_