diff options
| author | Klaus Schmidinger <vdr@tvdr.de> | 2002-11-01 10:53:07 +0100 | 
|---|---|---|
| committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-11-01 10:53:07 +0100 | 
| commit | c1a5a7d50c4a45b3d3d65717c788e1925463a61e (patch) | |
| tree | 9ba01bdc6f892e17da20ce08932a2b0fd74c7814 | |
| parent | fd3e819ba808e98d68737cf45583d70fa0588e51 (diff) | |
| download | vdr-c1a5a7d50c4a45b3d3d65717c788e1925463a61e.tar.gz vdr-c1a5a7d50c4a45b3d3d65717c788e1925463a61e.tar.bz2 | |
Only accepting key presses from the current remote control when learning
| -rw-r--r-- | CONTRIBUTORS | 2 | ||||
| -rw-r--r-- | HISTORY | 2 | ||||
| -rw-r--r-- | interface.c | 6 | ||||
| -rw-r--r-- | remote.c | 6 | ||||
| -rw-r--r-- | remote.h | 6 | 
5 files changed, 14 insertions, 8 deletions
| diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 7b75ac85..70b0b07e 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -426,6 +426,8 @@ Oliver Endriss <o.endriss@gmx.de>   one remote control   for reporting a crash when learning the keys of several remote controls and   pressing buttons of those that have already been learned + for making the remote control learn procedure accept key presses only from the + current remote control  Reinhard Walter Buchner <rw.buchner@freenet.de>   for adding some satellites to 'sources.conf' @@ -1677,3 +1677,5 @@ Video Disk Recorder Revision History    The NEWSTRUCT compile time switch is now obsolete. The required driver is now    the CVS HEAD version dated 2002-11-01 or later.  - Adjusted the INSTALL file to the 1.1.x version. +- Only accepting key presses from the current remote control when learning (thanks to +  Oliver Endriss). diff --git a/interface.c b/interface.c index a9f0d9a9..804747ae 100644 --- a/interface.c +++ b/interface.c @@ -4,7 +4,7 @@   * See the main source file 'vdr.c' for copyright information and   * how to reach the author.   * - * $Id: interface.c 1.59 2002/10/27 15:54:05 kls Exp $ + * $Id: interface.c 1.60 2002/11/01 10:50:38 kls Exp $   */  #include "interface.h" @@ -418,9 +418,9 @@ void cInterface::LearnKeys(void)           Clear();           cRemote::Clear();           WriteText(1, 1, Headline); -         cRemote::SetLearning(true); +         cRemote::SetLearning(Remote);           QueryKeys(Remote); -         cRemote::SetLearning(false); +         cRemote::SetLearning(NULL);           Clear();           WriteText(1, 1, Headline);           WriteText(1, 3, tr("Phase 3: Saving key codes")); @@ -4,7 +4,7 @@   * See the main source file 'vdr.c' for copyright information and   * how to reach the author.   * - * $Id: remote.c 1.30 2002/10/27 15:15:58 kls Exp $ + * $Id: remote.c 1.31 2002/11/01 10:50:13 kls Exp $   */  #include "remote.h" @@ -27,7 +27,7 @@  eKeys cRemote::keys[MaxKeys];  int cRemote::in = 0;  int cRemote::out = 0; -bool cRemote::learning = false; +cRemote *cRemote::learning = NULL;  char *cRemote::unknownCode = NULL;  cMutex cRemote::mutex;  cCondVar cRemote::keyPressed; @@ -109,6 +109,8 @@ bool cRemote::Put(uint64 Code, bool Repeat, bool Release)  bool cRemote::Put(const char *Code, bool Repeat, bool Release)  { +  if (learning && this != learning) +     return false;    eKeys Key = Keys.Get(Name(), Code);    if (Key != kNone) {       if (Repeat) @@ -4,7 +4,7 @@   * See the main source file 'vdr.c' for copyright information and   * how to reach the author.   * - * $Id: remote.h 1.18 2002/10/27 15:16:50 kls Exp $ + * $Id: remote.h 1.19 2002/11/01 10:48:11 kls Exp $   */  #ifndef __REMOTE_H @@ -24,7 +24,7 @@ private:    static eKeys keys[MaxKeys];    static int in;    static int out; -  static bool learning; +  static cRemote *learning;    static char *unknownCode;    static cMutex mutex;    static cCondVar keyPressed; @@ -39,7 +39,7 @@ public:    virtual ~cRemote();    virtual bool Initialize(void) { return true; }    const char *Name(void) { return name; } -  static void SetLearning(bool On) { learning = On; } +  static void SetLearning(cRemote *Learning) { learning = Learning; }    static void Clear(void);    static bool Put(eKeys Key);    static bool PutMacro(eKeys Key); | 
