vdr
1.7.31
Main Page
Namespaces
Classes
Files
File List
File Members
vdrttxtsubshooks.c
Go to the documentation of this file.
1
/*
2
* vdr-ttxtsubs - A plugin for the Linux Video Disk Recorder
3
* Copyright (c) 2003 - 2008 Ragnar Sundblad <ragge@nada.kth.se>
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License as published by the
7
* Free Software Foundation; either version 2 of the License, or (at your option)
8
* any later version.
9
*
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13
* details.
14
*
15
* You should have received a copy of the GNU General Public License along with
16
* this program; if not, write to the Free Software Foundation, Inc.,
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*
19
*/
20
21
#include <stdlib.h>
22
#include <stdio.h>
23
#include <stdint.h>
24
25
#include "
vdrttxtsubshooks.h
"
26
27
// XXX Really should be a list...
28
static
cVDRTtxtsubsHookListener
*
gListener
;
29
30
// ------ class cVDRTtxtsubsHookProxy ------
31
32
class
cVDRTtxtsubsHookProxy
:
public
cVDRTtxtsubsHookListener
33
{
34
public
:
35
virtual
void
HideOSD
(
void
) {
if
(gListener) gListener->
HideOSD
(); };
36
virtual
void
ShowOSD
(
void
) {
if
(gListener) gListener->
ShowOSD
(); };
37
virtual
void
PlayerTeletextData
(uint8_t *p,
int
length,
bool
IsPesRecording,
const
struct
tTeletextSubtitlePage
teletextSubtitlePages[] = NULL,
int
pageCount = 0)
38
{
if
(gListener) gListener->
PlayerTeletextData
(p, length, IsPesRecording, teletextSubtitlePages, pageCount); };
39
virtual
int
ManualPageNumber
(
const
cChannel
*channel)
40
{
if
(gListener)
return
gListener->
ManualPageNumber
(channel);
else
return
0; };
41
};
42
43
44
// ------ class cVDRTtxtsubsHookListener ------
45
46
cVDRTtxtsubsHookListener::~cVDRTtxtsubsHookListener
()
47
{
48
gListener = 0;
49
}
50
51
void
cVDRTtxtsubsHookListener::HookAttach
(
void
)
52
{
53
gListener =
this
;
54
//printf("cVDRTtxtsubsHookListener::HookAttach\n");
55
}
56
57
static
cVDRTtxtsubsHookProxy
gProxy
;
58
59
cVDRTtxtsubsHookListener
*
cVDRTtxtsubsHookListener::Hook
(
void
)
60
{
61
return
&
gProxy
;
62
}
63
Generated by
1.8.1.2