Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

remote.h

Go to the documentation of this file.
00001 
00010 #ifndef __REMOTE_H
00011 #define __REMOTE_H
00012 
00013 #include <stdio.h>
00014 #include <termios.h>
00015 #include <time.h>
00016 #include "keys.h"
00017 #include "thread.h"
00018 #include "tools.h"
00019 
00021 class cRemote : public cListObject {
00022 private:
00023   enum { MaxKeys = MAXKEYSINMACRO };
00024   static eKeys keys[MaxKeys];
00025   static int in;
00026   static int out;
00027   static cRemote *learning;
00028   static char *unknownCode;
00029   static cMutex mutex;
00030   static cCondVar keyPressed;
00031   static const char *plugin;
00032   char *name;
00033 protected:
00034   cRemote(const char *Name);
00035   const char *GetSetup(void);
00036   void PutSetup(const char *Setup);
00037   bool Put(uint64 Code, bool Repeat = false, bool Release = false);
00038   bool Put(const char *Code, bool Repeat = false, bool Release = false);
00039 public:
00040   virtual ~cRemote();
00041   virtual bool Initialize(void) { return true; }
00042   const char *Name(void) { return name; }
00043 
00047   static void SetLearning(cRemote *Learning) { learning = Learning; }
00048   static void Clear(void);
00049   static bool Put(eKeys Key);
00050   static bool PutMacro(eKeys Key);
00051   static const char *GetPlugin(void) { return plugin; }
00052   static eKeys Get(int WaitMs = 1000, char **UnknownCode = NULL);
00053   };
00054 
00055 
00057 class cRemotes : public cList<cRemote> {};
00058 
00059 extern cRemotes Remotes;
00060 
00062 enum eKbdFunc {
00063   kfNone,
00064   kfF1 = 0x100,
00065   kfF2,
00066   kfF3,
00067   kfF4,
00068   kfF5,
00069   kfF6,
00070   kfF7,
00071   kfF8,
00072   kfF9,
00073   kfF10,
00074   kfF11,
00075   kfF12,
00076   kfUp,
00077   kfDown,
00078   kfLeft,
00079   kfRight,
00080   kfHome,
00081   kfEnd,
00082   kfPgUp,
00083   kfPgDown,
00084   kfIns,
00085   kfDel,
00086   };
00087 
00089 class cKbdRemote : public cRemote, private cThread {
00090 private:
00091   bool active;
00092 
00096   static bool kbdAvailable;
00097 
00102   static bool rawMode;
00103   struct termios savedTm;
00104   virtual void Action(void);
00105   int MapCodeToFunc(uint64 Code);
00106 public:
00107   cKbdRemote(void);
00108   virtual ~cKbdRemote();
00109   static bool KbdAvailable(void) { return kbdAvailable; }
00110   static uint64 MapFuncToCode(int Func);
00111   static void SetRawMode(bool RawMode);
00112   };
00113 
00114 #endif //__REMOTE_H
00115 

Generated on Wed Feb 5 23:30:11 2003 for VDR by doxygen1.3-rc2