From 644a9f07f26df58b7d79cea8ea961c2232a092be Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 6 Feb 2010 14:23:03 +0100 Subject: Implemented cDeviceHook --- device.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'device.c') diff --git a/device.c b/device.c index cb31b834..88c46736 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.32 2010/01/30 11:06:51 kls Exp $ + * $Id: device.c 2.33 2010/02/06 13:55:50 kls Exp $ */ #include "device.h" @@ -44,6 +44,18 @@ void cLiveSubtitle::Receive(uchar *Data, int Length) cDevice::PrimaryDevice()->PlayTs(Data, Length); } +// --- cDeviceHook ----------------------------------------------------------- + +cDeviceHook::cDeviceHook(void) +{ + cDevice::deviceHooks.Add(this); +} + +bool cDeviceHook::DeviceProvidesTransponder(const cDevice *Device, const cChannel *Channel) const +{ + return true; +} + // --- cDevice --------------------------------------------------------------- // The default priority for non-primary devices: @@ -59,6 +71,7 @@ int cDevice::currentChannel = 1; cDevice *cDevice::device[MAXDEVICES] = { NULL }; cDevice *cDevice::primaryDevice = NULL; cDevice *cDevice::avoidDevice = NULL; +cList cDevice::deviceHooks; cDevice::cDevice(void) :patPmtParser(true) @@ -570,6 +583,17 @@ bool cDevice::ProvidesSource(int Source) const return false; } +bool cDevice::DeviceHooksProvidesTransponder(const cChannel *Channel) const +{ + cDeviceHook *Hook = deviceHooks.First(); + while (Hook) { + if (!Hook->DeviceProvidesTransponder(this, Channel)) + return false; + Hook = deviceHooks.Next(Hook); + } + return true; +} + bool cDevice::ProvidesTransponder(const cChannel *Channel) const { return false; -- cgit v1.2.3