vdr  2.2.0
filter.h
Go to the documentation of this file.
1 /*
2  * filter.h: Section filter
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: filter.h 3.0 2004/01/11 13:31:59 kls Exp $
8  */
9 
10 #ifndef __FILTER_H
11 #define __FILTER_H
12 
13 #include <sys/types.h>
14 #include "tools.h"
15 
17 private:
19  bool synced;
20 public:
21  cSectionSyncer(void);
22  void Reset(void);
23  bool Sync(uchar Version, int Number, int LastNumber);
24  };
25 
26 class cFilterData : public cListObject {
27 public:
28  u_short pid;
31  bool sticky;
32  cFilterData(void);
33  cFilterData(u_short Pid, u_char Tid, u_char Mask, bool Sticky);
34  bool Is(u_short Pid, u_char Tid, u_char Mask);
35  bool Matches(u_short Pid, u_char Tid);
36  };
37 
38 class cChannel;
39 class cSectionHandler;
40 
41 class cFilter : public cListObject {
42  friend class cSectionHandler;
43 private:
46  bool on;
47 protected:
48  cFilter(void);
49  cFilter(u_short Pid, u_char Tid, u_char Mask = 0xFF);
50  virtual ~cFilter();
51  virtual void SetStatus(bool On);
58  virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length) = 0;
69  int Source(void);
71  int Transponder(void);
73  const cChannel *Channel(void);
75  bool Matches(u_short Pid, u_char Tid);
77  void Set(u_short Pid, u_char Tid, u_char Mask = 0xFF);
79  void Add(u_short Pid, u_char Tid, u_char Mask = 0xFF, bool Sticky = false);
83  void Del(u_short Pid, u_char Tid, u_char Mask = 0xFF);
85  };
86 
87 #endif //__FILTER_H
bool synced
Definition: filter.h:19
unsigned char uchar
Definition: tools.h:30
bool sticky
Definition: filter.h:31
cFilterData(void)
Definition: filter.c:42
bool Matches(u_short Pid, u_char Tid)
Definition: filter.c:63
int lastVersion
Definition: filter.h:18
cList< cFilterData > data
Definition: filter.h:45
void Add(u_short Pid, u_char Tid, u_char Mask=0xFF, bool Sticky=false)
Adds the given filter data to this filter.
Definition: filter.c:142
const cChannel * Channel(void)
Returns the channel of the data delivered to this filter.
Definition: filter.c:99
bool on
Definition: filter.h:46
u_short pid
Definition: filter.h:28
Definition: filter.h:41
bool Sync(uchar Version, int Number, int LastNumber)
Definition: filter.c:26
cSectionSyncer(void)
Definition: filter.c:15
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)=0
Processes the data delivered to this filter.
cFilter(void)
Definition: filter.c:70
bool Matches(u_short Pid, u_char Tid)
Indicates whether this filter wants to receive data from the given Pid/Tid.
Definition: filter.c:126
void Del(u_short Pid, u_char Tid, u_char Mask=0xFF)
Deletes the given filter data from this filter.
Definition: filter.c:150
u_char mask
Definition: filter.h:30
int Source(void)
Returns the source of the data delivered to this filter.
Definition: filter.c:89
cSectionHandler * sectionHandler
Definition: filter.h:44
u_char tid
Definition: filter.h:29
bool Is(u_short Pid, u_char Tid, u_char Mask)
Definition: filter.c:58
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
Definition: filter.c:104
unsigned char u_char
Definition: headers.h:24
int Transponder(void)
Returns the transponder of the data delivered to this filter.
Definition: filter.c:94
void Set(u_short Pid, u_char Tid, u_char Mask=0xFF)
Sets the given filter data by calling Add() with Sticky = true.
Definition: filter.c:137
void Reset(void)
Definition: filter.c:20
virtual ~cFilter()
Definition: filter.c:83