Exemplo n.º 1
0
        protected override void SetChannel(Channel channel)
        {
            if (channel == null)
            {
                throw new ArgumentNullException("channel");
            }

            ITuneRequest tuneRequest;
            int          hr = tuningSpace.CreateTuneRequest(out tuneRequest);

            DsError.ThrowExceptionForHR(hr);

            IATSCChannelTuneRequest atscRequest = (IATSCChannelTuneRequest)tuneRequest;

            IATSCLocator locator = (IATSCLocator) new ATSCLocator();

            locator.put_CarrierFrequency(channel.CarrierFrequency);
            locator.put_PhysicalChannel(channel.PhysicalChannel);


            atscRequest.put_Locator(locator);
            atscRequest.put_Channel(channel.MajorChannel);
            atscRequest.put_MinorChannel(channel.MinorChannel);

            hr = tuner.put_TuneRequest(atscRequest);
            DsError.ThrowExceptionForHR(hr);

            ReleaseComObject(tuneRequest);
        }
Exemplo n.º 2
0
        protected virtual void SetCurrentChannel(Channel channel)
        {
            if (channel == null)
            {
                throw new ArgumentNullException("channel");
            }

            if (this.State != GraphState.Running)
            {
                return;
            }

            ITuneRequest tuneRequest;
            int          hr = tuningSpace.CreateTuneRequest(out tuneRequest);

            DsError.ThrowExceptionForHR(hr);

            IATSCChannelTuneRequest atscRequest = (IATSCChannelTuneRequest)tuneRequest;

            IATSCLocator locator = (IATSCLocator) new ATSCLocator();

            locator.put_CarrierFrequency(channel.CarrierFrequency);
            locator.put_PhysicalChannel(channel.PhysicalChannel);


            atscRequest.put_Locator(locator);
            atscRequest.put_Channel(channel.MajorChannel);
            atscRequest.put_MinorChannel(channel.MinorChannel);

            hr = tuner.put_TuneRequest(atscRequest);
            DsError.ThrowExceptionForHR(hr);

            ReleaseComObject(tuneRequest);

            channelSet = true;
        }