diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-12 14:43:24 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-12 14:43:24 +0000 |
commit | bc89fe0147c04b67141936d109c00dfd4d69cc4b (patch) | |
tree | 544ff450c40fe1f43853a8420228a26f27f1eafb /libs/ardour/crossfade.cc | |
parent | 30daaebaa2d90d6b0e8673143ccc3cacd7bd1753 (diff) |
most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas.cc; builds and runs and does a few specific things but expect it to be buggy for a while yet
git-svn-id: svn://localhost/ardour2/branches/3.0@4313 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/crossfade.cc')
-rw-r--r-- | libs/ardour/crossfade.cc | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index 05ea7765f0..3a7b525db6 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -217,22 +217,57 @@ Crossfade::initialize () _fade_out.freeze (); _fade_out.clear (); - _fade_out.add (0.0, 1.0); - _fade_out.add ((_length * 0.1), 0.99); - _fade_out.add ((_length * 0.2), 0.97); - _fade_out.add ((_length * 0.8), 0.03); - _fade_out.add ((_length * 0.9), 0.01); - _fade_out.add (_length, 0.0); + +#define EQUAL_POWER_MINUS_3DB +#ifdef EQUAL_POWER_MINUS_3DB + + _fade_out.add ((_length * 0.000000), 1.000000); + _fade_out.add ((_length * 0.166667), 0.948859); + _fade_out.add ((_length * 0.333333), 0.851507); + _fade_out.add ((_length * 0.500000), 0.707946); + _fade_out.add ((_length * 0.666667), 0.518174); + _fade_out.add ((_length * 0.833333), 0.282192); + _fade_out.add ((_length * 1.000000), 0.000000); + +#else // EQUAL_POWER_MINUS_6DB + + _fade_out.add ((_length * 0.000000), 1.000000); + _fade_out.add ((_length * 0.166667), 0.833033); + _fade_out.add ((_length * 0.333333), 0.666186); + _fade_out.add ((_length * 0.500000), 0.499459); + _fade_out.add ((_length * 0.666667), 0.332853); + _fade_out.add ((_length * 0.833333), 0.166366); + _fade_out.add ((_length * 1.000000), 0.000000); +#endif + _fade_out.thaw (); _fade_in.freeze (); _fade_in.clear (); - _fade_in.add (0.0, 0.0); - _fade_in.add ((_length * 0.1), 0.01); - _fade_in.add ((_length * 0.2), 0.03); - _fade_in.add ((_length * 0.8), 0.97); - _fade_in.add ((_length * 0.9), 0.99); - _fade_in.add (_length, 1.0); + +#define EQUAL_POWER_MINUS_3DB +#ifdef EQUAL_POWER_MINUS_3DB + + _fade_in.add ((_length * 0.000000), 0.000000); + _fade_in.add ((_length * 0.166667), 0.282192); + _fade_in.add ((_length * 0.333333), 0.518174); + _fade_in.add ((_length * 0.500000), 0.707946); + _fade_in.add ((_length * 0.666667), 0.851507); + _fade_in.add ((_length * 0.833333), 0.948859); + _fade_in.add ((_length * 1.000000), 1.000000); + +#else // EQUAL_POWER_MINUS_SIX_DB + + _fade_in.add ((_length * 0.000000), 0.000000); + _fade_in.add ((_length * 0.166667), 0.166366); + _fade_in.add ((_length * 0.333333), 0.332853); + _fade_in.add ((_length * 0.500000), 0.499459); + _fade_in.add ((_length * 0.666667), 0.666186); + _fade_in.add ((_length * 0.833333), 0.833033); + _fade_in.add ((_length * 1.000000), 1.000000); + +#endif + _fade_in.thaw (); overlap_type = _in->coverage (_out->position(), _out->last_frame()); |