1 | #ifndef SCAN_H |
---|
2 | #define SCAN_H |
---|
3 | |
---|
4 | uint8_t changeservicetype(uint8_t type) |
---|
5 | { |
---|
6 | int ret = type; |
---|
7 | |
---|
8 | switch(type) |
---|
9 | { |
---|
10 | case 0x01: |
---|
11 | case 0x11: |
---|
12 | case 0x19: |
---|
13 | case 0x9A: |
---|
14 | case 0x86: |
---|
15 | case 0xC3: |
---|
16 | case 0xC5: |
---|
17 | case 0xC6: |
---|
18 | ret = 0; |
---|
19 | break; |
---|
20 | case 0x02: |
---|
21 | ret = 1; |
---|
22 | break; |
---|
23 | } |
---|
24 | |
---|
25 | return ret; |
---|
26 | } |
---|
27 | |
---|
28 | int parsenit() |
---|
29 | { |
---|
30 | int ret = 0, i; |
---|
31 | int secdone[255]; |
---|
32 | int sectotal = -1; |
---|
33 | |
---|
34 | for(i = 0; i < 255; i++) secdone[i] = 0; |
---|
35 | |
---|
36 | unsigned char buf[MINMALLOC]; |
---|
37 | |
---|
38 | // position in buffer |
---|
39 | unsigned short pos; |
---|
40 | unsigned short pos2; |
---|
41 | |
---|
42 | // network_information_section elements |
---|
43 | unsigned short seclen; |
---|
44 | unsigned short desclen; |
---|
45 | unsigned short tdesclen; |
---|
46 | unsigned short looplen; |
---|
47 | unsigned long transponderid; |
---|
48 | unsigned short onid; |
---|
49 | unsigned short nid; |
---|
50 | |
---|
51 | while(sectotal < buf[7]) |
---|
52 | { |
---|
53 | seclen = ((buf[1] & 0x0F) << 8) + buf[2]; |
---|
54 | nid = ((buf[3] << 8)| buf[4]); |
---|
55 | desclen = ((buf[8] & 0x0F) << 8) | buf[9]; |
---|
56 | unsigned char secnr = buf[6]; |
---|
57 | |
---|
58 | //printf("[NIT] section %X last %X network_id 0x%x -> %s\n", secnum, buffer[7], network_id, secdone[secnum] ? "skip" : "use"); |
---|
59 | |
---|
60 | if(secdone[secnr] == 1) continue; |
---|
61 | secdone[secnr] = 1; |
---|
62 | sectotal++; |
---|
63 | for(pos = 10; pos < desclen + 10; pos += buf[pos + 1] + 2) |
---|
64 | { |
---|
65 | looplen = ((buf[pos] & 0x0F) << 8) | buf[pos + 1]; |
---|
66 | if (!looplen) continue; |
---|
67 | |
---|
68 | for(pos += 2; pos < seclen - 3; pos += tdesclen + 6) |
---|
69 | { |
---|
70 | transponderid = (buf[pos] << 8) | buf[pos + 1]; |
---|
71 | onid = (buf[pos + 2] << 8) | buf[pos + 3]; |
---|
72 | tdesclen = ((buf[pos + 4] & 0x0F) << 8) | buf[pos + 5]; |
---|
73 | { |
---|
74 | for(pos2 = pos + 6; pos2 < pos + tdesclen + 6; pos2 += buf[pos2 + 1] + 2) |
---|
75 | { |
---|
76 | switch(buf[pos2]) |
---|
77 | { |
---|
78 | case 0x41: |
---|
79 | //servicelistdesc(buffer + pos2, transponderid, onid); |
---|
80 | break; |
---|
81 | case 0x43: |
---|
82 | //if(satsystemdesc(buffer + pos2, transponderid, onid) < 0) |
---|
83 | { |
---|
84 | ret = -2; |
---|
85 | goto end; |
---|
86 | } |
---|
87 | break; |
---|
88 | case 0x44: |
---|
89 | //if(cablesystemdesc(buffer + pos2, transponderid, onid) < 0) |
---|
90 | { |
---|
91 | ret = -2; |
---|
92 | goto end; |
---|
93 | } |
---|
94 | break; |
---|
95 | case 0x5A: |
---|
96 | //if(terrestrialsystemdesc(buffer + pos2) < 0) |
---|
97 | { |
---|
98 | ret = -2; |
---|
99 | goto end; |
---|
100 | } |
---|
101 | break; |
---|
102 | case 0x62: |
---|
103 | //frequencylistdesc(buffer + pos2); |
---|
104 | break; |
---|
105 | |
---|
106 | } |
---|
107 | } |
---|
108 | } |
---|
109 | } |
---|
110 | } |
---|
111 | } |
---|
112 | |
---|
113 | end: |
---|
114 | return ret; |
---|
115 | } |
---|
116 | |
---|
117 | int findchannel(unsigned char *buf, unsigned long transponderid, uint8_t* lastsecnr, struct skin* scan, struct skin* listbox) |
---|
118 | { |
---|
119 | int ret = -1; |
---|
120 | struct skin* node = NULL; |
---|
121 | struct channel* chnode = NULL; |
---|
122 | |
---|
123 | // position in buffer |
---|
124 | unsigned short pos; |
---|
125 | unsigned short pos2; |
---|
126 | |
---|
127 | // service_description_section elements |
---|
128 | unsigned short seclen; |
---|
129 | uint8_t secnr; |
---|
130 | unsigned short onid, tid; |
---|
131 | unsigned short serviceid; |
---|
132 | unsigned short desclooplen; |
---|
133 | unsigned short running; |
---|
134 | int eitscheduleflag; |
---|
135 | int eitpresentfollowingflag; |
---|
136 | int camode; |
---|
137 | uint8_t servicetype = 0; |
---|
138 | uint8_t providerlen = 0; |
---|
139 | char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL; |
---|
140 | unsigned long* tmplong = NULL; |
---|
141 | |
---|
142 | seclen = ((buf[1] & 0x0F) << 8) | buf[2]; |
---|
143 | secnr = buf[6]; |
---|
144 | *lastsecnr = buf[7]; |
---|
145 | tid = (buf[3] << 8) | buf[4]; |
---|
146 | onid = (buf[8] << 8) | buf[9]; |
---|
147 | |
---|
148 | transponderid = (onid << 16) | tid; |
---|
149 | debug(500, "SDT nr: %d, lastnr: %d, len: %d, tid: %d, onid: %d, transponderid: %lu", secnr, *lastsecnr, seclen, tid, onid, transponderid); |
---|
150 | |
---|
151 | for(pos = 11; pos < seclen - 1; pos += desclooplen + 5) |
---|
152 | { |
---|
153 | serviceid = (buf[pos] << 8) | buf[pos + 1]; |
---|
154 | eitscheduleflag = buf[pos + 2] & 0x02; |
---|
155 | eitpresentfollowingflag = buf[pos + 2] & 0x01; |
---|
156 | running = buf[pos + 3] & 0xE0; |
---|
157 | camode = buf[pos + 3] & 0x10; |
---|
158 | desclooplen = ((buf[pos + 3] & 0x0F) << 8) | buf[pos + 4]; |
---|
159 | if(scaninfo.onlyfree == 1 && camode > 0) continue; |
---|
160 | |
---|
161 | for(pos2 = pos + 5; pos2 < pos + desclooplen + 5; pos2 += buf[pos2 + 1] + 2) |
---|
162 | { |
---|
163 | switch(buf[pos2]) |
---|
164 | { |
---|
165 | case 0x48: |
---|
166 | servicetype = buf[pos2 + 2]; |
---|
167 | servicetype = changeservicetype(servicetype); |
---|
168 | providerlen = buf[pos2 + 3]; |
---|
169 | tmpstr1 = strndup((char*)&(buf[pos2 + 4]), providerlen); |
---|
170 | tmpstr2 = strndup((char*)&(buf[pos2 + 4 + providerlen + 1]), (2 + buf[pos2 + 1]) - (4 + providerlen + 1)); |
---|
171 | |
---|
172 | if(tmpstr1 == NULL || strlen(tmpstr1) == 0) tmpstr1 = ostrcat(tmpstr1, "unknown", 1, 0); |
---|
173 | if(tmpstr2 == NULL || strlen(tmpstr2) == 0) tmpstr2 = ostrcat(tmpstr2, "unknown", 1, 0); |
---|
174 | |
---|
175 | tmpstr1 = strutf8(tmpstr1, strlen(tmpstr1), 0, 0, 1, 0); |
---|
176 | tmpstr2 = strutf8(tmpstr2, strlen(tmpstr2), 0, 0, 1, 1); |
---|
177 | |
---|
178 | //add to listbox |
---|
179 | chnode = getchannel(serviceid, transponderid); |
---|
180 | node = addlistbox(scan, listbox, node, 1); |
---|
181 | if(node != NULL) |
---|
182 | { |
---|
183 | if(chnode != NULL) |
---|
184 | node->fontcol = convertcol("deaktivcol"); |
---|
185 | switch(servicetype) |
---|
186 | { |
---|
187 | case 0: |
---|
188 | scaninfo.tvcount++; |
---|
189 | if(chnode == NULL) scaninfo.newtvcount++; |
---|
190 | break; |
---|
191 | case 1: |
---|
192 | scaninfo.radiocount++; |
---|
193 | if(chnode == NULL) scaninfo.newradiocount++; |
---|
194 | break; |
---|
195 | default: |
---|
196 | scaninfo.datacount++; |
---|
197 | if(chnode == NULL) scaninfo.newdatacount++; |
---|
198 | break; |
---|
199 | } |
---|
200 | tmpstr = ostrcat(tmpstr2, " (", 0, 0); |
---|
201 | tmpstr = ostrcat(tmpstr, tmpstr1, 0, 0); |
---|
202 | tmpstr = ostrcat(tmpstr, " - ", 0, 0); |
---|
203 | if(servicetype == 0) |
---|
204 | tmpstr = ostrcat(tmpstr, _("TV"), 0, 0); |
---|
205 | else if(servicetype == 1) |
---|
206 | tmpstr = ostrcat(tmpstr, _("Radio"), 0, 0); |
---|
207 | else |
---|
208 | tmpstr = ostrcat(tmpstr, _("Data"), 0, 0); |
---|
209 | tmpstr = ostrcat(tmpstr, ")", 0, 0); |
---|
210 | changetext(node, tmpstr); |
---|
211 | changeparam1(node, tmpstr1); |
---|
212 | changeparam2(node, tmpstr2); |
---|
213 | tmplong = (unsigned long*)malloc(sizeof(unsigned long) * 3); |
---|
214 | if(tmplong != NULL) |
---|
215 | { |
---|
216 | tmplong[0] = serviceid; |
---|
217 | tmplong[1] = transponderid; |
---|
218 | tmplong[2] = servicetype; |
---|
219 | } |
---|
220 | free(node->name); |
---|
221 | node->name = (char*)tmplong; |
---|
222 | } |
---|
223 | free(tmpstr); tmpstr = NULL; |
---|
224 | free(tmpstr1); tmpstr1 = NULL; |
---|
225 | free(tmpstr2); tmpstr2 = NULL; |
---|
226 | |
---|
227 | ret = 0; |
---|
228 | break; |
---|
229 | |
---|
230 | } |
---|
231 | } |
---|
232 | } |
---|
233 | |
---|
234 | return ret; |
---|
235 | } |
---|
236 | |
---|
237 | void doscan(struct stimerthread* timernode) |
---|
238 | { |
---|
239 | int festatus = 0, secnr = 0; |
---|
240 | uint8_t lastsecnr = 0xff; |
---|
241 | unsigned char* buf = NULL; |
---|
242 | struct transponder* tpnode = NULL; |
---|
243 | struct dvbdev* fenode = NULL; |
---|
244 | struct channel* chnode = NULL; |
---|
245 | struct sat* satnode = sat; |
---|
246 | |
---|
247 | if(scaninfo.fenode == NULL || scaninfo.tpnode == NULL || timernode == NULL) |
---|
248 | { |
---|
249 | scaninfo.threadend = 1; |
---|
250 | return; |
---|
251 | } |
---|
252 | |
---|
253 | debug(500, "channel scan thread start"); |
---|
254 | |
---|
255 | //sat loop |
---|
256 | satnode = sat; |
---|
257 | while(satnode != NULL && timernode->aktion == START) |
---|
258 | { |
---|
259 | if(satnode->scan == 0) |
---|
260 | { |
---|
261 | satnode = satnode->next; |
---|
262 | continue; |
---|
263 | } |
---|
264 | scaninfo.satname = satnode->name; |
---|
265 | |
---|
266 | if(scaninfo.scantype == 0) |
---|
267 | tpnode = scaninfo.tpnode; |
---|
268 | else if(scaninfo.scantype == 1) |
---|
269 | tpnode = transponder; |
---|
270 | else if(scaninfo.scantype == 2 || scaninfo.scantype == 3) |
---|
271 | { |
---|
272 | tpnode = transponder; |
---|
273 | scaninfo.orbitalpos = satnode->orbitalpos; |
---|
274 | } |
---|
275 | |
---|
276 | //transponder loop |
---|
277 | while(tpnode != NULL && timernode->aktion == START) |
---|
278 | { |
---|
279 | if(scaninfo.orbitalpos != tpnode->orbitalpos) |
---|
280 | { |
---|
281 | tpnode = tpnode->next; |
---|
282 | if(scaninfo.scantype == 0) break; |
---|
283 | continue; |
---|
284 | } |
---|
285 | |
---|
286 | fenode = fegetfree(tpnode, 0, scaninfo.fenode); |
---|
287 | if(fenode == NULL || (scaninfo.scantype != 3 && fenode != scaninfo.fenode)) |
---|
288 | { |
---|
289 | scaninfo.tpcount++; |
---|
290 | tpnode = tpnode->next; |
---|
291 | debug(500, "Frontend for scan not free"); |
---|
292 | if(scaninfo.scantype == 0) break; |
---|
293 | continue; |
---|
294 | } |
---|
295 | |
---|
296 | //frontend tune |
---|
297 | if(fenode->feinfo->type == FE_QPSK) |
---|
298 | { |
---|
299 | feset(fenode, tpnode); |
---|
300 | fetunedvbs(fenode, tpnode); |
---|
301 | } |
---|
302 | else if(fenode->feinfo->type == FE_QAM) |
---|
303 | fetunedvbc(fenode, tpnode); |
---|
304 | else if(fenode->feinfo->type == FE_OFDM) |
---|
305 | fetunedvbt(fenode, tpnode); |
---|
306 | else |
---|
307 | { |
---|
308 | scaninfo.tpcount++; |
---|
309 | tpnode = tpnode->next; |
---|
310 | debug(500, "Frontend type unknown"); |
---|
311 | if(scaninfo.scantype == 0) break; |
---|
312 | continue; |
---|
313 | } |
---|
314 | |
---|
315 | festatus = fewait(fenode); |
---|
316 | if(debug_level == 200) fereadstatus(fenode); |
---|
317 | if(festatus != 0) |
---|
318 | { |
---|
319 | scaninfo.tpcount++; |
---|
320 | tpnode = tpnode->next; |
---|
321 | debug(500, "tuning failed"); |
---|
322 | if(scaninfo.scantype == 0) break; |
---|
323 | continue; |
---|
324 | } |
---|
325 | |
---|
326 | //del channels from transponder if selected |
---|
327 | if(scaninfo.clear == 1) |
---|
328 | { |
---|
329 | chnode = channel; |
---|
330 | while(chnode != NULL) |
---|
331 | { |
---|
332 | if(chnode->transponder == tpnode) |
---|
333 | delchannel(chnode->serviceid, chnode->transponderid, 1); |
---|
334 | chnode = chnode->next; |
---|
335 | } |
---|
336 | } |
---|
337 | |
---|
338 | lastsecnr = 0xff; |
---|
339 | secnr = 0; |
---|
340 | while(secnr <= lastsecnr && secnr <= 256) |
---|
341 | { |
---|
342 | if(timernode->aktion != START) break; |
---|
343 | buf = dvbgetsdt(fenode, secnr, scaninfo.timeout); |
---|
344 | if(buf != NULL) |
---|
345 | findchannel(buf, tpnode->id, &lastsecnr, scaninfo.scanscreen, scaninfo.listbox); |
---|
346 | else |
---|
347 | break; |
---|
348 | free(buf); buf = NULL; |
---|
349 | secnr++; |
---|
350 | } |
---|
351 | |
---|
352 | scaninfo.tpcount++; |
---|
353 | if(scaninfo.scantype == 0) break; |
---|
354 | tpnode = tpnode->next; |
---|
355 | } |
---|
356 | if(scaninfo.scantype == 0 || scaninfo.scantype == 1) break; |
---|
357 | satnode = satnode->next; |
---|
358 | } |
---|
359 | scaninfo.threadend = 1; |
---|
360 | debug(500, "channel scan thread end"); |
---|
361 | } |
---|
362 | |
---|
363 | void scanaddchannel(struct skin* node, int scantype, struct transponder* tp1) |
---|
364 | { |
---|
365 | int serviceid = 0; |
---|
366 | unsigned long transponderid = 0; |
---|
367 | int servicetype = 0; |
---|
368 | int providerid = 0; |
---|
369 | struct provider* providernode = NULL; |
---|
370 | char* tmpstr = NULL; |
---|
371 | struct transponder* tp2 = NULL; |
---|
372 | |
---|
373 | if(node == NULL || node->name == NULL) return; |
---|
374 | |
---|
375 | serviceid = ((unsigned long*)node->name)[0]; |
---|
376 | transponderid = ((unsigned long*)node->name)[1]; |
---|
377 | servicetype = ((unsigned long*)node->name)[2]; |
---|
378 | if(getchannel(serviceid, transponderid) == NULL) |
---|
379 | { |
---|
380 | //check if provider valid |
---|
381 | providernode = getproviderbyname(node->param1); |
---|
382 | if(providernode != NULL) |
---|
383 | providerid = providernode->providerid; |
---|
384 | else |
---|
385 | { |
---|
386 | providerid = getlastproviderid(); |
---|
387 | tmpstr = ostrcat(tmpstr, oitoa(providerid), 1, 1); |
---|
388 | tmpstr = ostrcat(tmpstr, "#", 1, 0); |
---|
389 | tmpstr = ostrcat(tmpstr, node->param1, 1, 0); |
---|
390 | tmpstr = ostrcat(tmpstr, "#0", 1, 0); |
---|
391 | addprovider(tmpstr, 1, NULL); |
---|
392 | free(tmpstr); tmpstr = NULL; |
---|
393 | } |
---|
394 | |
---|
395 | //check if transponder valid |
---|
396 | if(scantype == 0) |
---|
397 | { |
---|
398 | tp2 = gettransponder(transponderid); |
---|
399 | if(tp2 == NULL) //create new transponder |
---|
400 | copytransponder(tp1, tp2, transponderid); |
---|
401 | else //change transponder |
---|
402 | copytransponder(tp1, tp2, 0); |
---|
403 | } |
---|
404 | |
---|
405 | if(servicetype != 0 && servicetype != 1) |
---|
406 | servicetype = 0; |
---|
407 | |
---|
408 | if(createchannel(node->param2, transponderid, providerid, serviceid, servicetype, 0, -1, -1, -1, -1, 0) != NULL) |
---|
409 | node->fontcol = convertcol("deaktivcol"); |
---|
410 | } |
---|
411 | else |
---|
412 | node->fontcol = convertcol("deaktivcol"); |
---|
413 | } |
---|
414 | |
---|
415 | void scansetallsat(int fetype) |
---|
416 | { |
---|
417 | struct sat* satnode = sat; |
---|
418 | |
---|
419 | while(satnode != NULL) |
---|
420 | { |
---|
421 | if(fetype == satnode->fetype) satnode->scan = 1; |
---|
422 | satnode = satnode->next; |
---|
423 | } |
---|
424 | } |
---|
425 | |
---|
426 | void scansetmultisat(struct skin* scan) |
---|
427 | { |
---|
428 | struct skin* node = scan; |
---|
429 | struct sat* satnode = NULL; |
---|
430 | |
---|
431 | while(node != NULL && node->name != NULL) |
---|
432 | { |
---|
433 | if(ostrcmp(node->ret, "1") == 0) |
---|
434 | { |
---|
435 | satnode = getsatbyorbitalpos(atoi(node->name)); |
---|
436 | if(satnode != NULL) |
---|
437 | satnode->scan = 1; |
---|
438 | } |
---|
439 | node = node->next; |
---|
440 | } |
---|
441 | } |
---|
442 | |
---|
443 | void screenscan(struct skin* mscan, char* tuner, int scantype, int orbitalpos, int frequency, int inversion, int symbolrate, int polarization, int fec, int modulation, int rolloff, int pilot, int networkscan, int onlyfree, int clear, int system, int timeout) |
---|
444 | { |
---|
445 | int rcret = 0, tpmax = 0, i = 0; |
---|
446 | struct skin* scan = getscreen("scan"); |
---|
447 | struct skin* progress = getscreennode(scan, "progress"); |
---|
448 | struct skin* listbox = getscreennode(scan, "listbox"); |
---|
449 | struct skin* satname = getscreennode(scan, "satname"); |
---|
450 | struct skin* tpcount = getscreennode(scan, "tpcount"); |
---|
451 | struct skin* foundtv = getscreennode(scan, "foundtv"); |
---|
452 | struct skin* foundradio = getscreennode(scan, "foundradio"); |
---|
453 | struct skin* founddata = getscreennode(scan, "founddata"); |
---|
454 | struct transponder* tpnode = NULL; |
---|
455 | struct dvbdev* fenode = NULL, *dvbnode = dvbdev; |
---|
456 | struct stimerthread* timernode = NULL; |
---|
457 | struct sat* satnode = NULL; |
---|
458 | char* tmpstr = NULL; |
---|
459 | |
---|
460 | listbox->aktline = 1; |
---|
461 | listbox->aktpage = -1; |
---|
462 | progress->progresssize = 0; |
---|
463 | memset(&scaninfo, 0, sizeof(struct scaninfo)); |
---|
464 | |
---|
465 | addscreenrc(scan, listbox); |
---|
466 | if(scantype != 3) |
---|
467 | { |
---|
468 | while(dvbnode != NULL) |
---|
469 | { |
---|
470 | if(dvbnode->type == FRONTENDDEV && dvbnode->feinfo != NULL && dvbnode->felock < 1 && dvbnode->feinfo->type == FE_QPSK) |
---|
471 | { |
---|
472 | if(ostrcmp(dvbnode->feshortname, tuner) == 0) |
---|
473 | { |
---|
474 | fenode = dvbnode; |
---|
475 | break; |
---|
476 | } |
---|
477 | } |
---|
478 | dvbnode = dvbnode->next; |
---|
479 | } |
---|
480 | if(fenode == NULL) return; |
---|
481 | } |
---|
482 | else if(scantype == 3) |
---|
483 | fenode = dvbdev; |
---|
484 | |
---|
485 | if(scantype == 0) //single transponder |
---|
486 | { |
---|
487 | if(fenode != NULL && fenode->feinfo != NULL) |
---|
488 | { |
---|
489 | debug(500, "fetype=%d, orbitalpos=%d, frequ=%d, inverion=%d, symbolrate=%d, polarization=%d, fec=%d, modulation=%d, rolloff=%d, pilot=%d, system=%d", fenode->feinfo->type, orbitalpos, frequency, inversion, symbolrate, polarization, fec, modulation, rolloff, pilot, system); |
---|
490 | tpnode = createtransponder(0, fenode->feinfo->type, orbitalpos, frequency, inversion, symbolrate, polarization, fec, modulation, rolloff, pilot, system); |
---|
491 | } |
---|
492 | if(tpnode != NULL) |
---|
493 | { |
---|
494 | tpmax = 1; |
---|
495 | satnode = getsatbyorbitalpos(tpnode->orbitalpos); |
---|
496 | if(satnode != NULL) satnode->scan = 1; |
---|
497 | } |
---|
498 | } |
---|
499 | else if(scantype == 1) //single sat |
---|
500 | { |
---|
501 | tpnode = transponder; |
---|
502 | while(tpnode != NULL) |
---|
503 | { |
---|
504 | if(tpnode->orbitalpos == orbitalpos) |
---|
505 | tpmax++; |
---|
506 | tpnode = tpnode->next; |
---|
507 | } |
---|
508 | tpnode = transponder; |
---|
509 | satnode = getsatbyorbitalpos(orbitalpos); |
---|
510 | if(satnode != NULL) satnode->scan = 1; |
---|
511 | } |
---|
512 | else if(scantype == 2 || scantype == 3) //2: multi sat, 3: all |
---|
513 | { |
---|
514 | if(scantype == 2) scansetmultisat(mscan); |
---|
515 | if(scantype == 3) scansetallsat(FE_QPSK); |
---|
516 | satnode = sat; |
---|
517 | while(satnode != NULL) |
---|
518 | { |
---|
519 | if(satnode->scan != 0) |
---|
520 | { |
---|
521 | tpnode = transponder; |
---|
522 | while(tpnode != NULL) |
---|
523 | { |
---|
524 | if(tpnode->orbitalpos == satnode->orbitalpos) |
---|
525 | tpmax++; |
---|
526 | tpnode = tpnode->next; |
---|
527 | } |
---|
528 | } |
---|
529 | satnode = satnode->next; |
---|
530 | } |
---|
531 | tpnode = transponder; |
---|
532 | } |
---|
533 | |
---|
534 | scaninfo.fenode = fenode; |
---|
535 | scaninfo.tpnode = tpnode; |
---|
536 | scaninfo.scanscreen = scan; |
---|
537 | scaninfo.listbox = listbox; |
---|
538 | scaninfo.timeout = timeout; |
---|
539 | scaninfo.scantype = scantype; |
---|
540 | scaninfo.orbitalpos = orbitalpos; |
---|
541 | scaninfo.onlyfree = onlyfree; |
---|
542 | scaninfo.clear = clear; |
---|
543 | timernode = addtimer(&doscan, START, 1000, 1, NULL, NULL, NULL); |
---|
544 | |
---|
545 | while(1) |
---|
546 | { |
---|
547 | //satname |
---|
548 | tmpstr = ostrcat(tmpstr, _("Sat: "), 1, 0); |
---|
549 | tmpstr = ostrcat(tmpstr, scaninfo.satname, 1, 0); |
---|
550 | changetext(satname, tmpstr); |
---|
551 | free(tmpstr); tmpstr = NULL; |
---|
552 | |
---|
553 | //transpondercount |
---|
554 | tmpstr = ostrcat(tmpstr, _("Transponder: "), 1, 0); |
---|
555 | tmpstr = ostrcat(tmpstr, oitoa(scaninfo.tpcount), 1, 1); |
---|
556 | tmpstr = ostrcat(tmpstr, " / ", 1, 0); |
---|
557 | tmpstr = ostrcat(tmpstr, oitoa(tpmax), 1, 1); |
---|
558 | changetext(tpcount, tmpstr); |
---|
559 | free(tmpstr); tmpstr = NULL; |
---|
560 | |
---|
561 | //tvcount |
---|
562 | tmpstr = ostrcat(tmpstr, _("TV: "), 1, 0); |
---|
563 | tmpstr = ostrcat(tmpstr, oitoa(scaninfo.newtvcount), 1, 1); |
---|
564 | tmpstr = ostrcat(tmpstr, " / ", 1, 0); |
---|
565 | tmpstr = ostrcat(tmpstr, oitoa(scaninfo.tvcount), 1, 1); |
---|
566 | changetext(foundtv, tmpstr); |
---|
567 | free(tmpstr); tmpstr = NULL; |
---|
568 | |
---|
569 | //radiocount |
---|
570 | tmpstr = ostrcat(tmpstr, _("Radio: "), 1, 0); |
---|
571 | tmpstr = ostrcat(tmpstr, oitoa(scaninfo.newradiocount), 1, 1); |
---|
572 | tmpstr = ostrcat(tmpstr, " / ", 1, 0); |
---|
573 | tmpstr = ostrcat(tmpstr, oitoa(scaninfo.radiocount), 1, 1); |
---|
574 | changetext(foundradio, tmpstr); |
---|
575 | free(tmpstr); tmpstr = NULL; |
---|
576 | |
---|
577 | //datacount |
---|
578 | tmpstr = ostrcat(tmpstr, _("Data: "), 1, 0); |
---|
579 | tmpstr = ostrcat(tmpstr, oitoa(scaninfo.newdatacount), 1, 1); |
---|
580 | tmpstr = ostrcat(tmpstr, " / ", 1, 0); |
---|
581 | tmpstr = ostrcat(tmpstr, oitoa(scaninfo.datacount), 1, 1); |
---|
582 | changetext(founddata, tmpstr); |
---|
583 | free(tmpstr); tmpstr = NULL; |
---|
584 | |
---|
585 | if(tpmax == 0) |
---|
586 | progress->progresssize = 100; |
---|
587 | else |
---|
588 | progress->progresssize = (100 / (float)tpmax) * scaninfo.tpcount; |
---|
589 | |
---|
590 | drawscreen(scan, 0); |
---|
591 | rcret = waitrc(scan, 1000, 0); |
---|
592 | if(rcret == getrcconfigint("rcexit", NULL)) |
---|
593 | { |
---|
594 | if(timernode != NULL) |
---|
595 | { |
---|
596 | timernode->aktion = STOP; |
---|
597 | while(i < 3 && scaninfo.threadend == 0) |
---|
598 | { |
---|
599 | textbox(_("Message"), _("Wait for channel scan end"), NULL, 0, NULL, 0, NULL, 0, NULL, 0, 600, 200, 3, 0); |
---|
600 | i++; |
---|
601 | } |
---|
602 | } |
---|
603 | break; |
---|
604 | } |
---|
605 | if(rcret == getrcconfigint("rcok", NULL)) |
---|
606 | scanaddchannel(listbox->select, scantype, tpnode); |
---|
607 | if(rcret == getrcconfigint("rcred", NULL)) |
---|
608 | { |
---|
609 | struct skin* lnode = listbox; |
---|
610 | long deaktivcol = convertcol("deaktivcol"); |
---|
611 | while(lnode != NULL) |
---|
612 | { |
---|
613 | if(lnode->fontcol != deaktivcol && lnode->del == 1) |
---|
614 | scanaddchannel(lnode, scantype, tpnode); |
---|
615 | lnode = lnode->next; |
---|
616 | } |
---|
617 | } |
---|
618 | } |
---|
619 | |
---|
620 | if(scantype == 0) deltransponder(0); |
---|
621 | if(clear == 1) delunusedbouquetchannels(); |
---|
622 | delmarkedscreennodes(scan, 1); |
---|
623 | delownerrc(scan); |
---|
624 | clearscreen(scan); |
---|
625 | resetsatscan(); |
---|
626 | } |
---|
627 | |
---|
628 | void changescantype(char* scantype, struct skin* scan, struct skin* listbox, struct skin* tuner, struct skin* satellite, struct skin* system, struct skin* frequency, struct skin* inversion, struct skin* symbolrate, struct skin* polarization, struct skin* fec, struct skin* modulation, struct skin* rolloff, struct skin* pilot) |
---|
629 | { |
---|
630 | struct sat* satnode = sat; |
---|
631 | struct skin* tmp = NULL; |
---|
632 | char* tmpstr = NULL, *tmpstr1 = NULL, *tmpnr = NULL; |
---|
633 | char* feshortname = NULL; |
---|
634 | int i, orbitalpos = 0; |
---|
635 | |
---|
636 | if(tuner != NULL) feshortname = tuner->ret; |
---|
637 | |
---|
638 | tuner->hidden = NO; |
---|
639 | system->hidden = NO; |
---|
640 | frequency->hidden = NO; |
---|
641 | inversion->hidden = NO; |
---|
642 | symbolrate->hidden = NO; |
---|
643 | polarization->hidden = NO; |
---|
644 | fec->hidden = NO; |
---|
645 | modulation->hidden = NO; |
---|
646 | rolloff->hidden = NO; |
---|
647 | pilot->hidden = NO; |
---|
648 | satellite->hidden = NO; |
---|
649 | delmarkedscreennodes(scan, 1); |
---|
650 | |
---|
651 | if(ostrcmp(scantype, "1") == 0 || ostrcmp(scantype, "2") == 0 || ostrcmp(scantype, "3") == 0) |
---|
652 | { |
---|
653 | system->hidden = YES; |
---|
654 | frequency->hidden = YES; |
---|
655 | inversion->hidden = YES; |
---|
656 | symbolrate->hidden = YES; |
---|
657 | polarization->hidden = YES; |
---|
658 | fec->hidden = YES; |
---|
659 | modulation->hidden = YES; |
---|
660 | rolloff->hidden = YES; |
---|
661 | pilot->hidden = YES; |
---|
662 | } |
---|
663 | if(ostrcmp(scantype, "2") == 0 && feshortname != NULL) |
---|
664 | { |
---|
665 | satellite->hidden = YES; |
---|
666 | |
---|
667 | tmpstr = ostrcat(feshortname, "_sat", 0, 0); |
---|
668 | for(i = 1; i <= status.maxsat; i++) |
---|
669 | { |
---|
670 | tmpnr = oitoa(i); |
---|
671 | orbitalpos = getconfigint(tmpstr, tmpnr); |
---|
672 | free(tmpnr); tmpnr = NULL; |
---|
673 | |
---|
674 | satnode = getsatbyorbitalpos(orbitalpos); |
---|
675 | if(satnode != NULL && satnode->fetype == FE_QPSK) |
---|
676 | { |
---|
677 | tmp = addlistbox(scan, listbox, tmp, 1); |
---|
678 | if(tmp != NULL) |
---|
679 | { |
---|
680 | tmpstr1 = oitoa(satnode->orbitalpos); |
---|
681 | changename(tmp, tmpstr1); |
---|
682 | free(tmpstr1); tmpstr1 = NULL; |
---|
683 | changetext(tmp, satnode->name); |
---|
684 | tmp->type = CHOICEBOX; |
---|
685 | addchoicebox(tmp, "0", _("no")); |
---|
686 | addchoicebox(tmp, "1", _("yes")); |
---|
687 | } |
---|
688 | } |
---|
689 | } |
---|
690 | free(tmpstr); tmpstr = NULL; |
---|
691 | } |
---|
692 | if(ostrcmp(scantype, "3") == 0) |
---|
693 | { |
---|
694 | tuner->hidden = YES; |
---|
695 | satellite->hidden = YES; |
---|
696 | } |
---|
697 | } |
---|
698 | |
---|
699 | void scanchangesat(struct skin* sat, struct transponder* tpnode, char* feshortname) |
---|
700 | { |
---|
701 | char* tmpstr = NULL; |
---|
702 | |
---|
703 | changeinput(sat, NULL); |
---|
704 | changechoiceboxvalue(sat, NULL); |
---|
705 | tmpstr = getsatstring(feshortname); |
---|
706 | changeinput(sat, tmpstr); |
---|
707 | free(tmpstr); tmpstr = NULL; |
---|
708 | tmpstr = getorbitalposstring(feshortname); |
---|
709 | changechoiceboxvalue(sat, tmpstr); |
---|
710 | free(tmpstr); tmpstr = NULL; |
---|
711 | if(tpnode != NULL) |
---|
712 | { |
---|
713 | tmpstr = oitoa(tpnode->orbitalpos); |
---|
714 | setchoiceboxselection(sat, tmpstr); |
---|
715 | free(tmpstr); tmpstr = NULL; |
---|
716 | } |
---|
717 | } |
---|
718 | |
---|
719 | //flag 0: manual scan |
---|
720 | //flag 1: auto scan |
---|
721 | void screenscanconfig(int flag) |
---|
722 | { |
---|
723 | int rcret = 0; |
---|
724 | int iscantype = -1, isat = -1, ifrequency = -1; |
---|
725 | int iinversion = -1, isymbolrate = -1, ipolarization = -1; |
---|
726 | int ifec = -1, imodulation = -1, irolloff = -1, ipilot = -1; |
---|
727 | int isystem = -1, inetworkscan = -1, ionlyfree = -1, iclear = -1; |
---|
728 | int i = 0, treffer = 0, tunercount = 0; |
---|
729 | struct skin* scan = getscreen("manualscan"); |
---|
730 | struct skin* listbox = getscreennode(scan, "listbox"); |
---|
731 | struct skin* tuner = getscreennode(scan, "tuner"); |
---|
732 | struct skin* scantype = getscreennode(scan, "scantype"); |
---|
733 | struct skin* sat = getscreennode(scan, "sat"); |
---|
734 | struct skin* system = getscreennode(scan, "system"); |
---|
735 | struct skin* frequency = getscreennode(scan, "frequency"); |
---|
736 | struct skin* inversion = getscreennode(scan, "inversion"); |
---|
737 | struct skin* symbolrate = getscreennode(scan, "symbolrate"); |
---|
738 | struct skin* polarization = getscreennode(scan, "polarization"); |
---|
739 | struct skin* fec = getscreennode(scan, "fec"); |
---|
740 | struct skin* modulation = getscreennode(scan, "modulation"); |
---|
741 | struct skin* rolloff = getscreennode(scan, "rolloff"); |
---|
742 | struct skin* pilot = getscreennode(scan, "pilot"); |
---|
743 | struct skin* networkscan = getscreennode(scan, "networkscan"); |
---|
744 | struct skin* clear = getscreennode(scan, "clear"); |
---|
745 | struct skin* onlyfree = getscreennode(scan, "onlyfree"); |
---|
746 | struct skin* tmp = NULL; |
---|
747 | char* tmpstr = NULL, *tmpnr = NULL, *feshortname = NULL; |
---|
748 | struct transponder* tpnode = NULL; |
---|
749 | struct dvbdev* dvbnode = dvbdev; |
---|
750 | |
---|
751 | if(status.recording > 0 || status.streaming > 0) |
---|
752 | { |
---|
753 | textbox(_("Message"), _("Scan is not allowed if record\nor stream is running !"), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
754 | return; |
---|
755 | } |
---|
756 | |
---|
757 | //del old values |
---|
758 | changeinput(tuner, NULL); |
---|
759 | changechoiceboxvalue(tuner, NULL); |
---|
760 | changeinput(scantype, NULL); |
---|
761 | changechoiceboxvalue(scantype, NULL); |
---|
762 | changeinput(sat, NULL); |
---|
763 | changechoiceboxvalue(sat, NULL); |
---|
764 | changeinput(system, NULL); |
---|
765 | changechoiceboxvalue(system, NULL); |
---|
766 | changeinput(inversion, NULL); |
---|
767 | changechoiceboxvalue(inversion, NULL); |
---|
768 | changeinput(polarization, NULL); |
---|
769 | changechoiceboxvalue(polarization, NULL); |
---|
770 | changeinput(fec, NULL); |
---|
771 | changechoiceboxvalue(fec, NULL); |
---|
772 | changeinput(modulation, NULL); |
---|
773 | changechoiceboxvalue(modulation, NULL); |
---|
774 | changeinput(rolloff, NULL); |
---|
775 | changechoiceboxvalue(rolloff, NULL); |
---|
776 | changeinput(pilot, NULL); |
---|
777 | changechoiceboxvalue(pilot, NULL); |
---|
778 | |
---|
779 | //tuner |
---|
780 | while(dvbnode != NULL) |
---|
781 | { |
---|
782 | if(dvbnode->type == FRONTENDDEV && dvbnode->feinfo != NULL && dvbnode->felock < 1 && dvbnode->feinfo->type == FE_QPSK) |
---|
783 | { |
---|
784 | treffer = 0; |
---|
785 | if(dvbnode->feshortname != NULL) |
---|
786 | { |
---|
787 | tmpstr = ostrcat(dvbnode->feshortname, "_sat", 0, 0); |
---|
788 | for(i = 1; i <= status.maxsat; i++) |
---|
789 | { |
---|
790 | tmpnr = oitoa(i); |
---|
791 | if(getconfigint(tmpstr, tmpnr) != 0) |
---|
792 | { |
---|
793 | treffer = 1; |
---|
794 | break; |
---|
795 | } |
---|
796 | free(tmpnr); tmpnr = NULL; |
---|
797 | } |
---|
798 | free(tmpnr); tmpnr = NULL; |
---|
799 | free(tmpstr); tmpstr = NULL; |
---|
800 | } |
---|
801 | |
---|
802 | if(treffer == 0) |
---|
803 | { |
---|
804 | dvbnode = dvbnode->next; |
---|
805 | continue; |
---|
806 | } |
---|
807 | |
---|
808 | tunercount++; |
---|
809 | if(feshortname == NULL) feshortname = dvbnode->feshortname; |
---|
810 | |
---|
811 | tmpstr = ostrcat(tmpstr, dvbnode->feinfo->name, 1, 0); |
---|
812 | tmpstr = ostrcat(tmpstr, " (", 1, 0); |
---|
813 | tmpstr = ostrcat(tmpstr, oitoa(dvbnode->adapter), 1, 1); |
---|
814 | tmpstr = ostrcat(tmpstr, "/", 1, 0); |
---|
815 | tmpstr = ostrcat(tmpstr, oitoa(dvbnode->devnr), 1, 1); |
---|
816 | tmpstr = ostrcat(tmpstr, ")", 1, 0); |
---|
817 | addchoicebox(tuner, dvbnode->feshortname, tmpstr); |
---|
818 | free(tmpstr); tmpstr = NULL; |
---|
819 | } |
---|
820 | dvbnode = dvbnode->next; |
---|
821 | } |
---|
822 | |
---|
823 | if(tunercount < 1) |
---|
824 | { |
---|
825 | textbox(_("Message"), _("No Tuner configured"), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
826 | return; |
---|
827 | } |
---|
828 | |
---|
829 | rcret = servicestop(status.aktservice, 1, 1); |
---|
830 | if(rcret == 1) return; |
---|
831 | |
---|
832 | if(status.aktservice->channel != NULL) |
---|
833 | tpnode = status.aktservice->channel->transponder; |
---|
834 | |
---|
835 | |
---|
836 | if(flag == 0) |
---|
837 | { |
---|
838 | addchoicebox(scantype, "0", _("Single Transponder")); |
---|
839 | addchoicebox(scantype, "1", _("Single Sat")); |
---|
840 | addchoicebox(scantype, "2", _("Multi Sat")); |
---|
841 | setchoiceboxselection(scantype, "0"); |
---|
842 | } |
---|
843 | else |
---|
844 | { |
---|
845 | addchoicebox(scantype, "3", _("Auto Scan")); |
---|
846 | setchoiceboxselection(scantype, "3"); |
---|
847 | } |
---|
848 | |
---|
849 | changescantype(scantype->ret, scan, listbox, tuner, sat, system, frequency, inversion, symbolrate, polarization, fec, modulation, rolloff, pilot); |
---|
850 | |
---|
851 | //sat |
---|
852 | scanchangesat(sat, tpnode, feshortname); |
---|
853 | |
---|
854 | //system |
---|
855 | tmpstr = transpondergetsystemstr(NULL, 1); |
---|
856 | changeinput(system, tmpstr); |
---|
857 | free(tmpstr); tmpstr = NULL; |
---|
858 | tmpstr = transpondergetsystemstr(NULL, 2); |
---|
859 | changechoiceboxvalue(system, tmpstr); |
---|
860 | free(tmpstr); tmpstr = NULL; |
---|
861 | if(tpnode != NULL) |
---|
862 | { |
---|
863 | tmpstr = oitoa(tpnode->system); |
---|
864 | setchoiceboxselection(system, tmpstr); |
---|
865 | free(tmpstr); tmpstr = NULL; |
---|
866 | } |
---|
867 | |
---|
868 | //frequency |
---|
869 | if(tpnode != NULL) |
---|
870 | tmpstr = oitoa(tpnode->frequency / 1000); |
---|
871 | else |
---|
872 | tmpstr = ostrcat(tmpstr, "00000", 1, 0); |
---|
873 | changemask(frequency, "00000"); |
---|
874 | changeinput(frequency, tmpstr); |
---|
875 | free(tmpstr); tmpstr = NULL; |
---|
876 | |
---|
877 | //inversion |
---|
878 | tmpstr = transpondergetinversionstr(NULL, 1); |
---|
879 | changeinput(inversion, tmpstr); |
---|
880 | free(tmpstr); tmpstr = NULL; |
---|
881 | tmpstr = transpondergetinversionstr(NULL, 2); |
---|
882 | changechoiceboxvalue(inversion, tmpstr); |
---|
883 | free(tmpstr); tmpstr = NULL; |
---|
884 | if(tpnode != NULL) |
---|
885 | { |
---|
886 | tmpstr = oitoa(tpnode->inversion); |
---|
887 | setchoiceboxselection(inversion, tmpstr); |
---|
888 | free(tmpstr); tmpstr = NULL; |
---|
889 | } |
---|
890 | |
---|
891 | //symbolrate |
---|
892 | if(tpnode != NULL) |
---|
893 | tmpstr = oitoa(tpnode->symbolrate / 1000); |
---|
894 | else |
---|
895 | tmpstr = ostrcat(tmpstr, "00000", 1, 0); |
---|
896 | changemask(symbolrate, "00000"); |
---|
897 | changeinput(symbolrate, tmpstr); |
---|
898 | free(tmpstr); tmpstr = NULL; |
---|
899 | |
---|
900 | //polarization |
---|
901 | tmpstr = transpondergetpolarizationstr(NULL, 1); |
---|
902 | changeinput(polarization, tmpstr); |
---|
903 | free(tmpstr); tmpstr = NULL; |
---|
904 | tmpstr = transpondergetpolarizationstr(NULL, 2); |
---|
905 | changechoiceboxvalue(polarization, tmpstr); |
---|
906 | free(tmpstr); tmpstr = NULL; |
---|
907 | if(tpnode != NULL) |
---|
908 | { |
---|
909 | tmpstr = oitoa(tpnode->polarization); |
---|
910 | setchoiceboxselection(polarization, tmpstr); |
---|
911 | free(tmpstr); tmpstr = NULL; |
---|
912 | } |
---|
913 | |
---|
914 | //fec |
---|
915 | tmpstr = transpondergetfecstr(NULL, 1); |
---|
916 | changeinput(fec, tmpstr); |
---|
917 | free(tmpstr); tmpstr = NULL; |
---|
918 | tmpstr = transpondergetfecstr(NULL, 2); |
---|
919 | changechoiceboxvalue(fec, tmpstr); |
---|
920 | free(tmpstr); tmpstr = NULL; |
---|
921 | if(tpnode != NULL) |
---|
922 | { |
---|
923 | tmpstr = oitoa(tpnode->fec); |
---|
924 | setchoiceboxselection(fec, tmpstr); |
---|
925 | free(tmpstr); tmpstr = NULL; |
---|
926 | } |
---|
927 | |
---|
928 | //modulation |
---|
929 | tmpstr = transpondergetmodulationstr(NULL, 1); |
---|
930 | changeinput(modulation, tmpstr); |
---|
931 | free(tmpstr); tmpstr = NULL; |
---|
932 | tmpstr = transpondergetmodulationstr(NULL, 2); |
---|
933 | changechoiceboxvalue(modulation, tmpstr); |
---|
934 | free(tmpstr); tmpstr = NULL; |
---|
935 | if(tpnode != NULL) |
---|
936 | { |
---|
937 | tmpstr = oitoa(tpnode->modulation); |
---|
938 | setchoiceboxselection(modulation, tmpstr); |
---|
939 | free(tmpstr); tmpstr = NULL; |
---|
940 | } |
---|
941 | |
---|
942 | //rolloff |
---|
943 | tmpstr = transpondergetrolloffstr(NULL, 1); |
---|
944 | changeinput(rolloff, tmpstr); |
---|
945 | free(tmpstr); tmpstr = NULL; |
---|
946 | tmpstr = transpondergetrolloffstr(NULL, 2); |
---|
947 | changechoiceboxvalue(rolloff, tmpstr); |
---|
948 | free(tmpstr); tmpstr = NULL; |
---|
949 | if(tpnode != NULL) |
---|
950 | { |
---|
951 | tmpstr = oitoa(tpnode->rolloff); |
---|
952 | setchoiceboxselection(rolloff, tmpstr); |
---|
953 | free(tmpstr); tmpstr = NULL; |
---|
954 | } |
---|
955 | |
---|
956 | //pilot |
---|
957 | tmpstr = transpondergetpilotstr(NULL, 1); |
---|
958 | changeinput(pilot, tmpstr); |
---|
959 | free(tmpstr); tmpstr = NULL; |
---|
960 | tmpstr = transpondergetpilotstr(NULL, 2); |
---|
961 | changechoiceboxvalue(pilot, tmpstr); |
---|
962 | free(tmpstr); tmpstr = NULL; |
---|
963 | if(tpnode != NULL) |
---|
964 | { |
---|
965 | tmpstr = oitoa(tpnode->pilot); |
---|
966 | setchoiceboxselection(pilot, tmpstr); |
---|
967 | free(tmpstr); tmpstr = NULL; |
---|
968 | } |
---|
969 | |
---|
970 | //networkscan |
---|
971 | addchoicebox(networkscan, "0", _("no")); |
---|
972 | addchoicebox(networkscan, "1", _("yes")); |
---|
973 | |
---|
974 | //clear |
---|
975 | addchoicebox(clear, "0", _("no")); |
---|
976 | addchoicebox(clear, "1", _("yes")); |
---|
977 | |
---|
978 | //only free |
---|
979 | addchoicebox(onlyfree, "0", _("no")); |
---|
980 | addchoicebox(onlyfree, "1", _("yes")); |
---|
981 | |
---|
982 | drawscreen(scan, 0); |
---|
983 | addscreenrc(scan, listbox); |
---|
984 | |
---|
985 | tmp = listbox->select; |
---|
986 | while(1) |
---|
987 | { |
---|
988 | addscreenrc(scan, tmp); |
---|
989 | rcret = waitrc(scan, 0, 0); |
---|
990 | tmp = listbox->select; |
---|
991 | |
---|
992 | if(scantype->ret != NULL) iscantype = atoi(scantype->ret); |
---|
993 | if(sat->ret != NULL) isat = atoi(sat->ret); |
---|
994 | if(system->ret != NULL) isystem = atoi(system->ret); |
---|
995 | if(frequency->ret != NULL) ifrequency = atoi(frequency->ret) * 1000; |
---|
996 | if(inversion->ret != NULL) iinversion = atoi(inversion->ret); |
---|
997 | if(symbolrate->ret != NULL) isymbolrate = atoi(symbolrate->ret) * 1000; |
---|
998 | if(polarization->ret != NULL) ipolarization = atoi(polarization->ret); |
---|
999 | if(fec->ret != NULL) ifec = atoi(fec->ret); |
---|
1000 | if(modulation->ret != NULL) imodulation = atoi(modulation->ret); |
---|
1001 | if(rolloff->ret != NULL) irolloff = atoi(rolloff->ret); |
---|
1002 | if(pilot->ret != NULL) ipilot = atoi(pilot->ret); |
---|
1003 | if(networkscan->ret != NULL) inetworkscan = atoi(networkscan->ret); |
---|
1004 | if(onlyfree->ret != NULL) ionlyfree = atoi(onlyfree->ret); |
---|
1005 | if(clear->ret != NULL) iclear = atoi(clear->ret); |
---|
1006 | |
---|
1007 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
1008 | if(listbox->select != NULL && ostrcmp(listbox->select->name, "tuner") == 0) |
---|
1009 | { |
---|
1010 | scanchangesat(sat, tpnode, listbox->select->ret); |
---|
1011 | changescantype(scantype->ret, scan, listbox, tuner, sat, system, frequency, inversion, symbolrate, polarization, fec, modulation, rolloff, pilot); |
---|
1012 | drawscreen(scan, 0); |
---|
1013 | } |
---|
1014 | if(listbox->select != NULL && ostrcmp(listbox->select->name, "scantype") == 0) |
---|
1015 | { |
---|
1016 | changescantype(scantype->ret, scan, listbox, tuner, sat, system, frequency, inversion, symbolrate, polarization, fec, modulation, rolloff, pilot); |
---|
1017 | drawscreen(scan, 0); |
---|
1018 | |
---|
1019 | } |
---|
1020 | if(rcret == getrcconfigint("rcok", NULL)) |
---|
1021 | { |
---|
1022 | clearscreen(scan); |
---|
1023 | screenscan(scan->child, tuner->ret, iscantype, isat, ifrequency, iinversion, isymbolrate, ipolarization, ifec, imodulation, irolloff, ipilot, inetworkscan, ionlyfree, iclear, isystem, 5000000); |
---|
1024 | drawscreen(scan, 0); |
---|
1025 | } |
---|
1026 | if(rcret == getrcconfigint("rcred", NULL) && tpnode != NULL && iscantype == 0) |
---|
1027 | { |
---|
1028 | struct transponder* tp1 = createtransponder(0, tpnode->fetype, isat, ifrequency, iinversion, isymbolrate, ipolarization, ifec, imodulation, irolloff, ipilot, isystem); |
---|
1029 | copytransponder(tp1, tpnode, 0); |
---|
1030 | deltransponder(0); |
---|
1031 | textbox(_("Message"), _("Transponder changed"), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 5, 0); |
---|
1032 | drawscreen(scan, 0); |
---|
1033 | } |
---|
1034 | } |
---|
1035 | |
---|
1036 | delmarkedscreennodes(scan, 1); |
---|
1037 | delownerrc(scan); |
---|
1038 | clearscreen(scan); |
---|
1039 | resetsatscan(); |
---|
1040 | servicestart(status.lastservice->channel, NULL, 0); |
---|
1041 | } |
---|
1042 | |
---|
1043 | #endif |
---|