vdr/remote.h
Klaus Schmidinger 7e4b4d2905 Version 0.64
- NOTE: If you are using DVB driver version 0.7 you need to load the dvb.o
  module with option outstream=0, so your insmod statement should read
  'insmod dvb.o outstream=0'. This is currently necessary because 'vdr'
  still works with AV_PES data.
- Video files now have the 'group read' bit set.
- Fixed handling errors in 'readstring()'.
- Handling SIGPIPE and re-establishing handler after intercepting a signal.
- The configuration files are now by default read from the video directory.
  This can be changed by using the new '-c' option. Make sure you copy your
  current '*.conf' files to your video directory ('/video' by default), or
  use "-c ." to get the old behaviour of loading the configuration files
  from the current directory.
- Waiting for input is now handled by a common function, which improves
  response time on user actions. As a consequence the EIT data may sometimes
  not be displayed, but this will change later when cEIT runs as a separate
  thread.
- The new SVDRP command 'HITK' (thanks to Guido Fiala!) can be used to 'hit'
  a remote control key.  Establish an SVDRP connection and enter HITK without
  a parameter for a list of all valid key names.
- The new SVDRP command 'GRAB' (thanks to Guido Fiala!) can be used to grab
  the current frame and save it to a file.
- The new SVDRP commands 'OVL*' can be used to control video overlays (thanks
  to Guido Fiala!). This is mainly for use in the 'kvdr' tool (see the 'kvdr'
  page at http://www.s.netic.de/gfiala).
- If the name of the video directory used with the '-v' option had trailing
  slashes, the recording file names have been damaged. Trailing slashes are
  now silently removed.
- Fixed a buffer overflow in EIT parsing.
- Added a security warning regarding SVDRP to the INSTALL file.
- Fixed 'confirm' dialog.
- The daemon mode (option '-d') now no longer works with REMOTE=KBD (there
  is no stdin in daemon mode, so KBD makes no sense - plus it sometimes
  crashed).
2000-09-20 18:00:00 +02:00

100 lines
2.7 KiB
C++

/*
* remote.h: Interface to the Remote Control Unit
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: remote.h 1.9 2000/09/19 17:39:36 kls Exp $
*/
#ifndef __REMOTE_H
#define __REMOTE_H
#include <stdio.h>
#include <time.h>
#include "tools.h"
class cRcIoBase {
protected:
time_t t;
int firstTime, lastTime;
unsigned int lastCommand;
cRcIoBase(void);
virtual ~cRcIoBase();
public:
enum { modeH = 'h', modeB = 'b', modeS = 's' };
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(bool Wait = false) = 0;
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL) = 0;
};
#if defined REMOTE_KBD
class cRcIoKBD : public cRcIoBase {
private:
cFile f;
public:
cRcIoKBD(void);
virtual ~cRcIoKBD();
virtual void Flush(int WaitMs = 0);
virtual bool InputAvailable(bool Wait = false);
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
};
#elif defined REMOTE_RCU
class cRcIoRCU : public cRcIoBase {
private:
cFile f;
unsigned char dp, code, mode;
unsigned short address;
int lastNumber;
bool SendCommand(unsigned char Cmd);
int ReceiveByte(bool Wait = true);
bool SendByteHandshake(unsigned char c);
bool SendByte(unsigned char c);
bool Digit(int n, int v);
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(bool Wait = false);
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
};
#elif defined REMOTE_LIRC
class cRcIoLIRC : public cRcIoBase {
private:
enum { LIRC_KEY_BUF = 8, LIRC_BUFFER_SIZE = 128 };
cFile f;
char keyName[LIRC_KEY_BUF];
const char *ReceiveString(void);
public:
cRcIoLIRC(char *DeviceName);
virtual ~cRcIoLIRC();
virtual void Flush(int WaitMs = 0);
virtual bool InputAvailable(bool Wait = false);
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
};
#else
#error Please define a remote control mode!
#endif
#endif //__REMOTE_H