SASC-NG
DVBSoftCAM

sources.h

Go to the documentation of this file.
00001 /*
00002  * sources.h: Source handling
00003  *
00004  * See the main source file 'vdr.c' for copyright information and
00005  * how to reach the author.
00006  *
00007  * $Id: sources.h 1.4 2005/05/14 09:30:41 kls Exp $
00008  */
00009 
00010 #ifndef __SOURCES_H
00011 #define __SOURCES_H
00012 
00013 #include "config.h"
00014 
00015 class cSource : public cListObject {
00016 public:
00017   enum eSourceType {
00018     stNone  = 0x0000,
00019     stCable = 0x4000,
00020     stSat   = 0x8000,
00021     stTerr  = 0xC000,
00022     st_Mask = 0xC000,
00023     st_Neg  = 0x0800,
00024     st_Pos  = 0x07FF,
00025     };
00026 private:
00027   int code;
00028   char *description;
00029 public:
00030   cSource(void);
00031   ~cSource();
00032   int Code(void) const { return code; }
00033   const char *Description(void) const { return description; }
00034   bool Parse(const char *s);
00035   static cString ToString(int Code);
00036   static int FromString(const char *s);
00037   static int FromData(eSourceType SourceType, int Position = 0, bool East = false);
00038   static bool IsCable(int Code) { return (Code & st_Mask) == stCable; }
00039   static bool IsSat(int Code) { return (Code & st_Mask) == stSat; }
00040   static bool IsTerr(int Code) { return (Code & st_Mask) == stTerr; }
00041   };
00042 
00043 class cSources : public cConfig<cSource> {
00044 public:
00045   cSource *Get(int Code);
00046   };
00047 
00048 extern cSources Sources;
00049 
00050 #endif //__SOURCES_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines