mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
The new function cDevice::DeviceType() returns a string identifying the type of the given device
This commit is contained in:
parent
0ac4d23cab
commit
d5aa5f7294
4
HISTORY
4
HISTORY
@ -7052,8 +7052,10 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed handling IDLEPRIORITY in cDvbDevice::ProvidesChannel() (thanks to Frank
|
- Fixed handling IDLEPRIORITY in cDvbDevice::ProvidesChannel() (thanks to Frank
|
||||||
Schmirler).
|
Schmirler).
|
||||||
|
|
||||||
2012-04-01: Version 1.7.28
|
2012-04-04: Version 1.7.28
|
||||||
|
|
||||||
- Fixed cPixmapMemory::DrawEllipse() for quadrants -1 and -4.
|
- Fixed cPixmapMemory::DrawEllipse() for quadrants -1 and -4.
|
||||||
- Fixed getting the maximum short channel name length in case there are no short names
|
- Fixed getting the maximum short channel name length in case there are no short names
|
||||||
at all (reported by Derek Kelly).
|
at all (reported by Derek Kelly).
|
||||||
|
- The new function cDevice::DeviceType() returns a string identifying the type of
|
||||||
|
the given device.
|
||||||
|
7
device.c
7
device.c
@ -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 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"
|
#include "device.h"
|
||||||
@ -162,6 +162,11 @@ int cDevice::DeviceNumber(void) const
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cString cDevice::DeviceType(void) const
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
cString cDevice::DeviceName(void) const
|
cString cDevice::DeviceName(void) const
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
|
8
device.h
8
device.h
@ -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 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
|
#ifndef __DEVICE_H
|
||||||
@ -201,6 +201,12 @@ public:
|
|||||||
///< Returns the card index of this device (0 ... MAXDEVICES - 1).
|
///< Returns the card index of this device (0 ... MAXDEVICES - 1).
|
||||||
int DeviceNumber(void) const;
|
int DeviceNumber(void) const;
|
||||||
///< Returns the number of this device (0 ... numDevices).
|
///< 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;
|
virtual cString DeviceName(void) const;
|
||||||
///< Returns a string identifying the name of this device.
|
///< Returns a string identifying the name of this device.
|
||||||
///< The default implementation returns an empty string.
|
///< The default implementation returns an empty string.
|
||||||
|
20
dvbdevice.c
20
dvbdevice.c
@ -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: 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"
|
#include "dvbdevice.h"
|
||||||
@ -285,6 +285,7 @@ class cDvbTuner : public cThread {
|
|||||||
private:
|
private:
|
||||||
static cMutex bondMutex;
|
static cMutex bondMutex;
|
||||||
enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked };
|
enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked };
|
||||||
|
int frontendType;
|
||||||
const cDvbDevice *device;
|
const cDvbDevice *device;
|
||||||
int fd_frontend;
|
int fd_frontend;
|
||||||
int adapter, frontend;
|
int adapter, frontend;
|
||||||
@ -314,6 +315,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
cDvbTuner(const cDvbDevice *Device, int Fd_Frontend, int Adapter, int Frontend);
|
cDvbTuner(const cDvbDevice *Device, int Fd_Frontend, int Adapter, int Frontend);
|
||||||
virtual ~cDvbTuner();
|
virtual ~cDvbTuner();
|
||||||
|
int FrontendType(void) const { return frontendType; }
|
||||||
bool Bond(cDvbTuner *Tuner);
|
bool Bond(cDvbTuner *Tuner);
|
||||||
void UnBond(void);
|
void UnBond(void);
|
||||||
bool BondingOk(const cChannel *Channel, bool ConsiderOccupied = false) const;
|
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)
|
cDvbTuner::cDvbTuner(const cDvbDevice *Device, int Fd_Frontend, int Adapter, int Frontend)
|
||||||
{
|
{
|
||||||
|
frontendType = SYS_UNDEFINED;
|
||||||
device = Device;
|
device = Device;
|
||||||
fd_frontend = Fd_Frontend;
|
fd_frontend = Fd_Frontend;
|
||||||
adapter = Adapter;
|
adapter = Adapter;
|
||||||
@ -733,7 +736,7 @@ bool cDvbTuner::SetFrontend(void)
|
|||||||
cDvbTransponderParameters dtp(channel.Parameters());
|
cDvbTransponderParameters dtp(channel.Parameters());
|
||||||
|
|
||||||
// Determine the required frontend type:
|
// Determine the required frontend type:
|
||||||
int frontendType = GetRequiredDeliverySystem(&channel, &dtp);
|
frontendType = GetRequiredDeliverySystem(&channel, &dtp);
|
||||||
if (frontendType == SYS_UNDEFINED)
|
if (frontendType == SYS_UNDEFINED)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -977,7 +980,7 @@ int cDvbDevice::setTransferModeForDolbyDigital = 1;
|
|||||||
cMutex cDvbDevice::bondMutex;
|
cMutex cDvbDevice::bondMutex;
|
||||||
|
|
||||||
const char *DeliverySystemNames[] = {
|
const char *DeliverySystemNames[] = {
|
||||||
"UNDEFINED",
|
"",
|
||||||
"DVB-C",
|
"DVB-C",
|
||||||
"DVB-C",
|
"DVB-C",
|
||||||
"DVB-T",
|
"DVB-T",
|
||||||
@ -1090,6 +1093,17 @@ bool cDvbDevice::Probe(int Adapter, int Frontend)
|
|||||||
return true;
|
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
|
cString cDvbDevice::DeviceName(void) const
|
||||||
{
|
{
|
||||||
return frontendInfo.name;
|
return frontendInfo.name;
|
||||||
|
@ -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: 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
|
#ifndef __DVBDEVICE_H
|
||||||
@ -138,6 +138,7 @@ public:
|
|||||||
int Adapter(void) const { return adapter; }
|
int Adapter(void) const { return adapter; }
|
||||||
int Frontend(void) const { return frontend; }
|
int Frontend(void) const { return frontend; }
|
||||||
virtual bool Ready(void);
|
virtual bool Ready(void);
|
||||||
|
virtual cString DeviceType(void) const;
|
||||||
virtual cString DeviceName(void) const;
|
virtual cString DeviceName(void) const;
|
||||||
static bool BondDevices(const char *Bondings);
|
static bool BondDevices(const char *Bondings);
|
||||||
///< Bonds the devices as defined in the given Bondings string.
|
///< Bonds the devices as defined in the given Bondings string.
|
||||||
|
Loading…
Reference in New Issue
Block a user