Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

receiver.c

Go to the documentation of this file.
00001 
00010 #include <stdarg.h>
00011 #include <stdio.h>
00012 #include "receiver.h"
00013 #include "tools.h"
00014 
00026 
00027 cReceiver::cReceiver(int Ca, int Priority, int NumPids, ...)
00028 {
00029   device = NULL;
00030 
00034 
00035   ca = Ca;
00036 
00040 
00041   priority = Priority;
00042   for (int i = 0; i < MAXRECEIVEPIDS; i++)
00043       pids[i] = 0;
00044   if (NumPids) {
00045      va_list ap;
00046      va_start(ap, NumPids);
00047      int n = 0;
00048      while (n < MAXRECEIVEPIDS && NumPids--) {
00049            if ((pids[n] = va_arg(ap, int)) != 0)
00050               n++;
00051            }
00052      va_end(ap);
00053      }
00054   else
00055      esyslog("ERROR: cReceiver called without a PID!");
00056 }
00057 
00058 cReceiver::~cReceiver()
00059 {
00060   Detach();
00061 }
00062 
00063 bool cReceiver::WantsPid(int Pid)
00064 {
00065   if (Pid) {
00066      for (int i = 0; i < MAXRECEIVEPIDS; i++) {
00067          if (pids[i] == Pid)
00068             return true;
00069          if (!pids[i])
00070             break;
00071          }
00072      }
00073   return false;
00074 }
00075 
00076 void cReceiver::Detach(void)
00077 {
00078   if (device)
00079      device->Detach(this);
00080 }

Generated on Wed Feb 5 23:30:11 2003 for VDR by doxygen1.3-rc2