Exemplo n.º 1
0
        /// <summary>
        /// Generate a copy of this frequency.
        /// </summary>
        /// <returns>A new instance with the same properties as the old instance.</returns>
        public override TuningFrequency Clone()
        {
            AtscFrequency newFrequency = new AtscFrequency();

            base.Clone(newFrequency);

            newFrequency.SymbolRate = symbolRate;
            newFrequency.FEC        = fec;
            newFrequency.SymbolRate = symbolRate;
            newFrequency.Modulation = modulation;

            return(newFrequency);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initialize a new instance of the TuningSpec class for an ATSC frequency.
 /// </summary>
 /// <param name="frequency">The frequency to tune to.</param>
 public TuningSpec(AtscFrequency frequency)
 {
     this.frequency = frequency;
     symbolRate = frequency.SymbolRate;
     fec = frequency.FEC;
     modulation = frequency.Modulation;
     channelNumber = frequency.ChannelNumber;
 }
Exemplo n.º 3
0
        internal void load(FileInfo fileInfo)
        {
            AtscFrequency atscFrequency = null;
            XmlReader reader = null;

            XmlReaderSettings settings = new XmlReaderSettings();
            settings.IgnoreWhitespace = true;

            try
            {
                reader = XmlReader.Create(fileInfo.FullName, settings);

                while (!reader.EOF)
                {
                    reader.Read();
                    if (reader.IsStartElement())
                    {
                        switch (reader.Name)
                        {
                            case "Channel":
                                if (atscFrequency != null)
                                    AddFrequency(atscFrequency);

                                atscFrequency = new AtscFrequency();
                                atscFrequency.Provider = this;

                                break;
                            default:
                                if (atscFrequency != null)
                                    atscFrequency.load(reader);
                                break;
                        }
                    }
                }

                if (atscFrequency != null)
                    AddFrequency(atscFrequency);
            }
            catch (IOException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("I/O exception: " + e.Message);
            }
            catch (XmlException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("Data exception: " + e.Message);
            }

            if (reader != null)
                reader.Close();
        }
Exemplo n.º 4
0
        internal void load(FileInfo fileInfo)
        {
            AtscFrequency atscFrequency = null;
            XmlReader     reader        = null;

            XmlReaderSettings settings = new XmlReaderSettings();

            settings.IgnoreWhitespace = true;

            try
            {
                reader = XmlReader.Create(fileInfo.FullName, settings);

                while (!reader.EOF)
                {
                    reader.Read();
                    if (reader.IsStartElement())
                    {
                        switch (reader.Name)
                        {
                        case "Channel":
                            if (atscFrequency != null)
                            {
                                AddFrequency(atscFrequency);
                            }

                            atscFrequency          = new AtscFrequency();
                            atscFrequency.Provider = this;

                            break;

                        default:
                            if (atscFrequency != null)
                            {
                                atscFrequency.load(reader);
                            }
                            break;
                        }
                    }
                }

                if (atscFrequency != null)
                {
                    AddFrequency(atscFrequency);
                }
            }
            catch (IOException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("I/O exception: " + e.Message);
            }
            catch (XmlException e)
            {
                Logger.Instance.Write("Failed to load file " + fileInfo.Name);
                Logger.Instance.Write("Data exception: " + e.Message);
            }

            if (reader != null)
            {
                reader.Close();
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Generate a copy of this frequency.
        /// </summary>
        /// <returns>A new instance with the same properties as the old instance.</returns>
        public override TuningFrequency Clone()
        {
            AtscFrequency newFrequency = new AtscFrequency();
            base.Clone(newFrequency);

            newFrequency.SymbolRate = symbolRate;
            newFrequency.FEC = fec;
            newFrequency.SymbolRate = symbolRate;
            newFrequency.Modulation = modulation;

            return (newFrequency);
        }