diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2000-10-08 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2000-10-08 18:00:00 +0200 |
commit | a379eb714f7f5ef9a12efbe7588bb3509faba056 (patch) | |
tree | ea9a0720f305e8ee76ea7c60c996fd3a8bad0ce5 /remote.h | |
parent | ef8fe3f04c30caedeb17b11ac275581539f039c7 (diff) | |
download | vdr-patch-lnbsharing-a379eb714f7f5ef9a12efbe7588bb3509faba056.tar.gz vdr-patch-lnbsharing-a379eb714f7f5ef9a12efbe7588bb3509faba056.tar.bz2 |
Version 0.66vdr-0.66
- Remote control data is now received in a separate thread, which makes things
a lot smoother.
- Repeat and release of remote control keys is now explicitly distinguished.
- In replay mode the search forward/back and skip functions now have two modes:
Pressing the key shortly and releasing it starts the function, and pressing it
again stops it. Pressing and holding down the key starts the function and
releasing the key stops it.
- The '@' character that marks an "instant recording" can now be turned off
in the "Setup" menu (thanks to Matthias Schniedermeyer).
- Pressing the "Back" button while replaying now stops replaying and brings up
the "Recordings" menu (suggested by Carsten Koch). This can be used to easily
delete a recording after watching it, or to switch to a different recording.
- The "Recordings" menu now places the cursor on the last replayed recording, if
that file still exists.
- The "Blue" button in the "Main" menu can now be used to "Resume" a previously
stopped replay session (suggested by Martin Hammerschmid).
- The low and high LNB frequencies can now be changed in the "Setup" menu.
Diffstat (limited to 'remote.h')
-rw-r--r-- | remote.h | 44 |
1 files changed, 23 insertions, 21 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: remote.h 1.10 2000/10/03 10:45:35 kls Exp $ + * $Id: remote.h 1.13 2000/10/08 12:11:34 kls Exp $ */ #ifndef __REMOTE_H @@ -12,26 +12,25 @@ #include <stdio.h> #include <time.h> +#include "thread.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 ~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) = 0; - virtual bool InputAvailable(bool Wait = false) = 0; - virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL) = 0; + virtual void Flush(int WaitMs = 0) {} + virtual bool InputAvailable(void) = 0; + virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL) = 0; }; #if defined REMOTE_KBD @@ -43,23 +42,27 @@ 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); + virtual bool InputAvailable(void); + virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL); }; #elif defined REMOTE_RCU -class cRcIoRCU : public cRcIoBase { +class cRcIoRCU : public cRcIoBase, private cThread { private: - cFile f; + 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(bool Wait = true); + 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(); @@ -70,25 +73,24 @@ public: 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); + virtual bool InputAvailable(void) { return receivedData; } + virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL); }; #elif defined REMOTE_LIRC -class cRcIoLIRC : public cRcIoBase { +class cRcIoLIRC : public cRcIoBase, private cThread { private: enum { LIRC_KEY_BUF = 8, LIRC_BUFFER_SIZE = 128 }; - cFile f; + int f; char keyName[LIRC_KEY_BUF]; - int repeat; - const char *ReceiveString(void); + bool receivedData, receivedRepeat, receivedRelease; + virtual void Action(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); + virtual bool InputAvailable(void) { return receivedData; } + virtual bool GetCommand(unsigned int *Command = NULL, bool *Repeat = NULL, bool *Release = NULL); }; #else |