add possibility to lock/unlock the rc devices (remote control) from python
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 6 Mar 2006 12:00:06 +0000 (12:00 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 6 Mar 2006 12:00:06 +0000 (12:00 +0000)
it is usable by this way:
from enigma import eRCInput, eRCInputPtr (or *)
rcinput = eRCInput.getInstance()
rcinput.lock()... unlock()... islocked()

lib/driver/rc.h
lib/python/enigma_python.i

index 1ce13c7241da2199c7f8f643fa10af2e637f49b7..e9542ca8facdea18cb5fa2ed580894eafd5d207e 100644 (file)
@@ -12,6 +12,8 @@ class eRCInput;
 class eRCDriver;
 class eRCKey;
 
+#ifndef SWIG
+
 /**
  * \brief A remote control.
  *
@@ -161,13 +163,19 @@ public:
                rrate;          // repeat rate (in ms)
 };
 
+#endif
+
 class eRCInput: public Object
 {
        int locked;     
        int handle;
        static eRCInput *instance;
        int keyboardMode;
-
+#ifdef SWIG
+       eRCInput();
+       ~eRCInput();
+public:
+#else
 public:
        struct lstr
        {
@@ -182,10 +190,7 @@ public:
        Signal1<void, const eRCKey&> keyEvent;
        eRCInput();
        ~eRCInput();
-       
-       int lock();
-       void unlock();
-       int islocked() { return locked; }
+
        void close();
        bool open();
 
@@ -224,10 +229,13 @@ public:
        void removeDevice(const std::string &id);
        eRCDevice *getDevice(const std::string &id);
        std::map<std::string,eRCDevice*,lstr> &getDevices();
-       
-       static eRCInput *getInstance() { return instance; }
-       
+
        eRCConfig config;
+#endif
+       static eRCInput *getInstance() { return instance; }
+       int lock();
+       void unlock();
+       int islocked() { return locked; }
 };
 
 #endif
index 29b66acf35950742291bb029c417a41902749b2a..4572243ad0d923cbaab2e36ea54e3dc8b0fffd53 100644 (file)
@@ -40,6 +40,7 @@ is usually caused by not marking PSignals as immutable.
 #include <lib/base/smartptr.h>
 #include <lib/base/eerror.h>
 #include <lib/base/console.h>
+#include <lib/driver/rc.h>
 #include <lib/service/iservice.h>
 #include <lib/service/service.h>
 #include <lib/service/event.h>
@@ -150,6 +151,7 @@ typedef long time_t;
 %immutable eListbox::selectionChanged;
 
 %include <lib/base/console.h>
+%include <lib/driver/rc.h>
 %include <lib/gdi/font.h>
 %include <lib/gdi/gpixmap.h>
 %include <lib/gdi/epoint.h>