MythTV  master
dishdescriptors.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 // Copyright (c) 2003-2004, Daniel Thor Kristjansson
3 #ifndef _DISH_DESCRIPTORS_H_
4 #define _DISH_DESCRIPTORS_H_
5 
6 #include <QString>
7 #include <QMutex>
8 #include <QDate>
9 #include <QMap>
10 
11 #include "atscdescriptors.h"
12 #include "dvbdescriptors.h"
13 
15 {
16  public:
17  DishEventMPAADescriptor(const unsigned char *data, int len = 300) :
18  MPEGDescriptor(data, len, PrivateDescriptorID::dish_event_mpaa) { }
19  // Name bits loc expected value
20  // descriptor_tag 8 0.0 0x89
21  // descriptor_length 8 1.0
22  // stars 3 2.0
23  uint stars_raw(void) const { return (_data[2] & 0xe0) >> 0x05; }
24  float stars(void) const;
25 
26  // rating 3 2.3
27  uint rating_raw(void) const { return (_data[2] & 0x1c) >> 0x02; }
28  QString rating(void) const;
29 
30  // advisories 8 3.0
31  uint advisory_raw(void) const { return _data[3]; }
32  QString advisory(void) const;
33 
34  private:
35  static void Init(void);
36 
37  private:
38  static QMutex mpaaRatingsLock;
39  static QMap<uint,QString> mpaaRatingsDesc;
40  static bool mpaaRatingsExists;
41 };
42 
44 {
45  public:
46  DishEventVCHIPDescriptor(const unsigned char *data, int len = 300) :
47  MPEGDescriptor(data, len, PrivateDescriptorID::dish_event_vchip) { }
48  // Name bits loc expected value
49  // descriptor_tag 8 0.0 0x95
50  // descriptor_length 8 1.0
51  // rating 8 2.0
52  uint rating_raw(void) const { return _data[2]; }
53  QString rating(void) const;
54 
55  // advisory 8 3.0
56  uint advisory_raw(void) const { return _data[3]; }
57  QString advisory(void) const;
58 
59  private:
60  static void Init(void);
61 
62  private:
63  static QMutex vchipRatingsLock;
64  static QMap<uint,QString> vchipRatingsDesc;
65  static bool vchipRatingsExists;
66 };
67 
69 {
70  public:
71  DishEventNameDescriptor(const unsigned char *data, int len = 300) :
72  MPEGDescriptor(data, len, PrivateDescriptorID::dish_event_name) { }
73  // Name bits loc expected value
74  // descriptor_tag 8 0.0 0x91
75  // descriptor_length 8 1.0
76  // unknown 8 2.0
77  // event_name dlen-1 3.0
78  bool HasName(void) const { return DescriptorLength() > 1; }
79  QString Name(uint) const;
80 };
81 
83 {
84  public:
85  DishEventDescriptionDescriptor(const unsigned char *data, int len = 300) :
87  data, len, PrivateDescriptorID::dish_event_description) { }
88  // Name bits loc expected value
89  // descriptor_tag 8 0.0 0x92
90  // descriptor_length 8 1.0
91  // unknown 8/16 2.0
92  // event_name dlen-2 3.0/4.0
93  const unsigned char *DescriptionRaw(void) const;
94  uint DescriptionRawLength(void) const;
95  bool HasDescription(void) const { return DescriptionRawLength(); }
96  QString Description(uint) const;
97 };
98 
100 {
101  public:
102  DishEventPropertiesDescriptor(const unsigned char *data, int len = 300) :
104  data, len, PrivateDescriptorID::dish_event_properties) { }
105  // Name bits loc expected value
106  // descriptor_tag 8 0.0 0x94
107  // descriptor_length 8 1.0
108  // unknown 8 2.0
109  // event_name dlen-1 3.0
110  bool HasProperties(void) const { return DescriptorLength() > 1; }
111  uint SubtitleProperties(uint compression_type) const;
112  uint AudioProperties(uint compression_type) const;
113 
114  private:
115  void decompress_properties(uint compression_type) const;
116 
117  private:
120  static bool decompressed;
121 };
122 
124 {
125  public:
126  DishEventTagsDescriptor(const unsigned char *data, int len = 300) :
127  MPEGDescriptor(data, len, PrivateDescriptorID::dish_event_tags) { }
128  // Name bits loc expected value
129  // descriptor_tag 8 0.0 0x96
130  // descriptor_length 8 1.0
131  // seriesid 64 2.0
132  QString seriesid(void) const;
133  QString programid(void) const;
134  QDate originalairdate(void) const;
135 };
136 
137 typedef enum
138 {
150 } DishThemeType;
151 
152 QString dish_theme_type_to_string(uint theme_type);
154 
156 {
157  public:
158  DishContentDescriptor(const unsigned char *data, int len = 300) :
159  ContentDescriptor(data, len) { }
160 
161  DishThemeType GetTheme(void) const;
162  QString GetCategory(void) const;
163  QString toString() const override; // ContentDescriptor
164 
165  private:
166  static void Init(void);
167 
168  private:
169  static QMap<uint,QString> themeDesc;
170  static QMap<uint,QString> dishCategoryDesc;
171  static volatile bool dishCategoryDescExists;
172 };
173 
174 #endif // _DISH_DESCRIPTORS_H_
DishThemeType GetTheme(void) const
DishEventMPAADescriptor(const unsigned char *data, int len=300)
uint SubtitleProperties(uint compression_type) const
DishThemeType
DishEventVCHIPDescriptor(const unsigned char *data, int len=300)
DishEventTagsDescriptor(const unsigned char *data, int len=300)
static QMap< uint, QString > themeDesc
bool HasName(void) const
DishThemeType string_to_dish_theme_type(const QString &type)
unsigned int uint
Definition: compat.h:140
static volatile bool dishCategoryDescExists
static QMap< uint, QString > mpaaRatingsDesc
DishEventPropertiesDescriptor(const unsigned char *data, int len=300)
QString toString() const override
DishContentDescriptor(const unsigned char *data, int len=300)
static void Init(void)
QString dish_theme_type_to_string(uint theme_type)
QString advisory(void) const
static QMutex vchipRatingsLock
uint stars_raw(void) const
void decompress_properties(uint compression_type) const
QString seriesid(void) const
QString Name(uint) const
uint rating_raw(void) const
static QMutex mpaaRatingsLock
DishEventDescriptionDescriptor(const unsigned char *data, int len=300)
static QMap< uint, QString > vchipRatingsDesc
uint DescriptorLength(void) const
QDate originalairdate(void) const
uint advisory_raw(void) const
uint advisory_raw(void) const
uint AudioProperties(uint compression_type) const
DishEventNameDescriptor(const unsigned char *data, int len=300)
QString rating(void) const
QString GetCategory(void) const
const unsigned char * _data
QString programid(void) const
static QMap< uint, QString > dishCategoryDesc
uint rating_raw(void) const
QString rating(void) const
QString advisory(void) const
const unsigned char * DescriptionRaw(void) const