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

Added cDevice::DeviceNumber()

This commit is contained in:
Klaus Schmidinger 2002-10-07 16:21:46 +02:00
parent 186ee74748
commit 10a7cf33d6
5 changed files with 22 additions and 6 deletions

View File

@ -1579,3 +1579,8 @@ Video Disk Recorder Revision History
- Updated channels.conf.terr and channels.conf.cable (thanks to Uwe Scheffler). - Updated channels.conf.terr and channels.conf.cable (thanks to Uwe Scheffler).
- Fixed a bug when pressing the "Blue" button in the main menu without having - Fixed a bug when pressing the "Blue" button in the main menu without having
displayed it (thanks to Oliver Endriss for reporting this one). displayed it (thanks to Oliver Endriss for reporting this one).
2002-10-06: Version 1.1.13
- Added cDevice::DeviceNumber() to get the number of a device, not counting any
gaps that might be in the index count.

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: config.h 1.131 2002/10/05 09:58:58 kls Exp $ * $Id: config.h 1.132 2002/10/06 16:03:01 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -20,7 +20,7 @@
#include "eit.h" #include "eit.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "1.1.12" #define VDRVERSION "1.1.13"
#define MAXPRIORITY 99 #define MAXPRIORITY 99
#define MAXLIFETIME 99 #define MAXLIFETIME 99

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: device.c 1.25 2002/10/06 13:49:38 kls Exp $ * $Id: device.c 1.26 2002/10/07 16:21:46 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -87,6 +87,15 @@ int cDevice::NextCardIndex(int n)
return nextCardIndex; return nextCardIndex;
} }
int cDevice::DeviceNumber(void) const
{
for (int i = 0; i < numDevices; i++) {
if (device[i] == this)
return i;
}
return -1;
}
void cDevice::MakePrimaryDevice(bool On) void cDevice::MakePrimaryDevice(bool On)
{ {
} }

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: device.h 1.21 2002/10/05 15:18:13 kls Exp $ * $Id: device.h 1.22 2002/10/06 15:59:08 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -111,6 +111,8 @@ public:
bool IsPrimaryDevice(void) const { return this == primaryDevice; } bool IsPrimaryDevice(void) const { return this == primaryDevice; }
int CardIndex(void) const { return cardIndex; } int CardIndex(void) const { return cardIndex; }
// Returns the card index of this device (0 ... MAXDEVICES - 1). // Returns the card index of this device (0 ... MAXDEVICES - 1).
int DeviceNumber(void) const;
// Returns number of this device (0 ... MAXDEVICES - 1).
int ProvidesCa(int Ca) const; int ProvidesCa(int Ca) const;
// Checks whether this device provides the given value in its // Checks whether this device provides the given value in its
// caCaps. Returns 0 if the value is not provided, 1 if only this // caCaps. Returns 0 if the value is not provided, 1 if only this

4
rcu.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: rcu.c 1.1 2002/09/29 13:16:44 kls Exp $ * $Id: rcu.c 1.2 2002/10/06 15:49:03 kls Exp $
*/ */
#include "rcu.h" #include "rcu.h"
@ -308,5 +308,5 @@ void cRcuRemote::ChannelSwitch(const cDevice *Device, int ChannelNumber)
void cRcuRemote::Recording(const cDevice *Device, const char *Name) void cRcuRemote::Recording(const cDevice *Device, const char *Name)
{ {
SetPoints(1 << Device->CardIndex(), Device->Receiving()); //XXX CardNumber()!!! SetPoints(1 << Device->DeviceNumber(), Device->Receiving());
} }