/// <summary> /// Create an instance of the descriptor class for Bell TV descriptors. /// </summary> /// <param name="byteData">The MPEG2 section containing the descriptor.</param> /// <param name="index">The index of the tag byte of the descriptor.</param> /// <param name="table">The table ID containing this descriptor.</param> /// <returns>A descriptor instance.</returns> internal static DescriptorBase BellTVInstance(byte[] byteData, int index, int table) { DescriptorBase descriptor; switch ((int)byteData[index]) { case ShortEventDescriptorTag: descriptor = new BellShortEventDescriptor(); break; case BellTVExtendedEventDescriptorTag: descriptor = new BellTVExtendedEventDescriptor(); break; case BellTVRatingDescriptorTag: descriptor = new BellTVRatingDescriptor(); break; case BellTVSeriesDescriptorTag: descriptor = new BellTVSeriesDescriptor(); break; case ContentDescriptorTag: descriptor = new DVBContentDescriptor(); break; default: descriptor = new DescriptorBase(); break; } descriptor.table = table; descriptor.tag = (int)byteData[index]; index++; descriptor.length = (int)byteData[index]; index++; descriptor.Process(byteData, index); return(descriptor); }
/// <summary> /// Create an instance of the descriptor class for Bell TV descriptors. /// </summary> /// <param name="byteData">The MPEG2 section containing the descriptor.</param> /// <param name="index">The index of the tag byte of the descriptor.</param> /// <param name="table">The table ID containing this descriptor.</param> /// <returns>A descriptor instance.</returns> internal static DescriptorBase BellTVInstance(byte[] byteData, int index, int table) { DescriptorBase descriptor; switch ((int)byteData[index]) { case ShortEventDescriptorTag: descriptor = new BellShortEventDescriptor(); break; case BellTVExtendedEventDescriptorTag: descriptor = new BellTVExtendedEventDescriptor(); break; case BellTVRatingDescriptorTag: descriptor = new BellTVRatingDescriptor(); break; case BellTVSeriesDescriptorTag: descriptor = new BellTVSeriesDescriptor(); break; case ContentDescriptorTag: descriptor = new DVBContentDescriptor(); break; default: descriptor = new DescriptorBase(); break; } descriptor.table = table; descriptor.tag = (int)byteData[index]; index++; descriptor.length = (int)byteData[index]; index++; descriptor.Process(byteData, index); return (descriptor); }
private void processDescriptor(DescriptorBase descriptor) { switch (descriptor.Tag) { case DescriptorBase.ShortEventDescriptorTag: BellShortEventDescriptor shortEventDescriptor = descriptor as BellShortEventDescriptor; if (eventName == null) { eventName = shortEventDescriptor.EventName; highDefinition = shortEventDescriptor.HighDefinition; } else { if (RunParameters.Instance.InputLanguage == null) { eventName = shortEventDescriptor.EventName; highDefinition = shortEventDescriptor.HighDefinition; } else { if (shortEventDescriptor.LanguageCode == RunParameters.Instance.InputLanguage) { eventName = shortEventDescriptor.EventName; highDefinition = shortEventDescriptor.HighDefinition; } else { if (shortEventDescriptor.LanguageCode == "eng") { eventName = shortEventDescriptor.EventName; highDefinition = shortEventDescriptor.HighDefinition; } } } } LanguageCode.RegisterUsage(shortEventDescriptor.LanguageCode); break; case DescriptorBase.BellTVExtendedEventDescriptorTag: BellTVExtendedEventDescriptor extendedEventDescriptor = descriptor as BellTVExtendedEventDescriptor; if (shortDescription == null) { originalDescription = extendedEventDescriptor.OriginalDescription; shortDescription = extendedEventDescriptor.EventDescription; subTitle = extendedEventDescriptor.SubTitle; } else { if (RunParameters.Instance.InputLanguage == null) { originalDescription = extendedEventDescriptor.OriginalDescription; shortDescription = extendedEventDescriptor.EventDescription; subTitle = extendedEventDescriptor.SubTitle; } else { if (extendedEventDescriptor.LanguageCode == RunParameters.Instance.InputLanguage) { originalDescription = extendedEventDescriptor.OriginalDescription; shortDescription = extendedEventDescriptor.EventDescription; subTitle = extendedEventDescriptor.SubTitle; } else { if (extendedEventDescriptor.LanguageCode == "eng") { originalDescription = extendedEventDescriptor.OriginalDescription; shortDescription = extendedEventDescriptor.EventDescription; subTitle = extendedEventDescriptor.SubTitle; } } } } LanguageCode.RegisterUsage(extendedEventDescriptor.LanguageCode); closedCaptions = extendedEventDescriptor.ClosedCaptions; stereo = extendedEventDescriptor.Stereo; date = extendedEventDescriptor.Date; cast = extendedEventDescriptor.Cast; break; case DescriptorBase.BellTVRatingDescriptorTag: BellTVRatingDescriptor ratingDescriptor = descriptor as BellTVRatingDescriptor; parentalRating = ratingDescriptor.ParentalRating; starRating = ratingDescriptor.StarRating; hasSexualContent = ratingDescriptor.HasSexualContent; hasStrongLanguage = ratingDescriptor.HasStrongLanguage; hasViolence = ratingDescriptor.HasViolence; hasNudity = ratingDescriptor.HasNudity; break; case DescriptorBase.BellTVSeriesDescriptorTag: BellTVSeriesDescriptor seriesDescriptor = descriptor as BellTVSeriesDescriptor; series = seriesDescriptor.Series; episode = seriesDescriptor.Episode; originalAirDate = seriesDescriptor.OriginalAirDate; break; case DescriptorBase.ContentDescriptorTag: contentType = (descriptor as DVBContentDescriptor).ContentSubType[0]; contentSubType = (descriptor as DVBContentDescriptor).UserType[0]; break; default: if (RunParameters.Instance.DebugIDs.Contains("UNKNOWNDESCRIPTORS")) { Logger.Instance.Write("Unprocessed Bell TV descriptor: 0x" + descriptor.Tag.ToString("X")); if (RunParameters.Instance.DebugIDs.Contains("LOGDESCRIPTORDATA")) { Logger.Instance.Dump("Descriptor Data", descriptor.Data, descriptor.Data.Length); } } break; } }