summaryrefslogtreecommitdiff
path: root/remote.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-09-29 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-09-29 18:00:00 +0200
commitd08073815d6d9132f7fb5cd9f82877967dc6b0e4 (patch)
treef93fbe9f18ed2893d88dc4ce6d01d80804d664da /remote.h
parent346f4cd1420bb02bd9cec4059385c9922d64fc3f (diff)
downloadvdr-patch-lnbsharing-d08073815d6d9132f7fb5cd9f82877967dc6b0e4.tar.gz
vdr-patch-lnbsharing-d08073815d6d9132f7fb5cd9f82877967dc6b0e4.tar.bz2
Version 1.1.11vdr-1.1.11
- Fixed an incomplete initialization of the filter parameters in eit.c (thanks to Jeremy Hall). - Fixed the 'newplugin' script for use with the NEWSTRUCT driver (thanks to Andreas Schultz for reporting this one). If you have already created a plugin directory and Makefile with 'newplugin', please apply the following patch to it: ------------------------------------------------------- --- Makefile 2002/06/10 16:24:06 1.4 +++ Makefile 2002/09/17 15:36:36 1.5 @@ -15,7 +15,12 @@ ### The directory environment: +ifdef NEWSTRUCT +DVBDIR = ../../../../DVB/include +DEFINES += -DNEWSTRUCT +else DVBDIR = ../../../../DVB/ost/include +endif VDRDIR = ../../.. VDRINC = $(VDRDIR)/include LIBDIR = ../../lib @@ -34,7 +39,7 @@ INCLUDES = -I$(VDRINC) -I$(DVBDIR) -DEFINES = -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): ------------------------------------------------------- This is the diff for the 'setup' example that comes with VDR, so your line numbers may be different. - Added a missing 'public' keyword in device.h (thanks to Martin Hammerschmid). - Fixed a race condition when starting 'Transfer Mode'. - Rearranged the remote control key handling to allow plugins to implement additional types of remote controls (see PLUGINS.html, section "Remote Control"). The previously used files 'keys.conf' and 'keys-pc.conf' have been replaced by the file 'remote.conf', which holds the key definitions of all remote controls. - The LIRC remote control keys are now handled just like the keyboard and RCU keys. This means that you can use the lircd.conf file as is for your remote control, without the need of editing it to make the key names the same as used in VDR. When first starting VDR it will go into the "Learning keys" mode and ask you to press the various keys. The resulting key assignment will be stored in the file 'remote.conf'. Since I have no way of testing the LIRC support, I hope I didn't break it in the process... - While learning the remote control keys it is now possible to press the 'Menu' key to skip the definition of keys that are not available on your particular RC unit. - Fixed handling DVD subtitles in the SPU decoder (thanks to Andreas Schultz). - Avoiding restarts due to 'panic level' when switching channels on the primary device during EPG scan.
Diffstat (limited to 'remote.h')
-rw-r--r--remote.h104
1 files changed, 33 insertions, 71 deletions
diff --git a/remote.h b/remote.h
index 184a42e..f715ade 100644
--- a/remote.h
+++ b/remote.h
@@ -1,10 +1,10 @@
/*
- * remote.h: Interface to the Remote Control Unit
+ * remote.h: General Remote Control handling
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remote.h 1.16 2002/05/09 11:43:04 kls Exp $
+ * $Id: remote.h 1.17 2002/09/29 11:26:45 kls Exp $
*/
#ifndef __REMOTE_H
@@ -12,91 +12,53 @@
#include <stdio.h>
#include <time.h>
+#include "keys.h"
#include "thread.h"
#include "tools.h"
-class cRcIoBase {
-protected:
- time_t t;
-public:
- enum { modeH = 'h', modeB = 'b', modeS = 's' };
- cRcIoBase(void);
- virtual ~cRcIoBase();
- virtual bool SetCode(unsigned char Code, unsigned short Address) { return true; }
- virtual bool SetMode(unsigned char Mode) { return true; }
- virtual bool Number(int n, bool Hex = false) { return true; }
- virtual void SetPoints(unsigned char Dp, bool On) {}
- virtual bool String(char *s) { return true; }
- virtual bool DetectCode(unsigned char *Code, unsigned short *Address) { return true; }
- virtual void Flush(int WaitMs = 0) {}
- virtual bool InputAvailable(void) { return false; }
- virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL) { return false; }
- };
+typedef unsigned long long int uint64;
-#if defined REMOTE_KBD
-
-class cRcIoKBD : public cRcIoBase {
+class cRemote : public cListObject {
private:
- cFile f;
+ enum { MaxKeys = 16 };
+ static eKeys keys[MaxKeys];
+ static int in;
+ static int out;
+ static bool learning;
+ static char *unknownCode;
+ static cMutex mutex;
+ static cCondVar keyPressed;
+ char *name;
+protected:
+ cRemote(const char *Name);
+ const char *GetSetup(void);
+ void PutSetup(const char *Setup);
+ bool Put(uint64 Code, bool Repeat = false, bool Release = false);
+ bool Put(const char *Code, bool Repeat = false, bool Release = false);
public:
- cRcIoKBD(void);
- virtual ~cRcIoKBD();
- virtual void Flush(int WaitMs = 0);
- virtual bool InputAvailable(void);
- virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL);
+ virtual ~cRemote();
+ virtual bool Initialize(void) { return true; }
+ const char *Name(void) { return name; }
+ static void SetLearning(bool On) { learning = On; }
+ static void Clear(void);
+ static bool Put(eKeys Key);
+ static eKeys Get(int WaitMs = 1000, char **UnknownCode = NULL);
};
-#elif defined REMOTE_RCU
+class cRemotes : public cList<cRemote> {};
-class cRcIoRCU : public cRcIoBase, private cThread {
-private:
- int f;
- unsigned char dp, code, mode;
- unsigned short address;
- unsigned short receivedAddress;
- unsigned int receivedCommand;
- bool receivedData, receivedRepeat, receivedRelease;
- int lastNumber;
- bool SendCommand(unsigned char Cmd);
- int ReceiveByte(int TimeoutMs = 0);
- bool SendByteHandshake(unsigned char c);
- bool SendByte(unsigned char c);
- bool Digit(int n, int v);
- virtual void Action(void);
-public:
- cRcIoRCU(char *DeviceName);
- virtual ~cRcIoRCU();
- virtual bool SetCode(unsigned char Code, unsigned short Address);
- virtual bool SetMode(unsigned char Mode);
- virtual bool Number(int n, bool Hex = false);
- virtual void SetPoints(unsigned char Dp, bool On);
- virtual bool String(char *s);
- virtual bool DetectCode(unsigned char *Code, unsigned short *Address);
- virtual void Flush(int WaitMs = 0);
- virtual bool InputAvailable(void) { return receivedData; }
- virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL);
- };
+extern cRemotes Remotes;
-#elif defined REMOTE_LIRC
+#if defined REMOTE_KBD
-class cRcIoLIRC : public cRcIoBase, private cThread {
+class cKbdRemote : public cRemote, private cThread {
private:
- enum { LIRC_KEY_BUF = 30, LIRC_BUFFER_SIZE = 128 };
- int f;
- char keyName[LIRC_KEY_BUF];
- bool receivedData, receivedRepeat, receivedRelease;
virtual void Action(void);
public:
- cRcIoLIRC(char *DeviceName);
- virtual ~cRcIoLIRC();
- virtual bool InputAvailable(void) { return receivedData; }
- virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL);
+ cKbdRemote(void);
+ virtual ~cKbdRemote();
};
-#elif !defined REMOTE_NONE
-
-// #error Please define a remote control mode!
-
#endif
#endif //__REMOTE_H