From f20648eab26f8efee41642f198da3d35b2d408c1 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 12 Apr 2003 14:37:57 +0200 Subject: [PATCH] The LIRC and RCU remote control no longer try to learn keys in case of errors during startup --- CONTRIBUTORS | 2 ++ HISTORY | 3 +++ PLUGINS.html | 35 +++++++++++++++++++++-------------- interface.c | 6 +++++- lirc.c | 7 ++++++- lirc.h | 3 ++- rcu.c | 7 ++++++- rcu.h | 3 ++- remote.h | 3 ++- 9 files changed, 49 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d8b87945..f050d337 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -581,6 +581,8 @@ Malcolm Caldwell Ludwig Nussel for making the LIRC thread avoid high CPU load in case the connection to LIRC gets lost for fixing handling repeat function with LIRC + for reporting a problem with the LIRC remote control trying to learn keys even if it + couldn't connect to the LIRC daemon Thomas Koch for his support in keeping the Premiere World channels up to date in 'channels.conf' diff --git a/HISTORY b/HISTORY index 2d76387f..3ffae833 100644 --- a/HISTORY +++ b/HISTORY @@ -2028,3 +2028,6 @@ Video Disk Recorder Revision History - Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt). - The 'epg.data' file is now read after all plugins have been started (thanks to Sascha Volkenandt). +- The LIRC remote control no longer tries to learn keys if it can't connect to + the LIRC daemon (thanks to Ludwig Nussel for reporting this one). The same + applies to the RCU remote control in case of errors during startup. diff --git a/PLUGINS.html b/PLUGINS.html index fe651303..d6c37760 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -21,18 +21,18 @@ VDR program and present itself to the user. The internal interface provides the plugin code access to VDR's internal data structures and allows it to hook itself into specific areas to perform special actions.

-
  -Important modifications introduced in version 1.1.13 are marked like this. -
-
  +
  Important modifications introduced in version 1.1.14 are marked like this.
-
  +
  Important modifications introduced in version 1.1.15 are marked like this.
-
  +
  Important modifications introduced in version 1.1.17 are marked like this.
+
  +Important modifications introduced in version 1.1.27 are marked like this. +

Table Of Contents

@@ -506,7 +506,7 @@ in the call to VDR. If the user selects the main menu entry of a plugin, VDR calls the function -
  +
 


virtual cOsdObject *MainMenuAction(void);

@@ -1011,7 +1011,6 @@ bool DevicePoll(cPoller &Poller, int TimeoutMs = 0);

to determine whether the device is ready for further data. -
 

If the player can provide more than a single audio track, it can implement the following functions to make them available: @@ -1022,9 +1021,8 @@ virtual const char **GetAudioTracks(int *CurrentTrack = NULL); virtual void SetAudioTrack(int Index);

-

-
  +
  If there is an additional audio track that has to be replayed with external hardware, the player shall call its member function @@ -1260,7 +1258,6 @@ virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView); These functions will be called with the desired source or channel and shall return whether this device can provide the requested source or channel and whether tuning to it was successful, repectively. -
 

Audio selection

@@ -1273,7 +1270,6 @@ virtual const char **GetAudioTracksDevice(int *CurrentTrack = NULL) const; virtual void SetAudioTrackDevice(int Index);

-

Recording

@@ -1307,7 +1303,7 @@ The functions to implement replaying capabilites are


virtual bool HasDecoder(void) const; -
  +
  virtual bool CanReplay(void) const;
virtual bool SetPlayMode(ePlayMode PlayMode); @@ -1369,7 +1365,7 @@ shut down (delete) all devices when the program terminates. It is therefore important that the devices are created on the heap, using the new operator! -
  +
 

Dolby Digital

"The stereo effect may only be experienced if stereo equipment is used!"

@@ -1480,6 +1476,17 @@ the incoming data (by calling your Action() function). In case you need to do any other setup steps, like opening a file or initializing member variables, you should do so before calling Start().

+
  +If your remote control for some reason can't work (maybe because it was unable to +open some file handle it requires) it can implement the virtual function + +


+virtual bool Ready(void); +

+ +and have it return false. In that case VDR will not try to learn keys from +that remote control. +

VDR will handle everything necessary to learn the key mappings of your remote control. In order to do so, it will first call the virtual function Initialize(), in which you should take all necessary steps to make sure your remote control diff --git a/interface.c b/interface.c index 82b2531e..9245c85f 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.62 2003/04/06 12:47:51 kls Exp $ + * $Id: interface.c 1.63 2003/04/12 14:17:49 kls Exp $ */ #include "interface.h" @@ -411,6 +411,10 @@ void cInterface::QueryKeys(cRemote *Remote) void cInterface::LearnKeys(void) { for (cRemote *Remote = Remotes.First(); Remote; Remote = Remotes.Next(Remote)) { + if (!Remote->Ready()) { + esyslog("ERROR: remote control %s not ready!", Remote->Name()); + continue; + } bool known = Keys.KnowsRemote(Remote->Name()); dsyslog("remote control %s - %s", Remote->Name(), known ? "keys known" : "learning keys"); if (!known) { diff --git a/lirc.c b/lirc.c index 2c92f6ab..b7f5b936 100644 --- a/lirc.c +++ b/lirc.c @@ -6,7 +6,7 @@ * * LIRC support added by Carsten Koch 2000-06-16. * - * $Id: lirc.c 1.3 2003/04/06 15:45:10 kls Exp $ + * $Id: lirc.c 1.4 2003/04/12 14:37:17 kls Exp $ */ #include "lirc.h" @@ -41,6 +41,11 @@ cLircRemote::~cLircRemote() Cancel(); } +bool cLircRemote::Ready(void) +{ + return f >= 0; +} + void cLircRemote::Action(void) { dsyslog("LIRC remote control thread started (pid=%d)", getpid()); diff --git a/lirc.h b/lirc.h index ff58f315..cd3c780d 100644 --- a/lirc.h +++ b/lirc.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: lirc.h 1.1 2002/09/28 14:11:04 kls Exp $ + * $Id: lirc.h 1.2 2003/04/12 14:15:20 kls Exp $ */ #ifndef __LIRC_H @@ -21,6 +21,7 @@ private: public: cLircRemote(char *DeviceName); virtual ~cLircRemote(); + virtual bool Ready(void); }; #endif //__LIRC_H diff --git a/rcu.c b/rcu.c index 4157c0d2..5c76a35c 100644 --- a/rcu.c +++ b/rcu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: rcu.c 1.3 2002/12/07 12:22:40 kls Exp $ + * $Id: rcu.c 1.4 2003/04/12 14:37:13 kls Exp $ */ #include "rcu.h" @@ -55,6 +55,11 @@ cRcuRemote::~cRcuRemote() Cancel(); } +bool cRcuRemote::Ready(void) +{ + return f >= 0; +} + bool cRcuRemote::Initialize(void) { if (f >= 0) { diff --git a/rcu.h b/rcu.h index d314275d..534ca3da 100644 --- a/rcu.h +++ b/rcu.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: rcu.h 1.2 2002/12/07 12:21:25 kls Exp $ + * $Id: rcu.h 1.3 2003/04/12 14:36:09 kls Exp $ */ #ifndef __RCU_H @@ -39,6 +39,7 @@ private: public: cRcuRemote(char *DeviceName); virtual ~cRcuRemote(); + virtual bool Ready(void); virtual bool Initialize(void); }; diff --git a/remote.h b/remote.h index 7908b1db..f26be169 100644 --- a/remote.h +++ b/remote.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: remote.h 1.24 2002/12/15 15:49:06 kls Exp $ + * $Id: remote.h 1.25 2003/04/12 14:14:49 kls Exp $ */ #ifndef __REMOTE_H @@ -37,6 +37,7 @@ protected: bool Put(const char *Code, bool Repeat = false, bool Release = false); public: virtual ~cRemote(); + virtual bool Ready(void) { return true; } virtual bool Initialize(void) { return true; } const char *Name(void) { return name; } static void SetLearning(cRemote *Learning) { learning = Learning; }