1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-08 22:23:59 +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:
Leland Lucius
2015-04-16 22:53:42 -05:00
parent 40e6bcc56a
commit 8fbfa460c4
140 changed files with 17288 additions and 20367 deletions

View File

@@ -12,56 +12,70 @@
#ifndef __AUDACITY_EFFECT_BASS_TREBLE__
#define __AUDACITY_EFFECT_BASS_TREBLE__
#include "TwoPassSimpleMono.h"
#include <wx/checkbox.h>
#include <wx/event.h>
#include <wx/slider.h>
#include <wx/stattext.h>
#include <wx/string.h>
#include <wx/textctrl.h>
class wxSizer;
class wxTextCtrl;
class WaveTrack;
#include "../ShuttleGui.h"
class EffectBassTreble: public EffectTwoPassSimpleMono {
#include "Effect.h"
#define BASSTREBLE_PLUGIN_SYMBOL wxTRANSLATE("Bass and Treble")
class EffectBassTreble : public Effect
{
public:
EffectBassTreble();
virtual ~EffectBassTreble() {};
virtual ~EffectBassTreble();
virtual wxString GetEffectName() {
return wxString(wxTRANSLATE("Bass and Treble..."));
}
// IdentInterface implementation
virtual std::set<wxString> GetEffectCategories() {
std::set<wxString> result;
result.insert(wxT("http://lv2plug.in/ns/lv2core#EQPlugin"));
return result;
}
virtual wxString GetSymbol();
virtual wxString GetDescription();
virtual wxString GetEffectIdentifier() {
return wxString(wxT("Bass and Treble"));
}
// EffectIdentInterface implementation
virtual wxString GetEffectAction() {
return wxString(_("Adjusting Bass and Treble"));
}
virtual EffectType GetType();
// Useful only after PromptUser values have been set.
virtual wxString GetEffectDescription();
// EffectClientInterface implementation
protected:
virtual bool PromptUser();
virtual bool TransferParameters( Shuttle & shuttle );
virtual bool Init();
virtual int GetAudioInCount();
virtual int GetAudioOutCount();
virtual bool ProcessInitialize(sampleCount totalLen, ChannelNames chanMap = NULL);
virtual sampleCount ProcessBlock(float **inBlock, float **outBlock, sampleCount blockLen);
virtual bool GetAutomationParameters(EffectAutomationParameters & parms);
virtual bool SetAutomationParameters(EffectAutomationParameters & parms);
virtual bool ProcessPass1(float *buffer, sampleCount len);
virtual bool ProcessPass2(float *buffer, sampleCount len);
// Effect Implementation
virtual bool Startup();
virtual bool InitPass1();
virtual bool InitPass2();
virtual void PopulateOrExchange(ShuttleGui & S);
virtual bool TransferDataToWindow();
virtual bool TransferDataFromWindow();
private:
// EffectBassTreble implementation
void Coefficents(double hz, float slope, double gain, int type,
float& a0, float& a1, float& a2, float& b0, float& b1, float& b2);
float DoFilter(float in);
void UpdateUI();
void OnBassText(wxCommandEvent & evt);
void OnTrebleText(wxCommandEvent & evt);
void OnLevelText(wxCommandEvent & evt);
void OnBassSlider(wxCommandEvent & evt);
void OnTrebleSlider(wxCommandEvent & evt);
void OnLevelSlider(wxCommandEvent & evt);
void OnNormalize(wxCommandEvent & evt);
private:
virtual bool NewTrackPass1();
virtual bool InitPass1();
virtual bool InitPass2();
float DoFilter(float in);
float xn1Bass, xn2Bass, yn1Bass, yn2Bass,
wBass, swBass, cwBass, aBass, bBass,
a0Bass, a1Bass, a2Bass, b0Bass, b1Bass, b2Bass;
@@ -75,36 +89,6 @@ private:
bool mbNormalize;
double mPreGain;
friend class BassTrebleDialog;
};
//----------------------------------------------------------------------------
// BassTrebleDialog
//----------------------------------------------------------------------------
class BassTrebleDialog:public EffectDialog {
public:
BassTrebleDialog(EffectBassTreble *effect, wxWindow * parent);
virtual ~BassTrebleDialog() {};
// method declarations for BassTrebleDialog
void PopulateOrExchange(ShuttleGui & S);
bool TransferDataToWindow();
bool TransferDataFromWindow();
private:
// handler declarations for BassTrebleDialog
void OnBassText(wxCommandEvent & event);
void OnTrebleText(wxCommandEvent & event);
void OnLevelText(wxCommandEvent & event);
void OnBassSlider(wxCommandEvent & event);
void OnTrebleSlider(wxCommandEvent & event);
void OnLevelSlider(wxCommandEvent & event);
void OnNormalize(wxCommandEvent& evt);
void UpdateUI();
void OnPreview(wxCommandEvent & event);
void set_properties();
private:
wxSlider *mBassS;
wxSlider *mTrebleS;
wxSlider *mLevelS;
@@ -112,17 +96,9 @@ private:
wxTextCtrl *mTrebleT;
wxTextCtrl *mLevelT;
wxCheckBox *mNormalizeCheckBox;
wxStaticText* mWarning;
wxStaticText *mWarning;
public:
EffectBassTreble *mEffect;
double mBass;
double mTreble;
double mLevel;
bool mbNormalize;
DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE();
};
#endif