summaryrefslogtreecommitdiff
path: root/receiver.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-06-16 12:57:31 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-06-16 12:57:31 +0200
commita4bfddd2f995ad03409de005bc3015437c10aa06 (patch)
treed5959a667bcdb4b7aec55940aaaecfd398de3bb8 /receiver.c
parentb005b8fc4a15926ab6f82c7ac19e5b13d811df5f (diff)
downloadvdr-a4bfddd2f995ad03409de005bc3015437c10aa06.tar.gz
vdr-a4bfddd2f995ad03409de005bc3015437c10aa06.tar.bz2
Totally rearranged device/player/recorder structures
Diffstat (limited to 'receiver.c')
-rw-r--r--receiver.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/receiver.c b/receiver.c
new file mode 100644
index 00000000..6ddbaa64
--- /dev/null
+++ b/receiver.c
@@ -0,0 +1,55 @@
+/*
+ * receiver.c: The basic receiver interface
+ *
+ * See the main source file 'vdr.c' for copyright information and
+ * how to reach the author.
+ *
+ * $Id: receiver.c 1.1 2002/06/10 16:30:00 kls Exp $
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "receiver.h"
+
+cReceiver::cReceiver(int Ca, int Priority, int NumPids, ...)
+{
+ device = NULL;
+ ca = Ca;
+ priority = Priority;
+ if (NumPids) {
+ va_list ap;
+ va_start(ap, NumPids);
+ int n = 0;
+ while (n < MAXRECEIVEPIDS && NumPids--) {
+ if ((pids[n] = va_arg(ap, int)) != 0)
+ n++;
+ }
+ va_end(ap);
+ }
+ else
+ esyslog("ERROR: cReceiver called without a PID!");
+}
+
+cReceiver::~cReceiver()
+{
+ Detach();
+}
+
+bool cReceiver::WantsPid(int Pid)
+{
+ if (Pid) {
+ for (int i = 0; i < MAXRECEIVEPIDS; i++) {
+ if (pids[i] == Pid)
+ return true;
+ if (!pids[i])
+ break;
+ }
+ }
+ return false;
+}
+
+void cReceiver::Detach(void)
+{
+ if (device)
+ device->Detach(this);
+}