Timeline/Fade: minor cleanup.

This commit is contained in:
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/.*/ * of type /type/.*/
/* FIXME: calling a function per sample is bad, switching on /* FIXME: calling a function per sample is bad, switching on
* type mid fade is bad. */ * type mid fade is bad. */
inline double inline float
gain ( const double fi ) const gain ( const float fi ) const
{ {
switch ( type ) switch ( type )
{ {
case Linear: case Linear:
return fi; return fi;
case Sigmoid: case Sigmoid:
return (1.0f - cos( fi * M_PI )) / 2.0f; return (1.0f - cosf( fi * M_PI )) * 0.5f;
case Logarithmic: case Logarithmic:
return pow( 0.1f, (1.0f - fi) * 3.0f ); return powf( 0.1f, (1.0f - fi) * 3.0f );
case Parabolic: case Parabolic:
return 1.0f - (1.0f - fi) * (1.0f - fi); return 1.0f - (1.0f - fi) * (1.0f - fi);
default: default: