diff options
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | rcu.c | 16 | ||||
-rw-r--r-- | rcu.h | 3 |
3 files changed, 16 insertions, 5 deletions
@@ -1843,3 +1843,5 @@ Video Disk Recorder Revision History newline character (suggested by Gerhard Steiner). - Updated 'channels.conf.cable' (thanks to Andreas Kool). - Improved handling of repeated remote keys. +- The RCU now only sets the channel number display when there are no incoming remote + control keys, which improves reaction on repeated keys. @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: rcu.c 1.2 2002/10/06 15:49:03 kls Exp $ + * $Id: rcu.c 1.3 2002/12/07 12:22:40 kls Exp $ */ #include "rcu.h" @@ -22,6 +22,7 @@ cRcuRemote::cRcuRemote(char *DeviceName) dp = 0; mode = modeB; code = 0; + numberToSend = -1; lastNumber = 0; receivedCommand = false; if ((f = open(DeviceName, O_RDWR | O_NONBLOCK)) >= 0) { @@ -136,8 +137,13 @@ void cRcuRemote::Action(void) repeat = false; LastCommand = 0; } - else + else { LastCommand = 0; + if (numberToSend >= 0) { + Number(numberToSend); + numberToSend = -1; + } + } if (code && time(NULL) - LastCodeRefresh > 60) { SendCommand(code); // in case the PIC listens to the wrong code LastCodeRefresh = time(NULL); @@ -302,8 +308,10 @@ bool cRcuRemote::DetectCode(unsigned char *Code) void cRcuRemote::ChannelSwitch(const cDevice *Device, int ChannelNumber) { - if (ChannelNumber && Device->IsPrimaryDevice()) - Number(ChannelNumber); + if (ChannelNumber && Device->IsPrimaryDevice()) { + LOCK_THREAD; + numberToSend = ChannelNumber; + } } void cRcuRemote::Recording(const cDevice *Device, const char *Name) @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: rcu.h 1.1 2002/09/29 08:56:15 kls Exp $ + * $Id: rcu.h 1.2 2002/12/07 12:21:25 kls Exp $ */ #ifndef __RCU_H @@ -19,6 +19,7 @@ private: enum { modeH = 'h', modeB = 'b', modeS = 's' }; int f; unsigned char dp, code, mode; + int numberToSend; int lastNumber; bool receivedCommand; bool SendCommand(unsigned char Cmd); |