summaryrefslogtreecommitdiff
path: root/receiver.h
diff options
context:
space:
mode:
Diffstat (limited to 'receiver.h')
-rw-r--r--receiver.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/receiver.h b/receiver.h
index 6f136e4b..bd98a426 100644
--- a/receiver.h
+++ b/receiver.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: receiver.h 1.5 2007/01/07 14:40:36 kls Exp $
+ * $Id: receiver.h 2.1 2010/01/30 10:25:19 kls Exp $
*/
#ifndef __RECEIVER_H
@@ -14,6 +14,8 @@
#define MAXRECEIVEPIDS 64 // the maximum number of PIDs per receiver
+#define LEGACY_CRECEIVER // Code enclosed with this macro is deprecated and may be removed in a future version
+
class cReceiver {
friend class cDevice;
private:
@@ -38,20 +40,35 @@ protected:
///< will be delivered only ONCE, so the cReceiver must make sure that
///< it will be able to buffer the data if necessary.
public:
+#ifdef LEGACY_CRECEIVER
cReceiver(tChannelID ChannelID, int Priority, int Pid, const int *Pids1 = NULL, const int *Pids2 = NULL, const int *Pids3 = NULL);
- ///< Creates a new receiver for the channel with the given ChannelID with
- ///< the given Priority. Pid is a single PID (typically the video PID), while
- ///< Pids1...Pids3 are pointers to zero terminated lists of PIDs.
- ///< If any of these PIDs are 0, they will be silently ignored.
- ///< The total number of non-zero PIDs must not exceed MAXRECEIVEPIDS.
+#endif
+ cReceiver(const cChannel *Channel = NULL, int Priority = -1);
+ ///< Creates a new receiver for the given Channel with the given Priority.
+ ///< If Channel is not NULL, its pids set by a call to SetPids().
+ ///< Otherwise pids can be added to the receiver by separate calls to the AddPid[s]
+ ///< functions.
+ ///< The total number of PIDs added to a receiver must not exceed MAXRECEIVEPIDS.
///< Priority may be any value in the range -99..99. Negative values indicate
///< that this cReceiver may be detached at any time (without blocking the
///< cDevice it is attached to).
- ///< The ChannelID is necessary to allow the device that will be used for this
- ///< receiver to detect and store whether the channel can be decrypted in case
- ///< this is an encrypted channel. If the channel is not encrypted or this
- ///< detection is not wanted, an invalid tChannelID may be given.
virtual ~cReceiver();
+ bool AddPid(int Pid);
+ ///< Adds the given Pid to the list of PIDs of this receiver.
+ bool AddPids(const int *Pids);
+ ///< Adds the given izero terminated list of Pids to the list of PIDs of this
+ ///< receiver.
+ 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);
+ ///< Adds the given Pids to the list of PIDs of this receiver.
+ bool SetPids(const cChannel *Channel);
+ ///< Sets the PIDs of this receiver to those of the given Channel,
+ ///< replacing and previously stored PIDs. If Channel is NULL, all
+ ///< PIDs will be cleared. Parameters in the Setup may control whether
+ ///< certain types of PIDs (like Dolby Digital, for instance) are
+ ///< actually set. The Channel's ID is stored and can later be retrieved
+ ///< through ChannelID(). The ChannelID is necessary to allow the device
+ ///< that will be used for this receiver to detect and store whether the
+ ///< channel can be decrypted in case this is an encrypted channel.
tChannelID ChannelID(void) { return channelID; }
bool IsAttached(void) { return device != NULL; }
///< Returns true if this receiver is (still) attached to a device.