public InfosFading(long _iReferenceTimestamp, long _iAverageTimeStampsPerFrame) { // This constructor is used by all drawings to get the default values. FromInfosFading(PreferencesManager.Instance().DefaultFading); m_iReferenceTimestamp = _iReferenceTimestamp; m_iAverageTimeStampsPerFrame = _iAverageTimeStampsPerFrame; }
public double GetOpacityFactor(long _iTimestamp) { double fOpacityFactor = 0.0f; if (!m_bEnabled) { // No fading. if (_iTimestamp == m_iReferenceTimestamp) { fOpacityFactor = 1.0f; } else { fOpacityFactor = 0.0f; } } else if (m_bUseDefault) { // Default value InfosFading info = PreferencesManager.Instance().DefaultFading; if (info.AlwaysVisible) { fOpacityFactor = 1.0f; } else { fOpacityFactor = ComputeOpacityFactor(m_iReferenceTimestamp, _iTimestamp, info.FadingFrames); } } else if (m_bAlwaysVisible) { // infinite fading. (= persisting drawing) fOpacityFactor = 1.0f; } else { // Custom value. fOpacityFactor = ComputeOpacityFactor(m_iReferenceTimestamp, _iTimestamp, m_iFadingFrames); } return(fOpacityFactor * m_fMasterFactor); }