1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Displaying the recording DVB interface status in the decimal points of the RCU display

This commit is contained in:
Klaus Schmidinger 2000-05-07 09:28:39 +02:00
parent bc44196ee5
commit 820de6bf59
5 changed files with 29 additions and 7 deletions

View File

@ -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: interface.c 1.8 2000/05/06 15:24:18 kls Exp $ * $Id: interface.c 1.9 2000/05/07 09:28:39 kls Exp $
*/ */
#include "interface.h" #include "interface.h"
@ -336,6 +336,13 @@ void cInterface::DisplayChannel(int Number, const char *Name)
} }
} }
void cInterface::DisplayRecording(int Index, bool On)
{
#ifndef DEBUG_REMOTE
RcIo.SetPoints(1 << Index, On);
#endif
}
bool cInterface::Recording(void) bool cInterface::Recording(void)
{ {
// This is located here because the Interface has to do with the "PrimaryDvbApi" anyway // This is located here because the Interface has to do with the "PrimaryDvbApi" anyway

View File

@ -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: interface.h 1.8 2000/05/01 10:10:08 kls Exp $ * $Id: interface.h 1.9 2000/05/06 15:39:23 kls Exp $
*/ */
#ifndef __INTERFACE_H #ifndef __INTERFACE_H
@ -43,6 +43,7 @@ public:
void Help(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); void Help(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL);
void LearnKeys(void); void LearnKeys(void);
void DisplayChannel(int Number, const char *Name = NULL); void DisplayChannel(int Number, const char *Name = NULL);
void DisplayRecording(int Index, bool On);
bool Recording(void); bool Recording(void);
}; };

4
menu.c
View File

@ -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: menu.c 1.13 2000/05/01 16:29:46 kls Exp $ * $Id: menu.c 1.14 2000/05/06 15:43:57 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -1056,12 +1056,14 @@ cRecordControl::cRecordControl(cDvbApi *DvbApi, cTimer *Timer)
cChannel::SwitchTo(timer->channel - 1, dvbApi); cChannel::SwitchTo(timer->channel - 1, dvbApi);
cRecording Recording(timer); cRecording Recording(timer);
dvbApi->StartRecord(Recording.FileName()); dvbApi->StartRecord(Recording.FileName());
Interface.DisplayRecording(dvbApi->Index(), true);
} }
cRecordControl::~cRecordControl() cRecordControl::~cRecordControl()
{ {
Stop(true); Stop(true);
delete instantId; delete instantId;
Interface.DisplayRecording(dvbApi->Index(), false);
} }
void cRecordControl::Stop(bool KeepInstant) void cRecordControl::Stop(bool KeepInstant)

View File

@ -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: remote.c 1.6 2000/04/24 09:45:56 kls Exp $ * $Id: remote.c 1.7 2000/05/07 09:28:18 kls Exp $
*/ */
#include "remote.h" #include "remote.h"
@ -29,6 +29,7 @@ cRcIo::cRcIo(char *DeviceName)
t = 0; t = 0;
firstTime = lastTime = 0; firstTime = lastTime = 0;
lastCommand = 0; lastCommand = 0;
lastNumber = 0;
if ((f = open(DeviceName, O_RDWR | O_NONBLOCK)) >= 0) { if ((f = open(DeviceName, O_RDWR | O_NONBLOCK)) >= 0) {
struct termios t; struct termios t;
if (tcgetattr(f, &t) == 0) { if (tcgetattr(f, &t) == 0) {
@ -206,6 +207,7 @@ bool cRcIo::Number(int n, bool Hex)
n = (n << 4) | ((*d - '0') & 0x0F); n = (n << 4) | ((*d - '0') & 0x0F);
} }
} }
lastNumber = n;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (!Digit(i, n)) if (!Digit(i, n))
return false; return false;
@ -231,6 +233,15 @@ bool cRcIo::String(char *s)
return Number(n, true); return Number(n, true);
} }
void cRcIo::SetPoints(unsigned char Dp, bool On)
{
if (On)
dp |= Dp;
else
dp &= ~Dp;
Number(lastNumber, true);
}
bool cRcIo::DetectCode(unsigned char *Code, unsigned short *Address) bool cRcIo::DetectCode(unsigned char *Code, unsigned short *Address)
{ {
// Caller should initialize 'Code' to 0 and call DetectCode() // Caller should initialize 'Code' to 0 and call DetectCode()

View File

@ -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: remote.h 1.4 2000/04/24 09:46:00 kls Exp $ * $Id: remote.h 1.5 2000/05/07 09:27:54 kls Exp $
*/ */
#ifndef __REMOTE_H #ifndef __REMOTE_H
@ -21,10 +21,12 @@ private:
time_t t; time_t t;
int firstTime, lastTime; int firstTime, lastTime;
unsigned int lastCommand; unsigned int lastCommand;
int lastNumber;
bool SendCommand(unsigned char Cmd); bool SendCommand(unsigned char Cmd);
int ReceiveByte(bool Wait = true); int ReceiveByte(bool Wait = true);
bool SendByteHandshake(unsigned char c); bool SendByteHandshake(unsigned char c);
bool SendByte(unsigned char c); bool SendByte(unsigned char c);
bool Digit(int n, int v);
public: public:
enum { modeH = 'h', modeB = 'b', modeS = 's' }; enum { modeH = 'h', modeB = 'b', modeS = 's' };
cRcIo(char *DeviceName); cRcIo(char *DeviceName);
@ -34,9 +36,8 @@ public:
bool SetCode(unsigned char Code, unsigned short Address); bool SetCode(unsigned char Code, unsigned short Address);
bool SetMode(unsigned char Mode); bool SetMode(unsigned char Mode);
bool GetCommand(unsigned int *Command, unsigned short *Address = NULL); bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
bool Digit(int n, int v);
bool Number(int n, bool Hex = false); bool Number(int n, bool Hex = false);
void Points(unsigned char Dp) { dp = Dp; } void SetPoints(unsigned char Dp, bool On);
bool String(char *s); bool String(char *s);
bool DetectCode(unsigned char *Code, unsigned short *Address); bool DetectCode(unsigned char *Code, unsigned short *Address);
}; };