diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-12 14:12:19 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-12 14:12:19 +0100 |
commit | 6b229d7d5f6377a930191d9ba469b7707b8eb8a5 (patch) | |
tree | ee391c59906522d890d2de1dabe37a028f29ecea | |
parent | 67fff7f4fcb83b5e1439bd7b8b3952ae3f423bc3 (diff) | |
download | vdr-6b229d7d5f6377a930191d9ba469b7707b8eb8a5.tar.gz vdr-6b229d7d5f6377a930191d9ba469b7707b8eb8a5.tar.bz2 |
Added functions to set and retrieve the priority of a cReceiver
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | receiver.c | 9 | ||||
-rw-r--r-- | receiver.h | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index cf961d25..44560335 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2549,6 +2549,7 @@ Frank Schmirler <vdr@schmirler.de> for suggestions used in revising priority handling to allow receivers with a priority that is lower than that of live viewing for fixing handling IDLEPRIORITY in cDvbDevice::ProvidesChannel() + for suggesting to add functions to set and retrieve the priority of a cReceiver Jörn Reder <joern@zyn.de> for reporting that a recording may unnecessarily block a device with a CAM, while @@ -8349,3 +8349,5 @@ Video Disk Recorder Revision History - Added the functions IndexOf(), InsertUnique(), AppendUnique() and RemoveElement() to the cVector class (thanks to Stefan Schallenberg). - Fixed a possible out-of-bounds access in cVector::Remove(). +- Added functions to set and retrieve the priority of a cReceiver (suggested by + Frank Schmirler). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: receiver.c 3.2 2014/02/08 15:57:30 kls Exp $ + * $Id: receiver.c 3.3 2015/01/12 14:04:31 kls Exp $ */ #include "receiver.h" @@ -14,7 +14,7 @@ cReceiver::cReceiver(const cChannel *Channel, int Priority) { device = NULL; - priority = constrain(Priority, MINPRIORITY, MAXPRIORITY); + SetPriority(Priority); numPids = 0; SetPids(Channel); } @@ -29,6 +29,11 @@ cReceiver::~cReceiver() } } +void cReceiver::SetPriority(int Priority) +{ + priority = constrain(Priority, MINPRIORITY, MAXPRIORITY); +} + bool cReceiver::AddPid(int Pid) { if (Pid) { @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: receiver.h 3.2 2015/01/12 10:24:20 kls Exp $ + * $Id: receiver.h 3.3 2015/01/12 14:03:22 kls Exp $ */ #ifndef __RECEIVER_H @@ -49,6 +49,8 @@ public: ///< that this cReceiver may be detached at any time in favor of a timer recording ///< or live viewing (without blocking the cDevice it is attached to). virtual ~cReceiver(); + int Priority(void) { return priority; } + void SetPriority(int Priority); bool AddPid(int Pid); ///< Adds the given Pid to the list of PIDs of this receiver. bool AddPids(const int *Pids); |