|
SASC-NG
DVBSoftCAM
|
00001 #include "include/vdr/channels.h" 00002 #include "include/vdr/device.h" 00003 #include <ctype.h> 00004 #include <linux/dvb/ca.h> 00005 int cChannel::Transponder() const 00006 { 00007 int tf = frequency; 00008 while (tf > 20000) 00009 tf /= 1000; 00010 if (IsSat()) 00011 tf = Transponder(tf, polarization); 00012 return tf; 00013 } 00014 int cChannel::Transponder(int Frequency, char Polarization) 00015 { 00016 // some satellites have transponders at the same frequency, just with different polarization: 00017 switch (tolower(Polarization)) { 00018 case 'h': Frequency += 100000; break; 00019 case 'v': Frequency += 200000; break; 00020 case 'l': Frequency += 300000; break; 00021 case 'r': Frequency += 400000; break; 00022 } 00023 return Frequency; 00024 } 00025 cChannel* cChannels::GetByNumber(int a, int b) { 00026 cChannel *ch = new cChannel; 00027 ch->SetId(0,0,a); 00028 return ch; 00029 } 00030 void cChannel::SetId(int Nid, int Tid, int Sid, int Rid) { 00031 sid = Sid; 00032 tid = Tid; 00033 } 00034 bool cChannel::SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH) { 00035 source = Source; 00036 frequency = Frequency; 00037 polarization = Polarization; 00038 srate = Srate; 00039 coderateH = CoderateH; 00040 return true; 00041 } 00042 bool cChannel::SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH) 00043 { 00044 source = Source; 00045 frequency = Frequency; 00046 modulation = Modulation; 00047 srate = Srate; 00048 coderateH = CoderateH; 00049 return true; 00050 } 00051 void cChannel::SetPids(int Vpid, int Ppid, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int Tpid) 00052 { 00053 vpid = Vpid; 00054 ppid = Ppid; 00055 tpid = Tpid; 00056 for (int i = 0; i < MAXAPIDS; i++) 00057 apids[i] = Apids[i]; 00058 apids[MAXAPIDS] = 0; 00059 for (int i = 0; i < MAXDPIDS; i++) { 00060 dpids[i] = Dpids[i]; 00061 } 00062 dpids[MAXDPIDS] = 0; 00063 } 00064 00065 cChannel::cChannel() { 00066 caids[0]=0x0101; 00067 caids[1]=0; 00068 source=1; 00069 sid=1; 00070 groupSep=0; 00071 } 00072 cChannel::~cChannel() { 00073 }