summaryrefslogtreecommitdiff
path: root/vdrttxtsubshooks.c
diff options
context:
space:
mode:
authorTobias Grimm <tobias@e-tobi.loc>2008-12-14 19:52:13 +0100
committerTobias Grimm <tobias@e-tobi.loc>2009-06-20 17:40:07 +0200
commitda9125bcaad4233983295e5d8c15b0f195891ba5 (patch)
tree5b4477866d04942cabbc8021b48bf6fa48061372 /vdrttxtsubshooks.c
parentab6f2ccf424896a80b6e2fdf9ab9313ea4b7f316 (diff)
downloadvdr-patches-da9125bcaad4233983295e5d8c15b0f195891ba5.tar.gz
vdr-patches-da9125bcaad4233983295e5d8c15b0f195891ba5.tar.bz2
ttxtsubs: Updated patch for VDR 1.7.x by Rolf Ahrenberg
Diffstat (limited to 'vdrttxtsubshooks.c')
-rw-r--r--vdrttxtsubshooks.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/vdrttxtsubshooks.c b/vdrttxtsubshooks.c
new file mode 100644
index 0000000..4c1836b
--- /dev/null
+++ b/vdrttxtsubshooks.c
@@ -0,0 +1,44 @@
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+
+#include "vdrttxtsubshooks.h"
+
+// XXX Really should be a list...
+static cVDRTtxtsubsHookListener *gListener;
+
+// ------ class cVDRTtxtsubsHookProxy ------
+
+class cVDRTtxtsubsHookProxy : public cVDRTtxtsubsHookListener
+{
+ public:
+ virtual void HideOSD(void) { if(gListener) gListener->HideOSD(); };
+ virtual void ShowOSD(void) { if(gListener) gListener->ShowOSD(); };
+ virtual void PlayerTeletextData(uint8_t *p, int length)
+ { if(gListener) gListener->PlayerTeletextData(p, length); };
+ virtual cTtxtSubsRecorderBase *NewTtxtSubsRecorder(cDevice *dev, const cChannel *ch)
+ { if(gListener) return gListener->NewTtxtSubsRecorder(dev, ch); else return NULL; };
+};
+
+
+// ------ class cVDRTtxtsubsHookListener ------
+
+cVDRTtxtsubsHookListener::~cVDRTtxtsubsHookListener()
+{
+ gListener = 0;
+}
+
+void cVDRTtxtsubsHookListener::HookAttach(void)
+{
+ gListener = this;
+ //printf("cVDRTtxtsubsHookListener::HookAttach\n");
+}
+
+static cVDRTtxtsubsHookProxy gProxy;
+
+cVDRTtxtsubsHookListener *cVDRTtxtsubsHookListener::Hook(void)
+{
+ return &gProxy;
+}
+