add ability to access eDVBLocalTimeHandler from python
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 23 Dec 2005 02:01:05 +0000 (02:01 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 23 Dec 2005 02:01:05 +0000 (02:01 +0000)
lib/dvb/dvbtime.h
lib/python/enigma_python.i

index 34c5d5f68a42c655adcae27cdbafa5b9ebfaa551..a0b570dda82d3b64ddcf4020ad167f247deb1bbd 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __LIB_DVB_DVBTIME_H_
 #define __LIB_DVB_DVBTIME_H_
 
+#ifndef SWIG
+
 #include <lib/base/eerror.h>
 #include <lib/dvb/esection.h>
 #include <dvbsi++/time_date_section.h>
@@ -33,6 +35,8 @@ public:
        int getUpdateCount() { return update_count; }
 };
 
+#endif  // SWIG
+
 class eDVBLocalTimeHandler: public Object
 {
        struct channel_data
@@ -57,9 +61,12 @@ class eDVBLocalTimeHandler: public Object
        void updateTime(time_t tp_time, eDVBChannel*, int updateCount);
        static eDVBLocalTimeHandler *instance;
 public:
+#ifndef SWIG
        PSignal0<void> m_timeUpdated;
        eDVBLocalTimeHandler();
        ~eDVBLocalTimeHandler();
+#endif
+       time_t nowTime() const { return m_time_ready ? ::time(0)+m_time_difference : -1; }
        bool ready() const { return m_time_ready; }
        int difference() const { return m_time_difference; }
        static eDVBLocalTimeHandler *getInstance() { return instance; }
index d0d467231f8e7c39eb09b7edc8504e0bd9683c42..8d18e4168d5333670908de2e9da9d741f077f6ef 100644 (file)
@@ -72,6 +72,7 @@ is usually caused by not marking PSignals as immutable.
 #include <lib/dvb/sec.h>
 #include <lib/dvb/epgcache.h>
 #include <lib/dvb/frontendparms.h>
+#include <lib/dvb/dvbtime.h>
 #include <lib/driver/avswitch.h>
 #include <lib/driver/rfmod.h>
 #include <lib/driver/etimezone.h>
@@ -168,6 +169,7 @@ typedef long time_t;
 %include <lib/dvb/sec.h>
 %include <lib/dvb/epgcache.h>
 %include <lib/dvb/frontendparms.h>
+%include <lib/dvb/dvbtime.h>
 %include <lib/driver/avswitch.h>
 %include <lib/driver/rfmod.h>
 %include <lib/driver/etimezone.h>