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 39 #define MAXTXTPAGES 8 // teletext pages 41 #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated 42 #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated 45 #define CA_DVB_MIN 0x0001 46 #define CA_DVB_MAX 0x000F 47 #define CA_USER_MIN 0x0010 48 #define CA_USER_MAX 0x00FF 49 #define CA_ENCRYPTED_MIN 0x0100 50 #define CA_ENCRYPTED_MAX 0xFFFF 52 #define LCN_OVERFLOW_OFFSET 1024 65 bool Valid(
void)
const {
return (nid || tid) &&
sid; }
80 tTeletextSubtitlePage(
int page) { ttxtMagazine = (page / 100) & 0x7; ttxtPage = (((page % 100) / 10) << 4) + (page % 10); ttxtType = 0x02; strcpy(ttxtLanguage,
"und"); }
152 cString TransponderDataToString(
void)
const;
159 bool Parse(
const char *s);
161 const char *Name(
void)
const;
162 const char *ShortName(
bool OrName =
false)
const;
163 const char *
Provider(
void)
const {
return provider; }
166 int Transponder(
void)
const;
167 static int Transponder(
int Frequency,
char Polarization);
170 int Vpid(
void)
const {
return vpid; }
171 int Ppid(
void)
const {
return ppid; }
172 int Vtype(
void)
const {
return vtype; }
173 const int *
Apids(
void)
const {
return apids; }
174 const int *
Dpids(
void)
const {
return dpids; }
175 const int *
Spids(
void)
const {
return spids; }
176 int Apid(
int i)
const {
return (0 <= i && i <
MAXAPIDS) ? apids[i] : 0; }
177 int Dpid(
int i)
const {
return (0 <= i && i <
MAXDPIDS) ? dpids[i] : 0; }
178 int Spid(
int i)
const {
return (0 <= i && i <
MAXSPIDS) ? spids[i] : 0; }
179 const char *
Alang(
int i)
const {
return (0 <= i && i <
MAXAPIDS) ? alangs[i] :
""; }
180 const char *
Dlang(
int i)
const {
return (0 <= i && i <
MAXDPIDS) ? dlangs[i] :
""; }
181 const char *
Slang(
int i)
const {
return (0 <= i && i <
MAXSPIDS) ? slangs[i] :
""; }
187 int Tpid(
void)
const {
return tpid; }
190 const int *
Caids(
void)
const {
return caids; }
196 int Lcn(
void)
const {
return lcn; }
197 int Number(
void)
const {
return number; }
209 bool HasTimer(
void)
const;
211 time_t
Seen(
void) {
return seen; }
212 void CopyTransponderData(
const cChannel *Channel);
213 bool SetTransponderData(
int Source,
int Frequency,
int Srate,
const char *Parameters,
bool Quiet =
false);
215 void SetLcn(
int Lcn);
216 void SetName(
const char *Name,
const char *ShortName,
const char *Provider);
217 void SetPortalName(
const char *PortalName);
218 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 void SetCaIds(
const int *CaIds);
221 void SetCaDescriptors(
int Level);
223 void SetRefChannel(
cChannel *RefChannel);
224 void SetSubtitlingDescriptors(
uchar *SubtitlingTypes, uint16_t *CompositionPageIds, uint16_t *AncillaryPageIds);
236 void DeleteDuplicateChannels(
void);
239 bool Load(
const char *FileName,
bool AllowComments =
false,
bool MustExist =
false);
240 void HashChannel(
cChannel *Channel);
241 void UnhashChannel(
cChannel *Channel);
242 int GetNextGroup(
int Idx);
243 int GetPrevGroup(
int Idx);
244 int GetNextNormal(
int Idx);
245 int GetPrevNormal(
int Idx);
247 cChannel *GetByNumber(
int Number,
int SkipGap = 0);
248 cChannel *GetByServiceID(
int Source,
int Transponder,
unsigned short ServiceID);
249 cChannel *GetByChannelID(
tChannelID ChannelID,
bool TryWithoutRid =
false,
bool TryWithoutPolarization =
false);
255 bool SwitchTo(
int Number);
257 int MaxChannelNameLength(
void);
258 int MaxShortChannelNameLength(
void);
259 void SetModified(
bool ByUser =
false);
264 cChannel *NewChannel(
const cChannel *Transponder,
const char *Name,
const char *ShortName,
const char *Provider,
int Nid,
int Tid,
int Sid,
int Rid = 0);
265 void MarkObsoleteChannels(
int Source,
int Nid,
int Tid);
272 #endif //__CHANNELS_H
uint16_t AncillaryPageId(int i) const
const int * Dpids(void) const
static tChannelID FromString(const char *s)
void SetNumber(int Number)
const cLinkChannels * LinkChannels(void) const
const char * PortalName(void) const
uchar SubtitlingType(int i) const
int TotalTeletextSubtitlePages() const
int Ca(int Index=0) const
static bool IsTerr(int Code)
bool GroupSep(void) const
tChannelID & ClrPolarization(void)
const char * Dlang(int i) const
int nid
actually the "original" network id
const cSchedule * schedule
int totalTtxtSubtitlePages
const char * Alang(int i) const
int maxShortChannelNameLength
const char * Parameters(void) const
const int * Caids(void) const
static bool IsAtsc(int Code)
void IncBeingEdited(void)
const tTeletextSubtitlePage * TeletextSubtitlePages() const
tChannelID(int Source, int Nid, int Tid, int Sid, int Rid=0)
static bool IsSat(int Code)
tChannelID GetChannelID(void) const
const char * Provider(void) const
const cChannel * RefChannel(void) const
int Frequency(void) const
Returns the actual frequency, as given in 'channels.conf'.
static bool IsType(int Code, char Source)
const int * Apids(void) const
void DecBeingEdited(void)
cString ToString(void) const
cString ChannelString(const cChannel *Channel, int Number)
int PageNumber(void) const
bool IsSourceType(char Source) const
static bool IsCable(int Code)
uint16_t CompositionPageId(int i) const
const char * Slang(int i) const
bool operator==(const tChannelID &arg) const
cHash< cChannel > channelsHashSid
static const tChannelID InvalidID
const int * Spids(void) const
tTeletextSubtitlePage(void)
cLinkChannel(cChannel *Channel)
tChannelID & ClrRid(void)
cLinkChannels * linkChannels
tTeletextSubtitlePage(int page)
int fixedTtxtSubtitlePages