summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-12-07 12:27:59 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-12-07 12:27:59 +0100
commit2d2369fca0c1d715009c9c29b03ffd47c0afa659 (patch)
treecd5c02691cf2be625f998f5d73f8c8d2467e3077
parent616ce3880a7e7cf6b23ddb40f21f40bb4a73aa35 (diff)
downloadvdr-2d2369fca0c1d715009c9c29b03ffd47c0afa659.tar.gz
vdr-2d2369fca0c1d715009c9c29b03ffd47c0afa659.tar.bz2
The RCU now only sets the channel number display when there are no incoming remote control keys
-rw-r--r--HISTORY2
-rw-r--r--rcu.c16
-rw-r--r--rcu.h3
3 files changed, 16 insertions, 5 deletions
diff --git a/HISTORY b/HISTORY
index 63b341c3..ab4c5c15 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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.
diff --git a/rcu.c b/rcu.c
index 6345bea7..4157c0d2 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.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)
diff --git a/rcu.h b/rcu.h
index 1c54999c..d314275d 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.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);