private void TestTuneRequestAndValidate() { int hr = 0; ITuneRequest tuneRequest; ILocator locator; // I have this value as global varible but i have to test get_TuneRequest... hr = tuner.get_TuneRequest(out tuneRequest); Debug.Assert(hr == 0, "ITuner.get_TuneRequest"); hr = tuneRequest.get_Locator(out locator); DsError.ThrowExceptionForHR(hr); // Assume a DVBT hardware // A valid carrier frequency must be passed... hr = (locator as IDVBTLocator).put_CarrierFrequency(586000); hr = tuneRequest.put_Locator(locator); // Select the first channel in the first transport stream found... hr = (tuneRequest as IDVBTuneRequest).put_ONID(-1); hr = (tuneRequest as IDVBTuneRequest).put_TSID(-1); hr = (tuneRequest as IDVBTuneRequest).put_SID(-1); // Is it a valid tune request ? hr = tuner.Validate(tuneRequest); Debug.Assert(hr == 0, "ITuner.Validate"); hr = tuner.put_TuneRequest(tuneRequest); Debug.Assert(hr == 0, "ITuner.put_TuneRequest"); }
protected override Channel GetChannel() { ITuneRequest request; int hr = tuner.get_TuneRequest(out request); DsError.ThrowExceptionForHR(hr); IATSCChannelTuneRequest atscRequest = (IATSCChannelTuneRequest)request; ILocator locator; atscRequest.get_Locator(out locator); IATSCLocator atscLocator = (IATSCLocator)locator; int freq, channel, major, minor; hr = atscLocator.get_CarrierFrequency(out freq); hr = atscLocator.get_PhysicalChannel(out channel); hr = atscRequest.get_Channel(out major); hr = atscRequest.get_MinorChannel(out minor); return(new Channel(freq, channel, major, minor)); }