/// <summary>
        /// Acquire and process MediaHighway1 data.
        /// </summary>
        /// <param name="dataProvider">A sample data provider.</param>
        /// <param name="worker">The background worker that is running this collection.</param>
        /// <returns>A CollectorReply code.</returns>
        public override CollectorReply Process(ISampleDataProvider dataProvider, BackgroundWorker worker)
        {
            MediaHighwayProgramCategory.LoadFromFrequency("1", dataProvider.Frequency.ToString());
            CustomProgramCategory.Load();

            getChannelSections(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getCategorySections(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getTitleSections(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getSummarySections(dataProvider, worker);

            return(CollectorReply.OK);
        }
Пример #2
0
        /// <summary>
        /// Acquire and process EIT data.
        /// </summary>
        /// <param name="dataProvider">A sample data provider.</param>
        /// <param name="worker">The background worker that is running this collection.</param>
        /// <returns>A CollectorReply code.</returns>
        public override CollectorReply Process(ISampleDataProvider dataProvider, BackgroundWorker worker)
        {
            EITProgramContent.Load();
            CustomProgramCategory.Load();

            MultiTreeDictionaryEntry.Load(Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary FreeSat T1.cfg"), Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary FreeSat T2.cfg"));

            /*GetStationData(dataProvider, worker, new int[] { 0xbba, 0xc1e, 0xf01 });*/
            GetStationData(dataProvider, worker, new int[] { 0xbba });
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            if (RunParameters.Instance.ChannelBouquet != -1 ||
                RunParameters.Instance.Options.Contains("USECHANNELID") ||
                RunParameters.Instance.Options.Contains("USELCN") ||
                RunParameters.Instance.Options.Contains("CREATEBRCHANNELS") ||
                RunParameters.Instance.Options.Contains("CREATEARCHANNELS"))
            {
                /*GetBouquetSections(dataProvider, worker, new int[] { 0xbba, oxc1e, oxf01 } );*/
                GetBouquetSections(dataProvider, worker, new int[] { 0xbba });
                if (worker.CancellationPending)
                {
                    return(CollectorReply.Cancelled);
                }
            }

            getFreeSatSections(dataProvider, worker);

            return(CollectorReply.OK);
        }
Пример #3
0
        /// <summary>
        /// Acquire and process OpenTV data.
        /// </summary>
        /// <param name="dataProvider">A sampe data provider.</param>
        /// <param name="worker">The background worker that is running this collection.</param>
        /// <returns>A CollectorReply code.</returns>
        public override CollectorReply Process(ISampleDataProvider dataProvider, BackgroundWorker worker)
        {
            OpenTVProgramCategory.LoadFromCode(RunParameters.Instance.CountryCode.Trim());
            CustomProgramCategory.Load();
            ParentalRating.Load();

            bool referenceTablesLoaded = SingleTreeDictionaryEntry.Load(Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary " + RunParameters.Instance.CountryCode.Trim() + ".cfg"));

            if (!referenceTablesLoaded)
            {
                return(CollectorReply.ReferenceDataError);
            }

            GetStationData(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            GetBouquetSections(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getTitleSections(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getSummarySections(dataProvider, worker);

            return(CollectorReply.OK);
        }
Пример #4
0
        private string getCustomCategory(string title, string description)
        {
            string category = CustomProgramCategory.FindCategoryDescription(title);

            if (category != null)
            {
                return(category);
            }

            return(CustomProgramCategory.FindCategoryDescription(description));
        }
Пример #5
0
        /// <summary>
        /// Acquire and process EIT data.
        /// </summary>
        /// <param name="dataProvider">A sample data provider.</param>
        /// <param name="worker">The background worker that is running this collection.</param>
        /// <returns>A CollectorReply code.</returns>
        public override CollectorReply Process(ISampleDataProvider dataProvider, BackgroundWorker worker)
        {
            EITProgramContent.Load();
            CustomProgramCategory.Load();
            ParentalRating.Load();

            if (RunParameters.Instance.Options.Contains("USEFREESATTABLES"))
            {
                MultiTreeDictionaryEntry.Load(Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary FreeSat T1.cfg"), Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary FreeSat T2.cfg"));
            }

            GetStationData(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            bool bouquetNeeded = checkBouquetNeeded();

            if (RunParameters.Instance.ChannelBouquet != -1 ||
                RunParameters.Instance.Options.Contains("USECHANNELID") ||
                RunParameters.Instance.Options.Contains("USELCN") ||
                RunParameters.Instance.Options.Contains("CREATEBRCHANNELS") ||
                RunParameters.Instance.Options.Contains("CREATEARCHANNELS"))
            {
                GetBouquetSections(dataProvider, worker);

                string bouquetType;

                if (eitChannels > 0)
                {
                    bouquetType = "Freeview";
                }
                else
                {
                    bouquetType = "OpenTV";
                }

                Logger.Instance.Write("Used " + bouquetType + " channel descriptors");

                if (worker.CancellationPending)
                {
                    return(CollectorReply.Cancelled);
                }
            }

            getEITSections(dataProvider, worker);

            return(CollectorReply.OK);
        }
Пример #6
0
        /// <summary>
        /// Acquire and process Bell TV data.
        /// </summary>
        /// <param name="dataProvider">A sample data provider.</param>
        /// <param name="worker">The background worker that is running this collection.</param>
        /// <returns>A CollectorReply code.</returns>
        public override CollectorReply Process(ISampleDataProvider dataProvider, BackgroundWorker worker)
        {
            BellTVProgramCategory.Load();
            CustomProgramCategory.Load();
            ParentalRating.Load();

            GetStationData(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getBellTVData(dataProvider, worker);

            return(CollectorReply.OK);
        }
Пример #7
0
        /// <summary>
        /// Acquire and process ATSC PSIP Info data.
        /// </summary>
        /// <param name="dataProvider">A sample data provider.</param>
        /// <param name="worker">The background worker that is running this collection.</param>
        /// <returns>A CollectorReply code.</returns>
        public override CollectorReply Process(ISampleDataProvider dataProvider, BackgroundWorker worker)
        {
            AtscPsipProgramCategory.Load();
            CustomProgramCategory.Load();

            bool referenceTablesLoaded = MultiTreeDictionaryEntry.Load(Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary ATSC PSIP T1.cfg"), Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary ATSC PSIP T2.cfg"));

            if (!referenceTablesLoaded)
            {
                return(CollectorReply.ReferenceDataError);
            }

            getMasterGuideData(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getVirtualChannelData(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            /*getRatingRegionData(dataProvider, worker);
             * if (worker.CancellationPending)
             *  return (CollectorReply.Cancelled);*/

            getExtendedTextData(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getEventInformationData(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            OutputFile.UseUnicodeEncoding = MultipleString.UseUnicodeEncoding;

            return(CollectorReply.OK);
        }
        /// <summary>
        /// Acquire and process Dish Network data.
        /// </summary>
        /// <param name="dataProvider">A sample data provider.</param>
        /// <param name="worker">The background worker that is running this collection.</param>
        /// <returns>A CollectorReply code.</returns>
        public override CollectorReply Process(ISampleDataProvider dataProvider, BackgroundWorker worker)
        {
            DishNetworkProgramCategory.Load();
            CustomProgramCategory.Load();
            ParentalRating.Load();

            SingleTreeDictionaryEntry.Load(Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary Dish Network 128.cfg"), 1);
            SingleTreeDictionaryEntry.Load(Path.Combine(RunParameters.ConfigDirectory, "Huffman Dictionary Dish Network 255.cfg"), 2);
            SingleTreeDictionaryEntry.OffsetStart = false;

            GetStationData(dataProvider, worker);
            if (worker.CancellationPending)
            {
                return(CollectorReply.Cancelled);
            }

            getDishNetworkData(dataProvider, worker);

            return(CollectorReply.OK);
        }
Пример #9
0
        /// <summary>
        /// Compare this instance with another for sorting purposes.
        /// </summary>
        /// <param name="category">The other instance.</param>
        /// <param name="keyName">The name of the key to compare on.</param>
        /// <returns>Zero if the instances are equal, Greater than 0 if this instance is greater; less than zero otherwise.</returns>
        public int CompareForSorting(CustomProgramCategory category, string keyName)
        {
            switch (keyName)
            {
                case "CategoryTag":
                    if (categoryTag == category.CategoryTag)
                        return (CustomDescription.CompareTo(category.CustomDescription));
                    else
                        return (categoryTag.CompareTo(category.CategoryTag));
                case "Description":
                    if (CustomDescription == category.CustomDescription)
                        return (categoryTag.CompareTo(category.CategoryTag));
                    else
                        return (CustomDescription.CompareTo(category.CustomDescription));
                case "WMCDescription":
                    string thisWMCDescription;
                    string otherWMCDescription;

                    if (WMCDescription != null)
                        thisWMCDescription = WMCDescription;
                    else
                        thisWMCDescription = string.Empty;

                    if (category.WMCDescription != null)
                        otherWMCDescription = category.WMCDescription;
                    else
                        otherWMCDescription = string.Empty;

                    if (thisWMCDescription == otherWMCDescription)
                        return (categoryTag.CompareTo(category.CategoryTag));
                    else
                        return (thisWMCDescription.CompareTo(otherWMCDescription));
                case "DVBLogicDescription":
                    string thisLogicDescription;
                    string otherLogicDescription;

                    if (DVBLogicDescription != null)
                        thisLogicDescription = DVBLogicDescription;
                    else
                        thisLogicDescription = string.Empty;

                    if (category.DVBLogicDescription != null)
                        otherLogicDescription = category.DVBLogicDescription;
                    else
                        otherLogicDescription = string.Empty;

                    if (thisLogicDescription == otherLogicDescription)
                        return (categoryTag.CompareTo(category.CategoryTag));
                    else
                        return (thisLogicDescription.CompareTo(otherLogicDescription));
                case "DVBViewerDescription":
                    string thisViewerDescription;
                    string otherViewerDescription;

                    if (DVBViewerDescription != null)
                        thisViewerDescription = DVBViewerDescription;
                    else
                        thisViewerDescription = string.Empty;

                    if (category.DVBViewerDescription != null)
                        otherViewerDescription = category.DVBViewerDescription;
                    else
                        otherViewerDescription = string.Empty;

                    if (thisViewerDescription == otherViewerDescription)
                        return (categoryTag.CompareTo(category.CategoryTag));
                    else
                        return (thisViewerDescription.CompareTo(otherViewerDescription));
                default:
                    return (0);
            }
        }
Пример #10
0
        /// <summary>
        /// Compare this instance with another for sorting purposes.
        /// </summary>
        /// <param name="category">The other instance.</param>
        /// <param name="keyName">The name of the key to compare on.</param>
        /// <returns>Zero if the instances are equal, Greater than 0 if this instance is greater; less than zero otherwise.</returns>
        public int CompareForSorting(CustomProgramCategory category, string keyName)
        {
            switch (keyName)
            {
            case "CategoryTag":
                if (categoryTag == category.CategoryTag)
                {
                    return(CustomDescription.CompareTo(category.CustomDescription));
                }
                else
                {
                    return(categoryTag.CompareTo(category.CategoryTag));
                }

            case "Description":
                if (CustomDescription == category.CustomDescription)
                {
                    return(categoryTag.CompareTo(category.CategoryTag));
                }
                else
                {
                    return(CustomDescription.CompareTo(category.CustomDescription));
                }

            case "WMCDescription":
                string thisWMCDescription;
                string otherWMCDescription;

                if (WMCDescription != null)
                {
                    thisWMCDescription = WMCDescription;
                }
                else
                {
                    thisWMCDescription = string.Empty;
                }

                if (category.WMCDescription != null)
                {
                    otherWMCDescription = category.WMCDescription;
                }
                else
                {
                    otherWMCDescription = string.Empty;
                }

                if (thisWMCDescription == otherWMCDescription)
                {
                    return(categoryTag.CompareTo(category.CategoryTag));
                }
                else
                {
                    return(thisWMCDescription.CompareTo(otherWMCDescription));
                }

            case "DVBLogicDescription":
                string thisLogicDescription;
                string otherLogicDescription;

                if (DVBLogicDescription != null)
                {
                    thisLogicDescription = DVBLogicDescription;
                }
                else
                {
                    thisLogicDescription = string.Empty;
                }

                if (category.DVBLogicDescription != null)
                {
                    otherLogicDescription = category.DVBLogicDescription;
                }
                else
                {
                    otherLogicDescription = string.Empty;
                }

                if (thisLogicDescription == otherLogicDescription)
                {
                    return(categoryTag.CompareTo(category.CategoryTag));
                }
                else
                {
                    return(thisLogicDescription.CompareTo(otherLogicDescription));
                }

            case "DVBViewerDescription":
                string thisViewerDescription;
                string otherViewerDescription;

                if (DVBViewerDescription != null)
                {
                    thisViewerDescription = DVBViewerDescription;
                }
                else
                {
                    thisViewerDescription = string.Empty;
                }

                if (category.DVBViewerDescription != null)
                {
                    otherViewerDescription = category.DVBViewerDescription;
                }
                else
                {
                    otherViewerDescription = string.Empty;
                }

                if (thisViewerDescription == otherViewerDescription)
                {
                    return(categoryTag.CompareTo(category.CategoryTag));
                }
                else
                {
                    return(thisViewerDescription.CompareTo(otherViewerDescription));
                }

            default:
                return(0);
            }
        }