3 #ifndef _ATSC_TABLES_H_
4 #define _ATSC_TABLES_H_
122 return (_ptrs[i][0]<<8) | _ptrs[i][1];
125 QString TableClassString(
uint i)
const;
130 return ((_ptrs[i][2]<<8) | (_ptrs[i][3])) & 0x1fff;
136 return (_ptrs[i][4]) & 0x1f;
141 return ((_ptrs[i][5]<<24) | (_ptrs[i][6]<<16) |
142 (_ptrs[i][7]<<8) | (_ptrs[i][8]));
148 return ((_ptrs[i][9]<<8) | (_ptrs[i][10])) & 0xfff;
155 const unsigned char* TableDescriptors(
uint i)
const
161 uint GlobalDescriptorsLength()
const
163 return ((_ptrs[TableCount()][0]<<8) |
164 (_ptrs[TableCount()][1])) & 0xfff;
167 const unsigned char* GlobalDescriptors()
const
169 return _ptrs[TableCount()]+2;
176 void Parse(
void)
const;
177 virtual QString
toString(
void)
const;
180 mutable vector<unsigned char*>
_ptrs;
225 const QString ShortChannelName(
uint i)
const
228 const unsigned short* ustr =
229 reinterpret_cast<const unsigned short*
>(_ptrs[i]);
230 for (
int j=0; j<7; j++)
232 QChar c((ustr[j]<<8) | (ustr[j]>>8));
233 if (c != QChar(
'\0')) str.append(c);
244 return (((_ptrs[i][14])<<6)&0x3c0) | (_ptrs[i][15]>>2);
249 return (((_ptrs[i][15])<<8)&0x300) | _ptrs[i][16];
256 QString ModulationModeString(
uint i)
const;
261 return ((_ptrs[i][22]<<8) | _ptrs[i][23]);
266 return ((_ptrs[i][24]<<8) | _ptrs[i][25]);
271 return (_ptrs[i][26]>>6) & 0x03;
274 bool IsAccessControlled(
uint i)
const
276 return bool(_ptrs[i][26] & 0x20);
281 return bool(_ptrs[i][26] & 0x10);
285 bool IsHiddenInGuide(
uint i)
const
287 return bool(_ptrs[i][26] & 0
x2);
293 return _ptrs[i][27] & 0x3f;
295 QString ServiceTypeString(
uint i)
const;
299 return ((_ptrs[i][28]<<8) | _ptrs[i][29]);
305 return ((_ptrs[i][30]<<8) | _ptrs[i][31]) & 0x03ff;
308 const unsigned char* Descriptors(
uint i)
const
315 uint GlobalDescriptorsLength()
const
317 uint i = ChannelCount();
318 return ((_ptrs[i][0]<<8) | _ptrs[i][1]) & 0x03ff;
321 const unsigned char* GlobalDescriptors()
const
323 return _ptrs[ChannelCount()]+2;
327 int Find(
int major,
int minor)
const;
328 QString GetExtendedChannelName(
uint idx)
const;
329 virtual QString
toString(
void)
const;
330 virtual QString ChannelString(
uint channel)
const = 0;
332 virtual QString ChannelStringXML(
uint indent_level,
uint channel)
const;
333 virtual QString XMLChannelValues(
uint indent_level,
uint channel)
const;
335 mutable vector<unsigned char*>
_ptrs;
462 bool SCTEIsChannelNumberOnePart(
uint i)
const
466 bool SCTEIsChannelNumberTwoPart(
uint i)
const
475 if (SCTEIsChannelNumberOnePart(i))
488 bool IsPathSelect(
uint i)
const
490 return bool(_ptrs[i][26] & 0x8);
495 return bool(_ptrs[i][26] & 0
x4);
557 return ((_ptrs[i][0]<<8) | _ptrs[i][1])&0x3fff;
562 return ((_ptrs[i][2]<<24) | (_ptrs[i][3]<<16) |
563 (_ptrs[i][4]<<8) | (_ptrs[i][5]));
565 QDateTime StartTimeGPS(
uint i)
const
574 return (_ptrs[i][6]>>4)&3;
579 return ((_ptrs[i][6]<<16) | (_ptrs[i][7]<<8) |
580 (_ptrs[i][8])) & 0xfffff;
584 {
return _ptrs[i][9]; }
594 unsigned char *desc=_ptrs[i]+10+TitleLength(i);
595 return ((desc[0]<<8)|(desc[1]))&0xfff;
600 const unsigned char* Descriptors(
uint i)
const
602 return _ptrs[i]+12+TitleLength(i);
610 mutable vector<unsigned char*>
_ptrs;
645 void SetExtendedTextTableID(
uint id)
703 uint32_t GPSRaw(
void)
const
708 QDateTime SystemTimeGPS(
void)
const
712 time_t GPSUnix(
void)
const
713 {
return GPS_EPOCH + GPSRaw(); }
714 time_t UTCUnix(
void)
const
715 {
return GPSUnix() - GPSOffset(); }
801 {
return "AggregateEventInformationTable\n"; }
803 {
return "<AggregateEventInformationTable />"; }
821 {
return "AggregateExtendedTextTable\n"; }
823 {
return "<AggregateExtendedTextTable />"; }
826 #endif // _ATSC_TABLES_H_