From 038d482b3d317e8369c11a693c485517b6646c33 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Wed, 14 Sep 2011 14:06:11 +0200 Subject: moved dish descriptor to separate files added dish theme/category --- dish.h | 272 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 272 insertions(+) create mode 100644 dish.h (limited to 'dish.h') diff --git a/dish.h b/dish.h new file mode 100644 index 0000000..80d2c6a --- /dev/null +++ b/dish.h @@ -0,0 +1,272 @@ +/*************************************************************************** + * * + * 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 + +namespace SI +{ + +#define SIZE_TABLE_128 128 +#define SIZE_TABLE_255 255 + +class UnimplementedDescriptor; + +class DishDescriptor { +public: + DishDescriptor(UnimplementedDescriptor*); + virtual ~DishDescriptor(); + const char* getText(void) const { return text; } + + const char* getShortText(void) const { return shortText; } + const char* getTheme(int contentNibleLvl2); + const char* getCategory(int userNible); + // Decompress the byte arrary and stores the result to a text string + void Decompress(unsigned char Tid); +protected: + const char* text; // name or description of the event + const char* shortText; // usually the episode name + unsigned char* decompressed; + UnimplementedDescriptor* unimplementedDesc; + + struct HuffmanTable { + unsigned int startingAddress; + unsigned char character; + unsigned char numberOfBits; + }; + static HuffmanTable Table128[SIZE_TABLE_128]; + static HuffmanTable Table255[SIZE_TABLE_255]; + + 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 + }; + }; +}; + +} /* namespace SI */ +#endif /* LIBSI_DISH_H */ -- cgit v1.2.3 From 9c53646dc79a1447fd3201b37412108d7f94ea28 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Wed, 14 Sep 2011 16:10:56 +0200 Subject: fix compile --- dish.h | 60 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'dish.h') diff --git a/dish.h b/dish.h index 80d2c6a..fb1689c 100644 --- a/dish.h +++ b/dish.h @@ -13,36 +13,6 @@ namespace SI { -#define SIZE_TABLE_128 128 -#define SIZE_TABLE_255 255 - -class UnimplementedDescriptor; - -class DishDescriptor { -public: - DishDescriptor(UnimplementedDescriptor*); - virtual ~DishDescriptor(); - const char* getText(void) const { return text; } - - const char* getShortText(void) const { return shortText; } - const char* getTheme(int contentNibleLvl2); - const char* getCategory(int userNible); - // Decompress the byte arrary and stores the result to a text string - void Decompress(unsigned char Tid); -protected: - const char* text; // name or description of the event - const char* shortText; // usually the episode name - unsigned char* decompressed; - UnimplementedDescriptor* unimplementedDesc; - - struct HuffmanTable { - unsigned int startingAddress; - unsigned char character; - unsigned char numberOfBits; - }; - static HuffmanTable Table128[SIZE_TABLE_128]; - static HuffmanTable Table255[SIZE_TABLE_255]; - namespace DISH_THEMES { enum eDishThemes { Movie = 0x01, @@ -266,6 +236,36 @@ protected: DishNetwork = 0xff }; }; +#define SIZE_TABLE_128 128 +#define SIZE_TABLE_255 255 + +class UnimplementedDescriptor; + +class DishDescriptor { +public: + DishDescriptor(UnimplementedDescriptor*); + virtual ~DishDescriptor(); + const char* getText(void) const { return text; } + + const char* getShortText(void) const { return shortText; } + const char* getTheme(int contentNibleLvl2); + const char* getCategory(int userNible); + // Decompress the byte arrary and stores the result to a text string + void Decompress(unsigned char Tid); +protected: + const char* text; // name or description of the event + const char* shortText; // usually the episode name + unsigned char* decompressed; + UnimplementedDescriptor* unimplementedDesc; + + 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 */ -- cgit v1.2.3 From 8bab540df87c3f38369c772fd956f85cd655cf6e Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Thu, 13 Oct 2011 20:40:14 +0200 Subject: test merge branches --- dish.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dish.h') diff --git a/dish.h b/dish.h index fb1689c..963fb42 100644 --- a/dish.h +++ b/dish.h @@ -10,6 +10,8 @@ #ifndef LIBSI_DISH_H #define LIBSI_DISH_H +#include + namespace SI { @@ -243,7 +245,7 @@ class UnimplementedDescriptor; class DishDescriptor { public: - DishDescriptor(UnimplementedDescriptor*); + DishDescriptor(); virtual ~DishDescriptor(); const char* getText(void) const { return text; } @@ -251,12 +253,11 @@ public: const char* getTheme(int contentNibleLvl2); const char* getCategory(int userNible); // Decompress the byte arrary and stores the result to a text string - void Decompress(unsigned char Tid); + void Decompress(unsigned char Tid, CharArray data); protected: const char* text; // name or description of the event const char* shortText; // usually the episode name unsigned char* decompressed; - UnimplementedDescriptor* unimplementedDesc; struct HuffmanTable { unsigned int startingAddress; -- cgit v1.2.3 From 5993000031faa54c50a32cf3c5857f5c87593e5a Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Sun, 23 Oct 2011 17:35:31 +0200 Subject: add ratings take 2 --- dish.h | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'dish.h') diff --git a/dish.h b/dish.h index 963fb42..04a8d90 100644 --- a/dish.h +++ b/dish.h @@ -10,7 +10,7 @@ #ifndef LIBSI_DISH_H #define LIBSI_DISH_H -#include +#include namespace SI { @@ -247,17 +247,35 @@ class DishDescriptor { public: DishDescriptor(); virtual ~DishDescriptor(); - const char* getText(void) const { return text; } + const char* getName(void) const { return name; } + 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(); + bool hasTheme() {return DishTheme > 0;} + bool hasCategory() {return DishCategory > 0;} + void setShortData(unsigned char Tid, CharArray data); + void setExtendedtData(unsigned char Tid, CharArray data); + void setRating(uint16_t value); + void setContent(ContentDescriptor::Nibble Nibble); - const char* getShortText(void) const { return shortText; } - const char* getTheme(int contentNibleLvl2); - const char* getCategory(int userNible); - // Decompress the byte arrary and stores the result to a text string - void Decompress(unsigned char Tid, CharArray data); protected: - const char* text; // name or description of the event - const char* shortText; // usually the episode name - unsigned char* decompressed; + // Decompress the byte array and stores the result to a text string + const char *Decompress(unsigned char Tid, CharArray data); + const char* name; // name of the event + const char* shortText; // usually the episode name + const char* description; // description of the event + unsigned char* decompressedShort; + unsigned char* decompressedExtended; + unsigned char DishTheme; + unsigned char DishCategory; + uint16_t mpaaRating; + uint16_t starRating; + struct HuffmanTable { unsigned int startingAddress; -- cgit v1.2.3 From 54b9cde7363fa33091166e4d3b47109a30cc8f81 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Sun, 23 Oct 2011 17:44:26 +0200 Subject: compile fix --- dish.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dish.h') diff --git a/dish.h b/dish.h index 04a8d90..c9fcfe1 100644 --- a/dish.h +++ b/dish.h @@ -11,6 +11,7 @@ #define LIBSI_DISH_H #include +#include namespace SI { @@ -265,7 +266,7 @@ public: protected: // Decompress the byte array and stores the result to a text string - const char *Decompress(unsigned char Tid, CharArray data); + unsigned char* Decompress(unsigned char Tid, CharArray data); const char* name; // name of the event const char* shortText; // usually the episode name const char* description; // description of the event -- cgit v1.2.3 From d7ffd368b513b9fc5e03842add42eb7ded562a61 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Tue, 25 Oct 2011 23:54:36 +0200 Subject: Add Program ID / Series ID fix ratings --- dish.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'dish.h') diff --git a/dish.h b/dish.h index c9fcfe1..07f0547 100644 --- a/dish.h +++ b/dish.h @@ -12,6 +12,7 @@ #include #include +#include namespace SI { @@ -257,12 +258,16 @@ public: const char *getCategory(); const char *getRating(); const char *getStarRating(); + const char *getSeriesId(); + const char *getProgramId(); + time_t getOriginalAirDate() { return originalAirDate; } bool hasTheme() {return DishTheme > 0;} bool hasCategory() {return DishCategory > 0;} void setShortData(unsigned char Tid, CharArray data); void setExtendedtData(unsigned char Tid, CharArray data); void setRating(uint16_t value); void setContent(ContentDescriptor::Nibble Nibble); + void setEpisodeInfo(CharArray data); protected: // Decompress the byte array and stores the result to a text string @@ -275,7 +280,10 @@ protected: unsigned char DishTheme; unsigned char DishCategory; uint16_t mpaaRating; - uint16_t starRating; + uint8_t starRating; + time_t originalAirDate; + char* seriesId; + char* programId; struct HuffmanTable { -- cgit v1.2.3