summaryrefslogtreecommitdiff
path: root/eit.h
blob: 28329f42736426257ac666f875270745bfbae18e (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
/***************************************************************************
                          eit.h  -  description
                             -------------------
    begin                : Fri Aug 25 2000
    copyright            : (C) 2000 by Robert Schneider
    email                : Robert.Schneider@web.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 * $Id: eit.h 1.1 2000/09/03 10:23:24 kls Exp $
 ***************************************************************************/

#ifndef __EIT_H
#define __EIT_H

#include <dvb_v4l.h>

typedef struct eit_event {

	bool	bIsValid;
	char	szTitle[512];
	char	szSubTitle[512];
	char	szDate[12];
	char	szTime[12];

}eit_event;

/**
  *@author Robert Schneider
  */

class cEIT {
public: 
	cEIT();
	~cEIT();
  /**  */
  int GetEIT();
  /**  */
  int SetProgramNumber(unsigned short pnr);
  /** Retrieves the string representing the time of the current event */
  char * GetRunningTime();
  /** Retrieves the string representing the date of the current event */
  char * GetRunningDate();
  /** Retrieves the string for the running subtitle */
  char * GetRunningSubtitle();
  /** retrieves the string for the running title */
  char * GetRunningTitle();
  /** Retrieves the string representing the time of the next event */
  char * GetNextTime();
  /** Retrieves the string representing the date of the next event */
  char * GetNextDate();
  /** Retrieves the string for the next subtitle */
  char * GetNextSubtitle();
  /** retrieves the string for the next title */
  char * GetNextTitle();
  /**  */
  bool IsValid();

protected: // Protected attributes
  /** Device name of VBI device */
  const char * cszBitFilter;
protected: // Protected attributes
  /** handle to VBI device (usually /dev/vbi) */
  int fsvbi;
  /** Describes the event next on */
  eit_event evtNext;
  /** Describes the running event */
  eit_event evtRunning;
protected: // Protected methods
  /** Set the bitfilter in vbi device to return
correct tables */
  int SetBitFilter(unsigned short pid, unsigned short section, unsigned short mode);
  /**  */
  int GetSection(unsigned char *buf, ushort PID, unsigned char sec);
  /**  */
  int CloseFilter(unsigned short handle);
  /**  */
  char * mjd2string(unsigned short mjd);
  /**  */
  int strdvbcpy(unsigned char *dst, unsigned char *src, int max);
public: // Public attributes
  /**  */
  unsigned short uProgramNumber;
};

#endif