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 MAXAPIDS 32 // audio
32 #define MAXDPIDS 16 // dolby (AC3 + DTS)
33 #define MAXSPIDS 32 // subtitles
34 #define MAXCAIDS 12 // conditional access
36 #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated
37 #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated
40 #define CA_DVB_MIN 0x0001
41 #define CA_DVB_MAX 0x000F
42 #define CA_USER_MIN 0x0010
43 #define CA_USER_MAX 0x00FF
44 #define CA_ENCRYPTED_MIN 0x0100
45 #define CA_ENCRYPTED_MAX 0xFFFF
47 #define LCN_OVERFLOW_OFFSET 1024
143 bool Parse(
const char *s);
145 const char *
Name(
void)
const;
146 const char *
ShortName(
bool OrName =
false)
const;
200 bool 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);
227 static bool Load(
const char *
FileName,
bool AllowComments =
false,
bool MustExist =
false);
255 cChannel *
NewChannel(
const cChannel *Transponder,
const char *Name,
const char *ShortName,
const char *Provider,
int Nid,
int Tid,
int Sid,
int Rid = 0);
267 #define LOCK_CHANNELS_READ USE_LIST_LOCK_READ(Channels)
268 #define LOCK_CHANNELS_WRITE USE_LIST_LOCK_WRITE(Channels)
272 #endif //__CHANNELS_H
uint16_t AncillaryPageId(int i) const
bool SetName(const char *Name, const char *ShortName, const char *Provider)
static const cChannels * GetChannelsRead(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for read access.
const int * Dpids(void) const
const cChannel * GetByTransponderID(tChannelID ChannelID) const
bool 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)
static tChannelID FromString(const char *s)
bool SetPortalName(const char *PortalName)
void SetNumber(int Number)
static 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
int Modification(int Mask=CHANNELMOD_ALL) const
uint16_t ancillaryPageIds[MAXSPIDS]
int Ca(int Index=0) const
bool HasUniqueChannelID(const cChannel *NewChannel, const cChannel *OldChannel=NULL) const
static bool IsTerr(int Code)
static int maxChannelNameLength
uchar subtitlingTypes[MAXSPIDS]
int GetPrevGroup(int Idx) const
Get previous channel group.
const char * ShortName(bool OrName=false) const
bool SetId(cChannels *Channels, int Nid, int Tid, int Sid, int Rid=0)
cChannel & operator=(const cChannel &Channel)
bool GroupSep(void) const
tChannelID & ClrPolarization(void)
cChannel * GetByTransponderID(tChannelID ChannelID)
const cChannel * GetByServiceID(int Source, int Transponder, unsigned short ServiceID) const
void ReNumber(void)
Recalculate 'number' based on channel type.
static int MaxChannelNameLength(void)
const char * Dlang(int i) const
int nid
actually the "original" network id
cString ChannelString(const cChannel *Channel, int Number)
int Transponder(void) const
Returns the transponder frequency in MHz, plus the polarization in case of sat.
const cSchedule * schedule
static int MaxNumber(void)
const char * FileName(void)
const char * Alang(int i) const
static int maxShortChannelNameLength
const char * Parameters(void) const
static 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)
static cChannels * GetChannelsWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for write access.
cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false)
cChannel * GetByNumber(int Number, int SkipGap=0)
static cChannels channels
const char * Name(void) const
void Del(cChannel *Channel)
Delete the given Channel from the list.
cChannel * NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid=0)
cChannel * GetByServiceID(int Source, int Transponder, unsigned short ServiceID)
int GetPrevNormal(int Idx) const
Get previous normal channel (not group)
const int * Caids(void) const
char alangs[MAXAPIDS][MAXLANGCODE2]
const cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false) const
bool Parse(const char *s)
static bool IsAtsc(int Code)
tChannelID(int Source, int Nid, int Tid, int Sid, int Rid=0)
int GetNextNormal(int Idx) const
Get next normal channel (not group)
bool ModifiedByUser(int &State) const
Returns true if the channels have been modified by the user since the last call to this function with...
char dlangs[MAXDPIDS][MAXLANGCODE2]
static bool IsSat(int Code)
tChannelID GetChannelID(void) const
cString TransponderDataToString(void) const
void DelLinkChannel(cChannel *LinkChannel)
const char * Provider(void) const
const cChannel * RefChannel(void) const
int Frequency(void) const
Returns the actual frequency, as given in 'channels.conf'.
bool SwitchTo(int Number) const
bool SetSubtitlingDescriptors(uchar *SubtitlingTypes, uint16_t *CompositionPageIds, uint16_t *AncillaryPageIds)
static bool IsType(int Code, char Source)
const int * Apids(void) const
cString ToString(void) const
void SetRefChannel(cChannel *RefChannel)
void DeleteDuplicateChannels(void)
bool IsSourceType(char Source) const
static bool IsCable(int Code)
uint16_t CompositionPageId(int i) const
const cChannel * GetByNumber(int Number, int SkipGap=0) const
bool SetLinkChannels(cLinkChannels *LinkChannels)
char slangs[MAXSPIDS][MAXLANGCODE2]
bool SetSource(int Source)
const char * Slang(int i) const
bool operator==(const tChannelID &arg) const
cHash< cChannel > channelsHashSid
static const tChannelID InvalidID
const int * Spids(void) const
void UnhashChannel(cChannel *Channel)
int GetNextGroup(int Idx) const
Get next channel group.
bool SetCaIds(const int *CaIds)
cLinkChannel(cChannel *Channel)
bool MarkObsoleteChannels(int Source, int Nid, int Tid)
tChannelID & ClrRid(void)
cLinkChannels * linkChannels
void SetModifiedByUser(void)
cString ToText(void) const
void HashChannel(cChannel *Channel)
bool SetCaDescriptors(int Level)