summaryrefslogtreecommitdiff
blob: 4de4dcc572ac170245acef3d4699fb9b69c1538f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Index: reelchannelscan-0.4.3/csmenu.c
===================================================================
--- reelchannelscan-0.4.3.orig/csmenu.c
+++ reelchannelscan-0.4.3/csmenu.c
@@ -190,26 +190,27 @@ void cMenuChannelscan::TunerDetection()
 {
 
   int stp=0;
-  for (int i=0;i<4;i++) 
+  for (int i=0;i<cDevice::NumDevices();i++) 
   {
     cDevice *device = cDevice::GetDevice(i);
-    srcTexts[i]=NULL; 
+    srcTexts[srcTuners]=NULL; 
     if (device) {
       char *txt=NULL;
       if (device->ProvidesSource(cSource::stTerr)) {
-         asprintf(&txt,"%s (%s %i)",tr("DVB-T - Terrestrial"),tr("Tuner"),i+1);
+         asprintf(&txt,"%s (%s %i)",tr("DVB-T - Terrestrial"),tr("Tuner"),srcTuners+1);
          stp=TERR;
       }
       else if (device->ProvidesSource(cSource::stCable)) {
-         asprintf(&txt,"%s (%s %i)",tr("DVB-C - Cable"),tr("Tuner"),i+1);
+         asprintf(&txt,"%s (%s %i)",tr("DVB-C - Cable"),tr("Tuner"),srcTuners+1);
          stp=CABLE;
       }
       else if (device->ProvidesSource(cSource::stSat)) {
-         asprintf(&txt,"%s (%s %i)",tr("DVB-S - Satellite"),tr("Tuner"),i+1);
+         asprintf(&txt,"%s (%s %i)",tr("DVB-S - Satellite"),tr("Tuner"),srcTuners+1);
          stp=SAT;
       }
       if (txt) {
          srcTypes[srcTuners]=stp;
+	 srcDeviceNr[srcTuners]=i;
          srcTexts[srcTuners++]=txt;
       }
     }
@@ -417,9 +418,9 @@ eOSState cMenuChannelscan::ProcessKey(eK
    
     sourceType=srcTypes[sourceStat];
   
-    scp.card = sourceStat;
+    scp.deviceNr = srcDeviceNr[sourceStat];
     scp.type=sourceType;
-    scp.source = 
+    scp.source = source; 
     scp.bandwidth = bandwidth;
     scp.polarization = polarization;
     scp.symbolrate = symbolrate;
@@ -573,7 +574,7 @@ cMenuScanActive::cMenuScanActive(scanPar
   // auto_ptr
   Scan.reset(new cScan());
   
-  isyslog (" start Scanning @ Card %d --- ", scp->card);
+  isyslog (" start Scanning @ Card %d --- ", scp->deviceNr);
   if (!Scan->StartScanning(scp))
   {
      esyslog (ERR "  Tuner Error");
Index: reelchannelscan-0.4.3/csmenu.h
===================================================================
--- reelchannelscan-0.4.3.orig/csmenu.h
+++ reelchannelscan-0.4.3/csmenu.h
@@ -51,8 +51,9 @@ private:
   int source;
   int frequency;
   int symbolrate;
-  char *srcTexts[4];
-  int srcTypes[4];
+  char *srcTexts[MAXDEVICES];
+  int srcTypes[MAXDEVICES];
+  int srcDeviceNr[MAXDEVICES];
   int srcTuners;
   const char *fecTexts[10];
   const char *modTexts[10];
Index: reelchannelscan-0.4.3/scan.c
===================================================================
--- reelchannelscan-0.4.3.orig/scan.c
+++ reelchannelscan-0.4.3/scan.c
@@ -38,7 +38,7 @@ cScan::cScan()
 
   newChannels = 0;
   fd_frontend= -1;
-  cardnr = -1;
+  devicenr = -1;
   transponderNr = 0;
   channelNumber = 0;
   frequency = 0;
@@ -70,26 +70,26 @@ cScan::~cScan()
 
   if (NFilter) 
   {
-    cDevice::GetDevice(cardnr)->Detach(NFilter);
+    cDevice::GetDevice(devicenr)->Detach(NFilter);
     delete NFilter;
     NFilter=NULL;
   }
 
   if (PFilter)  
   {
-    cDevice::GetDevice(cardnr)->Detach(PFilter);
+    cDevice::GetDevice(devicenr)->Detach(PFilter);
     delete PFilter;
     PFilter=NULL;
   }
   if (SFilter)
   {
-    cDevice::GetDevice(cardnr)->Detach(SFilter);
+    cDevice::GetDevice(devicenr)->Detach(SFilter);
     delete SFilter;
     SFilter=NULL;
   }
   if (EFilter)
   {
-    cDevice::GetDevice(cardnr)->Detach(EFilter);
+    cDevice::GetDevice(devicenr)->Detach(EFilter);
     delete EFilter;
     EFilter=NULL;
   }
@@ -144,8 +144,9 @@ bool cScan::StartScanning(scanParameters
     
     cDevice::PrimaryDevice()->StopReplay();
 
-    cardnr = scp->card;
-    DLOG (DBG " Stop Replay Card Number %d", cardnr);
+    devicenr = scp->deviceNr;
+    int cardnr = cDevice::GetDevice(devicenr)->CardIndex();
+    DLOG (DBG " Stop Replay Card Number %d", deviceNr);
 
     scanning_on_receiving_device=true;
 
@@ -330,7 +331,7 @@ void cScan::ScanDVB_S(cTransponder *tp, 
      }
 #endif        
   }
-  else if (cDevice::GetDevice(cardnr)->HasLock(DVBS_LOCK_TIMEOUT))
+  else if (cDevice::GetDevice(devicenr)->HasLock(DVBS_LOCK_TIMEOUT))
   {
      if (cMenuChannelscan::scanState == ssGetTransponders) {
        ScanNitServices();
@@ -500,7 +501,7 @@ void cScan::Action()
   // the one and only "scanning = true" !
   // cMenuChannelscan::scanning = true;
 
-  device = cDevice::GetDevice(cardnr);
+  device = cDevice::GetDevice(devicenr);
   std::auto_ptr<cChannel> c(new cChannel);
 
   cTransponders &transponders = cTransponders::GetInstance();
Index: reelchannelscan-0.4.3/scan.h
===================================================================
--- reelchannelscan-0.4.3.orig/scan.h
+++ reelchannelscan-0.4.3/scan.h
@@ -62,7 +62,7 @@ private:
   int origUpdateChannels;
   bool nitScan;
   int sourceCode;    // internal VDR Code for dvb Sources  see vdr/sources.c
-  int cardnr;
+  int devicenr;
   int transponderNr;
   int channelNumber;
   int frequency;
Index: reelchannelscan-0.4.3/transponders.h
===================================================================
--- reelchannelscan-0.4.3.orig/transponders.h
+++ reelchannelscan-0.4.3/transponders.h
@@ -39,7 +39,7 @@ namespace setup
 #endif
 
 typedef struct {
-    int card;
+    int deviceNr;
     int type;
     int source;
     int frequency;     // 0: Full band scan