예제 #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);
        }
예제 #2
0
파일: ATSCTuner.cs 프로젝트: ewin66/media
        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;
        }