vdr-1.4.7/receiver.c

Go to the documentation of this file.
00001 /*
00002  * receiver.c: 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.c 1.5 2006/03/26 14:07:21 kls Exp $
00008  */
00009 
00010 #include "receiver.h"
00011 #include <stdarg.h>
00012 #include <stdio.h>
00013 #include "tools.h"
00014 
00015 cReceiver::cReceiver(int Ca, int Priority, int Pid, const int *Pids1, const int *Pids2, const int *Pids3)
00016 {
00017   device = NULL;
00018   ca = Ca;
00019   priority = Priority;
00020   numPids = 0;
00021   if (Pid)
00022      pids[numPids++] = Pid;
00023   if (Pids1) {
00024      while (*Pids1 && numPids < MAXRECEIVEPIDS)
00025            pids[numPids++] = *Pids1++;
00026      }
00027   if (Pids2) {
00028      while (*Pids2 && numPids < MAXRECEIVEPIDS)
00029            pids[numPids++] = *Pids2++;
00030      }
00031   if (Pids3) {
00032      while (*Pids3 && numPids < MAXRECEIVEPIDS)
00033            pids[numPids++] = *Pids3++;
00034      }
00035   if (numPids >= MAXRECEIVEPIDS)
00036      dsyslog("too many PIDs in cReceiver");
00037 }
00038 
00039 cReceiver::~cReceiver()
00040 {
00041   Detach();
00042 }
00043 
00044 bool cReceiver::WantsPid(int Pid)
00045 {
00046   if (Pid) {
00047      for (int i = 0; i < numPids; i++) {
00048          if (pids[i] == Pid)
00049             return true;
00050          }
00051      }
00052   return false;
00053 }
00054 
00055 void cReceiver::Detach(void)
00056 {
00057   if (device)
00058      device->Detach(this);
00059 }

Generated on Tue Nov 6 19:57:55 2007 for VDR by  doxygen 1.5.3-20071008