Beispiel #1
0
        public List <Channel> GetVirtualChannels()
        {
            if (State != ServerGraphState.Running)
            {
                throw new InvalidOperationException("Graph must be running to retreive Virtual Channel Table");
            }

            List <Channel> items = new List <Channel>();

            try
            {
                VirtualChannelTable vct = _vctParser.GetVirtualChannelTable();
                foreach (VirtualChannelTable.Entry e in vct.Items)
                {
                    if ((e.ServiceType == VCTServiceTypes.ATSCDigitalTelevision) ||
                        (e.ServiceType == VCTServiceTypes.ATSCAudio))
                    {
                        items.Add(e.ToChannel());
                    }
                }

                return(items);
            }
            catch (Exception ex)
            {
                AppLogger.Dump(ex);
                return(items);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Retrieves all of the virtual channels for the currently tuned physical channel
        /// </summary>
        /// <returns></returns>
        public override List <Channel> GetVirtualChannels()
        {
            if (State != GraphState.Running)
            {
                throw new InvalidOperationException("Graph must be running to retreive Virtual Channel Table");
            }

            List <Channel> items = new List <Channel>();

            try
            {
                VirtualChannelTable vct = _parser.GetVirtualChannelTable();
                if (vct.Items.Count > 0)
                {
                    Channel physical = this.GetCurrentChannel();

                    foreach (VirtualChannelTable.Entry e in vct.Items)
                    {
                        if ((e.ServiceType == VCTServiceTypes.ATSCDigitalTelevision) ||
                            (e.ServiceType == VCTServiceTypes.ATSCAudio))
                        {
                            Channel ch = e.ToChannel();
                            ch.PhysicalChannel  = physical.PhysicalChannel;
                            ch.CarrierFrequency = physical.CarrierFrequency;
                            items.Add(ch);
                        }
                    }
                }

                return(items);
            }
            catch (Exception ex)
            {
                ErrorLogger.DumpToDebug(ex);
                return(items);
            }
        }