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 58 bool Valid(
void)
const {
return (nid || tid) &&
sid; }
134 cString TransponderDataToString(
void)
const;
141 bool Parse(
const char *s);
143 const char *Name(
void)
const;
144 const char *ShortName(
bool OrName =
false)
const;
145 const char *
Provider(
void)
const {
return provider; }
148 int Transponder(
void)
const;
149 static int Transponder(
int Frequency,
char Polarization);
152 int Vpid(
void)
const {
return vpid; }
153 int Ppid(
void)
const {
return ppid; }
154 int Vtype(
void)
const {
return vtype; }
155 const int *
Apids(
void)
const {
return apids; }
156 const int *
Dpids(
void)
const {
return dpids; }
157 const int *
Spids(
void)
const {
return spids; }
158 int Apid(
int i)
const {
return (0 <= i && i <
MAXAPIDS) ? apids[i] : 0; }
159 int Dpid(
int i)
const {
return (0 <= i && i <
MAXDPIDS) ? dpids[i] : 0; }
160 int Spid(
int i)
const {
return (0 <= i && i <
MAXSPIDS) ? spids[i] : 0; }
161 const char *
Alang(
int i)
const {
return (0 <= i && i <
MAXAPIDS) ? alangs[i] :
""; }
162 const char *
Dlang(
int i)
const {
return (0 <= i && i <
MAXDPIDS) ? dlangs[i] :
""; }
163 const char *
Slang(
int i)
const {
return (0 <= i && i <
MAXSPIDS) ? slangs[i] :
""; }
169 int Tpid(
void)
const {
return tpid; }
170 const int *
Caids(
void)
const {
return caids; }
176 int Lcn(
void)
const {
return lcn; }
177 int Number(
void)
const {
return number; }
190 time_t
Seen(
void)
const {
return seen; }
191 void CopyTransponderData(
const cChannel *Channel);
192 bool SetTransponderData(
int Source,
int Frequency,
int Srate,
const char *Parameters,
bool Quiet =
false);
193 bool SetSource(
int Source);
195 bool SetLcn(
int Lcn);
196 bool SetName(
const char *Name,
const char *ShortName,
const char *Provider);
197 bool SetPortalName(
const char *PortalName);
198 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);
199 bool SetCaIds(
const int *CaIds);
200 bool SetCaDescriptors(
int Level);
202 void SetRefChannel(
cChannel *RefChannel);
203 bool SetSubtitlingDescriptors(
uchar *SubtitlingTypes, uint16_t *CompositionPageIds, uint16_t *AncillaryPageIds);
205 void DelLinkChannel(
cChannel *LinkChannel);
216 void DeleteDuplicateChannels(
void);
225 static bool Load(
const char *FileName,
bool AllowComments =
false,
bool MustExist =
false);
226 void HashChannel(
cChannel *Channel);
227 void UnhashChannel(
cChannel *Channel);
228 int GetNextGroup(
int Idx)
const;
229 int GetPrevGroup(
int Idx)
const;
230 int GetNextNormal(
int Idx)
const;
231 int GetPrevNormal(
int Idx)
const;
234 const cChannel *GetByNumber(
int Number,
int SkipGap = 0)
const;
236 const cChannel *GetByServiceID(
int Source,
int Transponder,
unsigned short ServiceID)
const;
238 const cChannel *GetByChannelID(
tChannelID ChannelID,
bool TryWithoutRid =
false,
bool TryWithoutPolarization =
false)
const;
242 bool HasUniqueChannelID(
const cChannel *NewChannel,
const cChannel *OldChannel = NULL)
const;
243 bool SwitchTo(
int Number)
const;
245 static int MaxChannelNameLength(
void);
246 static int MaxShortChannelNameLength(
void);
247 void SetModifiedByUser(
void);
248 bool ModifiedByUser(
int &State)
const;
253 cChannel *NewChannel(
const cChannel *Transponder,
const char *Name,
const char *ShortName,
const char *Provider,
int Nid,
int Tid,
int Sid,
int Rid = 0);
254 bool MarkObsoleteChannels(
int Source,
int Nid,
int Tid);
265 #define LOCK_CHANNELS_READ USE_LIST_LOCK_READ(Channels) 266 #define LOCK_CHANNELS_WRITE USE_LIST_LOCK_WRITE(Channels) 270 #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 Ca(int Index=0) const
static bool IsTerr(int Code)
static int maxChannelNameLength
bool GroupSep(void) const
tChannelID & ClrPolarization(void)
cChannel * GetByTransponderID(tChannelID ChannelID)
const char * Dlang(int i) const
int nid
actually the "original" network id
const cSchedule * schedule
static int MaxNumber(void)
const char * Alang(int i) const
static int maxShortChannelNameLength
const char * Parameters(void) const
cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false)
cChannel * GetByNumber(int Number, int SkipGap=0)
static cChannels channels
cChannel * GetByServiceID(int Source, int Transponder, unsigned short ServiceID)
const int * Caids(void) const
static bool IsAtsc(int Code)
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
cString ToString(void) const
cString ChannelString(const cChannel *Channel, int Number)
bool IsSourceType(char Source) const
static bool IsCable(int Code)
uint16_t CompositionPageId(int i) const
cListObject & operator=(const cListObject &ListObject)
const char * Slang(int i) const
bool operator==(const tChannelID &arg) const
cHash< cChannel > channelsHashSid
static const tChannelID InvalidID
const int * Spids(void) const
cLinkChannel(cChannel *Channel)
tChannelID & ClrRid(void)
cLinkChannels * linkChannels