diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-11-10 15:50:21 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-11-10 15:50:21 +0100 |
commit | 9fee2b67abb2594c5db2ca9f66525cb09e7b5cc7 (patch) | |
tree | 9d9326af17fcee00a08e55f52d268fd4e5943129 /channels.h | |
parent | c67fe26e66a93b450ed46ca83b5502c47fe28eb3 (diff) | |
download | vdr-9fee2b67abb2594c5db2ca9f66525cb09e7b5cc7.tar.gz vdr-9fee2b67abb2594c5db2ca9f66525cb09e7b5cc7.tar.bz2 |
First step towards a 'unique channel ID'
Diffstat (limited to 'channels.h')
-rw-r--r-- | channels.h | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.h 1.3 2002/10/20 11:50:36 kls Exp $ + * $Id: channels.h 1.4 2002/11/10 13:01:23 kls Exp $ */ #ifndef __CHANNELS_H @@ -41,6 +41,7 @@ private: static char *buffer; static const char *ToText(cChannel *Channel); enum { MaxChannelName = 32 }; // 31 chars + terminating 0! + int __BeginData__; char name[MaxChannelName]; int frequency; // MHz int source; @@ -53,7 +54,6 @@ private: int sid; int number; // Sequence number assigned on load bool groupSep; - //XXX char polarization; int inversion; int bandwidth; @@ -63,13 +63,14 @@ private: int transmission; int guard; int hierarchy; + int __EndData__; const char *ParametersToString(void); bool StringToParameters(const char *s); public: cChannel(void); - cChannel(const cChannel *Channel); + cChannel& operator= (const cChannel &Channel); const char *ToText(void); - bool Parse(const char *s); + bool Parse(const char *s, bool AllowNonUniqueID = false); bool Save(FILE *f); const char *Name(void) const { return name; } int Frequency(void) const { return frequency; } @@ -86,7 +87,6 @@ public: int Number(void) const { return number; } void SetNumber(int Number) { number = Number; } bool GroupSep(void) const { return groupSep; } - //XXX char Polarization(void) const { return polarization; } int Inversion(void) const { return inversion; } int Bandwidth(void) const { return bandwidth; } @@ -96,10 +96,12 @@ public: int Transmission(void) const { return transmission; } int Guard(void) const { return guard; } int Hierarchy(void) const { return hierarchy; } - //XXX bool IsCable(void) { return (source & cSource::st_Mask) == cSource::stCable; } bool IsSat(void) { return (source & cSource::st_Mask) == cSource::stSat; } bool IsTerr(void) { return (source & cSource::st_Mask) == cSource::stTerr; } + uint64 GetChannelID(void) const; + const char *GetChannelIDStr(void) const; + static uint64 StringToChannelID(const char *s); }; class cChannels : public cConfig<cChannel> { @@ -113,7 +115,9 @@ public: int GetNextNormal(int Idx); // Get next normal channel (not group) void ReNumber(void); // Recalculate 'number' based on channel type cChannel *GetByNumber(int Number, int SkipGap = 0); - cChannel *GetByServiceID(unsigned short ServiceId); + cChannel *GetByServiceID(int Source, unsigned short ServiceID); + cChannel *GetByChannelID(uint64 ChannelID); + bool HasUniqueChannelID(cChannel *NewChannel, cChannel *OldChannel = NULL); bool SwitchTo(int Number); int MaxNumber(void) { return maxNumber; } }; |