summaryrefslogtreecommitdiff
path: root/dish.h
blob: b4efe1c36e086fc7fd2cc443711c54616915b635 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef LIBSI_DISH_H
#define LIBSI_DISH_H

#include <string>
#include <libsi/util.h>
#include <libsi/descriptor.h>

namespace SI
{

   namespace DISH_THEMES {
     enum eDishThemes {
      Movie           = 0x01,
      Sports          = 0x02,
      News_Business   = 0x03,
      Family_Children = 0x04,
      Education       = 0x05,
      Series_Special  = 0x06,
      Music_Art       = 0x07,
      Religious       = 0x08
     };
   };

   namespace DISH_CATEGORIES {
     enum eDishCategories {
        Action                   = 0x01,
        Adults_only              = 0x02,
        Adventure                = 0x03,
        Animals                  = 0x04,
        Animated                 = 0x05,
     //  Anime
        Anthology                = 0x07,
        Art                      = 0x08,
        Auto                     = 0x09,
        Awards                   = 0x0a,
        Ballet                   = 0x0b,
        Baseball                 = 0x0c,
        Basketball               = 0x0d,
     //  Beach soccer
     //  Beach volleyball
     //  Biathlon
        Biography                = 0x11,
        Boat                     = 0x12,
     //  Boat racing
        Bowling                  = 0x14,
        Boxing                   = 0x15,
        Bus_financial            = 0x16,
        Children                 = 0x1a,
        ChildrenSpecial          = 0x1b,
        ChildrenNews             = 0x1c,
        ChildrenMusic            = 0x1d,
        Collectibles             = 0x1f,
        Comedy                   = 0x20,
        ComedyDrama              = 0x21,
        Computers                = 0x22,
        Cooking                  = 0x23,
        Crime                    = 0x24,
        CrimeDrama               = 0x25,
     //  Curling
        Dance                    = 0x27,
     //  Dark comedy
        Docudrama                = 0x29,
        Documentary              = 0x2a,
        Drama                    = 0x2b,
        Educational              = 0x2c,
     //  Erotic
        Excercise                = 0x2f,
        Fantasy                  = 0x31,
        Fashion                   = 0x32,
     //  Fencing
        Fishing                  = 0x34,
        Football                 = 0x35,
        French                   = 0x36,
        Fundraiser               = 0x37,
        GameShow                 = 0x38,
        Golf                     = 0x39,
        Gymnastics               = 0x3a,
        Health                   = 0x3b,
        History                  = 0x3c,
        HistoricalDrama          = 0x3d,
        Hockey                   = 0x3e,
        Holiday                  = 0x3f,
        HolidayChildren          = 0x40,
        HolidayChildrenSpecial   = 0x41,
     //  Holiday music
     //  Holiday music special
        HolidaySpecial           = 0x44,
        Horror                   = 0x45,
        HorseRacing              = 0x46,
        House_garden             = 0x47,
        HowTo                    = 0x49,
        Interview                = 0x4b,
        Lacrosse                 = 0x4d,
        MartialArts              = 0x4f,
        Medical                  = 0x50,
        Miniseries               = 0x51,
        Motorsports              = 0x52,
        Motorcycle               = 0x53,
        Music                    = 0x54,
        MusicSpecial             = 0x55,
        MusicTalk                = 0x56,
        Musical                  = 0x57,
        MusicalComedy            = 0x58,
        Mystery                  = 0x5a,
        Nature                   = 0x5b,
        News                     = 0x5c,
     //  Olympics
        Opera                    = 0x5f,
        Outdoors                 = 0x60,
     //  Parade
     //  Politics                =  0x62,
        PublicAffairs            = 0x63,
        Reality                  = 0x66,
        Religious                = 0x67,
        Rodeo                    = 0x68,
        Romance                  = 0x69,
        RomanceComedy            = 0x6a,
        Rugby                    = 0x6b,
        Running                  = 0x6c,
        Science                  = 0x6e,
        ScienceFiction           = 0x6f,
        SelfImprovement          = 0x70,
        Shopping                 = 0x71,
        Skiing                   = 0x74,
        Soap                     = 0x77,
     //  Soap special
     //  Soap talk
        Soccor                   = 0x7b,
        Softball                 = 0x7c,
        Spanish                  = 0x7d,
        Special                  = 0x7e,
     //  Speedskating
     //  Sports event
        SportsNonEvent           = 0x81,
        SportsTalk               = 0x82,
        Suspense                 = 0x83,
        Swimming                 = 0x85,
        Talk                     = 0x86,
        Tennis                   = 0x87,
     //  Theater
     //  Thriller
        Track_field              = 0x89,
        Travel                   = 0x8a,
        Variety                  = 0x8b,
        Volleyball               = 0x8c,
        War                      = 0x8d,
        Watersports              = 0x8e,
        Weather                  = 0x8f,
        Western                  = 0x90,
        Wrestling                = 0x92,
        Yoga                     = 0x93,
        Agriculture              = 0x94,
        Anime                    = 0x95,
        ArmWrestling             = 0x97,
        Arts_crafts              = 0x98,
        Auction                  = 0x99,
        AutoRacing               = 0x9a,
        AirRacing                = 0x9b,
        Badminton                = 0x9c,
     //  Bicycle
        BicycleRacing            = 0xa0,
        BoatRacing               = 0xa1,
     //  Bobsled
     //  Bodybilding
     //  Canoe
     //  Cheerleading
        Community                = 0xa6,
        Consumer                 = 0xa7,
     //  Darts
        Debate                   = 0xaa,
     //  Diving
        DogShow                  = 0xac,
        DragRacing               = 0xad,
        Entertainment            = 0xae,
        Environment              = 0xaf,
        Equestrian               = 0xb0,
     //  Event
        FieldHockey              = 0xb3,
     //  Figure skating
        Football2                = 0xb5,
        Gay_lesbian              = 0xb6,
        Handball                 = 0xb7,
        HomeImprovement          = 0xb8,
        Hunting                  = 0xb9,
     //  Hurling
        HydroplaneRacing         = 0xbb,
     //  Indoor soccer
     //  Intl hockey
     //  Intl soccer
     //  Kayaking
        Law                      = 0xc1,
     //  Luge
     //  Mountain biking
        MotorcycleRacing         = 0xc3,
        Newsmagazine             = 0xc5,
        Paranormal               = 0xc7,
        Parenting                = 0xc8,
        PerformingArts           = 0xca,
     //  Playoff sports
        Politics                 = 0xcc,
     //  Polo
     //  Pool
        ProWrestling             = 0xcf,
     //  Ringuette
     //  Roller derby
     //  Rowing
        Sailing                  = 0xd3,
        Shooting                 = 0xd4,
        Sitcom                   = 0xd5,
        Skateboarding            = 0xd6,
     //  Skating
     //  Skeleton
        Snowboarding             = 0xd9,
     //  Snowmobile              =  0xda,
        Standup                  = 0xdd,
     //  Sumo wrestling
        Surfing                  = 0xdf,
        Tennis2                  = 0xe0,
        Triathlon                = 0xe1,
     //  Water polo
     //  Water skiing
     //  Weightlifting
     //  Yacht racing
        CardGames                = 0xe6 ,
        Poker                    = 0xe7 ,
     //  Musical                 =  0xe9,
        Military                 = 0xea,
        Technology               = 0xeb,
        MixedMartialArts         = 0xec,
        ActionSports             = 0xed,
        DishNetwork              = 0xff
     };
   };
#define SIZE_TABLE_128 128
#define SIZE_TABLE_255 255

using namespace std;

class DishDescriptor {
public:
    DishDescriptor();
    virtual ~DishDescriptor();
    const char* getName(void) const { return name.c_str(); }
    const char* getShortText(void);
    const char *getDescription(void);
    //   const char* getShortText(void) const { return shortText?shortText->c_str():""; }
    //   const char* getDescription(void) const { return description?description->c_str():""; }
    const char *getTheme();
    const char *getCategory();
    const char *getRating();
    const char *getStarRating();
    void setShortData(unsigned char Tid, CharArray data);
    void setExtendedtData(unsigned char Tid, CharArray data);
    void setRating(uint16_t value);
    void setContent(ContentDescriptor::Nibble Nibble);


protected:
    // Decompress the byte array and stores the result to a text string
    void Decompress(unsigned char Tid, CharArray data);
    string name; // name of the event
    string shortText; // usually the episode name
    string description; // description of the event
    unsigned char *decompressed;
    unsigned char DishTheme;
    unsigned char DishCategory;
    uint16_t mpaaRating;
    uint16_t starRating;

    struct HuffmanTable
    {
        unsigned int startingAddress;
        unsigned char character;
        unsigned char numberOfBits;
    };
    static HuffmanTable Table128[SIZE_TABLE_128];
    static HuffmanTable Table255[SIZE_TABLE_255];
};

} /* namespace SI */
#endif /* LIBSI_DISH_H */