Peak Controller: improve envelope calculation
This commit is contained in:
@@ -72,6 +72,7 @@ protected:
|
||||
friend class PeakControllerDialog;
|
||||
|
||||
private:
|
||||
float m_currentSample;
|
||||
//backward compatibility for <= 0.4.15
|
||||
static int m_getCount;
|
||||
static int m_loadCount;
|
||||
|
||||
@@ -200,4 +200,19 @@ static inline float dbvToAmp( float dbv )
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! returns 1.0f if val >= 0.0f, -1.0 else
|
||||
static inline float sign( float val )
|
||||
{
|
||||
return val >= 0.0f ? 1.0f : -1.0f;
|
||||
}
|
||||
|
||||
|
||||
//! if val >= 0.0f, returns sqrtf(val), else: -sqrtf(-val)
|
||||
static inline float sqrt_neg( float val )
|
||||
{
|
||||
return sqrtf( fabs( val ) ) * sign( val );
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user