Exemplo n.º 1
0
        /// <summary>
        /// Parse the summary header.
        /// </summary>
        /// <param name="byteData">The MPEG2 section containing the summary header.</param>
        /// <param name="index">Index of the first byte of the summary header in the MPEG2 section.</param>
        /// <param name="mpeg2Header">The MPEG2 header of the section.</param>
        internal void Process(byte[] byteData, int index, Mpeg2ExtendedHeader mpeg2Header)
        {
            lastIndex = index;

            channelID = mpeg2Header.TableIDExtension;

            try
            {
                baseDate   = getDate(Utils.Convert2BytesToInt(byteData, lastIndex));
                lastIndex += 2;

                while (lastIndex < byteData.Length - 4)
                {
                    OpenTVSummaryData data = new OpenTVSummaryData();
                    data.Process(byteData, lastIndex, baseDate);

                    if (summaryData == null)
                    {
                        summaryData = new Collection <OpenTVSummaryData>();
                    }

                    summaryData.Add(data);

                    lastIndex = data.Index;
                }

                Validate();
            }
            catch (IndexOutOfRangeException)
            {
                throw (new ArgumentOutOfRangeException("The Open TV Summary Header message is short"));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add summary data to the channel.
        /// </summary>
        /// <param name="newSummaryData"></param>
        public void AddSummaryData(OpenTVSummaryData newSummaryData)
        {
            foreach (OpenTVSummaryData oldSummaryData in SummaryData)
            {
                if (oldSummaryData.EventID == newSummaryData.EventID)
                    return;

                if (oldSummaryData.EventID > newSummaryData.EventID)
                {
                    SummaryData.Insert(SummaryData.IndexOf(oldSummaryData), newSummaryData);
                    return;
                }
            }

            SummaryData.Add(newSummaryData);
        }
Exemplo n.º 3
0
        private void getSeriesLink(EPGEntry epgEntry, OpenTVSummaryData summaryData)
        {
            if (summaryData == null || summaryData.SeriesLink == -1)
                return;

            if (RunParameters.Instance.Options.Contains("USEBSEPG"))
            {
                getSeriesLinkBSEPG(epgEntry, summaryData.SeriesLink);
                return;
            }

            if (epgEntry.EpisodeSystemType != null)
                return;

            epgEntry.Series = summaryData.SeriesLink.ToString();
            epgEntry.EpisodeSystemType = "xmltv_ns";
            epgEntry.EpisodeSystemParts = 3;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Parse the summary header.
        /// </summary>
        /// <param name="byteData">The MPEG2 section containing the summary header.</param>
        /// <param name="index">Index of the first byte of the summary header in the MPEG2 section.</param>
        /// <param name="mpeg2Header">The MPEG2 header of the section.</param>
        internal void Process(byte[] byteData, int index, Mpeg2ExtendedHeader mpeg2Header)
        {
            lastIndex = index;

            channelID = mpeg2Header.TableIDExtension;

            try
            {
                baseDate = getDate(Utils.Convert2BytesToInt(byteData, lastIndex));
                lastIndex += 2;

                while (lastIndex < byteData.Length - 4)
                {
                    OpenTVSummaryData data = new OpenTVSummaryData();
                    data.Process(byteData, lastIndex, baseDate);

                    if (summaryData == null)
                        summaryData = new Collection<OpenTVSummaryData>();

                    summaryData.Add(data);

                    lastIndex = data.Index;
                }

                Validate();
            }
            catch (IndexOutOfRangeException)
            {
                throw (new ArgumentOutOfRangeException("The Open TV Summary Header message is short"));
            }
        }