18 #define ISTRANSPONDER(f1, f2) (abs((f1) - (f2)) < 4) //XXX
20 #define CHANNELMOD_NONE 0x00
21 #define CHANNELMOD_ALL 0xFF
22 #define CHANNELMOD_NAME 0x01
23 #define CHANNELMOD_PIDS 0x02
24 #define CHANNELMOD_ID 0x04
25 #define CHANNELMOD_AUX 0x08
26 #define CHANNELMOD_CA 0x10
27 #define CHANNELMOD_TRANSP 0x20
28 #define CHANNELMOD_LANGS 0x40
29 #define CHANNELMOD_RETUNE (CHANNELMOD_PIDS | CHANNELMOD_CA | CHANNELMOD_TRANSP)
31 #define CHANNELSMOD_NONE 0
32 #define CHANNELSMOD_AUTO 1
33 #define CHANNELSMOD_USER 2
35 #define MAXAPIDS 32 // audio
36 #define MAXDPIDS 16 // dolby (AC3 + DTS)
37 #define MAXSPIDS 32 // subtitles
38 #define MAXCAIDS 12 // conditional access
40 #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated
41 #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated
44 #define CA_DVB_MIN 0x0001
45 #define CA_DVB_MAX 0x000F
46 #define CA_USER_MIN 0x0010
47 #define CA_USER_MAX 0x00FF
48 #define CA_ENCRYPTED_MIN 0x0100
49 #define CA_ENCRYPTED_MAX 0xFFFF
62 bool Valid(
void)
const {
return (nid || tid) &&
sid; }
143 bool Parse(
const char *s);
145 const char *
Name(
void)
const;
146 const char *
ShortName(
bool OrName =
false)
const;
160 int Apid(
int i)
const {
return (0 <= i && i <
MAXAPIDS) ? apids[i] : 0; }
161 int Dpid(
int i)
const {
return (0 <= i && i <
MAXDPIDS) ? dpids[i] : 0; }
162 int Spid(
int i)
const {
return (0 <= i && i <
MAXSPIDS) ? spids[i] : 0; }
163 const char *
Alang(
int i)
const {
return (0 <= i && i <
MAXAPIDS) ? alangs[i] :
""; }
164 const char *
Dlang(
int i)
const {
return (0 <= i && i <
MAXDPIDS) ? dlangs[i] :
""; }
165 const char *
Slang(
int i)
const {
return (0 <= i && i <
MAXSPIDS) ? slangs[i] :
""; }
200 void SetPids(
int Vpid,
int Ppid,
int Vtype,
int *
Apids,
int *Atypes,
char ALangs[][
MAXLANGCODE2],
int *
Dpids,
int *Dtypes,
char DLangs[][MAXLANGCODE2],
int *
Spids,
char SLangs[][MAXLANGCODE2],
int Tpid);
220 bool Load(
const char *
FileName,
bool AllowComments =
false,
bool MustExist =
false);
245 cChannel *
NewChannel(
const cChannel *Transponder,
const char *Name,
const char *ShortName,
const char *Provider,
int Nid,
int Tid,
int Sid,
int Rid = 0);
253 #endif //__CHANNELS_H
uint16_t AncillaryPageId(int i) const
void SetId(int Nid, int Tid, int Sid, int Rid=0)
int Modified(void)
Returns 0 if no channels have been modified, 1 if an automatic modification has been made...
const int * Dpids(void) const
static tChannelID FromString(const char *s)
int GetPrevGroup(int Idx)
void SetNumber(int Number)
int MaxShortChannelNameLength(void)
const cLinkChannels * LinkChannels(void) const
const char * PortalName(void) const
void CopyTransponderData(const cChannel *Channel)
uint16_t compositionPageIds[MAXSPIDS]
uchar SubtitlingType(int i) const
uint16_t ancillaryPageIds[MAXSPIDS]
int Ca(int Index=0) const
static bool IsTerr(int Code)
void MarkObsoleteChannels(int Source, int Nid, int Tid)
uchar subtitlingTypes[MAXSPIDS]
const char * ShortName(bool OrName=false) const
cChannel & operator=(const cChannel &Channel)
bool GroupSep(void) const
tChannelID & ClrPolarization(void)
int MaxChannelNameLength(void)
const char * Dlang(int i) const
int nid
actually the "original" network id
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
const cSchedule * schedule
const char * FileName(void)
const char * Alang(int i) const
int maxShortChannelNameLength
const char * Parameters(void) const
bool Load(const char *FileName, bool AllowComments=false, bool MustExist=false)
bool SetTransponderData(int Source, int Frequency, int Srate, const char *Parameters, bool Quiet=false)
const char * Name(void) const
cChannel * NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid=0)
void SetName(const char *Name, const char *ShortName, const char *Provider)
const int * Caids(void) const
char alangs[MAXAPIDS][MAXLANGCODE2]
bool Parse(const char *s)
static bool IsAtsc(int Code)
void IncBeingEdited(void)
tChannelID(int Source, int Nid, int Tid, int Sid, int Rid=0)
int GetNextNormal(int Idx)
int GetPrevNormal(int Idx)
void SetCaDescriptors(int Level)
char dlangs[MAXDPIDS][MAXLANGCODE2]
static bool IsSat(int Code)
tChannelID GetChannelID(void) const
void SetModified(bool ByUser=false)
int GetNextGroup(int Idx)
cString TransponderDataToString(void) const
const char * Provider(void) const
cChannel * GetByServiceID(int Source, int Transponder, unsigned short ServiceID)
const cChannel * RefChannel(void) const
int Frequency(void) const
Returns the actual frequency, as given in 'channels.conf'.
void SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *CompositionPageIds, uint16_t *AncillaryPageIds)
cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false)
bool HasTimer(void) const
static bool IsType(int Code, char Source)
const int * Apids(void) const
void DecBeingEdited(void)
void SetLinkChannels(cLinkChannels *LinkChannels)
bool HasUniqueChannelID(cChannel *NewChannel, cChannel *OldChannel=NULL)
cString ToString(void) const
void SetRefChannel(cChannel *RefChannel)
cString ChannelString(const cChannel *Channel, int Number)
cChannel * GetByNumber(int Number, int SkipGap=0)
void DeleteDuplicateChannels(void)
bool IsSourceType(char Source) const
static bool IsCable(int Code)
uint16_t CompositionPageId(int i) const
char slangs[MAXSPIDS][MAXLANGCODE2]
const char * Slang(int i) const
bool operator==(const tChannelID &arg) const
cHash< cChannel > channelsHashSid
cChannel * GetByTransponderID(tChannelID ChannelID)
static const tChannelID InvalidID
int Modification(int Mask=CHANNELMOD_ALL)
bool SwitchTo(int Number)
const int * Spids(void) const
void UnhashChannel(cChannel *Channel)
cLinkChannel(cChannel *Channel)
void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, int *Atypes, char ALangs[][MAXLANGCODE2], int *Dpids, int *Dtypes, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid)
void SetPortalName(const char *PortalName)
tChannelID & ClrRid(void)
cLinkChannels * linkChannels
void SetCaIds(const int *CaIds)
cString ToText(void) const
void HashChannel(cChannel *Channel)