X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1c384bc7cd9e5e2222c275a7a6b47bfd5712e870..a29bbc0a4ee2eb5f0d86407088380de9887359a0:/lib/dvb/dvbtime.h diff --git a/lib/dvb/dvbtime.h b/lib/dvb/dvbtime.h index a0b570dd..ffcfaa41 100644 --- a/lib/dvb/dvbtime.h +++ b/lib/dvb/dvbtime.h @@ -18,6 +18,13 @@ inline int fromBCD(int bcd) return ((bcd&0xF0)>>4)*10+(bcd&0xF); } +inline int toBCD(int dec) +{ + if (dec >= 100) + return -1; + return int(dec/10)*0x10 + dec%10; +} + time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5); class TDT: public eGTable @@ -25,7 +32,7 @@ class TDT: public eGTable eDVBChannel *chan; ePtr demux; eTimer m_interval_timer; - int createTable(int nr, const __u8 *data, unsigned int max); + int createTable(unsigned int nr, const __u8 *data, unsigned int max); void ready(int); int update_count; public: @@ -39,6 +46,7 @@ public: class eDVBLocalTimeHandler: public Object { + DECLARE_REF(eDVBLocalTimeHandler); struct channel_data { TDT *tdt; @@ -47,7 +55,6 @@ class eDVBLocalTimeHandler: public Object int m_prevChannelState; }; friend class TDT; - DECLARE_REF(eDVBLocalTimeHandler) std::map m_knownChannels; std::map m_timeOffsetMap; ePtr m_chanAddedConn; @@ -60,15 +67,17 @@ class eDVBLocalTimeHandler: public Object void writeTimeOffsetData(const char*); void updateTime(time_t tp_time, eDVBChannel*, int updateCount); static eDVBLocalTimeHandler *instance; +#ifdef SWIG + eDVBLocalTimeHandler(); + ~eDVBLocalTimeHandler(); +#endif public: #ifndef SWIG - PSignal0 m_timeUpdated; eDVBLocalTimeHandler(); ~eDVBLocalTimeHandler(); #endif - time_t nowTime() const { return m_time_ready ? ::time(0)+m_time_difference : -1; } + PSignal0 m_timeUpdated; bool ready() const { return m_time_ready; } - int difference() const { return m_time_difference; } static eDVBLocalTimeHandler *getInstance() { return instance; } };