Browse Source

Timeline/Fade: minor cleanup.

tags/non-daw-v1.2.0
Jonathan Moore Liles 11 years ago
parent
commit
46d2324446
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      timeline/src/Audio_Region.H

+ 4
- 4
timeline/src/Audio_Region.H 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:


Loading…
Cancel
Save