mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Only accepting key presses from the current remote control when learning
This commit is contained in:
		| @@ -426,6 +426,8 @@ Oliver Endriss <o.endriss@gmx.de> | |||||||
|  one remote control |  one remote control | ||||||
|  for reporting a crash when learning the keys of several remote controls and |  for reporting a crash when learning the keys of several remote controls and | ||||||
|  pressing buttons of those that have already been learned |  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> | Reinhard Walter Buchner <rw.buchner@freenet.de> | ||||||
|  for adding some satellites to 'sources.conf' |  for adding some satellites to 'sources.conf' | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -1677,3 +1677,5 @@ Video Disk Recorder Revision History | |||||||
|   The NEWSTRUCT compile time switch is now obsolete. The required driver is now |   The NEWSTRUCT compile time switch is now obsolete. The required driver is now | ||||||
|   the CVS HEAD version dated 2002-11-01 or later. |   the CVS HEAD version dated 2002-11-01 or later. | ||||||
| - Adjusted the INSTALL file to the 1.1.x version. | - 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). | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ | |||||||
|  * See the main source file 'vdr.c' for copyright information and |  * See the main source file 'vdr.c' for copyright information and | ||||||
|  * how to reach the author. |  * 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" | #include "interface.h" | ||||||
| @@ -418,9 +418,9 @@ void cInterface::LearnKeys(void) | |||||||
|          Clear(); |          Clear(); | ||||||
|          cRemote::Clear(); |          cRemote::Clear(); | ||||||
|          WriteText(1, 1, Headline); |          WriteText(1, 1, Headline); | ||||||
|          cRemote::SetLearning(true); |          cRemote::SetLearning(Remote); | ||||||
|          QueryKeys(Remote); |          QueryKeys(Remote); | ||||||
|          cRemote::SetLearning(false); |          cRemote::SetLearning(NULL); | ||||||
|          Clear(); |          Clear(); | ||||||
|          WriteText(1, 1, Headline); |          WriteText(1, 1, Headline); | ||||||
|          WriteText(1, 3, tr("Phase 3: Saving key codes")); |          WriteText(1, 3, tr("Phase 3: Saving key codes")); | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								remote.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								remote.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
|  * See the main source file 'vdr.c' for copyright information and |  * See the main source file 'vdr.c' for copyright information and | ||||||
|  * how to reach the author. |  * 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" | #include "remote.h" | ||||||
| @@ -27,7 +27,7 @@ | |||||||
| eKeys cRemote::keys[MaxKeys]; | eKeys cRemote::keys[MaxKeys]; | ||||||
| int cRemote::in = 0; | int cRemote::in = 0; | ||||||
| int cRemote::out = 0; | int cRemote::out = 0; | ||||||
| bool cRemote::learning = false; | cRemote *cRemote::learning = NULL; | ||||||
| char *cRemote::unknownCode = NULL; | char *cRemote::unknownCode = NULL; | ||||||
| cMutex cRemote::mutex; | cMutex cRemote::mutex; | ||||||
| cCondVar cRemote::keyPressed; | 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) | bool cRemote::Put(const char *Code, bool Repeat, bool Release) | ||||||
| { | { | ||||||
|  |   if (learning && this != learning) | ||||||
|  |      return false; | ||||||
|   eKeys Key = Keys.Get(Name(), Code); |   eKeys Key = Keys.Get(Name(), Code); | ||||||
|   if (Key != kNone) { |   if (Key != kNone) { | ||||||
|      if (Repeat) |      if (Repeat) | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								remote.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								remote.h
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | |||||||
|  * See the main source file 'vdr.c' for copyright information and |  * See the main source file 'vdr.c' for copyright information and | ||||||
|  * how to reach the author. |  * 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 | #ifndef __REMOTE_H | ||||||
| @@ -24,7 +24,7 @@ private: | |||||||
|   static eKeys keys[MaxKeys]; |   static eKeys keys[MaxKeys]; | ||||||
|   static int in; |   static int in; | ||||||
|   static int out; |   static int out; | ||||||
|   static bool learning; |   static cRemote *learning; | ||||||
|   static char *unknownCode; |   static char *unknownCode; | ||||||
|   static cMutex mutex; |   static cMutex mutex; | ||||||
|   static cCondVar keyPressed; |   static cCondVar keyPressed; | ||||||
| @@ -39,7 +39,7 @@ public: | |||||||
|   virtual ~cRemote(); |   virtual ~cRemote(); | ||||||
|   virtual bool Initialize(void) { return true; } |   virtual bool Initialize(void) { return true; } | ||||||
|   const char *Name(void) { return name; } |   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 void Clear(void); | ||||||
|   static bool Put(eKeys Key); |   static bool Put(eKeys Key); | ||||||
|   static bool PutMacro(eKeys Key); |   static bool PutMacro(eKeys Key); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user