summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY4
-rw-r--r--device.c7
-rw-r--r--device.h8
-rw-r--r--dvbdevice.c20
-rw-r--r--dvbdevice.h3
5 files changed, 35 insertions, 7 deletions
diff --git a/HISTORY b/HISTORY
index 2a7396aa..0dfa0c45 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7052,8 +7052,10 @@ Video Disk Recorder Revision History
- Fixed handling IDLEPRIORITY in cDvbDevice::ProvidesChannel() (thanks to Frank
Schmirler).
-2012-04-01: Version 1.7.28
+2012-04-04: Version 1.7.28
- Fixed cPixmapMemory::DrawEllipse() for quadrants -1 and -4.
- Fixed getting the maximum short channel name length in case there are no short names
at all (reported by Derek Kelly).
+- The new function cDevice::DeviceType() returns a string identifying the type of
+ the given device.
diff --git a/device.c b/device.c
index 00645cfc..cb5cd830 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 2.58 2012/03/13 09:48:14 kls Exp $
+ * $Id: device.c 2.59 2012/04/04 09:48:00 kls Exp $
*/
#include "device.h"
@@ -162,6 +162,11 @@ int cDevice::DeviceNumber(void) const
return -1;
}
+cString cDevice::DeviceType(void) const
+{
+ return "";
+}
+
cString cDevice::DeviceName(void) const
{
return "";
diff --git a/device.h b/device.h
index 987dfd2f..f279fda3 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h 2.38 2012/03/13 10:17:16 kls Exp $
+ * $Id: device.h 2.39 2012/04/04 09:48:21 kls Exp $
*/
#ifndef __DEVICE_H
@@ -201,6 +201,12 @@ public:
///< Returns the card index of this device (0 ... MAXDEVICES - 1).
int DeviceNumber(void) const;
///< Returns the number of this device (0 ... numDevices).
+ virtual cString DeviceType(void) const;
+ ///< Returns a string identifying the type of this device (like "DVB-S").
+ ///< If this device can receive different delivery systems, the returned
+ ///< string shall be that of the currently used system.
+ ///< The length of the returned string should not exceed 6 characters.
+ ///< The default implementation returns an empty string.
virtual cString DeviceName(void) const;
///< Returns a string identifying the name of this device.
///< The default implementation returns an empty string.
diff --git a/dvbdevice.c b/dvbdevice.c
index 65e9a4bc..46f130b3 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.c 2.69 2012/03/25 10:41:45 kls Exp $
+ * $Id: dvbdevice.c 2.70 2012/04/04 09:49:12 kls Exp $
*/
#include "dvbdevice.h"
@@ -285,6 +285,7 @@ class cDvbTuner : public cThread {
private:
static cMutex bondMutex;
enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked };
+ int frontendType;
const cDvbDevice *device;
int fd_frontend;
int adapter, frontend;
@@ -314,6 +315,7 @@ private:
public:
cDvbTuner(const cDvbDevice *Device, int Fd_Frontend, int Adapter, int Frontend);
virtual ~cDvbTuner();
+ int FrontendType(void) const { return frontendType; }
bool Bond(cDvbTuner *Tuner);
void UnBond(void);
bool BondingOk(const cChannel *Channel, bool ConsiderOccupied = false) const;
@@ -331,6 +333,7 @@ cMutex cDvbTuner::bondMutex;
cDvbTuner::cDvbTuner(const cDvbDevice *Device, int Fd_Frontend, int Adapter, int Frontend)
{
+ frontendType = SYS_UNDEFINED;
device = Device;
fd_frontend = Fd_Frontend;
adapter = Adapter;
@@ -733,7 +736,7 @@ bool cDvbTuner::SetFrontend(void)
cDvbTransponderParameters dtp(channel.Parameters());
// Determine the required frontend type:
- int frontendType = GetRequiredDeliverySystem(&channel, &dtp);
+ frontendType = GetRequiredDeliverySystem(&channel, &dtp);
if (frontendType == SYS_UNDEFINED)
return false;
@@ -977,7 +980,7 @@ int cDvbDevice::setTransferModeForDolbyDigital = 1;
cMutex cDvbDevice::bondMutex;
const char *DeliverySystemNames[] = {
- "UNDEFINED",
+ "",
"DVB-C",
"DVB-C",
"DVB-T",
@@ -1090,6 +1093,17 @@ bool cDvbDevice::Probe(int Adapter, int Frontend)
return true;
}
+cString cDvbDevice::DeviceType(void) const
+{
+ if (dvbTuner) {
+ if (dvbTuner->FrontendType() != SYS_UNDEFINED)
+ return DeliverySystemNames[dvbTuner->FrontendType()];
+ if (numDeliverySystems)
+ return DeliverySystemNames[deliverySystems[0]]; // to have some reasonable default
+ }
+ return "";
+}
+
cString cDvbDevice::DeviceName(void) const
{
return frontendInfo.name;
diff --git a/dvbdevice.h b/dvbdevice.h
index c53a2086..6dca3859 100644
--- a/dvbdevice.h
+++ b/dvbdevice.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.h 2.25 2012/03/13 10:11:15 kls Exp $
+ * $Id: dvbdevice.h 2.26 2012/04/04 09:48:00 kls Exp $
*/
#ifndef __DVBDEVICE_H
@@ -138,6 +138,7 @@ public:
int Adapter(void) const { return adapter; }
int Frontend(void) const { return frontend; }
virtual bool Ready(void);
+ virtual cString DeviceType(void) const;
virtual cString DeviceName(void) const;
static bool BondDevices(const char *Bondings);
///< Bonds the devices as defined in the given Bondings string.