Timeline/Fade: minor cleanup.

pull/116/head
Jonathan Moore Liles 2013-08-14 17:55:14 -07:00
parent e578deb112
commit 46d2324446
1 changed files with 4 additions and 4 deletions

View File

@ -69,17 +69,17 @@ public:
* of type /type/.*/
/* FIXME: calling a function per sample is bad, switching on
* type mid fade is bad. */
inline double
gain ( const double fi ) const
inline float
gain ( const float fi ) const
{
switch ( type )
{
case Linear:
return fi;
case Sigmoid:
return (1.0f - cos( fi * M_PI )) / 2.0f;
return (1.0f - cosf( fi * M_PI )) * 0.5f;
case Logarithmic:
return pow( 0.1f, (1.0f - fi) * 3.0f );
return powf( 0.1f, (1.0f - fi) * 3.0f );
case Parabolic:
return 1.0f - (1.0f - fi) * (1.0f - fi);
default: