1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

The actual transponder data is now taken from the NIT

This commit is contained in:
Klaus Schmidinger 2004-01-11 15:54:37 +01:00
parent 43ca916c20
commit 7f9d14ee8b
25 changed files with 523 additions and 192 deletions

View File

@ -2538,7 +2538,7 @@ Video Disk Recorder Revision History
overflow that caused a crash when cleaning up the EPG data (at 05:00 in the overflow that caused a crash when cleaning up the EPG data (at 05:00 in the
morning). morning).
2004-01-10: Version 1.3.1 2004-01-11: Version 1.3.1
- Fixed a lockup in the EPG scanner when no non-primary device was available - Fixed a lockup in the EPG scanner when no non-primary device was available
(thanks to Martin Holst for reporting this one). (thanks to Martin Holst for reporting this one).
@ -2566,3 +2566,8 @@ Video Disk Recorder Revision History
seconds. seconds.
- Fixed a possible NULL pointer access in cEITScanner::Process() (thanks to - Fixed a possible NULL pointer access in cEITScanner::Process() (thanks to
Andreas Kool). Andreas Kool).
- The actual transponder data is now taken from the NIT and existing channels
are adjusted if necessary. If the NIT contains new transponders, they are
scanned for channels during the next EPG scan. Note that only the satellite
branches are tested, cable and terrestrial need to be tested by somebody who
actually has such equipment.

7
MANUAL
View File

@ -511,10 +511,11 @@ Version 1.2
Video format = 4:3 The video format (or aspect ratio) of the tv set in use Video format = 4:3 The video format (or aspect ratio) of the tv set in use
(4:3 or 16:9). (4:3 or 16:9).
Update channels = 3 Controls the automatic channel update function. '0' means Update channels = 4 Controls the automatic channel update function. '0' means
no update, '1' will only update channel names, '2' will no update, '1' will only update channel names, '2' will
update channel names and PIDs, and '3' will perform all update channel names and PIDs, '3' will perform all
updates and also add newly found channels. updates and also add newly found channels, and '4' will
also add newly found transponders.
LNB: LNB:

View File

@ -4,7 +4,7 @@
# See the main source file 'vdr.c' for copyright information and # See the main source file 'vdr.c' for copyright information and
# how to reach the author. # how to reach the author.
# #
# $Id: Makefile 1.62 2003/12/25 13:38:56 kls Exp $ # $Id: Makefile 1.63 2004/01/11 10:35:36 kls Exp $
.DELETE_ON_ERROR: .DELETE_ON_ERROR:
@ -35,7 +35,7 @@ SILIB = $(LSIDIR)/libsi.a
OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o dvbosd.o\ OBJS = audio.o channels.o ci.o config.o cutter.o device.o diseqc.o dvbdevice.o dvbosd.o\
dvbplayer.o dvbspu.o eit.o eitscan.o epg.o filter.o font.o i18n.o interface.o keys.o\ dvbplayer.o dvbspu.o eit.o eitscan.o epg.o filter.o font.o i18n.o interface.o keys.o\
lirc.o menu.o menuitems.o osdbase.o osd.o pat.o player.o plugin.o rcu.o\ lirc.o menu.o menuitems.o nit.o osdbase.o osd.o pat.o player.o plugin.o rcu.o\
receiver.o recorder.o recording.o remote.o remux.o ringbuffer.o sdt.o sections.o sources.o\ receiver.o recorder.o recording.o remote.o remux.o ringbuffer.o sdt.o sections.o sources.o\
spu.o status.o svdrp.o thread.o timers.o tools.o transfer.o vdr.o videodir.o spu.o status.o svdrp.o thread.o timers.o tools.o transfer.o vdr.o videodir.o

View File

@ -32,7 +32,6 @@ Here's a list of the highlights - and what _not_ to expect yet
use the device that contains the proper CAM. use the device that contains the proper CAM.
- No NVOD or "linked services" support yet. - No NVOD or "linked services" support yet.
- No radio support yet. - No radio support yet.
- No transponder scan yet.
Note that this is currently work in progress, so there may be some Note that this is currently work in progress, so there may be some
areas that don't work as smooth as expected, yet. areas that don't work as smooth as expected, yet.
@ -77,7 +76,8 @@ Known bugs:
are switched, and there is still an SDT data packet being processed. are switched, and there is still an SDT data packet being processed.
The call to device->HasLock() in sections.c should fix this (and it The call to device->HasLock() in sections.c should fix this (and it
apparently does for most cases), but there must still be soemthing apparently does for most cases), but there must still be soemthing
wrong in that area. wrong in that area. This may be fixed in 1.3.1 - please report if
it does still happen there.
- Sometimes the current channel gets re-tuned even though the channel - Sometimes the current channel gets re-tuned even though the channel
data of this channel didn't change (but that of an other channel did data of this channel didn't change (but that of an other channel did
change). change).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: channels.c 1.18 2004/01/05 12:50:34 kls Exp $ * $Id: channels.c 1.19 2004/01/11 15:52:32 kls Exp $
*/ */
#include "channels.h" #include "channels.h"
@ -160,25 +160,6 @@ char *cChannel::buffer = NULL;
cChannel::cChannel(void) cChannel::cChannel(void)
{ {
memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__); memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__);
strcpy(name, "Pro7");
frequency = 12480;
source = cSource::FromString("S19.2E");
srate = 27500;
vpid = 255;
ppid = 0;
apid1 = 256;
apid2 = 0;
dpid1 = 257;
dpid2 = 0;
tpid = 32;
caids[0] = 0;
nid = 0;
tid = 0;
sid = 888;
rid = 0;
number = 0;
groupSep = false;
polarization = 'v';
inversion = INVERSION_AUTO; inversion = INVERSION_AUTO;
bandwidth = BANDWIDTH_AUTO; bandwidth = BANDWIDTH_AUTO;
coderateH = FEC_AUTO; coderateH = FEC_AUTO;
@ -237,6 +218,68 @@ int cChannel::Modification(int Mask)
return Result; return Result;
} }
bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, bool Log)
{
// Workarounds for broadcaster stupidity:
// Some providers broadcast the transponder frequency of their channels with two different
// values (like 12551 and 12552), so we need to allow for a little tolerance here
if (abs(frequency - Frequency) <= 1)
Frequency = frequency;
// Sometimes the transponder frequency is set to 0, which is just wrong
if (Frequency == 0)
return false;
if (source != Source || frequency != Frequency || polarization != Polarization || srate != Srate || coderateH != CoderateH) {
if (Log)
dsyslog("changing transponder data of channel %d from %s:%d:%c:%d:%d to %s:%d:%c:%d:%d", Number(), cSource::ToString(source), frequency, polarization, srate, coderateH, cSource::ToString(Source), Frequency, Polarization, Srate, CoderateH);
source = Source;
frequency = Frequency;
polarization = Polarization;
srate = Srate;
coderateH = CoderateH;
modulation = QPSK;
modification |= CHANNELMOD_TRANSP;
Channels.SetModified();
}
return true;
}
bool cChannel::SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH, bool Log)
{
if (source != Source || frequency != Frequency || modulation != Modulation || srate != Srate || coderateH != CoderateH) {
if (Log)
dsyslog("changing transponder data of channel %d from %s:%d:%d:%d:%d to %s:%d:%d:%d:%d", Number(), cSource::ToString(source), frequency, modulation, srate, coderateH, cSource::ToString(Source), Frequency, Modulation, Srate, CoderateH);
source = Source;
frequency = Frequency;
modulation = Modulation;
srate = Srate;
coderateH = CoderateH;
modification |= CHANNELMOD_TRANSP;
Channels.SetModified();
}
return true;
}
bool cChannel::SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CoderateH, int CoderateL, int Guard, int Transmission, bool Log)
{
if (source != Source || frequency != Frequency || bandwidth != Bandwidth || modulation != Modulation || hierarchy != Hierarchy || coderateH != CoderateH || coderateL != CoderateL || guard != Guard || transmission != Transmission) {
if (Log)
dsyslog("changing transponder data of channel %d from %s:%d:%d:%d:%d:%d:%d:%d:%d to %s:%d:%d:%d:%d:%d:%d:%d:%d", Number(), cSource::ToString(source), frequency, bandwidth, modulation, hierarchy, coderateH, coderateL, guard, transmission, cSource::ToString(Source), Frequency, Bandwidth, Modulation, Hierarchy, CoderateH, CoderateL, Guard, Transmission);
source = Source;
frequency = Frequency;
bandwidth = Bandwidth;
modulation = Modulation;
hierarchy = Hierarchy;
coderateH = CoderateH;
coderateL = CoderateL;
guard = Guard;
transmission = Transmission;
modification |= CHANNELMOD_TRANSP;
Channels.SetModified();
}
return true;
}
void cChannel::SetId(int Nid, int Tid, int Sid, int Rid, bool Log) void cChannel::SetId(int Nid, int Tid, int Sid, int Rid, bool Log)
{ {
if (nid != Nid || tid != Tid || sid != Sid || rid != Rid) { if (nid != Nid || tid != Tid || sid != Sid || rid != Rid) {
@ -382,9 +425,9 @@ bool cChannel::StringToParameters(const char *s)
case 'G': s = ParseParameter(s, guard, GuardValues); break; case 'G': s = ParseParameter(s, guard, GuardValues); break;
case 'H': polarization = *s++; break; case 'H': polarization = *s++; break;
case 'I': s = ParseParameter(s, inversion, InversionValues); break; case 'I': s = ParseParameter(s, inversion, InversionValues); break;
// 'L' reserved for possible circular polarization case 'L': polarization = *s++; break;
case 'M': s = ParseParameter(s, modulation, ModulationValues); break; case 'M': s = ParseParameter(s, modulation, ModulationValues); break;
// 'R' reserved for possible circular polarization case 'R': polarization = *s++; break;
case 'T': s = ParseParameter(s, transmission, TransmissionValues); break; case 'T': s = ParseParameter(s, transmission, TransmissionValues); break;
case 'V': polarization = *s++; break; case 'V': polarization = *s++; break;
case 'Y': s = ParseParameter(s, hierarchy, HierarchyValues); break; case 'Y': s = ParseParameter(s, hierarchy, HierarchyValues); break;
@ -675,18 +718,16 @@ bool cChannels::Modified(void)
return Result; return Result;
} }
cChannel *cChannels::NewChannel(int Source, int Transponder, const char *Name, int Nid, int Tid, int Sid, int Rid) cChannel *cChannels::NewChannel(const cChannel *Transponder, const char *Name, int Nid, int Tid, int Sid, int Rid)
{ {
dsyslog("creating new channel '%s' on %s transponder %d with id %d-%d-%d-%d", Name, cSource::ToString(Source), Transponder, Nid, Tid, Sid, Rid); if (Transponder) {
for (cChannel *channel = First(); channel; channel = Next(channel)) { dsyslog("creating new channel '%s' on %s transponder %d with id %d-%d-%d-%d", Name, cSource::ToString(Transponder->Source()), Transponder->Transponder(), Nid, Tid, Sid, Rid);
if (!channel->GroupSep() && channel->Source() == Source && ISTRANSPONDER(channel->Transponder(), Transponder)) { cChannel *NewChannel = new cChannel(Transponder);
cChannel *NewChannel = new cChannel(channel); Add(NewChannel);
Add(NewChannel); ReNumber();
ReNumber(); NewChannel->SetId(Nid, Tid, Sid, Rid, false);
NewChannel->SetId(Nid, Tid, Sid, Rid, false); NewChannel->SetName(Name, false);
NewChannel->SetName(Name, false); return NewChannel;
return NewChannel; }
}
}
return NULL; return NULL;
} }

View File

@ -1,95 +1,95 @@
RTL,RTL Television:12188:h:S19.2E:27500:163:104:105:0:12003:1:1089:0 RTL,RTL Television:12187:hC34:S19.2E:27500:163:104:105:0:12003:1:1089:0
SAT.1:12480:v:S19.2E:27500:1791:1792;1795:34:0:46:133:33:0 SAT.1:12480:vC34:S19.2E:27500:1791:1792;1795:34:0:46:133:33:0
ProSieben:12480:v:S19.2E:27500:255:256;257:32:0:898:133:33:0 ProSieben:12480:vC34:S19.2E:27500:255:256;257:32:0:898:133:33:0
RTL2:12188:h:S19.2E:27500:166:128:68:0:12020:1:1089:0 RTL2:12187:hC34:S19.2E:27500:166:128:68:0:12020:1:1089:0
Das Erste:11837:h:S19.2E:27500:101:102:104:0:28106:1:1101:0 Das Erste:11836:hC34:S19.2E:27500:101:102:104:0:28106:1:1101:0
Bayerisches FS:11837:h:S19.2E:27500:201:202:204:0:28107:1:1101:0 Bayerisches FS:11836:hC34:S19.2E:27500:201:202:204:0:28107:1:1101:0
hessen fernsehen:11837:h:S19.2E:27500:301:302:304:0:28108:1:1101:0 hessen fernsehen:11836:hC34:S19.2E:27500:301:302:304:0:28108:1:1101:0
NDR FS MV:12110:h:S19.2E:27500:2401:2402:2404:0:28224:1:1073:0 NDR FS MV:12109:hC34:S19.2E:27500:2401:2402:2404:0:28224:1:1073:0
SR Fernsehen Suedwest:11837:h:S19.2E:27500:501:502:504:0:28110:1:1101:0 SR Fernsehen Suedwest:11836:hC34:S19.2E:27500:501:502:504:0:28110:1:1101:0
WDR FERNSEHEN:11837:h:S19.2E:27500:601:602:604:0:28111:1:1101:0 WDR Köln:11836:hC34:S19.2E:27500:601:602:604:0:28111:1:1101:0
BR-alpha:11837:h:S19.2E:27500:701:702:704:0:28112:1:1101:0 BR-alpha:11836:hC34:S19.2E:27500:701:702:704:0:28112:1:1101:0
SÜDWEST BW:11837:h:S19.2E:27500:801:802:804:0:28113:1:1101:0 SÜDWEST BW:11836:hC34:S19.2E:27500:801:802:804:0:28113:1:1101:0
Phoenix:11837:h:S19.2E:27500:901:902:904:0:28114:1:1101:0 Phoenix:11836:hC34:S19.2E:27500:901:902:904:0:28114:1:1101:0
ZDF:11954:h:S19.2E:27500:110:120;125:130:0:28006:1:1079:0 ZDF:11953:hC34:S19.2E:27500:110:120;125:130:0:28006:1:1079:0
3sat:11954:h:S19.2E:27500:210:220:230:0:28007:1:1079:0 3sat:11953:hC34:S19.2E:27500:210:220:230:0:28007:1:1079:0
KiKa:11954:h:S19.2E:27500:310:320:330:0:28008:1:1079:0 KiKa:11953:hC34:S19.2E:27500:310:320:330:0:28008:1:1079:0
arte:11836:h:S19.2E:27500:401:402,403:404:0:28109:1:1101:0 arte:11836:hC34:S19.2E:27500:401:402,403:404:0:28109:1:1101:0
ORF 1:12692:h:S19.2E:22000:160:161;163:165:1762,D05,1702,1801:13001:1:1117:0 ORF 1:12692:hC56:S19.2E:22000:160:161,162;163:165:1762,D05,1702,1801:13001:1:1117:0
ORF 2:12692:h:S19.2E:22000:500:501;503:505:1762,D05,1702,1801:13002:1:1117:0 ORF 2:12692:hC56:S19.2E:22000:500:501;503:505:1762,D05,1702,1801:13002:1:1117:0
ZDFinfokanal:11954:h:S19.2E:27500:610:620:130:0:28011:1:1079:0 ZDFinfokanal:11953:hC34:S19.2E:27500:610:620:130:0:28011:1:1079:0
CNN Int.:11778:v:S19.2E:27500:165:100:47:0:28522:1:1068:0 CNN Int.:11778:vC34:S19.2E:27500:165:100:47:0:28522:1:1068:0
S RTL,Super RTL:12188:h:S19.2E:27500:165:120:65:0:12040:1:1089:0 S RTL,Super RTL:12187:hC34:S19.2E:27500:165:120:65:0:12040:1:1089:0
VOX:12188:h:S19.2E:27500:167:136:71:0:12060:1:1089:0 VOX:12187:hC34:S19.2E:27500:167:136:71:0:12060:1:1089:0
KABEL1:12480:v:S19.2E:27500:511:512:33:0:899:133:33:0 KABEL1:12480:vC34:S19.2E:27500:511:512:33:0:899:133:33:0
NEUN LIVE,NEUN LIVE Television:12480:v:S19.2E:27500:767:768:35:0:897:133:33:0 NEUN LIVE,NEUN LIVE Television:12480:vC34:S19.2E:27500:767:768:35:0:897:133:33:0
DSF:12480:v:S19.2E:27500:1023:1024:0:0:900:133:33:0 DSF:12480:vC34:S19.2E:27500:1023:1024:0:0:900:133:33:0
HSEurope,Home Shopping Europe:12480:v:S19.2E:27500:1279:1280:37:0:40:133:33:0 HSEurope,Home Shopping Europe:12480:vC34:S19.2E:27500:1279:1280:37:0:40:133:33:0
Bloomberg TV Germany:12552:v:S19.2E:22000:162:99:0:0:12160:1:1108:0 Bloomberg TV Germany:12552:vC56:S19.2E:22000:162:99:0:0:12160:1:1108:0
EURONEWS:11817:v:S19.2E:27500:163:92,93:0:500,100:8004:1:1070:0 EURONEWS:11817:vC34:S19.2E:27500:163:92,93:0:500,100:8004:1:1070:0
Sky News:11597:v:S19.2E:22000:305:306:0:0:28707:1:1026:0 Sky News:11597:vC56:S19.2E:22000:305:306:0:0:28707:1:1026:0
Veronica/FoxKids:12574:h:S19.2E:22000:518+8190:92:38:622,602,100:5020:53:1109:0 Veronica/FoxKids:12574:hC56:S19.2E:22000:518+8190:92:38:622,602,100:5020:53:1109:0
BVN:12574:h:S19.2E:22000:515+8190:96:36:0:5025:53:1109:0 BVN:12574:hC56:S19.2E:22000:515+8190:96:36:0:5025:53:1109:0
CNBC Europe:12610:v:S19.2E:22000:944:945:0:0:12200:1:1112:0 CNBC Europe:12610:vC56:S19.2E:22000:944:945:0:0:12200:1:1112:0
n-tv:12670:v:S19.2E:22000:162:96:55:0:12730:1:1116:0 n-tv:12669:vC56:S19.2E:22000:162:96:55:0:12730:1:1116:0
Al Jazeera:11568:v:S19.2E:22000:55:56:0:0:9021:1:1024:0 Al Jazeera:11567:vC56:S19.2E:22000:55:56:0:0:9021:1:1024:0
TW1:12692:h:S19.2E:22000:166:167:168:0:13013:1:1117:0 TW1:12692:hC56:S19.2E:22000:166:167:168:0:13013:1:1117:0
Eurosport:11954:h:S19.2E:27500:410:420:430:0:28009:1:1079:0 Eurosport:11953:hC34:S19.2E:27500:410:420:430:0:28009:1:1079:0
EinsExtra:12110:h:S19.2E:27500:101:102:0:0:28201:1:1073:0 EinsExtra:12109:hC34:S19.2E:27500:101:102:0:0:28201:1:1073:0
EinsFestival:12110:h:S19.2E:27500:201:202:0:0:28202:1:1073:0 EinsFestival:12109:hC34:S19.2E:27500:201:202:0:0:28202:1:1073:0
EinsMuXx:12110:h:S19.2E:27500:301:302:0:0:28203:1:1073:0 EinsMuXx:12109:hC34:S19.2E:27500:301:302:0:0:28203:1:1073:0
ZDFtheaterkanal:11954:h:S19.2E:27500:1110:1120:130:0:28016:1:1079:0 ZDFtheaterkanal:11953:hC34:S19.2E:27500:1110:1120:130:0:28016:1:1079:0
ZDFdokukanal:11954:h:S19.2E:27500:660:670:130:0:28014:1:1079:0 ZDFdokukanal:11953:hC34:S19.2E:27500:660:670:130:0:28014:1:1079:0
MDR FERNSEHEN:12110:h:S19.2E:27500:401:402:404:0:28204:1:1073:0 MDR FERNSEHEN:12109:hC34:S19.2E:27500:401:402:404:0:28204:1:1073:0
RBB Brandenburg:12110:h:S19.2E:27500:501:502:504:0:28205:1:1073:0 RBB Brandenburg:12109:hC34:S19.2E:27500:501:502:504:0:28205:1:1073:0
RBB Berlin:12110:h:S19.2E:27500:601:602:604:0:28206:1:1073:0 RBB Berlin:12109:hC34:S19.2E:27500:601:602:604:0:28206:1:1073:0
:Premiere World :Premiere World
START,PREMIERE START:11797:h:S19.2E:27500:255:256:32:1702,1722,1801:8:133:2:0 START,PREMIERE START:11797:hC34:S19.2E:27500:255:256:32:1702,1722,1801:8:133:2:0
PREM 1,PREMIERE 1:11797:h:S19.2E:27500:511:512,513;515:0:1702,1722,1801:10:133:2:0 PREM 1,PREMIERE 1:11797:hC34:S19.2E:27500:511:512,513;515:0:1702,1722,1801:10:133:2:0
PREM 2,PREMIERE 2:11797:h:S19.2E:27500:1791:1792,1793;1795:0:1702,1722,1801:11:133:2:0 PREM 2,PREMIERE 2:11797:hC34:S19.2E:27500:1791:1792,1793;1795:0:1702,1722,1801:11:133:2:0
PREM 3,PREMIERE 3:11797:h:S19.2E:27500:2303:2304,2305:0:1702,1722,1801:43:133:2:0 PREM 3,PREMIERE 3:11797:hC34:S19.2E:27500:2303:2304,2305:0:1702,1722,1801:43:133:2:0
PREM 4,PREMIERE 4:11797:h:S19.2E:27500:767:768,769:0:1702,1722,1801:9:133:2:0 PREM 4,PREMIERE 4:11797:hC34:S19.2E:27500:767:768,769:0:1702,1722,1801:9:133:2:0
PREM 5,PREMIERE 5:11797:h:S19.2E:27500:1279:1280,1281:0:1702,1722,1801:29:133:2:0 PREM 5,PREMIERE 5:11797:hC34:S19.2E:27500:1279:1280,1281:0:1702,1722,1801:29:133:2:0
PREM 6,PREMIERE 6:11797:h:S19.2E:27500:1535:1536:0:1702,1722,1801:41:133:2:0 PREM 6,PREMIERE 6:11797:hC34:S19.2E:27500:1535:1536:0:1702,1722,1801:41:133:2:0
PREM 7,PREMIERE 7:11797:h:S19.2E:27500:1023:1024:0:1702,1722,1801:20:133:2:0 PREM 7,PREMIERE 7:11797:hC34:S19.2E:27500:1023:1024:0:1702,1722,1801:20:133:2:0
DISNEY,DISNEY CHANNEL:11758:h:S19.2E:27500:2559:2560:0:1702,1722,1801:34:133:17:0 DISNEY,DISNEY CHANNEL:11758:hC34:S19.2E:27500:2559:2560:0:1702,1722,1801:34:133:17:0
:Premiere Direkt :Premiere Direkt
DIREKT,PREMIERE DIREKT:12031:h:S19.2E:27500:2815:2816,2817;2819:0:0:18:133:4:0 DIREKT,PREMIERE DIREKT:12031:hC34:S19.2E:27500:2815:2816,2817;2819:0:0:18:133:4:0
:PW Erotic :PW Erotic
B-UHSE,BEATE-UHSE.TV:12071:h:S19.2E:27500:1023:1024:0:1702,1722,1801:21:133:1:0 B-UHSE,BEATE-UHSE.TV:12070:hC34:S19.2E:27500:1023:1024:0:1702,1722,1801:21:133:1:0
EROTIK,PREMIERE EROTIK:12031:h:S19.2E:27500:1279:0:0:1702,1722,1801:513:133:4:0 EROTIK,PREMIERE EROTIK:12031:hC34:S19.2E:27500:1279:0:0:1702,1722,1801:513:133:4:0
:Sportsworld :Sportsworld
SPORT 1,PREMIERE SPORT 1:11720:h:S19.2E:27500:255:256,257:0:1702,1722,1801:17:133:3:0 SPORT 1,PREMIERE SPORT 1:11719:hC34:S19.2E:27500:255:256,257:0:1702,1722,1801:17:133:3:0
SPORT 2,PREMIERE SPORT 2:12031:h:S19.2E:27500:3839:3840,3841:0:1702,1722,1801:27:133:4:0 SPORT 2,PREMIERE SPORT 2:12031:hC34:S19.2E:27500:3839:3840,3841:0:1702,1722,1801:27:133:4:0
:Beta Digital :Beta Digital
N24:12480:v:S19.2E:27500:2047:2048:36:0:47:133:33:0 N24:12480:vC34:S19.2E:27500:2047:2048:36:0:47:133:33:0
CNBC:11954:h:S19.2E:27500:510:520:530:0:28010:1:1079:0 CNBC:11953:hC34:S19.2E:27500:510:520:530:0:28010:1:1079:0
Liberty TV.com:12610:v:S19.2E:22000:941:943:0:0:12199:1:1112:0 Liberty TV.com:12610:vC56:S19.2E:22000:941:943:0:0:12199:1:1112:0
:- :-
ProSieben Austria:12051:v:S19.2E:27500:161:84:36:0:20002:1:1082:0 ProSieben Austria:12051:vC34:S19.2E:27500:161:84:36:0:20002:1:1082:0
Kabel 1 Schweiz:12051:v:S19.2E:27500:162:163:165:0:20003:1:1082:0 Kabel 1 Schweiz:12051:vC34:S19.2E:27500:162:163:165:0:20003:1:1082:0
Kabel 1 Austria:12051:v:S19.2E:27500:166:167:169:0:20004:1:1082:0 Kabel 1 Austria:12051:vC34:S19.2E:27500:166:167:169:0:20004:1:1082:0
ProSieben Schweiz:12051:v:S19.2E:27500:289:290:33:0:20001:1:1082:0 ProSieben Schweiz:12051:vC34:S19.2E:27500:289:290:33:0:20001:1:1082:0
FRANCE 5:12207:v:S19.2E:27500:160:80:32:0:8501:1:1090:0 FRANCE 5:12207:vC34:S19.2E:27500:160:80:32:0:8501:1:1090:0
LCP:12207:v:S19.2E:27500:165:100:0:0:8506:1:1090:0 LCP:12207:vC34:S19.2E:27500:165:100:0:0:8506:1:1090:0
ESCALES:12285:v:S19.2E:27500:165:100:0:500,100:17025:1:1094:0 ESCALES:12285:vC34:S19.2E:27500:165:100:0:500,100:17025:1:1094:0
CANAL CLUB:12324:v:S19.2E:27500:160:80:0:0:8612:1:1096:0 CANAL CLUB:12324:vC34:S19.2E:27500:160:80:0:0:8612:1:1096:0
ASTRA-Mosaic:12552:v:S19.2E:22000:175:176:0:0:3988:1:1108:0 ASTRA-Mosaic:12552:vC56:S19.2E:22000:175:176:0:0:3988:1:1108:0
ASTRA-Mosaic 2:12552:v:S19.2E:22000:179:120:0:0:3987:1:1108:0 ASTRA-Mosaic 2:12552:vC56:S19.2E:22000:179:120:0:0:3987:1:1108:0
ASTRA-Mosaic 3:12552:v:S19.2E:22000:182:169:0:0:3986:1:1108:0 ASTRA-Mosaic 3:12552:vC56:S19.2E:22000:182:169:0:0:3986:1:1108:0
ASTRA-Mosaic 4:12552:v:S19.2E:22000:185:170:0:0:3985:1:1108:0 ASTRA-Mosaic 4:12552:vC56:S19.2E:22000:185:170:0:0:3985:1:1108:0
ASTRA-Mosaic 5:12552:v:S19.2E:22000:163:164:0:0:3984:1:1108:0 ASTRA-Mosaic 5:12552:vC56:S19.2E:22000:163:164:0:0:3984:1:1108:0
Chamber TV:12552:v:S19.2E:22000:55:56:0:0:12180:1:1108:0 Chamber TV:12552:vC56:S19.2E:22000:55:56:0:0:12180:1:1108:0
RTL TELE Letzebuerg:12552:v:S19.2E:22000:168:144,146:74:0:3994:1:1108:0 RTL TELE Letzebuerg:12552:vC56:S19.2E:22000:168:144,146:74:0:3994:1:1108:0
Yorin:12574:h:S19.2E:22000:512+8190:84:33:622,602,100:5010:53:1109:0 Yorin:12574:hC56:S19.2E:22000:512+8190:84:33:622,602,100:5010:53:1109:0
MTV2 Pop Channel:12225:h:S19.2E:27500:513:661:577:0:28640:1:1091:0 MTV2 Pop Channel:12226:hC34:S19.2E:27500:513:661:577:0:28640:1:1091:0
Via 1 - Schöner Reisen:12148:h:S19.2E:27500:511:512:0:0:44:0:0:0 Via 1 - Schöner Reisen:12148:h:S19.2E:27500:511:512:0:0:44:0:0:0
Video Italia:12610:v:S19.2E:22000:121:122:0:0:12220:0:0:0 Video Italia:12610:v:S19.2E:22000:121:122:0:0:12220:0:0:0
VIVA:12670:v:S19.2E:22000:309:310:311:0:12732:1:1116:0 VIVA:12669:vC56:S19.2E:22000:309:310:311:0:12732:1:1116:0
VIVA PLUS:12552:v:S19.2E:22000:171:172:173:0:12120:1:1108:0 VIVA PLUS:12552:vC56:S19.2E:22000:171:172:173:0:12120:1:1108:0
MTV Central:11739:v:S19.2E:27500:3031:3032:3034:0:28653:1:1066:0 MTV Central:11739:vC34:S19.2E:27500:3031:3032:3034:0:28653:1:1066:0
QVC GERMANY:12552:v:S19.2E:22000:165:166:167:0:12100:1:1108:0 QVC GERMANY:12552:vC56:S19.2E:22000:165:166:167:0:12100:1:1108:0
TELE 5:12480:v:S19.2E:27500:1535:1536:38:0:51:133:33:0 TELE 5:12480:vC34:S19.2E:27500:1535:1536:38:0:51:133:33:0
:@201 Sky :@201 Sky
Sky One:106:h:S28.2E:0:160:80:0:30:222:0:0:0 Sky One:106:h:S28.2E:0:160:80:0:30:222:0:0:0
Sky One Mix:107:h:S28.2E:0:160:80:0:30:919:0:0:0 Sky One Mix:107:h:S28.2E:0:160:80:0:30:919:0:0:0
@ -97,14 +97,14 @@ itv2:226:h:S28.2E:0:160:80:0:30:451:0:0:0
sci-fi:130:h:S28.2E:0:160:80:0:30:161:0:0:0 sci-fi:130:h:S28.2E:0:160:80:0:30:161:0:0:0
Paramount Comedy:127:h:S28.2E:0:160:80:0:30:185:0:0:0 Paramount Comedy:127:h:S28.2E:0:160:80:0:30:185:0:0:0
:@900 Some 'seed' channels :@900 Some 'seed' channels
Chelsea TV:11778:v:S28.2E:27500:2308+2304:2309:0:960,961:9307:2:2004:0 Chelsea TV:11778:vC23:S28.2E:27500:2308+2304:2309:0:960,961:9307:2:2004:0
Sky One:12285:v:S28.2E:27500:2311+2304:2312,2313:2307:960,961:4703:2:2030:0 Sky One:12285:vC23:S28.2E:27500:2311+2304:2312,2313:2307:960,961:4703:2:2030:0
WDR Münster:12421:h:S19.2E:27500:101:102:104:0:28310:1:1201:0 WDR Münster:12421:hC34:S19.2E:27500:101:102:104:0:28310:1:1201:0
Going Places:10921:h:S28.2E:22000:2310+2304:2311:2312:0:5008:2:2055:0 Going Places:10920:hC56:S28.2E:22000:2310+2304:2311:2312:0:5008:2:2055:0
Animal Plnt+:12070:h:S28.2E:27500:2315+2307:2316:0:960,961:50002:2:2019:0 Animal Plnt+:12070:hC23:S28.2E:27500:2315+2307:2316:0:960,961:50002:2:2019:0
S1T:11954:h:S28.2E:27500:0:0:0:0:4409:2:2030:0 S1T:12285:vC23:S28.2E:27500:2311+2304:2312,2313:2314:960,961:4409:2:2030:0
CNN:12032:v:S28.2E:27500:2309:2311:2310:0:7140:2:2018:0 CNN:12051:vC23:S28.2E:27500:2309:2311:2310:0:7140:2:2018:0
BBC PARL'MNT:12129:v:S28.2E:27500:2306:2308,2309:2307:0:7300:2:2022:0 BBC PARL'MNT:12129:vC23:S28.2E:27500:2306:2308,2309:2307:0:7300:2:2022:0
AL HAYAT:11200:v:S13.0E:27500:413:414:0:0:4733:318:13400:0 AL HAYAT:11200:vC56:S13.0E:27500:413:414:0:0:4733:318:13400:0
EURO1080:12168:v:S19.2E:27500:308:256:0:FF:21100:1:1088:0 EURO1080:12168:vC34:S19.2E:27500:308:256:0:FF:21100:1:1088:0
:@1000 New channels :@1000 New channels

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: channels.h 1.11 2004/01/05 10:06:15 kls Exp $ * $Id: channels.h 1.12 2004/01/11 15:20:18 kls Exp $
*/ */
#ifndef __CHANNELS_H #ifndef __CHANNELS_H
@ -23,7 +23,8 @@
#define CHANNELMOD_PIDS 0x02 #define CHANNELMOD_PIDS 0x02
#define CHANNELMOD_ID 0x04 #define CHANNELMOD_ID 0x04
#define CHANNELMOD_CA 0x10 #define CHANNELMOD_CA 0x10
#define CHANNELMOD_RETUNE (CHANNELMOD_PIDS | CHANNELMOD_CA) #define CHANNELMOD_TRANSP 0x20
#define CHANNELMOD_RETUNE (CHANNELMOD_PIDS | CHANNELMOD_CA | CHANNELMOD_TRANSP)
#define MAXAPIDS 2 #define MAXAPIDS 2
#define MAXCAIDS 8 #define MAXCAIDS 8
@ -142,6 +143,9 @@ public:
bool IsTerr(void) const { return (source & cSource::st_Mask) == cSource::stTerr; } bool IsTerr(void) const { return (source & cSource::st_Mask) == cSource::stTerr; }
tChannelID GetChannelID(void) const; tChannelID GetChannelID(void) const;
int Modification(int Mask = CHANNELMOD_ALL); int Modification(int Mask = CHANNELMOD_ALL);
bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, bool Log = true);
bool SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH, bool Log = true);
bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission, bool Log = true);
void SetId(int Nid, int Tid, int Sid, int Rid = 0, bool Log = true); void SetId(int Nid, int Tid, int Sid, int Rid = 0, bool Log = true);
void SetName(const char *Name, bool Log = true); void SetName(const char *Name, bool Log = true);
void SetPids(int Vpid, int Ppid, int Apid1, int Apid2, int Dpid1, int Dpid2, int Tpid); void SetPids(int Vpid, int Ppid, int Apid1, int Apid2, int Dpid1, int Dpid2, int Tpid);
@ -172,7 +176,7 @@ public:
int MaxNumber(void) { return maxNumber; } int MaxNumber(void) { return maxNumber; }
void SetModified(void); void SetModified(void);
bool Modified(void); bool Modified(void);
cChannel *NewChannel(int Source, int Transponder, const char *Name, int Nid, int Tid, int Sid, int Rid = 0); cChannel *NewChannel(const cChannel *Transponder, const char *Name, int Nid, int Tid, int Sid, int Rid = 0);
}; };
extern cChannels Channels; extern cChannels Channels;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.c 1.119 2004/01/06 17:09:54 kls Exp $ * $Id: config.c 1.120 2004/01/11 15:38:11 kls Exp $
*/ */
#include "config.h" #include "config.h"
@ -273,7 +273,7 @@ cSetup::cSetup(void)
UseSubtitle = 1; UseSubtitle = 1;
RecordingDirs = 1; RecordingDirs = 1;
VideoFormat = 0; VideoFormat = 0;
UpdateChannels = 3; UpdateChannels = 4;
RecordDolbyDigital = 1; RecordDolbyDigital = 1;
ChannelInfoPos = 0; ChannelInfoPos = 0;
OSDwidth = 52; OSDwidth = 52;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 1.51 2004/01/04 11:30:05 kls Exp $ * $Id: device.c 1.52 2004/01/11 13:21:12 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -48,6 +48,7 @@ cDevice::cDevice(void)
eitFilter = NULL; eitFilter = NULL;
patFilter = NULL; patFilter = NULL;
sdtFilter = NULL; sdtFilter = NULL;
nitFilter = NULL;
ciHandler = NULL; ciHandler = NULL;
player = NULL; player = NULL;
@ -69,6 +70,7 @@ cDevice::~cDevice()
for (int i = 0; i < MAXRECEIVERS; i++) for (int i = 0; i < MAXRECEIVERS; i++)
Detach(receiver[i]); Detach(receiver[i]);
delete ciHandler; delete ciHandler;
delete nitFilter;
delete sdtFilter; delete sdtFilter;
delete patFilter; delete patFilter;
delete eitFilter; delete eitFilter;
@ -328,6 +330,7 @@ void cDevice::StartSectionHandler(void)
AttachFilter(eitFilter = new cEitFilter); AttachFilter(eitFilter = new cEitFilter);
AttachFilter(patFilter = new cPatFilter); AttachFilter(patFilter = new cPatFilter);
AttachFilter(sdtFilter = new cSdtFilter(patFilter)); AttachFilter(sdtFilter = new cSdtFilter(patFilter));
AttachFilter(nitFilter = new cNitFilter);
sectionHandler->SetStatus(true); sectionHandler->SetStatus(true);
} }
} }
@ -444,12 +447,12 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
// Stop section handling: // Stop section handling:
if (sectionHandler) { if (sectionHandler) {
sectionHandler->SetStatus(false); sectionHandler->SetStatus(false);
sectionHandler->SetSource(0, 0); sectionHandler->SetChannel(NULL);
} }
if (SetChannelDevice(Channel, LiveView)) { if (SetChannelDevice(Channel, LiveView)) {
// Start section handling: // Start section handling:
if (sectionHandler) { if (sectionHandler) {
sectionHandler->SetSource(Channel->Source(), Channel->Transponder()); sectionHandler->SetChannel(Channel);
sectionHandler->SetStatus(true); sectionHandler->SetStatus(true);
} }
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.h 1.37 2004/01/04 11:52:00 kls Exp $ * $Id: device.h 1.38 2004/01/11 10:35:36 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -13,6 +13,7 @@
#include "ci.h" #include "ci.h"
#include "eit.h" #include "eit.h"
#include "filter.h" #include "filter.h"
#include "nit.h"
#include "pat.h" #include "pat.h"
#include "sdt.h" #include "sdt.h"
#include "sections.h" #include "sections.h"
@ -241,6 +242,7 @@ private:
cEitFilter *eitFilter; cEitFilter *eitFilter;
cPatFilter *patFilter; cPatFilter *patFilter;
cSdtFilter *sdtFilter; cSdtFilter *sdtFilter;
cNitFilter *nitFilter;
protected: protected:
void StartSectionHandler(void); void StartSectionHandler(void);
///< A derived device that provides section data must call ///< A derived device that provides section data must call

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: eitscan.c 1.17 2004/01/10 16:50:51 kls Exp $ * $Id: eitscan.c 1.18 2004/01/11 15:50:59 kls Exp $
*/ */
#include "eitscan.h" #include "eitscan.h"
@ -23,7 +23,7 @@ public:
virtual bool operator< (const cListObject &ListObject); virtual bool operator< (const cListObject &ListObject);
int Source(void) { return source; } int Source(void) { return source; }
int Transponder(void) { return transponder; } int Transponder(void) { return transponder; }
cChannel *GetChannel(void); cChannel *GetChannel(cList<cChannel> *Channels);
}; };
cScanData::cScanData(int Source, int Transponder) cScanData::cScanData(int Source, int Transponder)
@ -38,10 +38,9 @@ bool cScanData::operator< (const cListObject &ListObject)
return source < sd->source || source == sd->source && transponder < sd->transponder; return source < sd->source || source == sd->source && transponder < sd->transponder;
} }
//XXX this might be done differently later... cChannel *cScanData::GetChannel(cList<cChannel> *Channels)
cChannel *cScanData::GetChannel(void)
{ {
for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) { for (cChannel *Channel = Channels->First(); Channel; Channel = Channels->Next(Channel)) {
if (!Channel->GroupSep() && Channel->Source() == source && ISTRANSPONDER(Channel->Transponder(), transponder)) if (!Channel->GroupSep() && Channel->Source() == source && ISTRANSPONDER(Channel->Transponder(), transponder))
return Channel; return Channel;
} }
@ -52,13 +51,13 @@ cChannel *cScanData::GetChannel(void)
class cScanList : public cList<cScanData> { class cScanList : public cList<cScanData> {
public: public:
cScanList(void); cScanList(cList<cChannel> *Channels);
void AddTransponder(const cChannel *Channel); void AddTransponder(const cChannel *Channel);
}; };
cScanList::cScanList(void) cScanList::cScanList(cList<cChannel> *Channels)
{ {
for (cChannel *ch = Channels.First(); ch; ch = Channels.Next(ch)) for (cChannel *ch = Channels->First(); ch; ch = Channels->Next(ch))
AddTransponder(ch); AddTransponder(ch);
Sort(); Sort();
} }
@ -66,12 +65,30 @@ cScanList::cScanList(void)
void cScanList::AddTransponder(const cChannel *Channel) void cScanList::AddTransponder(const cChannel *Channel)
{ {
for (cScanData *sd = First(); sd; sd = Next(sd)) { for (cScanData *sd = First(); sd; sd = Next(sd)) {
if (sd->Source() == Channel->Source() && sd->Transponder() == Channel->Transponder()) if (sd->Source() == Channel->Source() && ISTRANSPONDER(sd->Transponder(), Channel->Transponder()))
return; return;
} }
Add(new cScanData(Channel->Source(), Channel->Transponder())); Add(new cScanData(Channel->Source(), Channel->Transponder()));
} }
// --- cTransponderList ------------------------------------------------------
class cTransponderList : public cList<cChannel> {
public:
void AddTransponder(cChannel *Channel);
};
void cTransponderList::AddTransponder(cChannel *Channel)
{
for (cChannel *ch = First(); ch; ch = Next(ch)) {
if (ch->Source() == Channel->Source() && ch->Transponder() == Channel->Transponder()) {
delete Channel;
return;
}
}
Add(Channel);
}
// --- cEITScanner ----------------------------------------------------------- // --- cEITScanner -----------------------------------------------------------
cEITScanner EITScanner; cEITScanner EITScanner;
@ -81,13 +98,22 @@ cEITScanner::cEITScanner(void)
lastScan = lastActivity = time(NULL); lastScan = lastActivity = time(NULL);
currentDevice = NULL; currentDevice = NULL;
currentChannel = 0; currentChannel = 0;
memset(lastChannel, 0, sizeof(lastChannel)); numScan = 0;
scanList = NULL; scanList = NULL;
transponderList = NULL;
} }
cEITScanner::~cEITScanner() cEITScanner::~cEITScanner()
{ {
delete scanList; delete scanList;
delete transponderList;
}
void cEITScanner::AddTransponder(cChannel *Channel)
{
if (!transponderList)
transponderList = new cTransponderList;
transponderList->AddTransponder(Channel);
} }
void cEITScanner::Activity(void) void cEITScanner::Activity(void)
@ -105,8 +131,11 @@ void cEITScanner::Process(void)
time_t now = time(NULL); time_t now = time(NULL);
if (now - lastScan > ScanTimeout && now - lastActivity > ActivityTimeout) { if (now - lastScan > ScanTimeout && now - lastActivity > ActivityTimeout) {
if (Channels.Lock(false, 10)) { if (Channels.Lock(false, 10)) {
cList<cChannel> *ChannelList = &Channels;
if (numScan % 2 == 0 && transponderList) // switch between the list of new transponders and the actual channels in case there are transponders w/o any channels
ChannelList = transponderList;
if (!scanList) if (!scanList)
scanList = new cScanList(); scanList = new cScanList(ChannelList);
for (bool AnyDeviceSwitched = false; !AnyDeviceSwitched; ) { for (bool AnyDeviceSwitched = false; !AnyDeviceSwitched; ) {
cScanData *ScanData = NULL; cScanData *ScanData = NULL;
for (int i = 0; i < cDevice::NumDevices(); i++) { for (int i = 0; i < cDevice::NumDevices(); i++) {
@ -115,7 +144,7 @@ void cEITScanner::Process(void)
if (Device) { if (Device) {
if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) { if (Device != cDevice::PrimaryDevice() || (cDevice::NumDevices() == 1 && Setup.EPGScanTimeout && now - lastActivity > Setup.EPGScanTimeout * 3600)) {
if (!(Device->Receiving(true) || Device->Replaying())) { if (!(Device->Receiving(true) || Device->Replaying())) {
cChannel *Channel = ScanData->GetChannel(); cChannel *Channel = ScanData->GetChannel(ChannelList);
if (Channel) { if (Channel) {
//XXX if (Device->ProvidesTransponder(Channel)) { //XXX if (Device->ProvidesTransponder(Channel)) {
if ((!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) && Device->ProvidesTransponder(Channel)) { //XXX temporary for the 'sky' plugin if ((!Channel->Ca() || Channel->Ca() == Device->DeviceNumber() + 1 || Channel->Ca() >= 0x0100) && Device->ProvidesTransponder(Channel)) { //XXX temporary for the 'sky' plugin
@ -143,6 +172,11 @@ void cEITScanner::Process(void)
if (!scanList->Count()) { if (!scanList->Count()) {
delete scanList; delete scanList;
scanList = NULL; scanList = NULL;
numScan++;
if (ChannelList == transponderList) {
delete transponderList;
transponderList = NULL;
}
break; break;
} }
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: eitscan.h 1.5 2004/01/03 13:08:39 kls Exp $ * $Id: eitscan.h 1.6 2004/01/11 14:11:25 kls Exp $
*/ */
#ifndef __EITSCAN_H #ifndef __EITSCAN_H
@ -14,6 +14,7 @@
#include "config.h" #include "config.h"
class cScanList; class cScanList;
class cTransponderList;
class cEITScanner { class cEITScanner {
private: private:
@ -23,13 +24,15 @@ private:
time_t lastScan, lastActivity; time_t lastScan, lastActivity;
cDevice *currentDevice; cDevice *currentDevice;
int currentChannel; int currentChannel;
int lastChannel[MAXDEVICES]; int numScan;
cScanList *scanList; cScanList *scanList;
cTransponderList *transponderList;
public: public:
cEITScanner(void); cEITScanner(void);
~cEITScanner(); ~cEITScanner();
bool Active(void) { return currentChannel; } bool Active(void) { return currentChannel; }
bool UsesDevice(const cDevice *Device) { return currentDevice == Device; } bool UsesDevice(const cDevice *Device) { return currentDevice == Device; }
void AddTransponder(cChannel *Channel);
void Activity(void); void Activity(void);
void Process(void); void Process(void);
}; };

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: filter.c 1.3 2004/01/10 10:02:06 kls Exp $ * $Id: filter.c 1.4 2004/01/11 13:31:34 kls Exp $
*/ */
#include "filter.h" #include "filter.h"
@ -96,6 +96,11 @@ int cFilter::Transponder(void)
return sectionHandler ? sectionHandler->Transponder() : 0; return sectionHandler ? sectionHandler->Transponder() : 0;
} }
const cChannel *cFilter::Channel(void)
{
return sectionHandler ? sectionHandler->Channel() : NULL;
}
void cFilter::SetStatus(bool On) void cFilter::SetStatus(bool On)
{ {
if (sectionHandler && on != On) { if (sectionHandler && on != On) {

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: filter.h 1.2 2004/01/05 14:29:49 kls Exp $ * $Id: filter.h 1.3 2004/01/11 13:31:59 kls Exp $
*/ */
#ifndef __FILTER_H #ifndef __FILTER_H
@ -35,6 +35,7 @@ public:
bool Matches(u_short Pid, u_char Tid); bool Matches(u_short Pid, u_char Tid);
}; };
class cChannel;
class cSectionHandler; class cSectionHandler;
class cFilter : public cListObject { class cFilter : public cListObject {
@ -69,6 +70,8 @@ protected:
///< Returns the source of the data delivered to this filter. ///< Returns the source of the data delivered to this filter.
int Transponder(void); int Transponder(void);
///< Returns the transponder of the data delivered to this filter. ///< Returns the transponder of the data delivered to this filter.
const cChannel *Channel(void);
///< Returns the channel of the data delivered to this filter.
bool Matches(u_short Pid, u_char Tid); bool Matches(u_short Pid, u_char Tid);
///< Indicates whether this filter wants to receive data from the given Pid/Tid. ///< Indicates whether this filter wants to receive data from the given Pid/Tid.
void Set(u_short Pid, u_char Tid, u_char Mask = 0xFF); void Set(u_short Pid, u_char Tid, u_char Mask = 0xFF);

19
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: i18n.c 1.139 2004/01/09 15:48:03 kls Exp $ * $Id: i18n.c 1.140 2004/01/11 15:38:45 kls Exp $
* *
* Translations provided by: * Translations provided by:
* *
@ -2381,6 +2381,23 @@ const tI18nPhrase Phrases[] = {
"",// TODO "",// TODO
"",// TODO "",// TODO
}, },
{ "add new transponders",
"neue Transponder hinzufügen",
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
},
{ "Setup.LNB$SLOF (MHz)", { "Setup.LNB$SLOF (MHz)",
"SLOF (MHz)", "SLOF (MHz)",
"Frekvenca preklopa (MHz)", "Frekvenca preklopa (MHz)",

7
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.278 2004/01/09 15:42:59 kls Exp $ * $Id: menu.c 1.279 2004/01/11 15:40:32 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -2112,7 +2112,7 @@ eOSState cMenuSetupEPG::ProcessKey(eKeys Key)
class cMenuSetupDVB : public cMenuSetupBase { class cMenuSetupDVB : public cMenuSetupBase {
private: private:
const char *updateChannelsTexts[4]; const char *updateChannelsTexts[5];
public: public:
cMenuSetupDVB(void); cMenuSetupDVB(void);
virtual eOSState ProcessKey(eKeys Key); virtual eOSState ProcessKey(eKeys Key);
@ -2124,11 +2124,12 @@ cMenuSetupDVB::cMenuSetupDVB(void)
updateChannelsTexts[1] = tr("names only"); updateChannelsTexts[1] = tr("names only");
updateChannelsTexts[2] = tr("names and PIDs"); updateChannelsTexts[2] = tr("names and PIDs");
updateChannelsTexts[3] = tr("add new channels"); updateChannelsTexts[3] = tr("add new channels");
updateChannelsTexts[4] = tr("add new transponders");
SetSection(tr("DVB")); SetSection(tr("DVB"));
Add(new cMenuEditIntItem( tr("Setup.DVB$Primary DVB interface"), &data.PrimaryDVB, 1, cDevice::NumDevices())); Add(new cMenuEditIntItem( tr("Setup.DVB$Primary DVB interface"), &data.PrimaryDVB, 1, cDevice::NumDevices()));
Add(new cMenuEditBoolItem(tr("Setup.DVB$Video format"), &data.VideoFormat, "4:3", "16:9")); Add(new cMenuEditBoolItem(tr("Setup.DVB$Video format"), &data.VideoFormat, "4:3", "16:9"));
Add(new cMenuEditStraItem(tr("Setup.DVB$Update channels"), &data.UpdateChannels, 4, updateChannelsTexts)); Add(new cMenuEditStraItem(tr("Setup.DVB$Update channels"), &data.UpdateChannels, 5, updateChannelsTexts));
} }
eOSState cMenuSetupDVB::ProcessKey(eKeys Key) eOSState cMenuSetupDVB::ProcessKey(eKeys Key)

139
nit.c Normal file
View File

@ -0,0 +1,139 @@
/*
* nit.c: NIT section filter
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: nit.c 1.1 2004/01/11 15:42:51 kls Exp $
*/
#include "nit.h"
#include <linux/dvb/frontend.h>
#include "channels.h"
#include "eitscan.h"
#include "libsi/section.h"
#include "libsi/descriptor.h"
#include "tools.h"
cNitFilter::cNitFilter(void)
{
Set(0x10, 0x40); // NIT
}
void cNitFilter::SetStatus(bool On)
{
cFilter::SetStatus(On);
sectionSyncer.Reset();
}
void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
{
SI::NIT nit(Data, false);
if (!nit.CheckCRCAndParse())
return;
if (!sectionSyncer.Sync(nit.getVersionNumber(), nit.getSectionNumber(), nit.getLastSectionNumber()))
return;
if (!Channels.Lock(true, 10))
return;
for (SI::Loop::Iterator it; nit.transportStreamLoop.hasNext(it); ) {
SI::NIT::TransportStream ts = nit.transportStreamLoop.getNext(it);
SI::Descriptor *d;
for (SI::Loop::Iterator it2; (d = ts.transportStreamDescriptors.getNext(it2)); ) {
switch (d->getDescriptorTag()) {
case SI::SatelliteDeliverySystemDescriptorTag: {
SI::SatelliteDeliverySystemDescriptor *sd = (SI::SatelliteDeliverySystemDescriptor *)d;
int Source = cSource::FromData(cSource::stSat, BCD2INT(sd->getOrbitalPosition()), sd->getWestEastFlag());
int Frequency = BCD2INT(sd->getFrequency()) / 100;
static char Polarizations[] = { 'h', 'v', 'l', 'r' };
char Polarization = Polarizations[sd->getPolarization()];
static int CodeRates[] = { FEC_NONE, FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE };
int CodeRate = CodeRates[sd->getFecInner()];
int SymbolRate = BCD2INT(sd->getSymbolRate()) / 10;
bool found = false;
for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) {
if (!Channel->GroupSep() && Channel->Source() == Source && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) {
if (Setup.UpdateChannels >= 4)
Channel->SetSatTransponderData(Source, Frequency, Polarization, SymbolRate, CodeRate);
found = true;
}
}
if (!found && Setup.UpdateChannels >= 4) {
cChannel *Channel = new cChannel;
Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0, false);
if (Channel->SetSatTransponderData(Source, Frequency, Polarization, SymbolRate, CodeRate, false))
EITScanner.AddTransponder(Channel);
else
delete Channel;
}
}
break;
case SI::CableDeliverySystemDescriptorTag: {
SI::CableDeliverySystemDescriptor *sd = (SI::CableDeliverySystemDescriptor *)d;
int Source = cSource::FromData(cSource::stCable);
int Frequency = BCD2INT(sd->getFrequency()) / 10;
//XXX FEC_outer???
static int CodeRates[] = { FEC_NONE, FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE, FEC_NONE };
int CodeRate = CodeRates[sd->getFecInner()];
static int Modulations[] = { QPSK, QAM_16, QAM_32, QAM_64, QAM_128, QAM_256 };
int Modulation = Modulations[sd->getModulation()];
int SymbolRate = BCD2INT(sd->getSymbolRate()) / 10;
bool found = false;
for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) {
if (!Channel->GroupSep() && Channel->Source() == Source && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) {
if (Setup.UpdateChannels >= 4)
Channel->SetCableTransponderData(Source, Frequency, Modulation, SymbolRate, CodeRate);
found = true;
}
}
if (!found && Setup.UpdateChannels >= 4) {
cChannel *Channel = new cChannel;
Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0, false);
if (Channel->SetCableTransponderData(Source, Frequency, Modulation, SymbolRate, CodeRate, false))
EITScanner.AddTransponder(Channel);
else
delete Channel;
}
}
break;
case SI::TerrestrialDeliverySystemDescriptorTag: {
SI::TerrestrialDeliverySystemDescriptor *sd = (SI::TerrestrialDeliverySystemDescriptor *)d;
int Source = cSource::FromData(cSource::stCable);
int Frequency = sd->getFrequency() * 10;
static int Bandwidths[] = { BANDWIDTH_6_MHZ, BANDWIDTH_7_MHZ, BANDWIDTH_8_MHZ, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO };
int Bandwidth = Bandwidths[sd->getBandwidth()];
static int Constellations[] = { QPSK, QAM_16, QAM_64, QAM_AUTO };
int Constellation = Constellations[sd->getConstellation()];
static int Hierarchies[] = { HIERARCHY_NONE, HIERARCHY_1, HIERARCHY_2, HIERARCHY_4 };
int Hierarchy = Hierarchies[sd->getHierarchy()];
static int CodeRates[] = { FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8, FEC_NONE, FEC_NONE, FEC_NONE };
int CodeRateHP = CodeRates[sd->getCodeRateHP()];
int CodeRateLP = CodeRates[sd->getCodeRateLP()];
static int GuardIntervals[] = { GUARD_INTERVAL_1_4, GUARD_INTERVAL_1_8, GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_32 };
int GuardInterval = GuardIntervals[sd->getGuardInterval()];
static int TransmissionModes[] = { TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, TRANSMISSION_MODE_AUTO, TRANSMISSION_MODE_AUTO };
int TransmissionMode = TransmissionModes[sd->getTransmissionMode()];
bool found = false;
for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) {
if (!Channel->GroupSep() && Channel->Source() == Source && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) {
if (Setup.UpdateChannels >= 4)
Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode);
found = true;
}
}
if (!found && Setup.UpdateChannels >= 4) {
cChannel *Channel = new cChannel;
Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0, false);
if (Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode, false))
EITScanner.AddTransponder(Channel);
else
delete Channel;
}
}
break;
default: ;
}
delete d;
}
}
Channels.Unlock();
}

25
nit.h Normal file
View File

@ -0,0 +1,25 @@
/*
* nit.h: NIT section filter
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: nit.h 1.1 2004/01/11 14:31:05 kls Exp $
*/
#ifndef __NIT_H
#define __NIT_H
#include "filter.h"
class cNitFilter : public cFilter {
private:
cSectionSyncer sectionSyncer;
protected:
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
public:
cNitFilter(void);
virtual void SetStatus(bool On);
};
#endif //__NIT_H

22
sdt.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: sdt.c 1.3 2004/01/05 14:30:31 kls Exp $ * $Id: sdt.c 1.4 2004/01/11 14:28:28 kls Exp $
*/ */
#include "sdt.h" #include "sdt.h"
@ -42,9 +42,9 @@ void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
for (SI::Loop::Iterator it; sdt.serviceLoop.hasNext(it); ) { for (SI::Loop::Iterator it; sdt.serviceLoop.hasNext(it); ) {
SiSdtService = sdt.serviceLoop.getNext(it); SiSdtService = sdt.serviceLoop.getNext(it);
cChannel *Channel = Channels.GetByChannelID(tChannelID(Source(), sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId())); cChannel *channel = Channels.GetByChannelID(tChannelID(Source(), sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId()));
if (!Channel) if (!channel)
Channel = Channels.GetByChannelID(tChannelID(Source(), 0, Transponder(), SiSdtService.getServiceId())); channel = Channels.GetByChannelID(tChannelID(Source(), 0, Transponder(), SiSdtService.getServiceId()));
SI::Descriptor *d; SI::Descriptor *d;
for (SI::Loop::Iterator it2; (d = SiSdtService.serviceDescriptors.getNext(it2)); ) { for (SI::Loop::Iterator it2; (d = SiSdtService.serviceDescriptors.getNext(it2)); ) {
@ -83,18 +83,18 @@ void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
strcpy(ps, NameBuf); strcpy(ps, NameBuf);
pn = ShortNameBuf; pn = ShortNameBuf;
} }
if (Channel) { if (channel) {
Channel->SetId(sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId()); channel->SetId(sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId());
if (Setup.UpdateChannels >= 1) if (Setup.UpdateChannels >= 1)
Channel->SetName(pn); channel->SetName(pn);
// Using SiSdtService.getFreeCaMode() is no good, because some // Using SiSdtService.getFreeCaMode() is no good, because some
// tv stations set this flag even for non-encrypted channels :-( // tv stations set this flag even for non-encrypted channels :-(
// The special value 0xFFFF was supposed to mean "unknown encryption" // The special value 0xFFFF was supposed to mean "unknown encryption"
// and would have been overwritten with real CA values later: // and would have been overwritten with real CA values later:
// Channel->SetCa(SiSdtService.getFreeCaMode() ? 0xFFFF : 0); // channel->SetCa(SiSdtService.getFreeCaMode() ? 0xFFFF : 0);
} }
else if (*pn && Setup.UpdateChannels >= 3) { else if (*pn && Setup.UpdateChannels >= 3) {
Channel = Channels.NewChannel(Source(), Transponder(), pn, sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId()); channel = Channels.NewChannel(Channel(), pn, sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId());
patFilter->Trigger(); patFilter->Trigger();
} }
} }
@ -106,9 +106,9 @@ void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
/* /*
case SI::CaIdentifierDescriptorTag: { case SI::CaIdentifierDescriptorTag: {
SI::CaIdentifierDescriptor *cid = (SI::CaIdentifierDescriptor *)d; SI::CaIdentifierDescriptor *cid = (SI::CaIdentifierDescriptor *)d;
if (Channel) { if (channel) {
for (SI::Loop::Iterator it; cid->identifiers.hasNext(it); ) for (SI::Loop::Iterator it; cid->identifiers.hasNext(it); )
Channel->SetCa(cid->identifiers.getNext(it)); channel->SetCa(cid->identifiers.getNext(it));
} }
} }
break; break;

View File

@ -4,11 +4,12 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: sections.c 1.3 2004/01/10 11:45:42 kls Exp $ * $Id: sections.c 1.4 2004/01/11 13:22:13 kls Exp $
*/ */
#include "sections.h" #include "sections.h"
#include <unistd.h> #include <unistd.h>
#include "channels.h"
#include "device.h" #include "device.h"
// --- cFilterHandle---------------------------------------------------------- // --- cFilterHandle----------------------------------------------------------
@ -28,15 +29,21 @@ cFilterHandle::cFilterHandle(const cFilterData &FilterData)
used = 0; used = 0;
} }
// --- cSectionHandlerPrivate ------------------------------------------------
class cSectionHandlerPrivate {
public:
cChannel channel;
};
// --- cSectionHandler ------------------------------------------------------- // --- cSectionHandler -------------------------------------------------------
cSectionHandler::cSectionHandler(cDevice *Device) cSectionHandler::cSectionHandler(cDevice *Device)
:cThread("Section handler") :cThread("Section handler")
{ {
shp = new cSectionHandlerPrivate;
device = Device; device = Device;
active = false; active = false;
source = 0;
transponder = 0;
statusCount = 0; statusCount = 0;
on = false; on = false;
lastIncompleteSection = 0; lastIncompleteSection = 0;
@ -50,6 +57,22 @@ cSectionHandler::~cSectionHandler()
cFilter *fi; cFilter *fi;
while ((fi = filters.First()) != NULL) while ((fi = filters.First()) != NULL)
Detach(fi); Detach(fi);
delete shp;
}
int cSectionHandler::Source(void)
{
return shp->channel.Source();
}
int cSectionHandler::Transponder(void)
{
return shp->channel.Transponder();
}
const cChannel *cSectionHandler::Channel(void)
{
return &shp->channel;
} }
void cSectionHandler::Add(const cFilterData *FilterData) void cSectionHandler::Add(const cFilterData *FilterData)
@ -107,11 +130,10 @@ void cSectionHandler::Detach(cFilter *Filter)
Unlock(); Unlock();
} }
void cSectionHandler::SetSource(int Source, int Transponder) void cSectionHandler::SetChannel(const cChannel *Channel)
{ {
Lock(); Lock();
source = Source; shp->channel = Channel? *Channel : cChannel();
transponder = Transponder;
Unlock(); Unlock();
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: sections.h 1.2 2004/01/10 11:42:49 kls Exp $ * $Id: sections.h 1.3 2004/01/11 13:18:38 kls Exp $
*/ */
#ifndef __SECTIONS_H #ifndef __SECTIONS_H
@ -16,15 +16,16 @@
#include "tools.h" #include "tools.h"
class cDevice; class cDevice;
class cChannel;
class cFilterHandle; class cFilterHandle;
class cSectionHandlerPrivate;
class cSectionHandler : public cThread { class cSectionHandler : public cThread {
friend class cFilter; friend class cFilter;
private: private:
cSectionHandlerPrivate *shp;
cDevice *device; cDevice *device;
bool active; bool active;
int source;
int transponder;
int statusCount; int statusCount;
bool on; bool on;
time_t lastIncompleteSection; time_t lastIncompleteSection;
@ -36,11 +37,12 @@ private:
public: public:
cSectionHandler(cDevice *Device); cSectionHandler(cDevice *Device);
virtual ~cSectionHandler(); virtual ~cSectionHandler();
int Source(void) { return source; } int Source(void);
int Transponder(void) { return transponder; } int Transponder(void);
const cChannel *Channel(void);
void Attach(cFilter *Filter); void Attach(cFilter *Filter);
void Detach(cFilter *Filter); void Detach(cFilter *Filter);
void SetSource(int Source, int Transponder); void SetChannel(const cChannel *Channel);
void SetStatus(bool On); void SetStatus(bool On);
}; };

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: sources.c 1.1 2002/10/06 09:27:10 kls Exp $ * $Id: sources.c 1.2 2004/01/11 10:36:57 kls Exp $
*/ */
#include "sources.h" #include "sources.h"
@ -90,6 +90,17 @@ int cSource::FromString(const char *s)
return code; return code;
} }
int cSource::FromData(eSourceType SourceType, int Position, bool East)
{
int code = SourceType;
if (SourceType == stSat) {
if (East)
code |= st_Neg;
code |= (Position & st_Pos);;
}
return code;
}
// -- cSources --------------------------------------------------------------- // -- cSources ---------------------------------------------------------------
cSources Sources; cSources Sources;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: sources.h 1.1 2002/10/04 14:25:03 kls Exp $ * $Id: sources.h 1.2 2004/01/11 10:35:36 kls Exp $
*/ */
#ifndef __SOURCES_H #ifndef __SOURCES_H
@ -21,6 +21,7 @@ public:
stTerr = 0xC000, stTerr = 0xC000,
st_Mask = 0xC000, st_Mask = 0xC000,
st_Neg = 0x0800, st_Neg = 0x0800,
st_Pos = 0x07FF,
}; };
private: private:
int code; int code;
@ -33,6 +34,7 @@ public:
bool Parse(const char *s); bool Parse(const char *s);
static const char *ToString(int Code); static const char *ToString(int Code);
static int FromString(const char *s); static int FromString(const char *s);
static int FromData(eSourceType SourceType, int Position = 0, bool East = false);
}; };
class cSources : public cConfig<cSource> { class cSources : public cConfig<cSource> {

10
tools.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: tools.c 1.77 2003/04/06 15:31:45 kls Exp $ * $Id: tools.c 1.78 2004/01/11 15:42:30 kls Exp $
*/ */
#include "tools.h" #include "tools.h"
@ -20,6 +20,14 @@
int SysLogLevel = 3; int SysLogLevel = 3;
int BCD2INT(int x)
{
return ((1000000 * BCDCHARTOINT((x >> 24) & 0xFF)) +
(10000 * BCDCHARTOINT((x >> 16) & 0xFF)) +
(100 * BCDCHARTOINT((x >> 8) & 0xFF)) +
BCDCHARTOINT( x & 0xFF));
}
ssize_t safe_read(int filedes, void *buffer, size_t size) ssize_t safe_read(int filedes, void *buffer, size_t size)
{ {
for (;;) { for (;;) {

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: tools.h 1.54 2002/12/15 14:59:53 kls Exp $ * $Id: tools.h 1.55 2004/01/11 15:42:15 kls Exp $
*/ */
#ifndef __TOOLS_H #ifndef __TOOLS_H
@ -52,6 +52,9 @@ template<class T> inline int sgn(T a) { return a < 0 ? -1 : a > 0 ? 1 : 0; }
template<class T> inline void swap(T &a, T &b) { T t = a; a = b; b = t; } template<class T> inline void swap(T &a, T &b) { T t = a; a = b; b = t; }
#endif #endif
#define BCDCHARTOINT(x) (10 * ((x & 0xF0) >> 4) + (x & 0xF))
int BCD2INT(int x);
ssize_t safe_read(int filedes, void *buffer, size_t size); ssize_t safe_read(int filedes, void *buffer, size_t size);
ssize_t safe_write(int filedes, const void *buffer, size_t size); ssize_t safe_write(int filedes, const void *buffer, size_t size);
void writechar(int filedes, char c); void writechar(int filedes, char c);