Commit 7e4b4d29 authored by Klaus Schmidinger's avatar Klaus Schmidinger

Version 0.64

- NOTE: If you are using DVB driver version 0.7 you need to load the dvb.o
  module with option outstream=0, so your insmod statement should read
  'insmod dvb.o outstream=0'. This is currently necessary because 'vdr'
  still works with AV_PES data.
- Video files now have the 'group read' bit set.
- Fixed handling errors in 'readstring()'.
- Handling SIGPIPE and re-establishing handler after intercepting a signal.
- The configuration files are now by default read from the video directory.
  This can be changed by using the new '-c' option. Make sure you copy your
  current '*.conf' files to your video directory ('/video' by default), or
  use "-c ." to get the old behaviour of loading the configuration files
  from the current directory.
- Waiting for input is now handled by a common function, which improves
  response time on user actions. As a consequence the EIT data may sometimes
  not be displayed, but this will change later when cEIT runs as a separate
  thread.
- The new SVDRP command 'HITK' (thanks to Guido Fiala!) can be used to 'hit'
  a remote control key.  Establish an SVDRP connection and enter HITK without
  a parameter for a list of all valid key names.
- The new SVDRP command 'GRAB' (thanks to Guido Fiala!) can be used to grab
  the current frame and save it to a file.
- The new SVDRP commands 'OVL*' can be used to control video overlays (thanks
  to Guido Fiala!). This is mainly for use in the 'kvdr' tool (see the 'kvdr'
  page at http://www.s.netic.de/gfiala).
- If the name of the video directory used with the '-v' option had trailing
  slashes, the recording file names have been damaged. Trailing slashes are
  now silently removed.
- Fixed a buffer overflow in EIT parsing.
- Added a security warning regarding SVDRP to the INSTALL file.
- Fixed 'confirm' dialog.
- The daemon mode (option '-d') now no longer works with REMOTE=KBD (there
  is no stdin in daemon mode, so KBD makes no sense - plus it sometimes
  crashed).
parent 76c33118
......@@ -18,6 +18,9 @@ Heino Goldenstein <heino.goldenstein@microplex.de>
Guido Fiala <gfiala@s.netic.de>
for implementing slow forward/back
for implementing the SVDRP command 'HITK'
for implementing image grabbing
for implementing overlay capabilities (see his 'kvdr' tool at http://www.s.netic.de/gfiala)
Robert Schneider <Robert.Schneider@lotus.com>
for implementing EIT support for displaying the current/next info
......
......@@ -167,4 +167,39 @@ Video Disk Recorder Revision History
- When directly selecting a channel by entering the channel number, the digits
entered so far together with the name of that channel are displayed on the
OSD (suggested by Martin Hammerschmid).
2000-09-20: Version 0.64
- NOTE: If you are using DVB driver version 0.7 you need to load the dvb.o
module with option outstream=0, so your insmod statement should read
'insmod dvb.o outstream=0'. This is currently necessary because 'vdr'
still works with AV_PES data.
- Video files now have the 'group read' bit set.
- Fixed handling errors in 'readstring()'.
- Handling SIGPIPE and re-establishing handler after intercepting a signal.
- The configuration files are now by default read from the video directory.
This can be changed by using the new '-c' option. Make sure you copy your
current '*.conf' files to your video directory ('/video' by default), or
use "-c ." to get the old behaviour of loading the configuration files
from the current directory.
- Waiting for input is now handled by a common function, which improves
response time on user actions. As a consequence the EIT data may sometimes
not be displayed, but this will change later when cEIT runs as a separate
thread.
- The new SVDRP command 'HITK' (thanks to Guido Fiala!) can be used to 'hit'
a remote control key. Establish an SVDRP connection and enter HITK without
a parameter for a list of all valid key names.
- The new SVDRP command 'GRAB' (thanks to Guido Fiala!) can be used to grab
the current frame and save it to a file.
- The new SVDRP commands 'OVL*' can be used to control video overlays (thanks
to Guido Fiala!). This is mainly for use in the 'kvdr' tool (see the 'kvdr'
page at http://www.s.netic.de/gfiala).
- If the name of the video directory used with the '-v' option had trailing
slashes, the recording file names have been damaged. Trailing slashes are
now silently removed.
- Fixed a buffer overflow in EIT parsing.
- Added a security warning regarding SVDRP to the INSTALL file.
- Fixed 'confirm' dialog.
- The daemon mode (option '-d') now no longer works with REMOTE=KBD (there
is no stdin in daemon mode, so KBD makes no sense - plus it sometimes
crashed).
......@@ -16,7 +16,11 @@ you will have to change the definition of DVBDIR in the
Makefile.
This program requires the card driver version 0.05 or higher
to work properly.
to work properly. If you are using driver version 0.7 you need
to load the dvb.o module with option outstream=0, so your insmod
statement should read 'insmod dvb.o outstream=0'. This is currently
necessary because 'vdr' works with AV_PES data and will change
once it has been modified to work directly with MPEG2.
After extracting the package, change into the VDR directory
and type 'make'. This should produce an executable file
......@@ -48,6 +52,11 @@ port ("Simple Video Disk Recorder Protocol"). By default, it listens
on port 2001 (use the --port=PORT option to change this). For details
about the SVDRP syntax see the source file 'svdrp.c'.
WARNING: DUE TO THE OPEN SVDRP PORT THIS PROGRAM MAY CONSTITUTE A
======= POTENTIAL SECURITY HAZARD! IF YOU ARE NOT RUNNING VDR IN
A CONTROLLED ENVIRONMENT, YOU MAY WANT TO DISABLE SVDRP
BY USING '--port=0'!
If the program shall run as a daemon, use the --daemon option. This
will completely detach it from the terminal and will continue as a
background process.
......@@ -64,7 +73,9 @@ All recordings are written into directories below "/video". Please
make sure this directory exists, and that the user who runs the 'vdr'
program has read and write access to that directory.
If you prefer a different location for your video files, you can use
the '-v' option to change that.
the '-v' option to change that. Please make sure that the directory
name you use with '-v' is a clean and absolute path name (no '..' or
multiple slashes).
Note that the file system need not be 64-bit proof, since the 'vdr'
program splits video files into chunks of about 1GB. You should use
......@@ -102,14 +113,15 @@ Configuration files:
--------------------
There are three configuration files that hold information about
channels, remote control keys and timers. These files are currrently
assumed to be located in the directory from which the 'vdr' program
was started (this will become configurable later). The configuration
files can be edited with any text editor, or will be written by the
'vdr' program if any changes are made inside the on-screen menus.
The meaning of the data entries may still vary in future releases,
so for the moment please look at the source code (config.c) to see
the meaning of the various fields.
channels, remote control keys and timers. By default these files are
assumed to be located in the video directory, but a different directory
can be used with the '-c' option.
The configuration files can be edited with any text editor, or will be written
by the 'vdr' program if any changes are made inside the on-screen menus.
The meaning of the data entries may still vary in future releases, so for the
moment please look at the source code (config.c) to see the meaning of the
various fields.
The files that come with this package contain the author's selections,
so please make sure you adapt these to your personal taste. Also make sure
......
......@@ -4,7 +4,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Makefile 1.9 2000/09/10 08:55:45 kls Exp $
# $Id: Makefile 1.11 2000/09/20 17:01:57 kls Exp $
DVBDIR = ../DVB
......@@ -26,21 +26,21 @@ endif
all: vdr
config.o : config.c config.h dvbapi.h eit.h interface.h tools.h
dvbapi.o : dvbapi.c config.h dvbapi.h interface.h tools.h videodir.h
eit.o : eit.c eit.h
interface.o: interface.c config.h dvbapi.h eit.h interface.h remote.h tools.h
menu.o : menu.c config.h dvbapi.h interface.h menu.h osd.h recording.h tools.h
osd.o : osd.c config.h dvbapi.h interface.h osd.h tools.h
vdr.o : vdr.c config.h dvbapi.h interface.h menu.h osd.h recording.h svdrp.h tools.h videodir.h
recording.o: recording.c config.h dvbapi.h interface.h recording.h tools.h videodir.h
remote.o : remote.c remote.h tools.h
svdrp.o : svdrp.c svdrp.h config.h interface.h tools.h
config.o : config.c config.h dvbapi.h eit.h interface.h svdrp.h tools.h
dvbapi.o : dvbapi.c config.h dvbapi.h interface.h svdrp.h tools.h videodir.h
eit.o : eit.c eit.h tools.h
interface.o: interface.c config.h dvbapi.h eit.h interface.h remote.h svdrp.h tools.h
menu.o : menu.c config.h dvbapi.h interface.h menu.h osd.h recording.h svdrp.h tools.h
osd.o : osd.c config.h dvbapi.h interface.h osd.h svdrp.h tools.h
recording.o: recording.c config.h dvbapi.h interface.h recording.h svdrp.h tools.h videodir.h
remote.o : remote.c config.h dvbapi.h remote.h tools.h
svdrp.o : svdrp.c config.h dvbapi.h interface.h svdrp.h tools.h
tools.o : tools.c tools.h
vdr.o : vdr.c config.h dvbapi.h interface.h menu.h osd.h recording.h svdrp.h tools.h videodir.h
videodir.o : videodir.c tools.h videodir.h
vdr: $(OBJS)
g++ -g -O2 $(OBJS) -lncurses -o vdr
g++ -g -O2 $(OBJS) -lncurses -ljpeg -o vdr
clean:
-rm $(OBJS) vdr
......@@ -7,5 +7,4 @@ TODO list for the Video Disk Recorder project
scenes in order to archive them (or, reversely, cut out
commercial breaks).
* Implement channel scanning.
* Better support for encrypted channels.
* Implement remaining commands in SVDRP.
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.22 2000/09/10 15:07:15 kls Exp $
* $Id: config.c 1.23 2000/09/17 09:11:59 kls Exp $
*/
#include "config.h"
......@@ -155,14 +155,22 @@ eKeys cKeys::Get(unsigned int Code)
return kNone;
}
unsigned int cKeys::Encode(const char *Command)
eKeys cKeys::Translate(const char *Command)
{
if (Command != NULL) {
if (Command) {
const tKey *k = keys;
while ((k->type != kNone) && strcmp(k->name, Command) != 0)
while ((k->type != kNone) && strcasecmp(k->name, Command) != 0)
k++;
return k->code;
return k->type;
}
return kNone;
}
unsigned int cKeys::Encode(const char *Command)
{
eKeys k = Translate(Command);
if (k != kNone)
return keys[k].code;
return 0;
}
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.19 2000/09/10 15:05:08 kls Exp $
* $Id: config.h 1.21 2000/09/17 09:08:13 kls Exp $
*/
#ifndef __CONFIG_H
......@@ -17,7 +17,7 @@
#include "dvbapi.h"
#include "tools.h"
#define VDRVERSION "0.63"
#define VDRVERSION "0.64"
#define MaxBuffer 10000
......@@ -55,6 +55,7 @@ public:
void SetDummyValues(void);
bool Load(const char *FileName = NULL);
bool Save(void);
eKeys Translate(const char *Command);
unsigned int Encode(const char *Command);
eKeys Get(unsigned int Code);
void Set(eKeys Key, unsigned int Code);
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.h 1.14 2000/09/10 10:03:29 kls Exp $
* $Id: dvbapi.h 1.16 2000/09/17 12:15:05 kls Exp $
*/
#ifndef __DVBAPI_H
......@@ -21,6 +21,12 @@ typedef unsigned char __u8;
#include <stdio.h>
#include <dvb.h>
// Overlay facilities
#define MAXCLIPRECTS 100
typedef struct CRect {
signed short x, y, width, height;
};
#define MenuLines 15
#define MenuColumns 40
......@@ -70,6 +76,25 @@ public:
// Closes down all DVB devices.
// Must be called at the end of the program.
// Image Grab facilities
bool GrabImage(const char *FileName, bool Jpeg = true, int Quality = -1, int SizeX = -1, int SizeY = -1);
// Overlay facilities
private:
bool ovlStat, ovlGeoSet, ovlFbSet;
int ovlSizeX, ovlSizeY, ovlPosX, ovlPosY, ovlBpp, ovlPalette, ovlClips, ovlClipCount;
int ovlFbSizeX, ovlFbSizeY;
__u16 ovlBrightness, ovlColour, ovlHue, ovlContrast;
struct video_clip ovlClipRects[MAXCLIPRECTS];
public:
bool OvlF(int SizeX, int SizeY, int FbAddr, int Bpp, int Palette);
bool OvlG(int SizeX, int SizeY, int PosX, int PosY);
bool OvlC(int ClipCount, CRect *Cr);
bool OvlP(__u16 Brightness, __u16 Color, __u16 Hue, __u16 Contrast);
bool OvlO(bool Value);
// On Screen Display facilities
private:
......
......@@ -13,7 +13,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: eit.c 1.1 2000/09/03 10:22:25 kls Exp $
* $Id: eit.c 1.3 2000/09/17 15:23:05 kls Exp $
***************************************************************************/
#include "eit.h"
......@@ -22,7 +22,6 @@
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <dvb_comcode.h>
#include "tools.h"
......@@ -253,15 +252,12 @@ int cEIT::GetSection(unsigned char *buf, ushort PID, unsigned char sec)
int seclen=0;
unsigned short handle, pid;
unsigned char section, sectionnum=0xff, maxsec=0;
struct pollfd pfd;
if ((handle = SetBitFilter(PID, (sec<<8)|0x00ff, SECTION_CONTINUOS))==0xffff)
return -1;
seclen=0;
pfd.fd=fsvbi;
pfd.events=POLLIN;
if (poll(&pfd, 1, 20000)==0)
if (!cFile::AnyFileReady(fsvbi, 20000))
{
//cerr << "Timeout\n";
return -1;
......@@ -312,13 +308,12 @@ char * cEIT::mjd2string(unsigned short mjd)
/** */
int cEIT::GetEIT()
{
unsigned char buf[1024];
unsigned char buf[4096+1]; // max. allowed size for any EIT section (+1 for safety ;-)
eit_t *eit;
struct eit_loop_struct1 *eitloop;
struct eit_short_event_descriptor_struct *eitevt;
int seclen;
unsigned int seclen;
unsigned short handle, pid;
struct pollfd pfd;
eit_event * pevt = (eit_event *)0;
time_t tstart;
......@@ -344,9 +339,7 @@ int cEIT::GetEIT()
tstart = time(NULL);
while ((!evtRunning.bIsValid || !evtNext.bIsValid) && nReceivedEITs < 20 && difftime(time(NULL), tstart) < 4)
{
pfd.fd=fsvbi;
pfd.events=POLLIN;
if (poll(&pfd, 1, 5000)==0)
if (!cFile::AnyFileReady(fsvbi, 5000))
{
//cerr << "Timeout\n";
CloseFilter(handle);
......@@ -357,6 +350,8 @@ int cEIT::GetEIT()
seclen=(buf[6]<<8)|buf[7];
pid=(buf[4]<<8)|buf[5];
if (seclen >= sizeof(buf))
seclen = sizeof(buf) - 1;
read(fsvbi, buf, seclen);
if (seclen < (int)(sizeof(eit_t)
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: interface.c 1.15 2000/09/10 16:04:14 kls Exp $
* $Id: interface.c 1.19 2000/09/19 17:41:23 kls Exp $
*/
#include "interface.h"
......@@ -29,11 +29,19 @@ cInterface::cInterface(void)
open = 0;
cols[0] = 0;
keyFromWait = kNone;
SVDRP = NULL;
}
void cInterface::Init(void)
void cInterface::Init(int SVDRPport)
{
RcIo.SetCode(Keys.code, Keys.address);
if (SVDRPport)
SVDRP = new cSVDRP(SVDRPport);
}
void cInterface::Cleanup(void)
{
delete SVDRP;
}
void cInterface::Open(int NumCols, int NumLines)
......@@ -52,10 +60,6 @@ void cInterface::Close(void)
unsigned int cInterface::GetCh(bool Wait)
{
#ifdef DEBUG_OSD
timeout(0);
getch(); // just to make 'ncurses' display the window:
#endif
if (RcIo.InputAvailable(Wait)) {
unsigned int Command;
return RcIo.GetCommand(&Command, NULL) ? Command : 0;
......@@ -65,21 +69,24 @@ unsigned int cInterface::GetCh(bool Wait)
eKeys cInterface::GetKey(bool Wait)
{
if (SVDRP)
SVDRP->Process();
eKeys Key = keyFromWait != kNone ? keyFromWait : Keys.Get(GetCh(Wait));
keyFromWait = kNone;
return Key;
}
void cInterface::PutKey(eKeys Key)
{
keyFromWait = Key;
}
eKeys cInterface::Wait(int Seconds, bool KeepChar)
{
int t0 = time_ms() + Seconds * 1000;
eKeys Key = kNone;
while (time_ms() < t0) {
Key = GetKey();
if (Key != kNone)
break;
}
RcIo.Flush(500);
if (cFile::AnyFileReady(-1, Seconds * 1000))
Key = GetKey();
if (KeepChar)
keyFromWait = Key;
return Key;
......@@ -227,7 +234,7 @@ void cInterface::QueryKeys(void)
Keys.address = Address;
WriteText(1, 5, "RC code detected!");
WriteText(1, 6, "Do not press any key...");
RcIo.Flush(3);
RcIo.Flush(3000);
ClearEol(0, 5);
ClearEol(0, 6);
break;
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: interface.h 1.11 2000/09/10 10:35:46 kls Exp $
* $Id: interface.h 1.13 2000/09/18 22:29:31 kls Exp $
*/
#ifndef __INTERFACE_H
......@@ -12,6 +12,7 @@
#include "config.h"
#include "dvbapi.h"
#include "svdrp.h"
class cInterface {
public:
......@@ -20,16 +21,19 @@ private:
int open;
int cols[MaxCols];
eKeys keyFromWait;
cSVDRP *SVDRP;
unsigned int GetCh(bool Wait = true);
void QueryKeys(void);
void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor);
eKeys Wait(int Seconds = 1, bool KeepChar = false);
public:
cInterface(void);
void Init(void);
void Init(int SVDRPport = 0);
void Cleanup(void);
void Open(int NumCols = MenuColumns, int NumLines = MenuLines);
void Close(void);
eKeys GetKey(bool Wait = true);
void PutKey(eKeys Key);
void Clear(void);
void ClearEol(int x, int y, eDvbColor Color = clrBackground);
void SetCols(int *c);
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.26 2000/09/10 15:06:15 kls Exp $
* $Id: menu.c 1.27 2000/09/11 21:13:46 kls Exp $
*/
#include "menu.h"
......@@ -1190,7 +1190,7 @@ eOSState cDirectChannelSelect::ProcessKey(eKeys Key)
if (number >= 0) {
number = number * 10 + Key - k0;
cChannel *channel = Channels.GetByNumber(number);
char *Name = channel ? channel->name : "*** Invalid Channel ***";
const char *Name = channel ? channel->name : "*** Invalid Channel ***";
int BufSize = MenuColumns + 1;
char buffer[BufSize];
snprintf(buffer, BufSize, "%d %s", number, Name);
......
......@@ -6,7 +6,7 @@
*
* Ported to LIRC by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16.
*
* $Id: remote.c 1.11 2000/07/29 16:23:47 kls Exp $
* $Id: remote.c 1.13 2000/09/19 17:40:52 kls Exp $
*/
#include "remote.h"
......@@ -49,33 +49,29 @@ cRcIoBase::~cRcIoBase()
cRcIoKBD::cRcIoKBD(void)
{
f.Open(0); // stdin
}
cRcIoKBD::~cRcIoKBD()
{
}
void cRcIoKBD::Flush(int WaitSeconds)
void cRcIoKBD::Flush(int WaitMs)
{
time_t t0 = time(NULL);
int t0 = time_ms();
timeout(10);
for (;;) {
while (getch() > 0)
t0 = time(NULL);
if (time(NULL) - t0 >= WaitSeconds)
t0 = time_ms();
if (time_ms() - t0 >= WaitMs)
break;
}
}
bool cRcIoKBD::InputAvailable(bool Wait)
{
timeout(Wait ? 1000 : 10);
int ch = getch();
if (ch == ERR)
return false;
ungetch(ch);
return true;
return f.Ready(Wait);
}
bool cRcIoKBD::GetCommand(unsigned int *Command, unsigned short *)
......@@ -98,7 +94,7 @@ cRcIoRCU::cRcIoRCU(char *DeviceName)
code = 0;
address = 0xFFFF;
lastNumber = 0;
if ((f = open(DeviceName, O_RDWR | O_NONBLOCK)) >= 0) {
if (f.Open(DeviceName, O_RDWR | O_NONBLOCK)) {
struct termios t;
if (tcgetattr(f, &t) == 0) {
cfsetspeed(&t, B9600);
......@@ -107,17 +103,14 @@ cRcIoRCU::cRcIoRCU(char *DeviceName)
return;
}
LOG_ERROR_STR(DeviceName);
close(f);
f.Close();
}
else
LOG_ERROR_STR(DeviceName);
f = -1;
}
cRcIoRCU::~cRcIoRCU()
{
if (f >= 0)
close(f);
}
int cRcIoRCU::ReceiveByte(bool Wait)
......@@ -135,7 +128,7 @@ int cRcIoRCU::ReceiveByte(bool Wait)
bool cRcIoRCU::SendByteHandshake(unsigned char c)
{
if (f >= 0) {
if (f.IsOpen()) {
int w = write(f, &c, 1);
if (w == 1) {
for (int reply = ReceiveByte(); reply >= 0;) {
......@@ -179,21 +172,21 @@ bool cRcIoRCU::SetMode(unsigned char Mode)
return SendCommand(mode);
}
void cRcIoRCU::Flush(int WaitSeconds)
void cRcIoRCU::Flush(int WaitMs)
{
time_t t0 = time(NULL);
int t0 = time_ms();
for (;;) {
while (ReceiveByte(false) >= 0)
t0 = time(NULL);
if (time(NULL) - t0 >= WaitSeconds)
t0 = time_ms();
if (time_ms() - t0 >= WaitMs)
break;
}
}
bool cRcIoRCU::InputAvailable(bool Wait)
{
return DataAvailable(f, Wait);
return f.Ready(Wait);
}
bool cRcIoRCU::GetCommand(unsigned int *Command, unsigned short *Address)
......@@ -349,22 +342,21 @@ cRcIoLIRC::cRcIoLIRC(char *DeviceName)
struct sockaddr_un addr;
addr.sun_family = AF_UNIX;
strcpy(addr.sun_path, DeviceName);
f = socket(AF_UNIX, SOCK_STREAM, 0);
if (f >= 0) {
if (connect(f, (struct sockaddr *)&addr, sizeof(addr)) >= 0)
int sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock >= 0) {
if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) >= 0) {
f.Open(sock);
return;
}
LOG_ERROR_STR(DeviceName);
close(f);
close(sock);
}
else
LOG_ERROR_STR(DeviceName);
f = -1;
}
cRcIoLIRC::~cRcIoLIRC()
{
if (f >= 0)
close(f);
}
const char *cRcIoLIRC::ReceiveString(void)
......@@ -389,24 +381,24 @@ const char *cRcIoLIRC::ReceiveString(void)
return NULL;
}
void cRcIoLIRC::Flush(int WaitSeconds)
void cRcIoLIRC::Flush(int WaitMs)
{
char buf[LIRC_BUFFER_SIZE];
time_t t0 = time(NULL);
int t0 = time_ms();
for (;;) {
while (InputAvailable(false)) {
read(f, buf, sizeof(buf));
t0 = time(NULL);
t0 = time_ms();
}
if (time(NULL) - t0 >= WaitSeconds)
if (time_ms() - t0 >= WaitMs)
break;
}
}
bool cRcIoLIRC::InputAvailable(bool Wait)
{
return DataAvailable(f, Wait);
return f.Ready(Wait);
}
bool cRcIoLIRC::GetCommand(unsigned int *Command, unsigned short *)
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: remote.h 1.7 2000/07/15 16:32:43 kls Exp $
* $Id: remote.h 1.9 2000/09/19 17:39:36 kls Exp $
*/
#ifndef __REMOTE_H
......@@ -12,6 +12,7 @@
#include <stdio.h>
#include <time.h>
#include "tools.h"
class cRcIoBase {
protected:
......@@ -28,7 +29,7 @@ public:
virtual void SetPoints(unsigned char Dp, bool On) {}
virtual bool String(char *s) { return true; }
virtual bool DetectCode(unsigned char *Code, unsigned short *Address) { return true; }
virtual void Flush(int WaitSeconds = 0) {}
virtual void Flush(int WaitMs = 0) {}
virtual bool InputAvailable(bool Wait = false) = 0;
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL) = 0;
};
......@@ -36,10 +37,12 @@ public:
#if defined REMOTE_KBD
class cRcIoKBD : public cRcIoBase {
private:
cFile f;
public:
cRcIoKBD(void);
virtual ~cRcIoKBD();
virtual void Flush(int WaitSeconds = 0);
virtual void Flush(int WaitMs = 0);
virtual bool InputAvailable(bool Wait = false);
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
};
......@@ -48,7 +51,7 @@ public:
class cRcIoRCU : public cRcIoBase {
private:
int f;
cFile f;
unsigned char dp, code, mode;
unsigned short address;
int lastNumber;
......@@ -66,7 +69,7 @@ public:
virtual void SetPoints(unsigned char Dp, bool On);
virtual bool String(char *s);
virtual bool DetectCode(unsigned char *Code, unsigned short *Address);
virtual void Flush(int WaitSeconds = 0);
virtual void Flush(int WaitMs = 0);
virtual bool InputAvailable(bool Wait = false);
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
};
......@@ -76,13 +79,13 @@ public:
class cRcIoLIRC : public cRcIoBase {
private:
enum { LIRC_KEY_BUF = 8, LIRC_BUFFER_SIZE = 128 };
int f;
cFile f;
char keyName[LIRC_KEY_BUF];
const char *ReceiveString(void);
public:
cRcIoLIRC(char *DeviceName);
virtual ~cRcIoLIRC();
virtual void Flush(int WaitSeconds = 0);
virtual void Flush(int WaitMs = 0);
virtual bool InputAvailable(bool Wait = false);
virtual bool GetCommand(unsigned int *Command, unsigned short *Address = NULL);
};
......
This diff is collapsed.
......@@ -4,12 +4,15 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: svdrp.h 1.2 2000/08/06 12:45:28 kls Exp $
* $Id: svdrp.h 1.6 2000/09/17 13:22:04 kls Exp $
*/
#ifndef __SVDRP_H
#define __SVDRP_H
#include "dvbapi.h"
#include "tools.h"
class cSocket {
private:
int port;
......@@ -26,23 +29,31 @@ public:
class cSVDRP {
private:
cSocket socket;
int filedes;
cFile file;
CRect ovlClipRects[MAXCLIPRECTS];
void Close(void);
bool Send(const char *s, int length = -1);
void Reply(int Code, const char *fmt, ...);
void CmdChan(const char *Option);
void CmdDelc(const char *Option);
void CmdDelt(const char *Option);
void CmdHelp(const char *Option);
void CmdLstc(const char *Option);
void CmdLstt(const char *Option);
void CmdModc(const char *Option);
void CmdModt(const char *Option);
void CmdMovc(const char *Option);
void CmdMovt(const char *Option);
void CmdNewc(const char *Option);
void CmdNewt(const char *Option);
void CmdUpdt(const char *Option);
void CmdCHAN(const char *Option);
void CmdDELC(const char *Option);