make dm8000 blink pattern a bit nicer
[enigma2.git] / lib / driver / rc.cpp
index 392065124358f81cbf708bd247c2f7ec869e9ac1..c7acd1138a1b35bc10c937e72df8e0d53453ff7d 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
-#include <lib/base/econfig.h>
 #include <lib/base/eerror.h>
 
 /*
  *  actions. have fun.
  */
 
-int eRCDevice::getKeyCompatibleCode(const eRCKey &) const
-{
-       return -1;
-}
-
 eRCDevice::eRCDevice(std::string id, eRCDriver *driver): driver(driver), id(id)
 {
        input=driver->getInput();
@@ -85,7 +79,7 @@ eRCShortDriver::eRCShortDriver(const char *filename): eRCDriver(eRCInput::getIns
                sn=0;
        } else
        {
-               sn=new eSocketNotifier(eApp, handle, eSocketNotifier::Read);
+               sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
                CONNECT(sn->activated, eRCShortDriver::keyPressed);
                eRCInput::getInstance()->setFile(handle);
        }
@@ -95,8 +89,6 @@ eRCShortDriver::~eRCShortDriver()
 {
        if (handle>=0)
                close(handle);
-       if (sn)
-               delete sn;
 }
 
 void eRCInputEventDriver::keyPressed(int)
@@ -108,7 +100,7 @@ void eRCInputEventDriver::keyPressed(int)
                        break;
                if (enabled && !input->islocked())
                        for (std::list<eRCDevice*>::iterator i(listeners.begin()); i!=listeners.end(); ++i)
-                               (*i)->handleCode((int)&ev);
+                               (*i)->handleCode((long)&ev);
        }
 }
 
@@ -121,7 +113,7 @@ eRCInputEventDriver::eRCInputEventDriver(const char *filename): eRCDriver(eRCInp
                sn=0;
        } else
        {
-               sn=new eSocketNotifier(eApp, handle, eSocketNotifier::Read);
+               sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
                CONNECT(sn->activated, eRCInputEventDriver::keyPressed);
                eRCInput::getInstance()->setFile(handle);
        }
@@ -139,8 +131,6 @@ eRCInputEventDriver::~eRCInputEventDriver()
 {
        if (handle>=0)
                close(handle);
-       if (sn)
-               delete sn;
 }
 
 eRCConfig::eRCConfig()
@@ -163,15 +153,10 @@ void eRCConfig::reload()
 {
        rdelay=500;
        rrate=100;
-       if ( eConfig::getInstance()->getKey("/ezap/rc/repeatRate", rrate) )
-               save();
-       eConfig::getInstance()->getKey("/ezap/rc/repeatDelay", rdelay);
 }
 
 void eRCConfig::save()
 {
-       eConfig::getInstance()->setKey("/ezap/rc/repeatRate", rrate);
-       eConfig::getInstance()->setKey("/ezap/rc/repeatDelay", rdelay);
 }
 
 eRCInput *eRCInput::instance;
@@ -182,6 +167,7 @@ eRCInput::eRCInput()
        instance=this;
        handle = -1;
        locked = 0;
+       keyboardMode = kmNone;
 }
 
 eRCInput::~eRCInput()