示例#1
0
        private void processDescriptor(DescriptorBase descriptor)
        {
            switch (descriptor.Tag)
            {
            case DescriptorBase.DishNetworkShortEventDescriptorTag:
                DishNetworkShortEventDescriptor shortEventDescriptor = descriptor as DishNetworkShortEventDescriptor;
                eventName = shortEventDescriptor.EventName;
                break;

            case DescriptorBase.DishNetworkExtendedEventDescriptorTag:
                DishNetworkExtendedEventDescriptor extendedEventDescriptor = descriptor as DishNetworkExtendedEventDescriptor;
                originalDescription = extendedEventDescriptor.OriginalDescription;
                shortDescription    = extendedEventDescriptor.EventDescription;
                subTitle            = extendedEventDescriptor.SubTitle;
                closedCaptions      = extendedEventDescriptor.ClosedCaptions;
                highDefinition      = extendedEventDescriptor.HighDefinition;
                stereo = extendedEventDescriptor.Stereo;
                date   = extendedEventDescriptor.Date;
                cast   = extendedEventDescriptor.Cast;
                break;

            case DescriptorBase.DishNetworkRatingDescriptorTag:
                DishNetworkRatingDescriptor ratingDescriptor = descriptor as DishNetworkRatingDescriptor;
                parentalRating    = ratingDescriptor.ParentalRating;
                starRating        = ratingDescriptor.StarRating;
                hasSexualContent  = ratingDescriptor.HasSexualContent;
                hasStrongLanguage = ratingDescriptor.HasStrongLanguage;
                hasViolence       = ratingDescriptor.HasViolence;
                hasNudity         = ratingDescriptor.HasNudity;
                break;

            case DescriptorBase.DishNetworkSeriesDescriptorTag:
                DishNetworkSeriesDescriptor seriesDescriptor = descriptor as DishNetworkSeriesDescriptor;
                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 Dish Network descriptor: 0x" + descriptor.Tag.ToString("X"));
                    if (RunParameters.Instance.DebugIDs.Contains("LOGDESCRIPTORDATA"))
                    {
                        Logger.Instance.Dump("Descriptor Data", descriptor.Data, descriptor.Data.Length);
                    }
                }
                break;
            }
        }
示例#2
0
        /// <summary>
        /// Create an instance of the descriptor class for Dish Network 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 DishNetworkInstance(byte[] byteData, int index, int table)
        {
            DescriptorBase descriptor;

            switch ((int)byteData[index])
            {
            case DishNetworkRatingDescriptorTag:
                descriptor = new DishNetworkRatingDescriptor();
                break;

            case DishNetworkShortEventDescriptorTag:
                descriptor = new DishNetworkShortEventDescriptor();
                break;

            case DishNetworkExtendedEventDescriptorTag:
                descriptor = new DishNetworkExtendedEventDescriptor();
                break;

            case DishNetworkSupplementaryDescriptorTag:
                descriptor = new DishNetworkSupplementaryDescriptor();
                break;

            case DishNetworkVCHIPDescriptorTag:
                descriptor = new DishNetworkVCHIPDescriptor();
                break;

            case DishNetworkSeriesDescriptorTag:
                descriptor = new DishNetworkSeriesDescriptor();
                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);
        }
示例#3
0
        /// <summary>
        /// Create an instance of the descriptor class for Dish Network 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 DishNetworkInstance(byte[] byteData, int index, int table)
        {
            DescriptorBase descriptor;

            switch ((int)byteData[index])
            {
                case DishNetworkRatingDescriptorTag:
                    descriptor = new DishNetworkRatingDescriptor();
                    break;
                case DishNetworkShortEventDescriptorTag:
                    descriptor = new DishNetworkShortEventDescriptor();
                    break;
                case DishNetworkExtendedEventDescriptorTag:
                    descriptor = new DishNetworkExtendedEventDescriptor();
                    break;
                case DishNetworkSupplementaryDescriptorTag:
                    descriptor = new DishNetworkSupplementaryDescriptor();
                    break;
                case DishNetworkVCHIPDescriptorTag:
                    descriptor = new DishNetworkVCHIPDescriptor();
                    break;
                case DishNetworkSeriesDescriptorTag:
                    descriptor = new DishNetworkSeriesDescriptor();
                    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);
        }