Re: [vdr] Concurrent LNB-patch for 1.5?

2007-10-15 Thread jdobry
Hi,

Patch you can find in attachment. Please confirm functionality and write about 
this into maillist.

Regards, 
Jiri

PS: I am not author. I just modify it for vdr 1.5.10



__
> Od: [EMAIL PROTECTED]
> Komu: 
> Datum: 15.10.2007 14:43
> Předmět: [vdr] Concurrent LNB-patch for 1.5?
>
>Hi,
>
>is there a concurrent LNB patch for 1.5.x? Or are there plans to nativly 
>support this?
>
>Regards,
>
>Andreas.
>
>_
>Express yourself instantly with MSN Messenger! Download today it's FREE!
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/___
>vdr mailing list
>vdr@linuxtv.org
>http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>
>

diff -u4 old/config.c vdr-1.5.10/config.c
--- old/config.c	2007-10-06 16:28:58.0 +0200
+++ vdr-1.5.10/config.c	2007-10-15 20:51:14.0 +0200
@@ -288,8 +288,12 @@
   CurrentVolume = MAXVOLUME;
   CurrentDolby = 0;
   InitialChannel = 0;
   InitialVolume = -1;
+#ifdef USE_LNBSHARE
+  VerboseLNBlog = 0;
+  for (int i = 0; i < MAXDEVICES; i++) CardUsesLNBnr[i] = i + 1;
+#endif /* LNBSHARE */
 }
 
 cSetup& cSetup::operator= (const cSetup &s)
 {
@@ -464,9 +468,25 @@
   else if (!strcasecmp(Name, "CurrentDolby"))CurrentDolby   = atoi(Value);
   else if (!strcasecmp(Name, "InitialChannel"))  InitialChannel = atoi(Value);
   else if (!strcasecmp(Name, "InitialVolume"))   InitialVolume  = atoi(Value);
   else
+#ifdef USE_LNBSHARE
+  if (!strcasecmp(Name, "VerboseLNBlog")) VerboseLNBlog = atoi(Value);
+  else {
+ char tmp[20];
+ bool result = false;
+ for (int i = 1; i <= MAXDEVICES; i++) {
+ sprintf(tmp, "Card%dusesLNBnr", i);
+ if (!strcasecmp(Name, tmp)) {
+CardUsesLNBnr[i - 1] = atoi(Value);
+result = true;
+}
+ }
+ return result;
+  }
+#else
  return false;
+#endif /* LNBSHARE */
   return true;
 }
 
 bool cSetup::Save(void)
@@ -545,8 +565,18 @@
   Store("CurrentVolume",  CurrentVolume);
   Store("CurrentDolby",   CurrentDolby);
   Store("InitialChannel", InitialChannel);
   Store("InitialVolume",  InitialVolume);
+#ifdef USE_LNBSHARE
+  Store("VerboseLNBlog",   VerboseLNBlog);
+  char tmp[20];
+  if (cDevice::NumDevices() > 1) {
+ for (int i = 1; i <= cDevice::NumDevices(); i++) {
+ sprintf(tmp, "Card%dusesLNBnr", i);
+ Store(tmp, CardUsesLNBnr[i - 1]);
+ }
+ }
+#endif /* LNBSHARE */
 
   Sort();
 
   if (cConfig::Save()) {
diff -u4 old/config.h vdr-1.5.10/config.h
--- old/config.h	2007-10-06 16:27:18.0 +0200
+++ vdr-1.5.10/config.h	2007-10-15 20:51:14.0 +0200
@@ -43,8 +43,14 @@
 #define MAXOSDWIDTH  672
 #define MINOSDHEIGHT 324
 #define MAXOSDHEIGHT 567
 
+#ifdef USE_LNBSHARE
+#ifndef MAXDEVICES
+#define MAXDEVICES 16 // the maximum number of devices in the system
+#endif
+#endif /* LNBSHARE */
+
 #define MaxFileName 256
 #define MaxSkinName 16
 #define MaxThemeName 16
 
@@ -265,8 +271,12 @@
   int CurrentVolume;
   int CurrentDolby;
   int InitialChannel;
   int InitialVolume;
+#ifdef USE_LNBSHARE
+  int VerboseLNBlog;
+  int CardUsesLNBnr[MAXDEVICES];
+#endif /* LNBSHARE */
   int __EndData__;
   cSetup(void);
   cSetup& operator= (const cSetup &s);
   bool Load(const char *FileName);
diff -u4 old/device.c vdr-1.5.10/device.c
--- old/device.c	2007-10-14 15:09:19.0 +0200
+++ vdr-1.5.10/device.c	2007-10-15 20:51:14.0 +0200
@@ -87,8 +87,12 @@
}
 }
 }
 
+#ifdef USE_LNBSHARE
+#include "diseqc.h"
+#endif /* LNBSHARE */
+
 // --- cPesAssembler -
 
 class cPesAssembler {
 private:
@@ -223,8 +227,14 @@
   SetDescription("receiver on device %d", CardIndex() + 1);
 
   SetVideoFormat(Setup.VideoFormat);
 
+#ifdef USE_LNBSHARE
+  LNBstate = -1;
+  LNBnr = Setup.CardUsesLNBnr[cardIndex];
+  LNBsource = NULL;
+#endif /* LNBSHARE */
+
   mute = false;
   volume = Setup.CurrentVolume;
 
   sectionHandler = NULL;
@@ -290,8 +300,18 @@
   if (n < MAXDEVICES)
  useDevice |= (1 << n);
 }
 
+#ifdef USE_LNBSHARE
+void cDevice::SetLNBnr(void)
+{
+  for (int i = 0; i < numDevices; i++) {
+  device[i]->LNBnr = Setup.CardUsesLNBnr[i];
+  isyslog("LNB-sharing: setting device %d to use LNB %d", i, device[i]->LNBnr);
+  }
+}
+#endif /* LNBSHARE */
+
 int cDevice::NextCardIndex(int n)
 {
   if (n > 0) {
  nextCardIndex += n;
@@ -350,8 +370,100 @@
  d = PrimaryDevice();
   return d;
 }
 
+#ifdef USE_LNBSHARE
+cDevice *cDevice::GetBadDevice(const cChannel *Channel)
+{
+  if (!cSource::IsSat(Channel->Source())) return NULL;
+  if (Setup.DiSEqC) {
+ cDiseqc *diseqc;
+ diseqc = Diseqcs.Get(Channel->Source(), Channel->Frequency(), Channel->Polarization());
+
+ for (int i = 0; i < numDevices; i++) {
+ if (this != d

Re: [vdr] Concurrent LNB-patch for 1.5?

2007-10-15 Thread jdobry
PS!!!

I am sorry. My last e-mail contain attachment and I want to send it only for 
Andreas. I was send to maillist only by my mistake.
I'am very sorry.

Jiri

__
> Od: [EMAIL PROTECTED]
> Komu: 
> Datum: 15.10.2007 14:43
> Předmět: [vdr] Concurrent LNB-patch for 1.5?
>
>Hi,
>
>is there a concurrent LNB patch for 1.5.x? Or are there plans to nativly 
>support this?
>
>Regards,
>
>Andreas.
>
>_
>Express yourself instantly with MSN Messenger! Download today it's FREE!
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/___
>vdr mailing list
>vdr@linuxtv.org
>http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>
>


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Concurrent LNB-patch for 1.5?

2007-10-15 Thread jdobry
Hi

Do you mean Configurablelnbshare? 
(http://www.linuxtv.org/vdrwiki/index.php/Configurablelnbshare) 
If yes, I have patch for 1.5.10 and I will send it to you at evening after 
tests.

And I also wan't to know about plans to nativly support.

Have a nice day,
Jiri

>
>is there a concurrent LNB patch for 1.5.x? Or are there plans to nativly 
>support this?
>


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr