mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-21 16:11:11 +01:00
Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches
This commit is contained in:
63
src/CrossFade.h
Normal file
63
src/CrossFade.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
CrossFade.h
|
||||
|
||||
(c) 2005 The Audacity Team
|
||||
Licensed under the GPL version 2.0
|
||||
|
||||
**********************************************************************/
|
||||
#ifndef __AUDACITY_CROSSFADE__
|
||||
#define __AUDACITY_CROSSFADE__
|
||||
|
||||
/// This defines a crossfader class that
|
||||
/// accepts a list of WaveClips and can do a mini-mixing
|
||||
/// to produce the desired crossfading
|
||||
|
||||
#include "SampleFormat.h"
|
||||
#include "Resample.h"
|
||||
#include "WaveClip.h"
|
||||
|
||||
|
||||
enum FadeType
|
||||
{
|
||||
FT_MIX,
|
||||
FT_TRIANGULAR,
|
||||
FT_EXPONENTIAL
|
||||
};
|
||||
|
||||
class CrossFader
|
||||
{
|
||||
|
||||
public:
|
||||
CrossFader();
|
||||
~CrossFader();
|
||||
|
||||
//This sets a crossfade mode where the overlapping
|
||||
//tracks are simply mixed equally.
|
||||
void SetMixCrossFade(){mType = FT_MIX;};
|
||||
void SetTriangularCrossFade(){mType = FT_TRIANGULAR;};
|
||||
void SetExponentialCrossFade(){mType = FT_EXPONENTIAL;};
|
||||
|
||||
void AddClip( WaveClip * clip);
|
||||
void ClearClips();
|
||||
//Produces samples according to crossfading rules.
|
||||
bool GetSamples(samplePtr buffer, sampleFormat format,
|
||||
sampleCount start, sampleCount len);
|
||||
|
||||
protected:
|
||||
WaveClipList mClips;
|
||||
|
||||
private:
|
||||
|
||||
bool CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount start, sampleCount len);
|
||||
|
||||
FadeType mType;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user