//
//  Copyright (c) 2001, Reson, Inc. All Rights Reserved.
//
//  Filename:   EdgeTechChannelScale.h
//
//  Project:    6046.
//
//  Author(s):  W. Arcus
//
//  Purpose:    
//
//  Notes:

#ifndef EDGETECHCHANNELSCALE_H_INCLUDE
#define EDGETECHCHANNELSCALE_H_INCLUDE

class CEdgeTechChannelScale
{
public:
	
	                        CEdgeTechChannelScale   (   const bool                  &rbEnable = false );

    virtual                ~CEdgeTechChannelScale   (   void );

                            EdgeTechChannelScale   (   const CEdgeTechChannelScale &rRhs );

    //CEdgeTechChannelScale & operator =              (   const CEdgeTechChannelScale &rRhs );

    void                    ScaleChannelData        (   const short                 &rnWeightFactor,
                                                        short                       *pnChannelData,
                                                        const unsigned long         &rulSamples );

    void                    EnableScaling           (   const bool                  &rbEnable );

    void                    Reset                   (   void );


private:

    const float m_fMaxRange;
    const int   m_iMaxPeriodResetValue;

    bool        m_bScaling;

    int         m_iMaxWeightFactor;
    int         m_iMaxPeriod;
    int         m_iPingsThisPeriod;

    float       m_fScaleBase;

    float       ComputeScaleFactor                  (   const short                 &rnWeightFactor,
                                                        const short                 *pnChannelData,
                                                        const unsigned long         &rulSamples );
};

#endif
