SASC-NG
DVBSoftCAM

cChannel Class Reference

#include <channels.h>

Inheritance diagram for cChannel:

List of all members.

Public Member Functions

 cChannel (void)
 cChannel (const cChannel &Channel)
 ~cChannel ()
cChannel & operator= (const cChannel &Channel)
cString ToText (void) const
bool Parse (const char *s)
bool Save (FILE *f)
const char * Name (void) const
const char * ShortName (bool OrName=false) const
const char * Provider (void) const
const char * PortalName (void) const
int Frequency (void) const
 Returns the actual frequency, as given in 'channels.conf'.
int Transponder (void) const
 Returns the transponder frequency in MHz, plus the polarization in case of sat.
int Source (void) const
int Srate (void) const
int Vpid (void) const
int Ppid (void) const
const int * Apids (void) const
const int * Dpids (void) const
const int * Spids (void) const
int Apid (int i) const
int Dpid (int i) const
int Spid (int i) const
const char * Alang (int i) const
const char * Dlang (int i) const
const char * Slang (int i) const
int Tpid (void) const
const int * Caids (void) const
int Ca (int Index=0) const
int Nid (void) const
int Tid (void) const
int Sid (void) const
int Rid (void) const
int Number (void) const
void SetNumber (int Number)
bool GroupSep (void) const
char Polarization (void) const
int Inversion (void) const
int Bandwidth (void) const
int CoderateH (void) const
int CoderateL (void) const
int Modulation (void) const
int Transmission (void) const
int Guard (void) const
int Hierarchy (void) const
const cLinkChannels * LinkChannels (void) const
const cChannel * RefChannel (void) const
bool IsCable (void) const
bool IsSat (void) const
bool IsTerr (void) const
tChannelID GetChannelID (void) const
bool HasTimer (void) const
int Modification (int Mask=CHANNELMOD_ALL)
void CopyTransponderData (const cChannel *Channel)
bool SetSatTransponderData (int Source, int Frequency, char Polarization, int Srate, int CoderateH)
bool SetCableTransponderData (int Source, int Frequency, int Modulation, int Srate, int CoderateH)
bool SetTerrTransponderData (int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission)
void SetId (int Nid, int Tid, int Sid, int Rid=0)
void SetName (const char *Name, const char *ShortName, const char *Provider)
void SetPortalName (const char *PortalName)
void SetPids (int Vpid, int Ppid, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int Tpid)
void SetCaIds (const int *CaIds)
void SetCaDescriptors (int Level)
void SetLinkChannels (cLinkChannels *LinkChannels)
void SetRefChannel (cChannel *RefChannel)

Static Public Member Functions

static int Transponder (int Frequency, char Polarization)
 builds the transponder from the given Frequency and Polarization

Friends

class cSchedules
class cMenuEditChannel

Detailed Description

Definition at line 108 of file channels.h.


Constructor & Destructor Documentation

cChannel::cChannel ( void  )

Definition at line 65 of file misc.cpp.

                   {
  caids[0]=0x0101;
  caids[1]=0;
  source=1;
  sid=1;
  groupSep=0;
}
cChannel::cChannel ( const cChannel &  Channel)
cChannel::~cChannel ( )

Definition at line 72 of file misc.cpp.

                    {
}

Member Function Documentation

const char* cChannel::Alang ( int  i) const [inline]

Definition at line 178 of file channels.h.

References i, and MAXAPIDS.

{ return (0 <= i && i < MAXAPIDS) ? alangs[i] : ""; }
int cChannel::Apid ( int  i) const [inline]

Definition at line 175 of file channels.h.

References i, and MAXAPIDS.

{ return (0 <= i && i < MAXAPIDS) ? apids[i] : 0; }
const int* cChannel::Apids ( void  ) const [inline]

Definition at line 172 of file channels.h.

{ return apids; }
int cChannel::Bandwidth ( void  ) const [inline]

Definition at line 193 of file channels.h.

{ return bandwidth; }
int cChannel::Ca ( int  Index = 0) const [inline]

Definition at line 183 of file channels.h.

References cListObject::Index(), and MAXCAIDS.

Referenced by SCDEVICE::SetChannelDevice().

{ return Index < MAXCAIDS ? caids[Index] : 0; }
const int* cChannel::Caids ( void  ) const [inline]

Definition at line 182 of file channels.h.

Referenced by cChannelCaids::cChannelCaids().

{ return caids; }
int cChannel::CoderateH ( void  ) const [inline]

Definition at line 194 of file channels.h.

Referenced by SetCableTransponderData(), and SetSatTransponderData().

{ return coderateH; }
int cChannel::CoderateL ( void  ) const [inline]

Definition at line 195 of file channels.h.

{ return coderateL; }
void cChannel::CopyTransponderData ( const cChannel *  Channel)
const char* cChannel::Dlang ( int  i) const [inline]

Definition at line 179 of file channels.h.

References i, and MAXDPIDS.

{ return (0 <= i && i < MAXDPIDS) ? dlangs[i] : ""; }
int cChannel::Dpid ( int  i) const [inline]

Definition at line 176 of file channels.h.

References i, and MAXDPIDS.

{ return (0 <= i && i < MAXDPIDS) ? dpids[i] : 0; }
const int* cChannel::Dpids ( void  ) const [inline]

Definition at line 173 of file channels.h.

{ return dpids; }
int cChannel::Frequency ( void  ) const [inline]

Returns the actual frequency, as given in 'channels.conf'.

Definition at line 165 of file channels.h.

Referenced by SetCableTransponderData(), SetSatTransponderData(), and Transponder().

tChannelID cChannel::GetChannelID ( void  ) const [inline]

Definition at line 205 of file channels.h.

References Transponder().

{ return tChannelID(source, nid, (nid || tid) ? tid : Transponder(), sid, rid); }
bool cChannel::GroupSep ( void  ) const [inline]

Definition at line 190 of file channels.h.

{ return groupSep; }
int cChannel::Guard ( void  ) const [inline]

Definition at line 198 of file channels.h.

{ return guard; }
bool cChannel::HasTimer ( void  ) const
int cChannel::Hierarchy ( void  ) const [inline]

Definition at line 199 of file channels.h.

{ return hierarchy; }
int cChannel::Inversion ( void  ) const [inline]

Definition at line 192 of file channels.h.

{ return inversion; }
bool cChannel::IsCable ( void  ) const [inline]

Definition at line 202 of file channels.h.

{ return cSource::IsCable(source); }
bool cChannel::IsSat ( void  ) const [inline]

Definition at line 203 of file channels.h.

Referenced by Transponder().

{ return cSource::IsSat(source); }
bool cChannel::IsTerr ( void  ) const [inline]

Definition at line 204 of file channels.h.

{ return cSource::IsTerr(source); }
const cLinkChannels* cChannel::LinkChannels ( void  ) const [inline]

Definition at line 200 of file channels.h.

{ return linkChannels; }
int cChannel::Modification ( int  Mask = CHANNELMOD_ALL)
int cChannel::Modulation ( void  ) const [inline]

Definition at line 196 of file channels.h.

Referenced by SetCableTransponderData().

{ return modulation; }
const char* cChannel::Name ( void  ) const [inline]

Definition at line 161 of file channels.h.

{ return name; }
int cChannel::Nid ( void  ) const [inline]

Definition at line 184 of file channels.h.

{ return nid; }
int cChannel::Number ( void  ) const [inline]

Definition at line 188 of file channels.h.

Referenced by cDevice::SetCurrentChannel(), and SetNumber().

{ return number; }
cChannel& cChannel::operator= ( const cChannel &  Channel)
bool cChannel::Parse ( const char *  s)
char cChannel::Polarization ( void  ) const [inline]

Definition at line 191 of file channels.h.

Referenced by SetSatTransponderData().

{ return polarization; }
const char* cChannel::PortalName ( void  ) const [inline]

Definition at line 164 of file channels.h.

{ return portalName; }
int cChannel::Ppid ( void  ) const [inline]

Definition at line 171 of file channels.h.

Referenced by SetPids().

{ return ppid; }
const char* cChannel::Provider ( void  ) const [inline]

Definition at line 163 of file channels.h.

{ return provider; }
const cChannel* cChannel::RefChannel ( void  ) const [inline]

Definition at line 201 of file channels.h.

{ return refChannel; }
int cChannel::Rid ( void  ) const [inline]

Definition at line 187 of file channels.h.

{ return rid; }
bool cChannel::Save ( FILE *  f)
bool cChannel::SetCableTransponderData ( int  Source,
int  Frequency,
int  Modulation,
int  Srate,
int  CoderateH 
)

Definition at line 42 of file misc.cpp.

References CoderateH(), Frequency(), Modulation(), Source(), and Srate().

Referenced by process_cam().

{
     source = Source;
     frequency = Frequency;
     modulation = Modulation;
     srate = Srate;
     coderateH = CoderateH;
     return true;
}
void cChannel::SetCaDescriptors ( int  Level)
void cChannel::SetCaIds ( const int *  CaIds)
void cChannel::SetId ( int  Nid,
int  Tid,
int  Sid,
int  Rid = 0 
)

Definition at line 30 of file misc.cpp.

References Sid(), and Tid().

Referenced by cChannels::GetByNumber(), and process_cam().

                                                       {
  sid = Sid;
  tid = Tid;
}
void cChannel::SetLinkChannels ( cLinkChannels *  LinkChannels)
void cChannel::SetName ( const char *  Name,
const char *  ShortName,
const char *  Provider 
)
void cChannel::SetNumber ( int  Number) [inline]

Definition at line 189 of file channels.h.

References Number().

{ number = Number; }
void cChannel::SetPids ( int  Vpid,
int  Ppid,
int *  Apids,
char  ALangs[][MAXLANGCODE2],
int *  Dpids,
char  DLangs[][MAXLANGCODE2],
int  Tpid 
)

Definition at line 51 of file misc.cpp.

References i, MAXAPIDS, MAXDPIDS, Ppid(), Tpid(), and Vpid().

Referenced by process_cam().

{
  vpid = Vpid;
  ppid = Ppid;
  tpid = Tpid;
  for (int i = 0; i < MAXAPIDS; i++)
      apids[i] = Apids[i];
  apids[MAXAPIDS] = 0;
  for (int i = 0; i < MAXDPIDS; i++) {
     dpids[i] = Dpids[i];
  }
  dpids[MAXDPIDS] = 0;
}
void cChannel::SetPortalName ( const char *  PortalName)
void cChannel::SetRefChannel ( cChannel *  RefChannel)
bool cChannel::SetSatTransponderData ( int  Source,
int  Frequency,
char  Polarization,
int  Srate,
int  CoderateH 
)

Definition at line 34 of file misc.cpp.

References CoderateH(), Frequency(), Polarization(), Source(), and Srate().

Referenced by process_cam().

                                                                                                           {
     source = Source;
     frequency = Frequency;
     polarization = Polarization;
     srate = Srate;
     coderateH = CoderateH;
     return true;
}
bool cChannel::SetTerrTransponderData ( int  Source,
int  Frequency,
int  Bandwidth,
int  Modulation,
int  Hierarchy,
int  CodeRateH,
int  CodeRateL,
int  Guard,
int  Transmission 
)
const char* cChannel::ShortName ( bool  OrName = false) const [inline]

Definition at line 162 of file channels.h.

References isempty().

{ return (OrName && isempty(shortName)) ? name : shortName; }
int cChannel::Sid ( void  ) const [inline]

Definition at line 186 of file channels.h.

References sid.

Referenced by cChannelCaids::cChannelCaids(), cChannelCaids::IsChannel(), process_cam(), and SetId().

{ return sid; }
const char* cChannel::Slang ( int  i) const [inline]

Definition at line 180 of file channels.h.

References i, and MAXSPIDS.

{ return (0 <= i && i < MAXSPIDS) ? slangs[i] : ""; }
int cChannel::Source ( void  ) const [inline]
int cChannel::Spid ( int  i) const [inline]

Definition at line 177 of file channels.h.

References i, and MAXSPIDS.

{ return (0 <= i && i < MAXSPIDS) ? spids[i] : 0; }
const int* cChannel::Spids ( void  ) const [inline]

Definition at line 174 of file channels.h.

{ return spids; }
int cChannel::Srate ( void  ) const [inline]

Definition at line 169 of file channels.h.

Referenced by SetCableTransponderData(), and SetSatTransponderData().

{ return srate; }
int cChannel::Tid ( void  ) const [inline]

Definition at line 185 of file channels.h.

Referenced by SetId().

{ return tid; }
cString cChannel::ToText ( void  ) const
int cChannel::Tpid ( void  ) const [inline]

Definition at line 181 of file channels.h.

Referenced by SetPids().

{ return tpid; }
int cChannel::Transmission ( void  ) const [inline]

Definition at line 197 of file channels.h.

{ return transmission; }
int cChannel::Transponder ( int  Frequency,
char  Polarization 
) [static]

builds the transponder from the given Frequency and Polarization

Definition at line 14 of file misc.cpp.

References Frequency().

{
  // some satellites have transponders at the same frequency, just with different polarization:
  switch (tolower(Polarization)) {
    case 'h': Frequency += 100000; break;
    case 'v': Frequency += 200000; break;
    case 'l': Frequency += 300000; break;
    case 'r': Frequency += 400000; break;
    }
  return Frequency;
}
int cChannel::Transponder ( void  ) const

Returns the transponder frequency in MHz, plus the polarization in case of sat.

Definition at line 5 of file misc.cpp.

References IsSat().

Referenced by cChannelCaids::cChannelCaids(), GetChannelID(), cChannelCaids::IsChannel(), cPlainKeyConstCw::Parse(), and cCam::Tune().

{
  int tf = frequency;
  while (tf > 20000)
        tf /= 1000;
  if (IsSat())
     tf = Transponder(tf, polarization);
  return tf;
}
int cChannel::Vpid ( void  ) const [inline]

Definition at line 170 of file channels.h.

Referenced by SetPids().

{ return vpid; }

Friends And Related Function Documentation

friend class cMenuEditChannel [friend]

Definition at line 110 of file channels.h.

friend class cSchedules [friend]

Definition at line 109 of file channels.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines