mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
The RCU now only sets the channel number display when there are no incoming remote control keys
This commit is contained in:
parent
616ce3880a
commit
2d2369fca0
2
HISTORY
2
HISTORY
@ -1843,3 +1843,5 @@ Video Disk Recorder Revision History
|
|||||||
newline character (suggested by Gerhard Steiner).
|
newline character (suggested by Gerhard Steiner).
|
||||||
- Updated 'channels.conf.cable' (thanks to Andreas Kool).
|
- Updated 'channels.conf.cable' (thanks to Andreas Kool).
|
||||||
- Improved handling of repeated remote keys.
|
- 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.
|
||||||
|
16
rcu.c
16
rcu.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: 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"
|
#include "rcu.h"
|
||||||
@ -22,6 +22,7 @@ cRcuRemote::cRcuRemote(char *DeviceName)
|
|||||||
dp = 0;
|
dp = 0;
|
||||||
mode = modeB;
|
mode = modeB;
|
||||||
code = 0;
|
code = 0;
|
||||||
|
numberToSend = -1;
|
||||||
lastNumber = 0;
|
lastNumber = 0;
|
||||||
receivedCommand = false;
|
receivedCommand = false;
|
||||||
if ((f = open(DeviceName, O_RDWR | O_NONBLOCK)) >= 0) {
|
if ((f = open(DeviceName, O_RDWR | O_NONBLOCK)) >= 0) {
|
||||||
@ -136,8 +137,13 @@ void cRcuRemote::Action(void)
|
|||||||
repeat = false;
|
repeat = false;
|
||||||
LastCommand = 0;
|
LastCommand = 0;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
LastCommand = 0;
|
LastCommand = 0;
|
||||||
|
if (numberToSend >= 0) {
|
||||||
|
Number(numberToSend);
|
||||||
|
numberToSend = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (code && time(NULL) - LastCodeRefresh > 60) {
|
if (code && time(NULL) - LastCodeRefresh > 60) {
|
||||||
SendCommand(code); // in case the PIC listens to the wrong code
|
SendCommand(code); // in case the PIC listens to the wrong code
|
||||||
LastCodeRefresh = time(NULL);
|
LastCodeRefresh = time(NULL);
|
||||||
@ -302,8 +308,10 @@ bool cRcuRemote::DetectCode(unsigned char *Code)
|
|||||||
|
|
||||||
void cRcuRemote::ChannelSwitch(const cDevice *Device, int ChannelNumber)
|
void cRcuRemote::ChannelSwitch(const cDevice *Device, int ChannelNumber)
|
||||||
{
|
{
|
||||||
if (ChannelNumber && Device->IsPrimaryDevice())
|
if (ChannelNumber && Device->IsPrimaryDevice()) {
|
||||||
Number(ChannelNumber);
|
LOCK_THREAD;
|
||||||
|
numberToSend = ChannelNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cRcuRemote::Recording(const cDevice *Device, const char *Name)
|
void cRcuRemote::Recording(const cDevice *Device, const char *Name)
|
||||||
|
3
rcu.h
3
rcu.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: 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
|
#ifndef __RCU_H
|
||||||
@ -19,6 +19,7 @@ private:
|
|||||||
enum { modeH = 'h', modeB = 'b', modeS = 's' };
|
enum { modeH = 'h', modeB = 'b', modeS = 's' };
|
||||||
int f;
|
int f;
|
||||||
unsigned char dp, code, mode;
|
unsigned char dp, code, mode;
|
||||||
|
int numberToSend;
|
||||||
int lastNumber;
|
int lastNumber;
|
||||||
bool receivedCommand;
|
bool receivedCommand;
|
||||||
bool SendCommand(unsigned char Cmd);
|
bool SendCommand(unsigned char Cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user