From e7d98d2ee679e9f4b0f5581ddbf62465523fba09 Mon Sep 17 00:00:00 2001
From: Klaus Schmidinger <vdr@tvdr.de>
Date: Sat, 17 Sep 2005 14:30:18 +0200
Subject: Removed obsolete 'shift' code in device.[hc]

---
 HISTORY  |  1 +
 device.c | 55 +------------------------------------------------------
 device.h |  3 +--
 3 files changed, 3 insertions(+), 56 deletions(-)

diff --git a/HISTORY b/HISTORY
index 541c5803..bc1881ee 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3821,3 +3821,4 @@ Video Disk Recorder Revision History
   reporting this one).
 - Fixed error handling in cCiTransportConnection::RecvTPDU() (thanks to Georg Acher
   for reporting this one).
+- Removed obsolete 'shift' code in device.[hc].
diff --git a/device.c b/device.c
index 8673cf05..dcd05a31 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: device.c 1.109 2005/09/04 14:28:16 kls Exp $
+ * $Id: device.c 1.110 2005/09/17 14:29:44 kls Exp $
  */
 
 #include "device.h"
@@ -310,22 +310,6 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool *NeedsDe
             }
          }
       }
-
-  /*XXX+ too complex with multiple recordings per device
-  if (!d && Ca > MAXDEVICES) {
-     // We didn't find one the easy way, so now we have to try harder:
-     int ShiftLevel = -1;
-     for (int i = 0; i < numDevices; i++) {
-         if (Provides[i]) { // this device is basicly able to do the job, but for some reason we didn't get it above
-            int sl = device[i]->CanShift(Ca, Priority); // asks this device to shift its job to another device
-            if (sl >= 0 && (ShiftLevel < 0 || sl < ShiftLevel)) {
-               d = device[i]; // found one that can be shifted with the fewest number of subsequent shifts
-               ShiftLevel = sl;
-               }
-            }
-         }
-     }
-  XXX*/
   return d;
 }
 
@@ -1084,43 +1068,6 @@ int cDevice::Priority(void) const
   return priority;
 }
 
-int cDevice::CanShift(int Ca, int Priority, int UsedCards) const
-{
-  return -1;//XXX+ too complex with multiple recordings per device
-  /*XXX
-  // Test whether a receiver on this device can be shifted to another one
-  // in order to perform a new receiving with the given Ca and Priority on this device:
-  int ShiftLevel = -1; // default means this device can't be shifted
-  if (UsedCards & (1 << CardIndex()) != 0)
-     return ShiftLevel; // otherwise we would get into a loop
-  if (Receiving()) {
-     if (ProvidesCa(Ca) // this device provides the requested Ca
-        && (Ca != this->Ca() // the requested Ca is different from the one currently used...
-           || Priority > this->Priority())) { // ...or the request comes from a higher priority
-        cDevice *d = NULL;
-        int Provides[MAXDEVICES];
-        UsedCards |= (1 << CardIndex());
-        for (int i = 0; i < numDevices; i++) {
-            if ((Provides[i] = device[i]->ProvidesCa(this->Ca())) != 0) { // this device is basicly able to do the job
-               if (device[i] != this) { // it is not _this_ device
-                  int sl = device[i]->CanShift(this->Ca(), Priority, UsedCards); // this is the original Priority!
-                  if (sl >= 0 && (ShiftLevel < 0 || sl < ShiftLevel)) {
-                     d = device[i];
-                     ShiftLevel = sl;
-                     }
-                  }
-               }
-            }
-        if (ShiftLevel >= 0)
-           ShiftLevel++; // adds the device's own shift
-        }
-     }
-  else if (Priority > this->Priority())
-     ShiftLevel = 0; // no shifting necessary, this device can do the job
-  return ShiftLevel;
-  XXX*/
-}
-
 bool cDevice::Ready(void)
 {
   return true;
diff --git a/device.h b/device.h
index 484f0be5..d13b896c 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
  * See the main source file 'vdr.c' for copyright information and
  * how to reach the author.
  *
- * $Id: device.h 1.64 2005/09/10 11:54:02 kls Exp $
+ * $Id: device.h 1.65 2005/09/17 14:29:28 kls Exp $
  */
 
 #ifndef __DEVICE_H
@@ -485,7 +485,6 @@ public:
 private:
   cMutex mutexReceiver;
   cReceiver *receiver[MAXRECEIVERS];
-  int CanShift(int Ca, int Priority, int UsedCards = 0) const;
 protected:
   int Priority(void) const;
       ///< Returns the priority of the current receiving session (0..MAXPRIORITY),
-- 
cgit v1.2.3