Effects are registered, not exhaustively listed

This commit is contained in:
Paul Licameli 2020-01-19 19:18:16 -05:00
commit 8832621b0a
68 changed files with 439 additions and 316 deletions

View File

@ -20,6 +20,7 @@
#include "../Audacity.h"
#include "Amplify.h"
#include "LoadEffects.h"
#include <math.h>
#include <float.h>
@ -58,6 +59,11 @@ Param( Clipping, bool, wxT("AllowClipping"), false, false, true, 1
// EffectAmplify
//
const ComponentInterfaceSymbol EffectAmplify::Symbol
{ XO("Amplify") };
namespace{ BuiltinEffectsModule::Registration< EffectAmplify > reg; }
BEGIN_EVENT_TABLE(EffectAmplify, wxEvtHandler)
EVT_SLIDER(ID_Amp, EffectAmplify::OnAmpSlider)
EVT_TEXT(ID_Amp, EffectAmplify::OnAmpText)
@ -84,7 +90,7 @@ EffectAmplify::~EffectAmplify()
ComponentInterfaceSymbol EffectAmplify::GetSymbol()
{
return AMPLIFY_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectAmplify::GetDescription()

View File

@ -17,7 +17,6 @@
#include "Effect.h"
#define AMPLIFY_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Amplify") }
class wxSlider;
class wxCheckBox;
@ -27,6 +26,8 @@ class ShuttleGui;
class EffectAmplify final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectAmplify();
virtual ~EffectAmplify();

View File

@ -18,6 +18,7 @@
#include "../Audacity.h"
#include "AutoDuck.h"
#include "LoadEffects.h"
#include <math.h>
#include <float.h>
@ -74,6 +75,11 @@ struct AutoDuckRegion
* Effect implementation
*/
const ComponentInterfaceSymbol EffectAutoDuck::Symbol
{ XO("Auto Duck") };
namespace{ BuiltinEffectsModule::Registration< EffectAutoDuck > reg; }
BEGIN_EVENT_TABLE(EffectAutoDuck, wxEvtHandler)
EVT_TEXT(wxID_ANY, EffectAutoDuck::OnValueChanged)
END_EVENT_TABLE()
@ -103,7 +109,7 @@ EffectAutoDuck::~EffectAutoDuck()
ComponentInterfaceSymbol EffectAutoDuck::GetSymbol()
{
return AUTODUCK_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectAutoDuck::GetDescription()

View File

@ -20,11 +20,11 @@ class ShuttleGui;
#define AUTO_DUCK_PANEL_NUM_CONTROL_POINTS 5
#define AUTODUCK_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Auto Duck") }
class EffectAutoDuck final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectAutoDuck();
virtual ~EffectAutoDuck();

View File

@ -16,6 +16,7 @@
#include "../Audacity.h"
#include "BassTreble.h"
#include "LoadEffects.h"
#include "../Experimental.h"
@ -58,6 +59,11 @@ enum kShelfType
kTreble
};
const ComponentInterfaceSymbol EffectBassTreble::Symbol
{ XO("Bass and Treble") };
namespace{ BuiltinEffectsModule::Registration< EffectBassTreble > reg; }
BEGIN_EVENT_TABLE(EffectBassTreble, wxEvtHandler)
EVT_SLIDER(ID_Bass, EffectBassTreble::OnBassSlider)
EVT_SLIDER(ID_Treble, EffectBassTreble::OnTrebleSlider)
@ -86,7 +92,7 @@ EffectBassTreble::~EffectBassTreble()
ComponentInterfaceSymbol EffectBassTreble::GetSymbol()
{
return BASSTREBLE_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectBassTreble::GetDescription()

View File

@ -19,8 +19,6 @@ class wxCheckBox;
class wxTextCtrl;
class ShuttleGui;
#define BASSTREBLE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Bass and Treble") }
class EffectBassTrebleState
{
public:
@ -38,6 +36,8 @@ public:
class EffectBassTreble final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectBassTreble();
virtual ~EffectBassTreble();

View File

@ -19,6 +19,7 @@ the pitch without changing the tempo.
#if USE_SOUNDTOUCH
#include "ChangePitch.h"
#include "LoadEffects.h"
#if USE_SBSMS
#include <wx/valgen.h>
@ -81,6 +82,11 @@ static const double kSliderWarp = 1.30105; // warp power takes max from 10
// EffectChangePitch
const ComponentInterfaceSymbol EffectChangePitch::Symbol
{ XO("Change Pitch") };
namespace{ BuiltinEffectsModule::Registration< EffectChangePitch > reg; }
BEGIN_EVENT_TABLE(EffectChangePitch, wxEvtHandler)
EVT_CHOICE(ID_FromPitch, EffectChangePitch::OnChoice_FromPitch)
EVT_TEXT(ID_FromOctave, EffectChangePitch::OnSpin_FromOctave)
@ -136,7 +142,7 @@ EffectChangePitch::~EffectChangePitch()
ComponentInterfaceSymbol EffectChangePitch::GetSymbol()
{
return CHANGEPITCH_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectChangePitch::GetDescription()

View File

@ -34,11 +34,11 @@ class wxTextCtrl;
class wxSpinCtrl;
class ShuttleGui;
#define CHANGEPITCH_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Change Pitch") }
class EffectChangePitch final : public EffectSoundTouch
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectChangePitch();
virtual ~EffectChangePitch();

View File

@ -15,6 +15,7 @@
#include "../Audacity.h"
#include "ChangeSpeed.h"
#include "LoadEffects.h"
#include <math.h>
@ -75,6 +76,11 @@ static const double kSliderWarp = 1.30105; // warp power takes max from 100
// EffectChangeSpeed
//
const ComponentInterfaceSymbol EffectChangeSpeed::Symbol
{ XO("Change Speed") };
namespace{ BuiltinEffectsModule::Registration< EffectChangeSpeed > reg; }
BEGIN_EVENT_TABLE(EffectChangeSpeed, wxEvtHandler)
EVT_TEXT(ID_PercentChange, EffectChangeSpeed::OnText_PercentChange)
EVT_TEXT(ID_Multiplier, EffectChangeSpeed::OnText_Multiplier)
@ -108,7 +114,7 @@ EffectChangeSpeed::~EffectChangeSpeed()
ComponentInterfaceSymbol EffectChangeSpeed::GetSymbol()
{
return CHANGESPEED_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectChangeSpeed::GetDescription()

View File

@ -21,11 +21,11 @@ class wxTextCtrl;
class NumericTextCtrl;
class ShuttleGui;
#define CHANGESPEED_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Change Speed") }
class EffectChangeSpeed final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectChangeSpeed();
virtual ~EffectChangeSpeed();

View File

@ -36,6 +36,8 @@
#include "../widgets/valnum.h"
#include "TimeWarper.h"
#include "LoadEffects.h"
// Soundtouch defines these as well, which are also in generated configmac.h
// and configunix.h, so get rid of them before including,
// to avoid compiler warnings, and be sure to do this
@ -75,6 +77,11 @@ static const double kSliderWarp = 1.30105; // warp power takes max from 100
// EffectChangeTempo
//
const ComponentInterfaceSymbol EffectChangeTempo::Symbol
{ XO("Change Tempo") };
namespace{ BuiltinEffectsModule::Registration< EffectChangeTempo > reg; }
BEGIN_EVENT_TABLE(EffectChangeTempo, wxEvtHandler)
EVT_TEXT(ID_PercentChange, EffectChangeTempo::OnText_PercentChange)
EVT_SLIDER(ID_PercentChange, EffectChangeTempo::OnSlider_PercentChange)
@ -110,7 +117,7 @@ EffectChangeTempo::~EffectChangeTempo()
ComponentInterfaceSymbol EffectChangeTempo::GetSymbol()
{
return CHANGETEMPO_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectChangeTempo::GetDescription()

View File

@ -28,11 +28,11 @@ class wxCheckBox;
class wxTextCtrl;
class ShuttleGui;
#define CHANGETEMPO_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Change Tempo") }
class EffectChangeTempo final : public EffectSoundTouch
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectChangeTempo();
virtual ~EffectChangeTempo();

View File

@ -26,6 +26,7 @@
#include "../Audacity.h"
#include "ClickRemoval.h"
#include "LoadEffects.h"
#include <math.h>
@ -53,6 +54,11 @@ enum
Param( Threshold, int, wxT("Threshold"), 200, 0, 900, 1 );
Param( Width, int, wxT("Width"), 20, 0, 40, 1 );
const ComponentInterfaceSymbol EffectClickRemoval::Symbol
{ XO("Click Removal") };
namespace{ BuiltinEffectsModule::Registration< EffectClickRemoval > reg; }
BEGIN_EVENT_TABLE(EffectClickRemoval, wxEvtHandler)
EVT_SLIDER(ID_Thresh, EffectClickRemoval::OnThreshSlider)
EVT_SLIDER(ID_Width, EffectClickRemoval::OnWidthSlider)
@ -79,7 +85,7 @@ EffectClickRemoval::~EffectClickRemoval()
ComponentInterfaceSymbol EffectClickRemoval::GetSymbol()
{
return CLICKREMOVAL_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectClickRemoval::GetDescription()

View File

@ -23,11 +23,11 @@ class wxTextCtrl;
class Envelope;
class ShuttleGui;
#define CLICKREMOVAL_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Click Removal") }
class EffectClickRemoval final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectClickRemoval();
virtual ~EffectClickRemoval();

View File

@ -26,6 +26,7 @@
#include "../Audacity.h"
#include "Compressor.h"
#include "LoadEffects.h"
#include <math.h>
@ -71,6 +72,11 @@ Param( UsePeak, bool, wxT("UsePeak"), false, false, true, 1
// EffectCompressor
//----------------------------------------------------------------------------
const ComponentInterfaceSymbol EffectCompressor::Symbol
{ XO("Compressor") };
namespace{ BuiltinEffectsModule::Registration< EffectCompressor > reg; }
BEGIN_EVENT_TABLE(EffectCompressor, wxEvtHandler)
EVT_SLIDER(wxID_ANY, EffectCompressor::OnSlider)
END_EVENT_TABLE()
@ -101,7 +107,7 @@ EffectCompressor::~EffectCompressor()
ComponentInterfaceSymbol EffectCompressor::GetSymbol()
{
return COMPRESSOR_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectCompressor::GetDescription()

View File

@ -19,11 +19,10 @@ class wxStaticText;
class EffectCompressorPanel;
class ShuttleGui;
#define COMPRESSOR_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Compressor") }
class EffectCompressor final : public EffectTwoPassSimpleMono
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectCompressor();
virtual ~EffectCompressor();

View File

@ -18,6 +18,7 @@
#include "../Audacity.h"
#include "Distortion.h"
#include "LoadEffects.h"
#include "../Experimental.h"
@ -146,6 +147,11 @@ TranslatableString defaultLabel(int index)
// EffectDistortion
//
const ComponentInterfaceSymbol EffectDistortion::Symbol
{ XO("Distortion") };
namespace{ BuiltinEffectsModule::Registration< EffectDistortion > reg; }
BEGIN_EVENT_TABLE(EffectDistortion, wxEvtHandler)
EVT_CHOICE(ID_Type, EffectDistortion::OnTypeChoice)
EVT_CHECKBOX(ID_DCBlock, EffectDistortion::OnDCBlockCheckbox)
@ -187,7 +193,7 @@ EffectDistortion::~EffectDistortion()
ComponentInterfaceSymbol EffectDistortion::GetSymbol()
{
return DISTORTION_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectDistortion::GetDescription()

View File

@ -21,7 +21,6 @@ class wxCheckBox;
class wxTextCtrl;
class ShuttleGui;
#define DISTORTION_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Distortion") }
#define STEPS 1024 // number of +ve or -ve steps in lookup tabe
#define TABLESIZE 2049 // size of lookup table (steps * 2 + 1)
@ -46,6 +45,8 @@ public:
class EffectDistortion final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectDistortion();
virtual ~EffectDistortion();

View File

@ -15,6 +15,7 @@
#include "../Audacity.h"
#include "DtmfGen.h"
#include "LoadEffects.h"
#include "../Experimental.h"
@ -74,6 +75,11 @@ const static wxChar *kSymbols[] =
// EffectDtmf
//
const ComponentInterfaceSymbol EffectDtmf::Symbol
{ XO("DTMF Tones") };
namespace{ BuiltinEffectsModule::Registration< EffectDtmf > reg; }
BEGIN_EVENT_TABLE(EffectDtmf, wxEvtHandler)
EVT_TEXT(ID_Sequence, EffectDtmf::OnSequence)
EVT_TEXT(ID_DutyCycle, EffectDtmf::OnAmplitude)
@ -98,7 +104,7 @@ EffectDtmf::~EffectDtmf()
ComponentInterfaceSymbol EffectDtmf::GetSymbol()
{
return DTMFTONES_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectDtmf::GetDescription()

View File

@ -22,11 +22,11 @@ class wxTextCtrl;
class NumericTextCtrl;
class ShuttleGui;
#define DTMFTONES_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("DTMF Tones") }
class EffectDtmf final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectDtmf();
virtual ~EffectDtmf();

View File

@ -21,6 +21,7 @@
#include "../Audacity.h"
#include "Echo.h"
#include "LoadEffects.h"
#include <float.h>
@ -37,6 +38,11 @@
Param( Delay, float, wxT("Delay"), 1.0f, 0.001f, FLT_MAX, 1.0f );
Param( Decay, float, wxT("Decay"), 0.5f, 0.0f, FLT_MAX, 1.0f );
const ComponentInterfaceSymbol EffectEcho::Symbol
{ XO("Echo") };
namespace{ BuiltinEffectsModule::Registration< EffectEcho > reg; }
EffectEcho::EffectEcho()
{
delay = DEF_Delay;
@ -53,7 +59,7 @@ EffectEcho::~EffectEcho()
ComponentInterfaceSymbol EffectEcho::GetSymbol()
{
return ECHO_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectEcho::GetDescription()

View File

@ -16,11 +16,11 @@
class ShuttleGui;
#define ECHO_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Echo") }
class EffectEcho final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectEcho();
virtual ~EffectEcho();

View File

@ -54,6 +54,7 @@
#include "../Audacity.h"
#include "Equalization.h"
#include "LoadEffects.h"
#include "../Experimental.h"
@ -191,6 +192,23 @@ Param( dBMax, float, wxT(""), 30.0, 0.0, 60.0,
// EffectEqualization
//----------------------------------------------------------------------------
const ComponentInterfaceSymbol EffectEqualization::Symbol
{ XO("Equalization") };
// namespace{ BuiltinEffectsModule::Registration< EffectEqualization > reg; }
// "Filter Curve EQ" in the user-facing string, but preserve the old
// internal string
const ComponentInterfaceSymbol EffectEqualizationCurve::Symbol
{ wxT("Filter Curve"), XO("Filter Curve EQ") };
namespace{ BuiltinEffectsModule::Registration< EffectEqualizationCurve > reg2; }
const ComponentInterfaceSymbol EffectEqualizationGraphic::Symbol
{ wxT("Graphic EQ"), XO("Graphic EQ") };
namespace{ BuiltinEffectsModule::Registration< EffectEqualizationGraphic > reg3; }
BEGIN_EVENT_TABLE(EffectEqualization, wxEvtHandler)
EVT_SIZE( EffectEqualization::OnSize )
@ -303,10 +321,10 @@ EffectEqualization::~EffectEqualization()
ComponentInterfaceSymbol EffectEqualization::GetSymbol()
{
if( mOptions == kEqOptionGraphic )
return GRAPHIC_EQ_PLUGIN_SYMBOL;
return EffectEqualizationGraphic::Symbol;
if( mOptions == kEqOptionCurve )
return FILTER_CURVE_PLUGIN_SYMBOL;
return EQUALIZATION_PLUGIN_SYMBOL;
return EffectEqualizationCurve::Symbol;
return EffectEqualization::Symbol;
}
TranslatableString EffectEqualization::GetDescription()

View File

@ -22,15 +22,6 @@
#include "Effect.h"
#include "../RealFFTf.h"
#define EQUALIZATION_PLUGIN_SYMBOL \
ComponentInterfaceSymbol{ XO("Equalization") }
#define GRAPHIC_EQ_PLUGIN_SYMBOL \
ComponentInterfaceSymbol{ wxT("Graphic EQ"), XO("Graphic EQ") }
// "Filter Curve EQ" in the user-facing string, but preserve the old
// internal string
#define FILTER_CURVE_PLUGIN_SYMBOL \
ComponentInterfaceSymbol{ wxT("Filter Curve"), XO("Filter Curve EQ") }
// Flags to specialise the UI
const int kEqOptionGraphic =1;
const int kEqOptionCurve =1<<1;
@ -100,11 +91,14 @@ using EQCurveArray = std::vector<EQCurve>;
class EffectEqualization48x;
#endif
class EffectEqualization final : public Effect,
class EffectEqualization : public Effect,
public XMLTagHandler
{
public:
EffectEqualization(int Options);
static const ComponentInterfaceSymbol Symbol;
EffectEqualization(int Options = kEqLegacy);
virtual ~EffectEqualization();
// ComponentInterface implementation
@ -290,6 +284,22 @@ private:
friend class EditCurvesDialog;
};
class EffectEqualizationCurve final : public EffectEqualization
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectEqualizationCurve() : EffectEqualization( kEqOptionCurve ) {}
};
class EffectEqualizationGraphic final : public EffectEqualization
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectEqualizationGraphic() : EffectEqualization( kEqOptionGraphic ) {}
};
class EqualizationPanel final : public wxPanelWrapper
{
public:

View File

@ -18,6 +18,18 @@
#include <wx/intl.h>
#include "LoadEffects.h"
const ComponentInterfaceSymbol EffectFadeIn::Symbol
{ XO("Fade In") };
namespace{ BuiltinEffectsModule::Registration< EffectFadeIn > reg; }
const ComponentInterfaceSymbol EffectFadeOut::Symbol
{ XO("Fade Out") };
namespace{ BuiltinEffectsModule::Registration< EffectFadeOut > reg2; }
EffectFade::EffectFade(bool fadeIn)
{
mFadeIn = fadeIn;
@ -32,8 +44,8 @@ EffectFade::~EffectFade()
ComponentInterfaceSymbol EffectFade::GetSymbol()
{
return mFadeIn
? FADEIN_PLUGIN_SYMBOL
: FADEOUT_PLUGIN_SYMBOL;
? EffectFadeIn::Symbol
: EffectFadeOut::Symbol;
}
TranslatableString EffectFade::GetDescription()

View File

@ -13,10 +13,7 @@
#include "Effect.h"
#define FADEIN_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Fade In") }
#define FADEOUT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Fade Out") }
class EffectFade final : public Effect
class EffectFade : public Effect
{
public:
EffectFade(bool fadeIn = false);
@ -40,10 +37,27 @@ public:
size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override;
private:
// EffectFadeIn implementation
// EffectFade implementation
bool mFadeIn;
sampleCount mSample;
};
class EffectFadeIn final : public EffectFade
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectFadeIn() : EffectFade{ true } {}
};
class EffectFadeOut final : public EffectFade
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectFadeOut() : EffectFade{ false } {}
};
#endif

View File

@ -21,6 +21,7 @@
#include "../Audacity.h"
#include "FindClipping.h"
#include "LoadEffects.h"
#include <math.h>
@ -40,6 +41,11 @@
Param( Start, int, wxT("Duty Cycle Start"), 3, 1, INT_MAX, 1 );
Param( Stop, int, wxT("Duty Cycle End"), 3, 1, INT_MAX, 1 );
const ComponentInterfaceSymbol EffectFindClipping::Symbol
{ XO("Find Clipping") };
namespace{ BuiltinEffectsModule::Registration< EffectFindClipping > reg; }
EffectFindClipping::EffectFindClipping()
{
mStart = DEF_Start;
@ -54,7 +60,7 @@ EffectFindClipping::~EffectFindClipping()
ComponentInterfaceSymbol EffectFindClipping::GetSymbol()
{
return FINDCLIPPING_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectFindClipping::GetDescription()

View File

@ -18,11 +18,11 @@ class LabelTrack;
#include "Effect.h"
#define FINDCLIPPING_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Find Clipping") }
class EffectFindClipping final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectFindClipping();
virtual ~EffectFindClipping();

View File

@ -19,6 +19,13 @@
#include <wx/intl.h>
#include "LoadEffects.h"
const ComponentInterfaceSymbol EffectInvert::Symbol
{ XO("Invert") };
namespace{ BuiltinEffectsModule::Registration< EffectInvert > reg; }
EffectInvert::EffectInvert()
{
}
@ -31,7 +38,7 @@ EffectInvert::~EffectInvert()
ComponentInterfaceSymbol EffectInvert::GetSymbol()
{
return INVERT_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectInvert::GetDescription()

View File

@ -15,11 +15,11 @@
#include "Effect.h"
#define INVERT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Invert") }
class EffectInvert final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectInvert();
virtual ~EffectInvert();

View File

@ -14,185 +14,32 @@
#include "../Audacity.h" // for USE_* macros
#include "LoadEffects.h"
#include "../Experimental.h"
#include "../Prefs.h"
#include "Amplify.h"
#include "AutoDuck.h"
#include "BassTreble.h"
#include "ChangeSpeed.h"
#include "ClickRemoval.h"
#include "Compressor.h"
#include "Distortion.h"
#include "DtmfGen.h"
#include "Echo.h"
#include "Paulstretch.h"
#include "Equalization.h"
#include "Fade.h"
#include "Invert.h"
#include "Loudness.h"
#include "Noise.h"
#ifdef EXPERIMENTAL_NOISE_REDUCTION
#include "NoiseReduction.h"
#endif
#include "NoiseRemoval.h"
#include "Normalize.h"
#include "Phaser.h"
#include "Repair.h"
#include "Repeat.h"
#include "Reverb.h"
#include "Reverse.h"
#include "Silence.h"
#include "ScienFilter.h"
#include "StereoToMono.h"
#ifdef USE_SBSMS
#include "TimeScale.h"
#endif
#include "ToneGen.h"
#include "TruncSilence.h"
#include "Wahwah.h"
#include "Effect.h"
#include "FindClipping.h"
static bool sInitialized = false;
#ifdef USE_SOUNDTOUCH
#include "ChangePitch.h"
#include "ChangeTempo.h"
#endif
struct BuiltinEffectsModule::Entry {
wxString name;
BuiltinEffectsModule::Factory factory;
bool excluded;
//
// Include the SoundTouch effects, if requested
//
#if defined(USE_SOUNDTOUCH)
#define SOUNDTOUCH_EFFECTS \
EFFECT( CHANGEPITCH, EffectChangePitch, () ) \
EFFECT( CHANGETEMPO, EffectChangeTempo, () )
#else
#define SOUNDTOUCH_EFFECTS
#endif
//
// Select the desired Noise Reduction/Removal effect
//
#if defined(EXPERIMENTAL_NOISE_REDUCTION)
#define NOISEREDUCTION_EFFECT \
EFFECT( NOISEREDUCTION, EffectNoiseReduction, () )
#else
#define NOISEREDUCTION_EFFECT \
EFFECT( NOISEREMOVAL, EffectNoiseRemoval, () )
#endif
//
// Include the Classic Filters effect, if requested
//
#if defined(EXPERIMENTAL_SCIENCE_FILTERS)
#define CLASSICFILTER_EFFECT \
EFFECT( CLASSICFILTERS, EffectScienFilter, () )
#else
#define CLASSICFILTER_EFFECT
#endif
//
// Include the SBSMS effect, if requested
//
#if defined(USE_SBSMS)
#define SBSMS_EFFECTS \
EFFECT( TIMESCALE, EffectTimeScale, () )
#else
#define SBSMS_EFFECTS
#endif
//
// Define the list of effects that will be autoregistered and how to instantiate each
//
#define EFFECT_LIST \
EFFECT( CHIRP, EffectToneGen, (true) ) \
EFFECT( DTMFTONES, EffectDtmf, () ) \
EFFECT( NOISE, EffectNoise, () ) \
EFFECT( SILENCE, EffectSilence, () ) \
EFFECT( TONE, EffectToneGen, (false) ) \
EFFECT( AMPLIFY, EffectAmplify, () ) \
EFFECT( BASSTREBLE, EffectBassTreble, () ) \
EFFECT( CHANGESPEED, EffectChangeSpeed, () ) \
EFFECT( CLICKREMOVAL, EffectClickRemoval, () ) \
EFFECT( COMPRESSOR, EffectCompressor, () ) \
EFFECT( DISTORTION, EffectDistortion, () ) \
EFFECT( ECHO, EffectEcho, () ) \
EFFECT( FADEIN, EffectFade, (true) ) \
EFFECT( FADEOUT, EffectFade, (false) ) \
EFFECT( FILTER_CURVE, EffectEqualization, (kEqOptionCurve) ) \
EFFECT( GRAPHIC_EQ, EffectEqualization, (kEqOptionGraphic) ) \
EFFECT( INVERT, EffectInvert, () ) \
EFFECT( LOUDNESS , EffectLoudness, () ) \
EFFECT( NORMALIZE, EffectNormalize, () ) \
EFFECT( PHASER, EffectPhaser, () ) \
EFFECT( REPAIR, EffectRepair, () ) \
EFFECT( REPEAT, EffectRepeat, () ) \
EFFECT( REVERB, EffectReverb, () ) \
EFFECT( REVERSE, EffectReverse, () ) \
EFFECT( STEREOTOMONO, EffectStereoToMono, () ) \
EFFECT( TRUNCATESILENCE, EffectTruncSilence, () ) \
EFFECT( WAHWAH, EffectWahwah, () ) \
EFFECT( FINDCLIPPING, EffectFindClipping, () ) \
NOISEREDUCTION_EFFECT \
SOUNDTOUCH_EFFECTS \
EFFECT( AUTODUCK, EffectAutoDuck, () ) \
EFFECT( PAULSTRETCH, EffectPaulstretch, () ) \
SBSMS_EFFECTS
//EFFECT( EQUALIZATION, EffectEqualization, (kEqLegacy) ) \
//
// Define the list of effects that do not get autoregistered
//
#define EXCLUDE_LIST \
CLASSICFILTER_EFFECT
//
// Define the EFFECT() macro to generate enum names
//
#define EFFECT(n, i, args) ENUM_ ## n,
//
// Create the enum for the list of effects (will be used in a switch statement)
//
enum
{
EFFECT_LIST
EXCLUDE_LIST
using Entries = std::vector< Entry >;
static Entries &Registry()
{
static Entries result;
return result;
}
};
//
// Redefine EFFECT() to add the effect's name to an array
//
#undef EFFECT
#define EFFECT(n, i, args) results.push_back((n ## _PLUGIN_SYMBOL).Internal());
//
// Create the effect name array
//
static const std::vector<wxString> kEffectNames() {
std::vector<wxString> results;
EFFECT_LIST;
return results;
void BuiltinEffectsModule::DoRegistration(
const ComponentInterfaceSymbol &name, const Factory &factory, bool excluded )
{
wxASSERT( !sInitialized );
Entry::Registry().emplace_back( Entry{ name.Internal(), factory, excluded } );
}
//
// Create the effect name array of excluded effects
//
static const std::vector<wxString> kExcludedNames() {
std::vector<wxString> results;
EXCLUDE_LIST;
return results;
}
//
// Redefine EFFECT() to generate a case statement for the lookup switch
//
#undef EFFECT
#define EFFECT(n, i, args) case ENUM_ ## n: return std::make_unique<i> args;
// ============================================================================
// Module registration entry point
//
@ -271,18 +118,11 @@ TranslatableString BuiltinEffectsModule::GetDescription()
bool BuiltinEffectsModule::Initialize()
{
const auto &names = kEffectNames();
for (const auto &name : names)
{
mNames.push_back(wxString(BUILTIN_EFFECT_PREFIX) + name);
for ( const auto &entry : Entry::Registry() ) {
auto path = wxString(BUILTIN_EFFECT_PREFIX) + entry.name;
mEffects[ path ] = &entry;
}
const auto &excluded = kExcludedNames();
for (const auto &name : excluded)
{
mNames.push_back(wxString(BUILTIN_EFFECT_PREFIX) + name);
}
sInitialized = true;
return true;
}
@ -308,11 +148,11 @@ const FileExtensions &BuiltinEffectsModule::GetFileExtensions()
bool BuiltinEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm)
{
TranslatableString ignoredErrMsg;
const auto &names = kEffectNames();
for (const auto &name : names)
for (const auto &pair : mEffects)
{
PluginPath path(wxString(BUILTIN_EFFECT_PREFIX) + name);
if ( pair.second->excluded )
continue;
const auto &path = pair.first;
if (!pm.IsPluginRegistered(path))
{
// No checking of error ?
@ -327,7 +167,10 @@ bool BuiltinEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm)
PluginPaths BuiltinEffectsModule::FindPluginPaths(PluginManagerInterface & WXUNUSED(pm))
{
return mNames;
PluginPaths names;
for ( const auto &pair : mEffects )
names.push_back( pair.first );
return names;
}
unsigned BuiltinEffectsModule::DiscoverPluginsAtPath(
@ -351,7 +194,7 @@ bool BuiltinEffectsModule::IsPluginValid(const PluginPath & path, bool bFast)
{
// bFast is unused as checking in the list is fast.
static_cast<void>(bFast);
return make_iterator_range( mNames ).contains( path );
return mEffects.find( path ) != mEffects.end();
}
ComponentInterface *BuiltinEffectsModule::CreateInstance(const PluginPath & path)
@ -376,14 +219,10 @@ void BuiltinEffectsModule::DeleteInstance(ComponentInterface *instance)
std::unique_ptr<Effect> BuiltinEffectsModule::Instantiate(const PluginPath & path)
{
wxASSERT(path.StartsWith(BUILTIN_EFFECT_PREFIX));
auto index = make_iterator_range( mNames ).index( path );
wxASSERT( index != wxNOT_FOUND );
switch ( index )
{
EFFECT_LIST;
EXCLUDE_LIST;
}
auto iter = mEffects.find( path );
if ( iter != mEffects.end() )
return iter->second->factory();
wxASSERT( false );
return nullptr;
}

View File

@ -10,6 +10,9 @@
#include "audacity/ModuleInterface.h"
#include <functional>
#include <memory>
#include <unordered_map>
#include "../MemoryX.h"
class Effect;
@ -26,6 +29,17 @@ public:
BuiltinEffectsModule(ModuleManagerInterface *moduleManager, const wxString *path);
virtual ~BuiltinEffectsModule();
using Factory = std::function< std::unique_ptr<Effect> () >;
// Typically you make a static object of this type in the .cpp file that
// also implements the Effect subclass.
template< typename Subclass >
struct Registration final { Registration( bool excluded = false ) {
DoRegistration(
Subclass::Symbol, []{ return std::make_unique< Subclass >(); },
excluded );
} };
// ComponentInterface implementation
PluginPath GetPath() override;
@ -61,8 +75,14 @@ private:
std::unique_ptr<Effect> Instantiate(const PluginPath & path);
private:
static void DoRegistration(
const ComponentInterfaceSymbol &name, const Factory &factory,
bool excluded );
ModuleManagerInterface *mModMan;
PluginPath mPath;
PluginPaths mNames;
struct Entry;
using EffectHash = std::unordered_map< wxString, const Entry* > ;
EffectHash mEffects;
};

View File

@ -31,6 +31,8 @@
#include "../widgets/valnum.h"
#include "../widgets/ProgressDialog.h"
#include "LoadEffects.h"
enum kNormalizeTargets
{
kLoudness,
@ -58,6 +60,11 @@ BEGIN_EVENT_TABLE(EffectLoudness, wxEvtHandler)
EVT_TEXT(wxID_ANY, EffectLoudness::OnUpdateUI)
END_EVENT_TABLE()
const ComponentInterfaceSymbol EffectLoudness::Symbol
{ XO("Loudness Normalization") };
namespace{ BuiltinEffectsModule::Registration< EffectLoudness > reg; }
EffectLoudness::EffectLoudness()
{
mStereoInd = DEF_StereoInd;
@ -77,7 +84,7 @@ EffectLoudness::~EffectLoudness()
ComponentInterfaceSymbol EffectLoudness::GetSymbol()
{
return LOUDNESS_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectLoudness::GetDescription()

View File

@ -24,11 +24,11 @@
class ShuttleGui;
#define LOUDNESS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Loudness Normalization") }
class EffectLoudness final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectLoudness();
virtual ~EffectLoudness();

View File

@ -15,6 +15,7 @@
#include "../Audacity.h"
#include "Noise.h"
#include "LoadEffects.h"
#include <math.h>
@ -55,6 +56,11 @@ Param( Amp, double, wxT("Amplitude"), 0.8, 0.0, 1.0, 1 );
// EffectNoise
//
const ComponentInterfaceSymbol EffectNoise::Symbol
{ XO("Noise") };
namespace{ BuiltinEffectsModule::Registration< EffectNoise > reg; }
EffectNoise::EffectNoise()
{
mType = DEF_Type;
@ -73,7 +79,7 @@ EffectNoise::~EffectNoise()
ComponentInterfaceSymbol EffectNoise::GetSymbol()
{
return NOISE_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectNoise::GetDescription()

View File

@ -18,11 +18,11 @@
class NumericTextCtrl;
class ShuttleGui;
#define NOISE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Noise") }
class EffectNoise final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectNoise();
virtual ~EffectNoise();

View File

@ -41,6 +41,7 @@
#include "../Experimental.h"
#include "LoadEffects.h"
#include "EffectManager.h"
#include "../ShuttleGui.h"
@ -420,6 +421,11 @@ private:
DECLARE_EVENT_TABLE()
};
const ComponentInterfaceSymbol EffectNoiseReduction::Symbol
{ XO("Noise Reduction") };
namespace{ BuiltinEffectsModule::Registration< EffectNoiseReduction > reg; }
EffectNoiseReduction::EffectNoiseReduction()
: mSettings(std::make_unique<EffectNoiseReduction::Settings>())
{
@ -434,7 +440,7 @@ EffectNoiseReduction::~EffectNoiseReduction()
ComponentInterfaceSymbol EffectNoiseReduction::GetSymbol()
{
return NOISEREDUCTION_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectNoiseReduction::GetDescription()

View File

@ -15,10 +15,9 @@
#include "Effect.h"
#define NOISEREDUCTION_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Noise Reduction") }
class EffectNoiseReduction final : public Effect {
public:
static const ComponentInterfaceSymbol Symbol;
EffectNoiseReduction();
virtual ~EffectNoiseReduction();

View File

@ -45,6 +45,8 @@
#if !defined(EXPERIMENTAL_NOISE_REDUCTION)
#include "LoadEffects.h"
#include "../WaveTrack.h"
#include "../Prefs.h"
#include "../FileNames.h"
@ -76,6 +78,11 @@
#include "../PlatformCompatibility.h"
const ComponentInterfaceSymbol EffectNoiseRemoval::Symbol
{ XO("Noise Removal") };
namespace{ BuiltinEffectsModule::Registration< EffectNoiseRemoval > reg; }
EffectNoiseRemoval::EffectNoiseRemoval()
{
mWindowSize = 2048;
@ -111,7 +118,7 @@ EffectNoiseRemoval::~EffectNoiseRemoval()
ComponentInterfaceSymbol EffectNoiseRemoval::GetSymbol()
{
return XO("Noise Removal");
return Symbol;
}
TranslatableString EffectNoiseRemoval::GetDescription()

View File

@ -33,11 +33,11 @@ class wxTextCtrl;
#include "../RealFFTf.h"
#define NOISEREMOVAL_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Noise Removal") }
class EffectNoiseRemoval final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectNoiseRemoval();
virtual ~EffectNoiseRemoval();

View File

@ -17,6 +17,7 @@
#include "../Audacity.h" // for rint from configwin.h
#include "Normalize.h"
#include "LoadEffects.h"
#include "../Experimental.h"
@ -43,6 +44,11 @@ Param( RemoveDC, bool, wxT("RemoveDcOffset"), true, false, true,
Param( ApplyGain, bool, wxT("ApplyGain"), true, false, true, 1 );
Param( StereoInd, bool, wxT("StereoIndependent"), false, false, true, 1 );
const ComponentInterfaceSymbol EffectNormalize::Symbol
{ XO("Normalize") };
namespace{ BuiltinEffectsModule::Registration< EffectNormalize > reg; }
BEGIN_EVENT_TABLE(EffectNormalize, wxEvtHandler)
EVT_CHECKBOX(wxID_ANY, EffectNormalize::OnUpdateUI)
EVT_TEXT(wxID_ANY, EffectNormalize::OnUpdateUI)
@ -66,7 +72,7 @@ EffectNormalize::~EffectNormalize()
ComponentInterfaceSymbol EffectNormalize::GetSymbol()
{
return NORMALIZE_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectNormalize::GetDescription()

View File

@ -22,11 +22,11 @@ class wxStaticText;
class wxTextCtrl;
class ShuttleGui;
#define NORMALIZE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Normalize") }
class EffectNormalize final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectNormalize();
virtual ~EffectNormalize();

View File

@ -16,6 +16,7 @@
#include "../Audacity.h"
#include "Paulstretch.h"
#include "LoadEffects.h"
#include <algorithm>
@ -83,6 +84,11 @@ private:
// EffectPaulstretch
//
const ComponentInterfaceSymbol EffectPaulstretch::Symbol
{ XO("Paulstretch") };
namespace{ BuiltinEffectsModule::Registration< EffectPaulstretch > reg; }
BEGIN_EVENT_TABLE(EffectPaulstretch, wxEvtHandler)
EVT_TEXT(wxID_ANY, EffectPaulstretch::OnText)
END_EVENT_TABLE()
@ -103,7 +109,7 @@ EffectPaulstretch::~EffectPaulstretch()
ComponentInterfaceSymbol EffectPaulstretch::GetSymbol()
{
return PAULSTRETCH_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectPaulstretch::GetDescription()

View File

@ -14,11 +14,11 @@
class ShuttleGui;
#define PAULSTRETCH_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Paulstretch") }
class EffectPaulstretch final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectPaulstretch();
virtual ~EffectPaulstretch();

View File

@ -21,6 +21,7 @@
#include "../Audacity.h"
#include "Phaser.h"
#include "LoadEffects.h"
#include "../Experimental.h"
@ -65,6 +66,11 @@ Param( OutGain, double, wxT("Gain"), -6.0, -30.0, 30.0, 1 );
// EffectPhaser
//
const ComponentInterfaceSymbol EffectPhaser::Symbol
{ XO("Phaser") };
namespace{ BuiltinEffectsModule::Registration< EffectPhaser > reg; }
BEGIN_EVENT_TABLE(EffectPhaser, wxEvtHandler)
EVT_SLIDER(ID_Stages, EffectPhaser::OnStagesSlider)
EVT_SLIDER(ID_DryWet, EffectPhaser::OnDryWetSlider)
@ -103,7 +109,7 @@ EffectPhaser::~EffectPhaser()
ComponentInterfaceSymbol EffectPhaser::GetSymbol()
{
return PHASER_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectPhaser::GetDescription()

View File

@ -24,8 +24,6 @@ class ShuttleGui;
#define NUM_STAGES 24
#define PHASER_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Phaser") }
class EffectPhaserState
{
public:
@ -44,6 +42,8 @@ public:
class EffectPhaser final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectPhaser();
virtual ~EffectPhaser();

View File

@ -32,6 +32,13 @@ the audio, rather than actually finding the clicks.
#include "../WaveTrack.h"
#include "../widgets/AudacityMessageBox.h"
#include "LoadEffects.h"
const ComponentInterfaceSymbol EffectRepair::Symbol
{ XO("Repair") };
namespace{ BuiltinEffectsModule::Registration< EffectRepair > reg; }
EffectRepair::EffectRepair()
{
}
@ -44,7 +51,7 @@ EffectRepair::~EffectRepair()
ComponentInterfaceSymbol EffectRepair::GetSymbol()
{
return REPAIR_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectRepair::GetDescription()

View File

@ -13,13 +13,13 @@
#include "Effect.h"
#define REPAIR_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Repair") }
class WaveTrack;
class EffectRepair final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectRepair();
virtual ~EffectRepair();

View File

@ -36,11 +36,18 @@
#include "../widgets/NumericTextCtrl.h"
#include "../widgets/valnum.h"
#include "LoadEffects.h"
// Define keys, defaults, minimums, and maximums for the effect parameters
//
// Name Type Key Def Min Max Scale
Param( Count, int, wxT("Count"), 1, 1, INT_MAX, 1 );
const ComponentInterfaceSymbol EffectRepeat::Symbol
{ XO("Repeat") };
namespace{ BuiltinEffectsModule::Registration< EffectRepeat > reg; }
BEGIN_EVENT_TABLE(EffectRepeat, wxEvtHandler)
EVT_TEXT(wxID_ANY, EffectRepeat::OnRepeatTextChange)
END_EVENT_TABLE()
@ -60,7 +67,7 @@ EffectRepeat::~EffectRepeat()
ComponentInterfaceSymbol EffectRepeat::GetSymbol()
{
return REPEAT_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectRepeat::GetDescription()

View File

@ -16,13 +16,13 @@
class wxTextCtrl;
class ShuttleGui;
#define REPEAT_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Repeat") }
class wxStaticText;
class EffectRepeat final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectRepeat();
virtual ~EffectRepeat();

View File

@ -16,6 +16,7 @@
#include "../Audacity.h"
#include "Reverb.h"
#include "LoadEffects.h"
#include <wx/arrstr.h>
#include <wx/checkbox.h>
@ -89,6 +90,11 @@ struct Reverb_priv_t
// EffectReverb
//
const ComponentInterfaceSymbol EffectReverb::Symbol
{ XO("Reverb") };
namespace{ BuiltinEffectsModule::Registration< EffectReverb > reg; }
BEGIN_EVENT_TABLE(EffectReverb, wxEvtHandler)
#define SpinSliderEvent(n) \
@ -135,7 +141,7 @@ EffectReverb::~EffectReverb()
ComponentInterfaceSymbol EffectReverb::GetSymbol()
{
return REVERB_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectReverb::GetDescription()

View File

@ -19,13 +19,13 @@ class wxSlider;
class wxSpinCtrl;
class ShuttleGui;
#define REVERB_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Reverb") }
struct Reverb_priv_t;
class EffectReverb final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectReverb();
virtual ~EffectReverb();

View File

@ -16,6 +16,7 @@
#include "../Audacity.h"
#include "Reverse.h"
#include "LoadEffects.h"
#include <math.h>
@ -29,6 +30,11 @@
// EffectReverse
//
const ComponentInterfaceSymbol EffectReverse::Symbol
{ XO("Reverse") };
namespace{ BuiltinEffectsModule::Registration< EffectReverse > reg; }
EffectReverse::EffectReverse()
{
}
@ -41,7 +47,7 @@ EffectReverse::~EffectReverse()
ComponentInterfaceSymbol EffectReverse::GetSymbol()
{
return REVERSE_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectReverse::GetDescription()

View File

@ -15,11 +15,11 @@
#include "Effect.h"
#define REVERSE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Reverse") }
class EffectReverse final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectReverse();
virtual ~EffectReverse();

View File

@ -34,6 +34,7 @@ a graph for EffectScienFilter.
#include "../Audacity.h"
#include "ScienFilter.h"
#include "LoadEffects.h"
#include <math.h>
#include <float.h>
@ -132,6 +133,14 @@ Param( Stopband, float, wxT("StopbandRipple"), 30.0, 0.0, 100.0,
// EffectScienFilter
//----------------------------------------------------------------------------
const ComponentInterfaceSymbol EffectScienFilter::Symbol
{ XO("Classic Filters") };
#ifdef EXPERIMENTAL_SCIENCE_FILTERS
// true argument means don't automatically enable this effect
namespace{ BuiltinEffectsModule::Registration< EffectScienFilter > reg( true ); }
#endif
BEGIN_EVENT_TABLE(EffectScienFilter, wxEvtHandler)
EVT_SIZE(EffectScienFilter::OnSize)
@ -173,7 +182,7 @@ EffectScienFilter::~EffectScienFilter()
ComponentInterfaceSymbol EffectScienFilter::GetSymbol()
{
return CLASSICFILTERS_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectScienFilter::GetDescription()

View File

@ -27,13 +27,13 @@ class wxTextCtrl;
class RulerPanel;
class ShuttleGui;
#define CLASSICFILTERS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Classic Filters") }
class EffectScienFilterPanel;
class EffectScienFilter final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectScienFilter();
virtual ~EffectScienFilter();

View File

@ -15,6 +15,7 @@
#include "../Audacity.h"
#include "Silence.h"
#include "LoadEffects.h"
#include <wx/intl.h>
@ -22,6 +23,11 @@
#include "../WaveTrack.h"
#include "../widgets/NumericTextCtrl.h"
const ComponentInterfaceSymbol EffectSilence::Symbol
{ XO("Silence") };
namespace{ BuiltinEffectsModule::Registration< EffectSilence > reg; }
EffectSilence::EffectSilence()
{
SetLinearEffectFlag(true);
@ -35,7 +41,7 @@ EffectSilence::~EffectSilence()
ComponentInterfaceSymbol EffectSilence::GetSymbol()
{
return SILENCE_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectSilence::GetDescription()

View File

@ -17,11 +17,11 @@
class NumericTextCtrl;
#define SILENCE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Silence") }
class EffectSilence final : public Generator
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectSilence();
virtual ~EffectSilence();

View File

@ -15,12 +15,18 @@
#include "../Audacity.h"
#include "StereoToMono.h"
#include "LoadEffects.h"
#include <wx/intl.h>
#include "../Project.h"
#include "../WaveTrack.h"
const ComponentInterfaceSymbol EffectStereoToMono::Symbol
{ XO("Stereo To Mono") };
namespace{ BuiltinEffectsModule::Registration< EffectStereoToMono > reg; }
EffectStereoToMono::EffectStereoToMono()
{
}
@ -33,7 +39,7 @@ EffectStereoToMono::~EffectStereoToMono()
ComponentInterfaceSymbol EffectStereoToMono::GetSymbol()
{
return STEREOTOMONO_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectStereoToMono::GetDescription()

View File

@ -13,11 +13,11 @@
#include "Effect.h"
#define STEREOTOMONO_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Stereo To Mono") }
class EffectStereoToMono final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectStereoToMono();
virtual ~EffectStereoToMono();

View File

@ -17,6 +17,7 @@
#if USE_SBSMS
#include "TimeScale.h"
#include "LoadEffects.h"
#include <math.h>
@ -51,6 +52,11 @@ Param( PitchPercentEnd, double, wxT("PitchPercentChangeEnd"), 0.0, -50.0,
// EffectTimeScale
//
const ComponentInterfaceSymbol EffectTimeScale::Symbol
{ wxT("Sliding Stretch"), XO("Sliding Stretch") };
namespace{ BuiltinEffectsModule::Registration< EffectTimeScale > reg; }
BEGIN_EVENT_TABLE(EffectTimeScale, wxEvtHandler)
EVT_TEXT(ID_RatePercentChangeStart, EffectTimeScale::OnText_RatePercentChangeStart)
EVT_TEXT(ID_RatePercentChangeEnd, EffectTimeScale::OnText_RatePercentChangeEnd)
@ -87,7 +93,7 @@ EffectTimeScale::~EffectTimeScale()
ComponentInterfaceSymbol EffectTimeScale::GetSymbol()
{
return TIMESCALE_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectTimeScale::GetDescription()

View File

@ -21,15 +21,11 @@ class wxSlider;
class wxTextCtrl;
class ShuttleGui;
// two strings here
// unusual case
#define TIMESCALE_PLUGIN_SYMBOL \
ComponentInterfaceSymbol{ wxT("Sliding Stretch"), \
XO("Sliding Stretch") }
class EffectTimeScale final : public EffectSBSMS
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectTimeScale();
virtual ~EffectTimeScale();

View File

@ -20,6 +20,7 @@ frequency changes smoothly during the tone.
#include "../Audacity.h"
#include "ToneGen.h"
#include "LoadEffects.h"
#include <math.h>
#include <float.h>
@ -82,6 +83,16 @@ Param( Interp, int, wxT("Interpolation"), 0, 0, nInterpolatio
// EffectToneGen
//
const ComponentInterfaceSymbol EffectChirp::Symbol
{ XO("Chirp") };
namespace{ BuiltinEffectsModule::Registration< EffectChirp > reg; }
const ComponentInterfaceSymbol EffectTone::Symbol
{ XO("Tone") };
namespace{ BuiltinEffectsModule::Registration< EffectTone > reg2; }
BEGIN_EVENT_TABLE(EffectToneGen, wxEvtHandler)
EVT_TEXT(wxID_ANY, EffectToneGen::OnControlUpdate)
END_EVENT_TABLE();
@ -117,8 +128,8 @@ EffectToneGen::~EffectToneGen()
ComponentInterfaceSymbol EffectToneGen::GetSymbol()
{
return mChirp
? CHIRP_PLUGIN_SYMBOL
: TONE_PLUGIN_SYMBOL;
? EffectChirp::Symbol
: EffectTone::Symbol;
}
TranslatableString EffectToneGen::GetDescription()

View File

@ -18,10 +18,7 @@
class NumericTextCtrl;
class ShuttleGui;
#define CHIRP_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Chirp") }
#define TONE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Tone") }
class EffectToneGen final : public Effect
class EffectToneGen : public Effect
{
public:
EffectToneGen(bool isChirp);
@ -78,4 +75,21 @@ private:
DECLARE_EVENT_TABLE()
};
class EffectChirp final : public EffectToneGen
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectChirp() : EffectToneGen{ true } {}
};
class EffectTone final : public EffectToneGen
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectTone() : EffectToneGen{ false } {}
};
#endif

View File

@ -17,6 +17,7 @@
#include "../Audacity.h"
#include "TruncSilence.h"
#include "LoadEffects.h"
#include <algorithm>
#include <list>
@ -119,6 +120,11 @@ static const double DEF_MinTruncMs = 0.001;
// Typical fraction of total time taken by detection (better to guess low)
const double detectFrac = 0.4;
const ComponentInterfaceSymbol EffectTruncSilence::Symbol
{ XO("Truncate Silence") };
namespace{ BuiltinEffectsModule::Registration< EffectTruncSilence > reg; }
BEGIN_EVENT_TABLE(EffectTruncSilence, wxEvtHandler)
EVT_CHOICE(wxID_ANY, EffectTruncSilence::OnControlChange)
EVT_TEXT(wxID_ANY, EffectTruncSilence::OnControlChange)
@ -154,7 +160,7 @@ EffectTruncSilence::~EffectTruncSilence()
ComponentInterfaceSymbol EffectTruncSilence::GetSymbol()
{
return TRUNCATESILENCE_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectTruncSilence::GetDescription()

View File

@ -24,13 +24,13 @@ class wxChoice;
class wxTextCtrl;
class wxCheckBox;
#define TRUNCATESILENCE_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Truncate Silence") }
class RegionList;
class EffectTruncSilence final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectTruncSilence();
virtual ~EffectTruncSilence();

View File

@ -20,6 +20,7 @@
#include "../Audacity.h"
#include "Wahwah.h"
#include "LoadEffects.h"
#include "../Experimental.h"
@ -59,6 +60,11 @@ Param( OutGain, double, wxT("Gain"), -6.0, -30.0, 30.0, 1 );
// EffectWahwah
//
const ComponentInterfaceSymbol EffectWahwah::Symbol
{ XO("Wahwah") };
namespace{ BuiltinEffectsModule::Registration< EffectWahwah > reg; }
BEGIN_EVENT_TABLE(EffectWahwah, wxEvtHandler)
EVT_SLIDER(ID_Freq, EffectWahwah::OnFreqSlider)
EVT_SLIDER(ID_Phase, EffectWahwah::OnPhaseSlider)
@ -94,7 +100,7 @@ EffectWahwah::~EffectWahwah()
ComponentInterfaceSymbol EffectWahwah::GetSymbol()
{
return WAHWAH_PLUGIN_SYMBOL;
return Symbol;
}
TranslatableString EffectWahwah::GetDescription()

View File

@ -22,8 +22,6 @@ class wxSlider;
class wxTextCtrl;
class ShuttleGui;
#define WAHWAH_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Wahwah") }
class EffectWahwahState
{
public:
@ -41,6 +39,8 @@ public:
class EffectWahwah final : public Effect
{
public:
static const ComponentInterfaceSymbol Symbol;
EffectWahwah();
virtual ~EffectWahwah();