Commit d0807381 authored by Klaus Schmidinger's avatar Klaus Schmidinger

Version 1.1.11

- Fixed an incomplete initialization of the filter parameters in eit.c (thanks
  to Jeremy Hall).
- Fixed the 'newplugin' script for use with the NEWSTRUCT driver (thanks to
  Andreas Schultz for reporting this one). If you have already created a plugin
  directory and Makefile with 'newplugin', please apply the following patch to it:

  -------------------------------------------------------
  --- Makefile    2002/06/10 16:24:06     1.4
  +++ Makefile    2002/09/17 15:36:36     1.5
  @@ -15,7 +15,12 @@

   ### The directory environment:

  +ifdef NEWSTRUCT
  +DVBDIR = ../../../../DVB/include
  +DEFINES += -DNEWSTRUCT
  +else
   DVBDIR = ../../../../DVB/ost/include
  +endif
   VDRDIR = ../../..
   VDRINC = $(VDRDIR)/include
   LIBDIR = ../../lib
  @@ -34,7 +39,7 @@

   INCLUDES = -I$(VDRINC) -I$(DVBDIR)

  -DEFINES = -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
  +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'

   ### The object files (add further files here):
  -------------------------------------------------------

  This is the diff for the 'setup' example that comes with VDR, so your line
  numbers may be different.
- Added a missing 'public' keyword in device.h (thanks to Martin Hammerschmid).
- Fixed a race condition when starting 'Transfer Mode'.
- Rearranged the remote control key handling to allow plugins to implement
  additional types of remote controls (see PLUGINS.html, section "Remote Control").
  The previously used files 'keys.conf' and 'keys-pc.conf' have been replaced
  by the file 'remote.conf', which holds the key definitions of all remote controls.
- The LIRC remote control keys are now handled just like the keyboard and RCU keys.
  This means that you can use the lircd.conf file as is for your remote control,
  without the need of editing it to make the key names the same as used in VDR.
  When first starting VDR it will go into the "Learning keys" mode and ask you
  to press the various keys. The resulting key assignment will be stored in
  the file 'remote.conf'.
  Since I have no way of testing the LIRC support, I hope I didn't break it in
  the process...
- While learning the remote control keys it is now possible to press the 'Menu'
  key to skip the definition of keys that are not available on your particular
  RC unit.
- Fixed handling DVD subtitles in the SPU decoder (thanks to Andreas Schultz).
- Avoiding restarts due to 'panic level' when switching channels on the primary
  device during EPG scan.
parent 346f4cd1
......@@ -45,6 +45,7 @@ Martin Hammerschmid <martin@hammerschmid.com>
for implementing pege up/down with the "Left" and "Right" keys
for detecting a deadlock when switching channels via Schedule/Now|Next/Switch
for adding a missing #include to ringbuffer.c
for adding a missing 'public' keyword in device.h
Bastian Guse <bastian@nocopy.de>
for writing the FORMATS entry for timers.conf
......@@ -174,6 +175,7 @@ Andreas Schultz <aschultz@warp10.net>
OSD capabilities
for implementing an SPU decoder
for fixing opening /dev/video in cDvbDevice::GrabImage() in case of NEWSTRUCT driver
for reporting a problem with plugin Makefiles and the NEWSTRUCT driver
Aaron Holtzman
for writing 'ac3dec'
......@@ -399,3 +401,6 @@ J
Helmut Auer <vdr@helmutauer.de>
for reporting a superfluous error message in cLockFile.
Jeremy Hall <jhall@UU.NET>
for fixing an incomplete initialization of the filter parameters in eit.c
......@@ -1478,3 +1478,60 @@ Video Disk Recorder Revision History
- Added a missing StripAudioPackets() to cDvbPlayer::Action() (thanks to
Stefan Huelswitt).
- Added an EPG bugfix for the latest VOX EPG data format.
2002-09-29: Version 1.1.11
- Fixed an incomplete initialization of the filter parameters in eit.c (thanks
to Jeremy Hall).
- Fixed the 'newplugin' script for use with the NEWSTRUCT driver (thanks to
Andreas Schultz for reporting this one). If you have already created a plugin
directory and Makefile with 'newplugin', please apply the following patch to it:
-------------------------------------------------------
--- Makefile 2002/06/10 16:24:06 1.4
+++ Makefile 2002/09/17 15:36:36 1.5
@@ -15,7 +15,12 @@
### The directory environment:
+ifdef NEWSTRUCT
+DVBDIR = ../../../../DVB/include
+DEFINES += -DNEWSTRUCT
+else
DVBDIR = ../../../../DVB/ost/include
+endif
VDRDIR = ../../..
VDRINC = $(VDRDIR)/include
LIBDIR = ../../lib
@@ -34,7 +39,7 @@
INCLUDES = -I$(VDRINC) -I$(DVBDIR)
-DEFINES = -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
### The object files (add further files here):
-------------------------------------------------------
This is the diff for the 'setup' example that comes with VDR, so your line
numbers may be different.
- Added a missing 'public' keyword in device.h (thanks to Martin Hammerschmid).
- Fixed a race condition when starting 'Transfer Mode'.
- Rearranged the remote control key handling to allow plugins to implement
additional types of remote controls (see PLUGINS.html, section "Remote Control").
The previously used files 'keys.conf' and 'keys-pc.conf' have been replaced
by the file 'remote.conf', which holds the key definitions of all remote controls.
- The LIRC remote control keys are now handled just like the keyboard and RCU keys.
This means that you can use the lircd.conf file as is for your remote control,
without the need of editing it to make the key names the same as used in VDR.
When first starting VDR it will go into the "Learning keys" mode and ask you
to press the various keys. The resulting key assignment will be stored in
the file 'remote.conf'.
Since I have no way of testing the LIRC support, I hope I didn't break it in
the process...
- While learning the remote control keys it is now possible to press the 'Menu'
key to skip the definition of keys that are not available on your particular
RC unit.
- Fixed handling DVD subtitles in the SPU decoder (thanks to Andreas Schultz).
- Avoiding restarts due to 'panic level' when switching channels on the primary
device during EPG scan.
......@@ -330,8 +330,7 @@ of the card that can receive it.
Learning the remote control keys:
---------------------------------
There is no default 'keys.conf' file, so if you compile the program
with 'REMOTE=RCU' you will have to go through a "teach-in"
There is no default 'remote.conf' file, so you will have to go through a "teach-in"
session that allows the program to learn your remote control codes.
It will first attempt to determine the basic data transfer mode and
timing of your remote control unit, and then will ask you to press one
......@@ -342,11 +341,8 @@ you define, the more you will be able to navigate through the menus and
control recording/replaying. The program uses only a very small number
of keys which have multiple meanings in the various modes (see MANUAL
for a detailed description).
If the program has been built with "REMOTE=KBD", it will use the
key configuration file 'keys-pc.conf', so that you won't loose data
when switching between remote control and keyboard mode.
The default PC key assignments are:
The recommended PC key assignments are:
Up, Down, Left, Right Crsr keys in numeric block
Menu 'Home' in numeric block
......@@ -359,10 +355,6 @@ The default PC key assignments are:
Mute 'm'
If you prefer different key assignments, or if the default doesn't work for
your keyboard, simply delete the file 'keys-pc.conf' and restart 'vdr' to get
your keyboard, simply delete the file 'remote.conf' and restart 'vdr' to get
into learning mode.
If the program has been compiled with 'REMOTE=LIRC', no 'keys.conf' file
will be used. Instead, the key names as listed in the source file 'config.c'
must be used when setting up LIRC. See http://www.lirc.org for more about LIRC.
......@@ -4,7 +4,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Makefile 1.46 2002/09/08 14:00:48 kls Exp $
# $Id: Makefile 1.47 2002/09/28 14:12:43 kls Exp $
.DELETE_ON_ERROR:
......@@ -33,7 +33,7 @@ endif
DTVLIB = $(DTVDIR)/libdtv.a
OBJS = audio.o config.o cutter.o device.o dvbdevice.o dvbosd.o dvbplayer.o dvbspu.o eit.o eitscan.o font.o i18n.o\
interface.o menu.o menuitems.o osdbase.o osd.o player.o plugin.o receiver.o\
interface.o keys.o lirc.o menu.o menuitems.o osdbase.o osd.o player.o plugin.o rcu.o receiver.o\
recorder.o recording.o remote.o remux.o ringbuffer.o spu.o status.o svdrp.o thread.o\
tools.o transfer.o vdr.o videodir.o
......
This diff is collapsed.
......@@ -22,3 +22,7 @@ VDR Plugin 'hello' Revision History
2002-08-04: Version 0.0.5
- Added a missing #include.
2002-09-21: Version 0.0.6
- Fixed Makefile for NEWSTRUCT driver.
#
# Makefile for a Video Disk Recorder plugin
#
# $Id: Makefile 1.4 2002/06/10 16:24:06 kls Exp $
# $Id: Makefile 1.5 2002/09/17 15:36:36 kls Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
......@@ -15,7 +15,12 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
### The directory environment:
ifdef NEWSTRUCT
DVBDIR = ../../../../DVB/include
DEFINES += -DNEWSTRUCT
else
DVBDIR = ../../../../DVB/ost/include
endif
VDRDIR = ../../..
VDRINC = $(VDRDIR)/include
LIBDIR = ../../lib
......@@ -34,7 +39,7 @@ PACKAGE = vdr-$(ARCHIVE)
INCLUDES = -I$(VDRINC) -I$(DVBDIR)
DEFINES = -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
### The object files (add further files here):
......
......@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: hello.c 1.6 2002/08/04 15:13:35 kls Exp $
* $Id: hello.c 1.7 2002/09/21 08:44:56 kls Exp $
*/
#include <getopt.h>
......@@ -12,7 +12,7 @@
#include <vdr/plugin.h>
#include "i18n.h"
static const char *VERSION = "0.0.5";
static const char *VERSION = "0.0.6";
static const char *DESCRIPTION = "A friendly greeting";
static const char *MAINMENUENTRY = "Hello";
......
......@@ -8,3 +8,7 @@ VDR Plugin 'status' Revision History
2002-07-13: Version 0.0.2
- Changed the interface of cStatus::Replaying().
2002-09-21: Version 0.0.3
- Fixed Makefile for NEWSTRUCT driver.
#
# Makefile for a Video Disk Recorder plugin
#
# $Id: Makefile 1.2 2002/08/28 19:30:35 kls Exp $
# $Id: Makefile 1.3 2002/09/21 08:38:39 kls Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
......@@ -15,7 +15,12 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri
### The directory environment:
ifdef NEWSTRUCT
DVBDIR = ../../../../DVB/include
DEFINES += -DNEWSTRUCT
else
DVBDIR = ../../../../DVB/ost/include
endif
VDRDIR = ../../..
VDRINC = $(VDRDIR)/include
LIBDIR = ../../lib
......@@ -34,7 +39,7 @@ PACKAGE = vdr-$(ARCHIVE)
INCLUDES = -I$(VDRINC) -I$(DVBDIR)
DEFINES = -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
### The object files (add further files here):
......@@ -43,7 +48,7 @@ OBJS = $(PLUGIN).o
### The C++ compiler and options:
CXX = g++
CXXFLAGS = -g -O2 -Wall -Woverloaded-virtual
CXXFLAGS = -O2 -Wall -Woverloaded-virtual
### Implicit rules:
......
......@@ -3,13 +3,13 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: status.c 1.2 2002/07/13 10:55:55 kls Exp $
* $Id: status.c 1.3 2002/09/21 08:46:01 kls Exp $
*/
#include <vdr/plugin.h>
#include <vdr/status.h>
static const char *VERSION = "0.0.2";
static const char *VERSION = "0.0.3";
static const char *DESCRIPTION = "Status monitor test";
static const char *MAINMENUENTRY = NULL;
......
......@@ -43,7 +43,6 @@ EinsMuXx:12110:h:0:27500:301:302:0:0:28203
ZDF Theaterkanal:11954:h:0:27500:1110:1120:0:0:28016
ZDF.doku:11954:h:0:27500:660:670:0:0:28014
MDR:12110:h:0:27500:401:402:404:0:28204
NICK-PARAMOUNT:12246:v:0:27500:167:108:0:0:29312
ORB:12110:h:0:27500:501:502:504:0:28205
B1:12110:h:0:27500:601:602:604:0:28206
ARD Online-Kanal:12722:h:0:22000:0:701:0:0:0
......@@ -110,7 +109,7 @@ BuLi 6:11719:h:0:27500:3071:3072,3073:0:101:244
BuLi 7:11719:h:0:27500:3327:3328,3329:0:101:245
BuLi 8:12031:h:0:27500:3071:3072,3073:0:101:208
BuLi 9:12031:h:0:27500:3327:3328,3329:0:101:209
:
:-
:#TV Niepokalanow:11876:h:0:27500:305:321:0:0:20601
Mosaico:11934:v:0:27500:165:100:0:0:29010
Andalucia TV:11934:v:0:27500:166:104:0:0:29011
......@@ -159,7 +158,6 @@ Fashion TV:12402:v:0:27500:163:92:0:0:0
VideoService:12422:h:0:27500:255:256:0:0:0
Beta Research promo:12422:h:0:27500:1023:1024:0:0:0
Canal Canarias:12441:v:0:27500:160:80:0:0:0
TVC International:12441:v:0:27500:512:660:0:0:29701
Fitur:12441:v:0:27500:514:662:0:0:0
Astra Info 1:12552:v:0:22000:164:112:0:0:0
Astra Info 2:12552:v:0:22000:165:120:0:0:0
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.105 2002/09/04 13:45:56 kls Exp $
* $Id: config.c 1.106 2002/09/28 09:43:41 kls Exp $
*/
#include "config.h"
......@@ -19,169 +19,6 @@
// format characters in order to allow any number of blanks after a numeric
// value!
// -- cKeys ------------------------------------------------------------------
tKey keyTable[] = { // "Up" and "Down" must be the first two keys!
{ kUp, "Up", 0 },
{ kDown, "Down", 0 },
{ kMenu, "Menu", 0 },
{ kOk, "Ok", 0 },
{ kBack, "Back", 0 },
{ kLeft, "Left", 0 },
{ kRight, "Right", 0 },
{ kRed, "Red", 0 },
{ kGreen, "Green", 0 },
{ kYellow, "Yellow", 0 },
{ kBlue, "Blue", 0 },
{ k0, "0", 0 },
{ k1, "1", 0 },
{ k2, "2", 0 },
{ k3, "3", 0 },
{ k4, "4", 0 },
{ k5, "5", 0 },
{ k6, "6", 0 },
{ k7, "7", 0 },
{ k8, "8", 0 },
{ k9, "9", 0 },
{ kPower, "Power", 0 },
{ kVolUp, "Volume+", 0 },
{ kVolDn, "Volume-", 0 },
{ kMute, "Mute", 0 },
{ kNone, "", 0 },
};
cKeys::cKeys(void)
{
fileName = NULL;
code = 0;
address = 0;
keys = keyTable;
}
void cKeys::Clear(void)
{
for (tKey *k = keys; k->type != kNone; k++)
k->code = 0;
}
void cKeys::SetDummyValues(void)
{
for (tKey *k = keys; k->type != kNone; k++)
k->code = k->type + 1; // '+1' to avoid 0
}
bool cKeys::Load(const char *FileName)
{
isyslog("loading %s", FileName);
bool result = false;
if (FileName)
fileName = strdup(FileName);
if (fileName) {
FILE *f = fopen(fileName, "r");
if (f) {
int line = 0;
char buffer[MAXPARSEBUFFER];
result = true;
while (fgets(buffer, sizeof(buffer), f) > 0) {
line++;
if (!isempty(buffer)) {
char *Name = buffer;
char *p = strpbrk(Name, " \t");
if (p) {
*p = 0; // terminates 'Name'
while (*++p && isspace(*p))
;
if (*p) {
if (strcasecmp(Name, "Code") == 0)
code = *p;
else if (strcasecmp(Name, "Address") == 0)
address = strtol(p, NULL, 16);
else {
for (tKey *k = keys; k->type != kNone; k++) {
if (strcasecmp(Name, k->name) == 0) {
k->code = strtol(p, NULL, 16);
Name = NULL; // to indicate that we found it
break;
}
}
if (Name) {
esyslog("unknown key in %s, line %d\n", fileName, line);
result = false;
break;
}
}
}
continue;
}
esyslog("error in %s, line %d\n", fileName, line);
result = false;
break;
}
}
fclose(f);
}
else
esyslog("can't open '%s'\n", fileName);
}
else
esyslog("no key configuration file name supplied!\n");
return result;
}
bool cKeys::Save(void)
{
cSafeFile f(fileName);
if (f.Open()) {
fprintf(f, "Code\t%c\nAddress\t%04X\n", code, address);
for (tKey *k = keys; k->type != kNone; k++)
fprintf(f, "%s\t%08X\n", k->name, k->code);
return f.Close();
}
return false;
}
eKeys cKeys::Get(unsigned int Code)
{
if (Code != 0) {
tKey *k;
for (k = keys; k->type != kNone; k++) {
if (k->code == Code)
break;
}
return k->type;
}
return kNone;
}
eKeys cKeys::Translate(const char *Command)
{
if (Command) {
const tKey *k = keys;
while ((k->type != kNone) && strcasecmp(k->name, Command) != 0)
k++;
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;
}
void cKeys::Set(eKeys Key, unsigned int Code)
{
for (tKey *k = keys; k->type != kNone; k++) {
if (k->type == Key) {
k->code = Code;
break;
}
}
}
// -- cChannel ---------------------------------------------------------------
char *cChannel::buffer = NULL;
......@@ -247,7 +84,6 @@ bool cChannel::Parse(const char *s)
if (*s == ':') {
if (*++s) {
strn0cpy(name, s, MaxChannelName);
name[strlen(name) - 1] = 0; // strip the '\n'
groupSep = true;
number = 0;
}
......@@ -696,7 +532,7 @@ bool cSVDRPhost::Parse(const char *s)
if (p) {
char *error = NULL;
int m = strtoul(p + 1, &error, 10);
if (error && !isspace(*error) || m > 32)
if (error && *error && !isspace(*error) || m > 32)
return false;
*(char *)p = 0; // yes, we know it's 'const' - will be restored!
if (m == 0)
......@@ -733,10 +569,6 @@ bool cCaDefinition::Parse(const char *s)
return 2 == sscanf(s, "%d %a[^\n]", &number, &description) && description && *description;
}
// -- cKeys ------------------------------------------------------------------
cKeys Keys;
// -- cCommands --------------------------------------------------------------
cCommands Commands;
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.127 2002/09/09 21:35:55 kls Exp $
* $Id: config.h 1.129 2002/09/29 10:42:17 kls Exp $
*/
#ifndef __CONFIG_H
......@@ -20,7 +20,7 @@
#include "eit.h"
#include "tools.h"
#define VDRVERSION "1.1.10"
#define VDRVERSION "1.1.11"
#define MAXPRIORITY 99
#define MAXLIFETIME 99
......@@ -30,69 +30,8 @@
#define MINOSDHEIGHT 12
#define MAXOSDHEIGHT 21
enum eKeys { // "Up" and "Down" must be the first two keys!
kUp,
kDown,
kMenu,
kOk,
kBack,
kLeft,
kRight,
kRed,
kGreen,
kYellow,
kBlue,
k0, k1, k2, k3, k4, k5, k6, k7, k8, k9,
kPower,
kVolUp,
kVolDn,
kMute,
kNone,
// The following flags are OR'd with the above codes:
k_Repeat = 0x8000,
k_Release = 0x4000,
k_Flags = k_Repeat | k_Release,
};
// This is in preparation for having more key codes:
#define kMarkToggle k0
#define kMarkMoveBack k4
#define kMarkMoveForward k6
#define kMarkJumpBack k7
#define kMarkJumpForward k9
#define kEditCut k2
#define kEditTest k8
#define RAWKEY(k) (eKeys((k) & ~k_Flags))
#define ISRAWKEY(k) ((k) != kNone && ((k) & k_Flags) == 0)
#define NORMALKEY(k) (eKeys((k) & ~k_Repeat))
#define MaxFileName 256
struct tKey {
eKeys type;
char *name;
unsigned int code;
};
class cKeys {
private:
char *fileName;
public:
unsigned char code;
unsigned short address;
tKey *keys;
cKeys(void);
void Clear(void);
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);
};
#define ISTRANSPONDER(f1, f2) (abs((f1) - (f2)) < 4)
class cChannel : public cListObject {
......@@ -214,6 +153,7 @@ public:
template<class T> class cConfig : public cList<T> {
private:
char *fileName;
bool allowComments;
void Clear(void)
{
free(fileName);
......@@ -224,13 +164,17 @@ public:
cConfig(void) { fileName = NULL; }
virtual ~cConfig() { free(fileName); }
const char *FileName(void) { return fileName; }
bool Load(const char *FileName, bool AllowComments = false)
bool Load(const char *FileName = NULL, bool AllowComments = false)
{
Clear();
fileName = strdup(FileName);
if (FileName) {
free(fileName);
fileName = strdup(FileName);
allowComments = AllowComments;
}
bool result = false;
if (access(FileName, F_OK) == 0) {
isyslog("loading %s", FileName);
if (fileName && access(fileName, F_OK) == 0) {
isyslog("loading %s", fileName);
FILE *f = fopen(fileName, "r");
if (f) {
int line = 0;
......@@ -238,11 +182,12 @@ public:
result = true;
while (fgets(buffer, sizeof(buffer), f) > 0) {
line++;
if (AllowComments) {
if (allowComments) {
char *p = strchr(buffer, '#');
if (p)
*p = 0;
}
stripspace(buffer);
if (!isempty(buffer)) {
T *l = new T;
if (l->Parse(buffer))
......@@ -322,7 +267,6 @@ public:
extern cChannels Channels;
extern cTimers Timers;
extern cKeys Keys;
extern cCommands Commands;
extern cSVDRPhosts SVDRPhosts;
extern cCaDefinitions CaDefinitions;
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 1.21 2002/09/15 11:50:19 kls Exp $
* $Id: device.c 1.22 2002/09/28 12:20:22 kls Exp $
*/
#include "device.h"
......@@ -201,7 +201,7 @@ void cDevice::SetVideoFormat(bool VideoFormat16_9)
//#define PRINTPIDS(s) { char b[500]; char *q = b; q += sprintf(q, "%d %s ", CardIndex(), s); for (int i = 0; i < MAXPIDHANDLES; i++) q += sprintf(q, " %s%4d %d", i == ptOther ? "* " : "", pidHandles[i].pid, pidHandles[i].used); dsyslog(b); }
#define PRINTPIDS(s)
bool cDevice::HasPid(int Pid)
bool cDevice::HasPid(int Pid) const
{
for (int i = 0; i < MAXPIDHANDLES; i++) {
if (pidHandles[i].pid == Pid)
......@@ -275,7 +275,7 @@ bool cDevice::SetPid(cPidHandle *Handle, int Type, bool On)
return false;
}
bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers)
bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
{
return false;
}
......@@ -424,7 +424,7 @@ void cDevice::StillPicture(const uchar *Data, int Length)
{
}
bool cDevice::Replaying(void)
bool cDevice::Replaying(void) const
{
return player != NULL;
}
......@@ -478,7 +478,7 @@ int cDevice::PlayAudio(const uchar *Data, int Length)
return -1;
}
int cDevice::Priority(void)
int cDevice::Priority(void) const
{
int priority = IsPrimaryDevice() ? Setup.PrimaryLimit - 1 : DEFAULTPRIORITY;
for (int i = 0; i < MAXRECEIVERS; i++) {
......@@ -488,7 +488,7 @@ int cDevice::Priority(void)
return priority;
}
int cDevice::CanShift(int Ca, int Priority, int UsedCards)
int cDevice::CanShift(int Ca, int Priority, int UsedCards) const
{
return -1;//XXX+ too complex with multiple recordings per device
// Test whether a receiver on this device can be shifted to another one
......@@ -523,7 +523,7 @@ int cDevice::CanShift(int Ca, int Priority, int UsedCards)
return ShiftLevel;
}
int cDevice::ProvidesCa(int Ca)
int cDevice::ProvidesCa(int Ca) const
{
if (Ca == CardIndex() + 1)
return 1; // exactly _this_ card was requested
......@@ -542,7 +542,7 @@ int cDevice::ProvidesCa(int Ca)
return result ? result + others : 0;
}
bool cDevice::Receiving(void)
bool cDevice::Receiving(void) const
{
for (int i = 0; i < MAXRECEIVERS; i++) {
if (receiver[i] && receiver[i]->priority >= 0) // cReceiver with priority < 0 doesn't count
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.h 1.18 2002/09/14 15:24:47 kls Exp $
* $Id: device.h 1.20 2002/09/28 12:20:34 kls Exp $
*/
#ifndef __DEVICE_H
......@@ -50,7 +50,7 @@ class cPlayer;
class cReceiver;
class cSpuDecoder;
class cDevice : cThread {
class cDevice : public cThread {
private:
static int numDevices;
static int useDevice;
......@@ -111,7 +111,7 @@ public:
bool IsPrimaryDevice(void) const { return this == primaryDevice; }
int CardIndex(void) const { return cardIndex; }
// Returns the card index of this device (0 ... MAXDEVICES - 1).
int ProvidesCa(int Ca);
int ProvidesCa(int Ca) const;
// Checks whether this device provides the given value in its
// caCaps. Returns 0 if the value is not provided, 1 if only this
// value is provided, and > 1 if this and other values are provided.
......@@ -139,7 +139,7 @@ public:
protected:
static int currentChannel;
public:
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL);
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL) const;
// Returns true if this device can provide the given channel.
// In case the device has cReceivers attached to it or it is the primary
// device, Priority is used to decide whether the caller's request can
......@@ -186,7 +186,7 @@ protected:
cPidHandle(void) { pid = used = 0; handle = -1; }
};
cPidHandle pidHandles[MAXPIDHANDLES];
bool HasPid(int Pid);
bool HasPid(int Pid) const;
// Returns true if this device is currently receiving the given PID.
bool AddPid(int Pid, ePidType PidType = ptOther);
// Adds a PID to the set of PIDs this device shall receive.
......@@ -224,7 +224,7 @@ protected:
virtual void SetVolumeDevice(int Volume);
// Sets the audio volume on this device (Volume = 0...255).
public:
bool IsMute(void) { return mute; }
bool IsMute(void) const { return mute; }
bool ToggleMute(void);
// Turns the volume off or on and returns the new mute state.
void SetVolume(int Volume, bool Absolute = false);
......@@ -269,7 +269,7 @@ public:
// one video and one audio strem.
virtual int PlayAudio(const uchar *Data, int Length);
// Plays additional audio streams, like Dolby Digital.
bool Replaying(void);