Beispiel #1
0
        private void processDescriptor(DescriptorBase descriptor)
        {
            switch (descriptor.Tag)
            {
            case DescriptorBase.ShortEventDescriptorTag:
                DVBShortEventDescriptor shortEventDescriptor = descriptor as DVBShortEventDescriptor;
                if (eventName == null)
                {
                    processShortEventDescriptor(shortEventDescriptor);
                }
                else
                {
                    if (RunParameters.Instance.InputLanguage == null)
                    {
                        processShortEventDescriptor(shortEventDescriptor);
                    }
                    else
                    {
                        if (shortEventDescriptor.LanguageCode == RunParameters.Instance.InputLanguage)
                        {
                            processShortEventDescriptor(shortEventDescriptor);
                        }
                        else
                        {
                            if (shortEventDescriptor.LanguageCode == "eng")
                            {
                                processShortEventDescriptor(shortEventDescriptor);
                            }
                        }
                    }
                }
                LanguageCode.RegisterUsage(shortEventDescriptor.LanguageCode);
                break;

            case DescriptorBase.ExtendedEventDescriptorTag:
                DVBExtendedEventDescriptor extendedEventDescriptor = descriptor as DVBExtendedEventDescriptor;
                if (extendedDescription == null)
                {
                    processExtendedEventDescriptor(extendedEventDescriptor);
                }
                else
                {
                    if (RunParameters.Instance.InputLanguage == null)
                    {
                        processExtendedEventDescriptor(extendedEventDescriptor);
                    }
                    else
                    {
                        if (extendedEventDescriptor.LanguageCode == RunParameters.Instance.InputLanguage)
                        {
                            processExtendedEventDescriptor(extendedEventDescriptor);
                        }
                        else
                        {
                            if (extendedEventDescriptor.LanguageCode == "eng")
                            {
                                processExtendedEventDescriptor(extendedEventDescriptor);
                            }
                        }
                    }
                }
                LanguageCode.RegisterUsage(extendedEventDescriptor.LanguageCode);
                break;

            case DescriptorBase.ComponentDescriptorTag:
                if ((descriptor as DVBComponentDescriptor).ComponentTypeVideo != -1)
                {
                    componentTypeVideo = (descriptor as DVBComponentDescriptor).ComponentTypeVideo;
                }
                if ((descriptor as DVBComponentDescriptor).ComponentTypeAudio != -1)
                {
                    componentTypeAudio = (descriptor as DVBComponentDescriptor).ComponentTypeAudio;
                }
                if ((descriptor as DVBComponentDescriptor).ComponentTypeSubtitles != -1)
                {
                    componentTypeSubtitles = (descriptor as DVBComponentDescriptor).ComponentTypeSubtitles;
                }
                break;

            case DescriptorBase.ContentDescriptorTag:
                contentType    = (descriptor as DVBContentDescriptor).ContentType[0];
                contentSubType = (descriptor as DVBContentDescriptor).ContentSubType[0];
                break;

            case DescriptorBase.ParentalRatingDescriptorTag:
                DVBParentalRatingDescriptor parentalRatingDescriptor = descriptor as DVBParentalRatingDescriptor;
                if (parentalRatingDescriptor.ParentalRatings != null)
                {
                    parentalRating = (descriptor as DVBParentalRatingDescriptor).ParentalRatings[0];
                }
                break;

            case DescriptorBase.ContentIdentifierDescriptorTag:
                DVBContentIdentifierDescriptor contentIdentifierDescriptor = descriptor as DVBContentIdentifierDescriptor;
                if (contentIdentifierDescriptor.IsSeriesLink)
                {
                    seriesID = contentIdentifierDescriptor.ContentReference;
                }
                else
                {
                    if (contentIdentifierDescriptor.IsEpisodeLink)
                    {
                        episodeID = contentIdentifierDescriptor.ContentReference;
                    }
                }
                break;

            default:
                if (RunParameters.Instance.DebugIDs.Contains("UNKNOWNDESCRIPTORS"))
                {
                    Logger.Instance.Write("Unprocessed EIT descriptor: 0x" + descriptor.Tag.ToString("X"));
                    if (RunParameters.Instance.DebugIDs.Contains("LOGDESCRIPTORDATA"))
                    {
                        Logger.Instance.Dump("Descriptor Data", descriptor.Data, descriptor.Data.Length);
                    }
                }
                break;
            }
        }
Beispiel #2
0
        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;
            }
        }