From 2e1ffe9283833fdbe211291f794b8ee2576421de Mon Sep 17 00:00:00 2001 From: etobi Date: Fri, 12 Feb 2010 21:55:04 +0100 Subject: Record teletext subtitles --- channels.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'channels.h') diff --git a/channels.h b/channels.h index 4ed1358..defb6bc 100644 --- a/channels.h +++ b/channels.h @@ -35,6 +35,7 @@ #define MAXDPIDS 16 // dolby (AC3 + DTS) #define MAXSPIDS 32 // subtitles #define MAXCAIDS 8 // conditional access +#define MAXTXTPAGES 8 // teletext pages #define MAXLANGCODE1 4 // a 3 letter language code, zero terminated #define MAXLANGCODE2 8 // up to two 3 letter language codes, separated by '+' and zero terminated @@ -71,6 +72,16 @@ public: static const tChannelID InvalidID; }; +struct tTeletextSubtitlePage { + tTeletextSubtitlePage(void) { ttxtPage = ttxtMagazine = 0; ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } + tTeletextSubtitlePage(int page) { ttxtMagazine = (page / 100) & 0x7; ttxtPage = (((page % 100) / 10) << 4) + (page % 10); ttxtType = 0x02; strcpy(ttxtLanguage, "und"); } + char ttxtLanguage[MAXLANGCODE1]; + uchar ttxtPage; + uchar ttxtMagazine; + uchar ttxtType; + int PageNumber(void) const { return BCDCHARTOINT(ttxtMagazine) * 100 + BCDCHARTOINT(ttxtPage); } + }; + class cChannel; class cLinkChannel : public cListObject { @@ -113,6 +124,8 @@ private: uint16_t compositionPageIds[MAXSPIDS]; uint16_t ancillaryPageIds[MAXSPIDS]; int tpid; + int totalTtxtSubtitlePages; + tTeletextSubtitlePage teletextSubtitlePages[MAXTXTPAGES]; int caids[MAXCAIDS + 1]; // list is zero-terminated int nid; int tid; @@ -160,6 +173,8 @@ public: uint16_t CompositionPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? compositionPageIds[i] : uint16_t(0); } uint16_t AncillaryPageId(int i) const { return (0 <= i && i < MAXSPIDS) ? ancillaryPageIds[i] : uint16_t(0); } int Tpid(void) const { return tpid; } + const tTeletextSubtitlePage *TeletextSubtitlePages() const { return teletextSubtitlePages; } + int TotalTeletextSubtitlePages() const { return totalTtxtSubtitlePages; } const int *Caids(void) const { return caids; } int Ca(int Index = 0) const { return Index < MAXCAIDS ? caids[Index] : 0; } int Nid(void) const { return nid; } @@ -184,6 +199,7 @@ public: void SetName(const char *Name, const char *ShortName, const char *Provider); void SetPortalName(const char *PortalName); void SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid); + void SetTeletextSubtitlePages(tTeletextSubtitlePage pages[], int numberOfPages); void SetCaIds(const int *CaIds); // list must be zero-terminated void SetCaDescriptors(int Level); void SetLinkChannels(cLinkChannels *LinkChannels); -- cgit v1.2.3