vdr
1.7.31
Main Page
Namespaces
Classes
Files
File List
File Members
include
vdr
include/vdr/sources.h
Go to the documentation of this file.
1
/*
2
* sources.h: Source handling
3
*
4
* See the main source file 'vdr.c' for copyright information and
5
* how to reach the author.
6
*
7
* $Id: sources.h 2.4 2012/06/17 11:19:23 kls Exp $
8
*/
9
10
#ifndef __SOURCES_H
11
#define __SOURCES_H
12
13
#include "
config.h
"
14
15
class
cSource
:
public
cListObject
{
16
public
:
17
enum
eSourceType
{
18
stNone
= 0x00000000,
19
stAtsc
= (
'A'
<< 24),
20
stCable
= (
'C'
<< 24),
21
stSat
= (
'S'
<< 24),
22
stTerr
= (
'T'
<< 24),
23
st_Mask
= 0xFF000000,
24
st_Pos
= 0x0000FFFF,
25
};
26
private
:
27
int
code
;
28
char
*
description
;
29
public
:
30
cSource
(
void
);
31
cSource
(
char
Source,
const
char
*
Description
);
32
~cSource
();
33
int
Code
(
void
)
const
{
return
code
; }
34
const
char
*
Description
(
void
)
const
{
return
description
; }
35
bool
Parse
(
const
char
*s);
36
static
char
ToChar
(
int
Code
) {
return
(Code &
st_Mask
) >> 24; }
37
static
cString
ToString
(
int
Code
);
38
static
int
FromString
(
const
char
*s);
39
static
int
FromData
(
eSourceType
SourceType,
int
Position = 0,
bool
East =
false
);
40
static
bool
IsAtsc
(
int
Code
) {
return
(Code &
st_Mask
) ==
stAtsc
; }
41
static
bool
IsCable
(
int
Code
) {
return
(Code &
st_Mask
) ==
stCable
; }
42
static
bool
IsSat
(
int
Code
) {
return
(Code &
st_Mask
) ==
stSat
; }
43
static
bool
IsTerr
(
int
Code
) {
return
(Code &
st_Mask
) ==
stTerr
; }
44
static
bool
IsType
(
int
Code
,
char
Source) {
return
int(Code &
st_Mask
) == (int(Source) << 24); }
45
};
46
47
class
cSources
:
public
cConfig
<cSource> {
48
public
:
49
cSource
*
Get
(
int
Code);
50
};
51
52
extern
cSources
Sources
;
53
54
#endif //__SOURCES_H
Generated by
1.8.1.2