summaryrefslogtreecommitdiff
path: root/maps.h
blob: 04008ff0f5f0617e73d37c2011e642468c0db4fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
 * maps.h: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 */

#ifndef _MAPS_H
#define _MAPS_H

#include <vdr/channels.h>
#include <vdr/tools.h>

// Flags field definition

// Bit  0-23  USE_ flags
// Bit 24-30  OPT_ flags
// Bit 31     always zero

#define USE_NOTHING            0

#define USE_SHORTTEXT          0x1
#define USE_LONGTEXT           0x2
#define USE_COUNTRYDATE        0x4
#define USE_ORIGTITLE          0x8
#define USE_CATEGORIES         0x10
#define USE_CREDITS            0x20
#define USE_RATING             0x40
#define USE_REVIEW             0x80
#define USE_VIDEO              0x100
#define USE_AUDIO              0x200
#define USE_SEASON             0x400
#define USE_STARRATING         0x800
#define USE_TITLE              0x1000

#define CREDITS_ACTORS         0x100000
#define CREDITS_DIRECTORS      0x200000
#define CREDITS_OTHERS         0x400000
#define CREDITS_LIST           0x800000

#define OPT_RATING_TEXT        0x1000000
#define OPT_CATEGORIES_TEXT    0x2000000
#define OPT_SEASON_SHORTTEXT   0x4000000
#define OPT_APPEND             0x40000000

#define EPLIST_USE_SEASON      0x1
#define EPLIST_USE_TEXT        0x2

class cTEXTMapping : public cListObject
{
private:
    const char *name;
    const char *value;
public:
    cTEXTMapping(const char *Name, const char *Value);
    ~cTEXTMapping();
    void ChangeValue(const char *Value);
    const char *Name(void)
    {
        return name;
    }
    const char *Value(void)
    {
        return value;
    }
};

class cTEXTMappings : public cList<cTEXTMapping>
{
public:
    cTEXTMapping *GetMap(const char *Name);
    void Remove();
};

class cEPGMapping : public cListObject
{
private:
    static int compare(const void *a, const void *b);
    const char *channelname;
    tChannelID *channelids;
    int numchannelids;
    int flags;
    void addchannels(const char *channels);
public:
    cEPGMapping(const char *ChannelName, const char *Flags_and_Mappings);
    cEPGMapping(cEPGMapping&copy);
    ~cEPGMapping();
    void ChangeFlags(int NewFlags)
    {
        flags=NewFlags;
    }
    void ReplaceChannels(int NumChannelIDs, tChannelID *ChannelIDs);
    void AddChannel(int ChannelNumber);
    void RemoveChannel(int ChannelNumber, bool MarkOnly=false);
    void RemoveChannel(tChannelID ChannelID, bool MarkOnly=false);
    void RemoveInvalidChannels();
    int Flags()
    {
        return flags;
    }
    const char *ChannelName()
    {
        return channelname;
    }
    int NumChannelIDs()
    {
        return numchannelids;
    }
    tChannelID *ChannelIDs()
    {
        return channelids;
    }
};

class cEPGMappings : public cList<cEPGMapping>
{
public:
    cEPGMapping *GetMap(const char *ChannelName);
    cEPGMapping *GetMap(tChannelID ChannelID);
    bool ProcessChannel(tChannelID ChannelID);
    bool IgnoreChannel(const cChannel *Channel);
    void Remove();
};

#endif