summaryrefslogtreecommitdiffstats
path: root/kaffeine/src/input/dvb/dvbsi.h
blob: 6ea81cd6d2d37d3c7f4a61ab181174707772d5ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
 * dvbsi.h
 *
 * Copyright (C) 2003-2007 Christophe Thommeret <hftom@free.fr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef DVBSI_H
#define DVBSI_H

#include "dvbsection.h"
#include "dvbstream.h"



class NitSection : public KaffeineDVBsection
{

public:

	NitSection( TQPtrList<Transponder> *tp, bool *end, bool *ok, int anum, int tnum );
	~NitSection();
	bool getSection( int pid, int tid, int timeout=5000 );
	bool tableNIT( unsigned char* buf );
	void satelliteDesc( unsigned char* buf, Transponder *trans );
	void S2satelliteDesc( unsigned char* buf, Transponder *trans );
	void cableDesc( unsigned char* buf, Transponder *trans );
	void terrestrialDesc( unsigned char* buf, Transponder *trans );
	void freqListDesc( unsigned char* buf, Transponder *trans );
	void stop();

	bool *ended;
	TQPtrList<Transponder> *transponders;

protected:

	virtual void run();
};



class DVBsi : public TQObject, public KaffeineDVBsection
{
	TQ_OBJECT
  

public:

	DVBsi( bool *ok, int anum, int tnum, DvbStream *d, const TQString &charset );
	~DVBsi();
	bool getSection( int pid, int tid, int timeout=5000, int sid=0 );
	bool listChannels();
	bool tableSDT( unsigned char* buf );
	bool tablePAT( unsigned char *buf );
	bool tablePMT( unsigned char* buf );
	void serviceDesc( unsigned char* buf, ChannelDesc *desc );

	// ATSC related methods
	virtual bool handle_atsc_transponder();
	virtual bool parseMGT( int pid, int tid, int timeout=5000, int sid=0 );
	virtual bool parseVCT( int pid, int tid, int timeout=5000, int sid=0 );

	TQPtrList<ChannelDesc> channels;
	TQPtrList<Transponder> transponders;
	DvbStream *dvb;
	int indexChannels;
	int progressTransponder;
	int adapter, tuner;

public slots:

	void go( TQPtrList<Transponder> trans, int mode=1 );
	void stop();

protected:

	virtual void run();
	virtual void timerEvent( TQTimerEvent *e );

private:

	void out( bool stopscan=true );

	int scanMode;
	NitSection *ns;

	/* ATSC related */
	int vct_table;

signals:

	void end( bool );
};

#endif /* DVBSI_H */