vdr  1.7.27
receiver.h
Go to the documentation of this file.
00001 /*
00002  * receiver.h: The basic receiver interface
00003  *
00004  * See the main source file 'vdr.c' for copyright information and
00005  * how to reach the author.
00006  *
00007  * $Id: receiver.h 2.6 2012/03/11 15:25:40 kls Exp $
00008  */
00009 
00010 #ifndef __RECEIVER_H
00011 #define __RECEIVER_H
00012 
00013 #include "device.h"
00014 
00015 #define MAXRECEIVEPIDS  64 // the maximum number of PIDs per receiver
00016 
00017 #define LEGACY_CRECEIVER // Code enclosed with this macro is deprecated and may be removed in a future version
00018 
00019 class cReceiver {
00020   friend class cDevice;
00021 private:
00022   cDevice *device;
00023   tChannelID channelID;
00024   int priority;
00025   int pids[MAXRECEIVEPIDS];
00026   int numPids;
00027   bool WantsPid(int Pid);
00028 protected:
00029   void Detach(void);
00030   virtual void Activate(bool On) {}
00035   virtual void Receive(uchar *Data, int Length) = 0;
00042 public:
00043 #ifdef LEGACY_CRECEIVER
00044   cReceiver(tChannelID ChannelID, int Priority, int Pid, const int *Pids1 = NULL, const int *Pids2 = NULL, const int *Pids3 = NULL);
00045 #endif
00046   cReceiver(const cChannel *Channel = NULL, int Priority = MINPRIORITY);
00055   virtual ~cReceiver();
00056   bool AddPid(int Pid);
00058   bool AddPids(const int *Pids);
00061   bool AddPids(int Pid1, int Pid2, int Pid3 = 0, int Pid4 = 0, int Pid5 = 0, int Pid6 = 0, int Pid7 = 0, int Pid8 = 0, int Pid9 = 0);
00063   bool SetPids(const cChannel *Channel);
00072   tChannelID ChannelID(void) { return channelID; }
00073   bool IsAttached(void) { return device != NULL; }
00079   };
00080 
00081 #endif //__RECEIVER_H