diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-12-07 12:27:59 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-12-07 12:27:59 +0100 |
commit | 2d2369fca0c1d715009c9c29b03ffd47c0afa659 (patch) | |
tree | cd5c02691cf2be625f998f5d73f8c8d2467e3077 /rcu.c | |
parent | 616ce3880a7e7cf6b23ddb40f21f40bb4a73aa35 (diff) | |
download | vdr-2d2369fca0c1d715009c9c29b03ffd47c0afa659.tar.gz vdr-2d2369fca0c1d715009c9c29b03ffd47c0afa659.tar.bz2 |
The RCU now only sets the channel number display when there are no incoming remote control keys
Diffstat (limited to 'rcu.c')
-rw-r--r-- | rcu.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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) |