From 644a9f07f26df58b7d79cea8ea961c2232a092be Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 6 Feb 2010 14:23:03 +0100 Subject: Implemented cDeviceHook --- PLUGINS.html | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'PLUGINS.html') diff --git a/PLUGINS.html b/PLUGINS.html index 9167a4b9..05fb7ed0 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -1970,6 +1970,46 @@ shut down (delete) all devices when the program terminates. It is therefore important that the devices are created on the heap, using the new operator! +
+

+Device hooks +

+VDR has builtin facilities that select which device is able to provide a given +transponder. However, there may be situations where the setup is so special +that it requires considerations that exceed the scope of the core VDR code. +This is where device hooks can be used. + +

+class cMyDeviceHook : public cDeviceHook {
+public:
+  cMyDeviceHook(void);
+  virtual bool DeviceProvidesTransponder(const cDevice *Device, const cChannel *Channel) const;
+  };
+

+ +In its DeviceProvidesTransponder() function the device hook can take +whatever actions are necessary to determine whether the given Device can +provide the given Channel's transponder, as in + +

+void cMyDeviceHook::DeviceProvidesTransponder(const cDevice *Device, const cChannel *Channel) const
+{
+  if (condition where Device can't provide Channel)
+     return false;
+  return true;
+}
+

+ +A plugin that creates a derived cDeviceHook shall do so in its Initialize() +function, as in + +

+new cMyDeviceHook;
+

+ +and shall not delete this object. It will be automatically deleted when the program ends. +

+

Audio

"The stereo effect may only be experienced if stereo equipment is used!"

-- cgit v1.2.3