mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-17 14:11:13 +01:00
Migrating the remaining effects
This brings the builtin, LV2, and VAMP effects inline with the Audio Units, LADSPA, and VST effects. All effects now share a common UI. This gives all effects (though not implemented for all): User and factory preset capability Preset import/export capability Shared or private configuration options Builtin effects can now be migrated to RTP, depending on algorithm. LV2 effects now support graphical interfaces if the plugin supplies one. Nyquist prompt enhanced to provide some features of the Nyquist Workbench. It may not look like it, but this was a LOT of work, so trust me, there WILL be problems and everything effect related should be suspect. Keep a sharp eye (or two) open.
This commit is contained in:
@@ -8,57 +8,92 @@
|
||||
|
||||
*******************************************************************//**
|
||||
|
||||
\class EffectFadeIn
|
||||
\brief An EffectSimpleMono
|
||||
|
||||
*//****************************************************************//**
|
||||
|
||||
\class EffectFadeOut
|
||||
\brief An EffectSimpleMono
|
||||
\class EffectFade
|
||||
\brief An Effect
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
|
||||
#include <wx/intl.h>
|
||||
|
||||
#include "Fade.h"
|
||||
#include "../WaveTrack.h"
|
||||
|
||||
#include <wx/generic/textdlgg.h>
|
||||
#include <math.h>
|
||||
|
||||
bool EffectFadeIn::NewTrackSimpleMono()
|
||||
EffectFade::EffectFade(bool fadeIn)
|
||||
{
|
||||
mFadeIn = fadeIn;
|
||||
}
|
||||
|
||||
EffectFade::~EffectFade()
|
||||
{
|
||||
}
|
||||
|
||||
// IdentInterface implementation
|
||||
|
||||
wxString EffectFade::GetSymbol()
|
||||
{
|
||||
return mFadeIn
|
||||
? FADEIN_PLUGIN_SYMBOL
|
||||
: FADEOUT_PLUGIN_SYMBOL;
|
||||
}
|
||||
|
||||
wxString EffectFade::GetDescription()
|
||||
{
|
||||
return mFadeIn
|
||||
? wxTRANSLATE("Applies a linear fade-in to the selected audio")
|
||||
: wxTRANSLATE("Applies a linear fade-out to the selected audio");
|
||||
}
|
||||
|
||||
// EffectIdentInterface implementation
|
||||
|
||||
EffectType EffectFade::GetType()
|
||||
{
|
||||
return EffectTypeProcess;
|
||||
}
|
||||
|
||||
bool EffectFade::IsInteractive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// EffectClientInterface implementation
|
||||
|
||||
int EffectFade::GetAudioInCount()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int EffectFade::GetAudioOutCount()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool EffectFade::ProcessInitialize(sampleCount WXUNUSED(totalLen), ChannelNames WXUNUSED(chanMap))
|
||||
{
|
||||
mLen = (int)((mCurT1 - mCurT0) * mCurRate + 0.5);
|
||||
mSample = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EffectFadeIn::ProcessSimpleMono(float *buffer, sampleCount len)
|
||||
sampleCount EffectFade::ProcessBlock(float **inBlock, float **outBlock, sampleCount blockLen)
|
||||
{
|
||||
for (sampleCount i = 0; i < len; i++)
|
||||
buffer[i] = (float) (buffer[i] * (float) (mSample + i)
|
||||
/ (float) (mLen));
|
||||
mSample += len;
|
||||
float *ibuf = inBlock[0];
|
||||
float *obuf = outBlock[0];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EffectFadeOut::NewTrackSimpleMono()
|
||||
{
|
||||
mLen = (int)((mCurT1 - mCurT0) * mCurRate + 0.5);
|
||||
mSample = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EffectFadeOut::ProcessSimpleMono(float *buffer, sampleCount len)
|
||||
{
|
||||
for (sampleCount i = 0; i < len; i++)
|
||||
buffer[i] = (float) (buffer[i]
|
||||
* (float) (mLen - 1 - (mSample + i))
|
||||
/ (float) (mLen));
|
||||
mSample += len;
|
||||
|
||||
return true;
|
||||
if (mFadeIn)
|
||||
{
|
||||
for (sampleCount i = 0; i < blockLen; i++)
|
||||
{
|
||||
obuf[i] = (ibuf[i] * ((float) mSample++)) / mSampleCnt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (sampleCount i = 0; i < blockLen; i++)
|
||||
{
|
||||
obuf[i] = (ibuf[i] * ((float) mSampleCnt - 1 - mSample++)) / mSampleCnt;
|
||||
}
|
||||
}
|
||||
|
||||
return blockLen;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user