Пример #1
0
        /// <summary>
        /// Updates the signal quality
        /// </summary>
        public void UpdateSignalQuality()
        {
            _tunerLocked   = false;
            _signalLevel   = 0;
            _signalQuality = 0;
            try
            {
                AMTunerSignalStrength signalStrength;
                _tuner.SignalPresent(out signalStrength);
                // Some tuners (in particular, cards based on the Philips/NXP
                // SAA713x and SAA716x PCI-e bridge chipsets such as the Hauppauge
                // HVR2200) report values outside the range specified by the DirectShow
                // interface when they are locked. This means it is best to assume the
                // tuner is locked unless the tuner reports no signal.
                // See Mantis #0002445.
                _tunerLocked = (signalStrength != AMTunerSignalStrength.NoSignal);
            }
            catch (TvExceptionSWEncoderMissing)
            {
                Log.Log.Error("UpdateSignalQuality: unable to perform the check because of a missing audio/video encoder!");
            }

            if (_tunerLocked)
            {
                _signalLevel   = 100;
                _signalQuality = 100;
            }
            else
            {
                _signalLevel   = 0;
                _signalQuality = 0;
            }
        }
Пример #2
0
        public void TestSignalPresent()
        {
            int hr = 0;
            AMTunerSignalStrength sig;

            hr = tuner.SignalPresent(out sig);
            DsError.ThrowExceptionForHR(hr);
            Debug.Assert(hr == 0, "IAMTVTuner.SignalPresent");
        }
Пример #3
0
 /// <summary>
 /// Returns the AMTunerSignalStrength for the currently tuned channel
 /// </summary>
 protected override int GetSignalStrength()
 {
     if (_amTvTuner != null)
     {
         int hr;
         AMTunerSignalStrength signalStrength;
         hr = _amTvTuner.SignalPresent(out signalStrength);
         DsError.ThrowExceptionForHR(hr);
         return((int)signalStrength);
     }
     else
     {
         return((int)AMTunerSignalStrength.HasNoSignalStrength);
     }
 }