mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-08 14:13:57 +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:
@@ -16,168 +16,101 @@
|
||||
#ifndef __AUDACITY_EFFECT_WAHWAH__
|
||||
#define __AUDACITY_EFFECT_WAHWAH__
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/window.h>
|
||||
#endif
|
||||
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/slider.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
|
||||
class wxString;
|
||||
class wxSizer;
|
||||
class wxTextCtrl;
|
||||
#include "../ShuttleGui.h"
|
||||
|
||||
#include "SimpleMono.h"
|
||||
#include "Effect.h"
|
||||
|
||||
class EffectWahwah:public EffectSimpleMono {
|
||||
#define WAHWAH_PLUGIN_SYMBOL wxTRANSLATE("Wahwah")
|
||||
|
||||
public:
|
||||
class EffectWahwah : public Effect
|
||||
{
|
||||
public:
|
||||
EffectWahwah();
|
||||
virtual ~EffectWahwah();
|
||||
|
||||
virtual wxString GetEffectName() {
|
||||
return wxString(wxTRANSLATE("Wahwah..."));
|
||||
}
|
||||
// IdentInterface implementation
|
||||
|
||||
virtual std::set<wxString> GetEffectCategories() {
|
||||
std::set<wxString> result;
|
||||
result.insert(wxT("http://lv2plug.in/ns/lv2core#ModulatorPlugin"));
|
||||
return result;
|
||||
}
|
||||
virtual wxString GetSymbol();
|
||||
virtual wxString GetDescription();
|
||||
|
||||
virtual wxString GetEffectIdentifier() {
|
||||
return wxString(wxT("Wahwah"));
|
||||
}
|
||||
// EffectIdentInterface implementation
|
||||
|
||||
virtual wxString GetEffectAction() {
|
||||
return wxString(_("Applying Wahwah"));
|
||||
}
|
||||
virtual EffectType GetType();
|
||||
|
||||
// Useful only after PromptUser values have been set.
|
||||
virtual wxString GetEffectDescription();
|
||||
// EffectClientInterface implementation
|
||||
|
||||
virtual bool PromptUser();
|
||||
virtual bool TransferParameters( Shuttle & shuttle );
|
||||
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);
|
||||
|
||||
protected:
|
||||
virtual bool NewTrackSimpleMono();
|
||||
// Effect implementation
|
||||
|
||||
virtual bool ProcessSimpleMono(float *buffer, sampleCount len);
|
||||
virtual void PopulateOrExchange(ShuttleGui & S);
|
||||
virtual bool TransferDataToWindow();
|
||||
virtual bool TransferDataFromWindow();
|
||||
|
||||
float phase;
|
||||
float lfoskip;
|
||||
private:
|
||||
// EffectWahwah implementation
|
||||
|
||||
void OnFreqSlider(wxCommandEvent & evt);
|
||||
void OnPhaseSlider(wxCommandEvent & evt);
|
||||
void OnDepthSlider(wxCommandEvent & evt);
|
||||
void OnResonanceSlider(wxCommandEvent & evt);
|
||||
void OnFreqOffSlider(wxCommandEvent & evt);
|
||||
|
||||
void OnFreqText(wxCommandEvent & evt);
|
||||
void OnPhaseText(wxCommandEvent & evt);
|
||||
void OnDepthText(wxCommandEvent & evt);
|
||||
void OnResonanceText(wxCommandEvent & evt);
|
||||
void OnFreqOffText(wxCommandEvent & evt);
|
||||
|
||||
private:
|
||||
double depth;
|
||||
double freqofs;
|
||||
double phase;
|
||||
double lfoskip;
|
||||
unsigned long skipcount;
|
||||
float xn1, xn2, yn1, yn2;
|
||||
float b0, b1, b2, a0, a1, a2;
|
||||
double xn1, xn2, yn1, yn2;
|
||||
double b0, b1, b2, a0, a1, a2;
|
||||
|
||||
/* Parameters:
|
||||
freq - LFO frequency
|
||||
startphase - LFO startphase in RADIANS - usefull for stereo WahWah
|
||||
depth - Wah depth
|
||||
freqofs - Wah frequency offset
|
||||
res - Resonance
|
||||
mFreq - LFO frequency
|
||||
mPhase - LFO startphase in RADIANS - useful for stereo WahWah
|
||||
mDepth - Wah depth
|
||||
mRes - Resonance
|
||||
mFreqOfs - Wah frequency offset
|
||||
|
||||
!!!!!!!!!!!!! IMPORTANT!!!!!!!!! :
|
||||
depth and freqofs should be from 0(min) to 1(max) !
|
||||
res should be greater than 0 ! */
|
||||
mDepth and mFreqOfs should be from 0(min) to 1(max) !
|
||||
mRes should be greater than 0 ! */
|
||||
|
||||
private:
|
||||
float freq, startphase;
|
||||
float depth, freqofs, res;
|
||||
double mFreq;
|
||||
double mPhase;
|
||||
int mDepth;
|
||||
double mRes;
|
||||
int mFreqOfs;
|
||||
|
||||
friend class WahwahDialog;
|
||||
};
|
||||
wxTextCtrl *mFreqT;
|
||||
wxTextCtrl *mPhaseT;
|
||||
wxTextCtrl *mDepthT;
|
||||
wxTextCtrl *mResT;
|
||||
wxTextCtrl *mFreqOfsT;
|
||||
|
||||
// Declare window functions
|
||||
wxSlider *mFreqS;
|
||||
wxSlider *mPhaseS;
|
||||
wxSlider *mDepthS;
|
||||
wxSlider *mResS;
|
||||
wxSlider *mFreqOfsS;
|
||||
|
||||
#define ID_FREQTEXT 10003
|
||||
#define ID_FREQSLIDER 10004
|
||||
#define ID_PHASETEXT 10005
|
||||
#define ID_PHASESLIDER 10006
|
||||
#define ID_DEPTHTEXT 10007
|
||||
#define ID_DEPTHSLIDER 10008
|
||||
#define ID_RESONANCETEXT 10009
|
||||
#define ID_RESONANCESLIDER 10010
|
||||
#define ID_FREQOFFTEXT 10011
|
||||
#define ID_FREQOFFSLIDER 10012
|
||||
|
||||
// WDR: class declarations
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// WahwahDialog
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class WahwahDialog:public EffectDialog {
|
||||
public:
|
||||
// constructors and destructors
|
||||
WahwahDialog(EffectWahwah * effect, wxWindow * parent);
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
// WDR: method declarations for WahwahDialog
|
||||
wxSlider *GetResonanceSlider() {
|
||||
return (wxSlider *) FindWindow(ID_RESONANCESLIDER);
|
||||
} wxSlider *GetDepthSlider() {
|
||||
return (wxSlider *) FindWindow(ID_DEPTHSLIDER);
|
||||
}
|
||||
wxSlider *GetPhaseSlider() {
|
||||
return (wxSlider *) FindWindow(ID_PHASESLIDER);
|
||||
}
|
||||
wxSlider *GetFreqSlider() {
|
||||
return (wxSlider *) FindWindow(ID_FREQSLIDER);
|
||||
}
|
||||
wxSlider *GetFreqOffSlider() {
|
||||
return (wxSlider *) FindWindow(ID_FREQOFFSLIDER);
|
||||
}
|
||||
wxTextCtrl *GetResonanceText() {
|
||||
return (wxTextCtrl *) FindWindow(ID_RESONANCETEXT);
|
||||
}
|
||||
wxTextCtrl *GetDepthText() {
|
||||
return (wxTextCtrl *) FindWindow(ID_DEPTHTEXT);
|
||||
}
|
||||
wxTextCtrl *GetPhaseText() {
|
||||
return (wxTextCtrl *) FindWindow(ID_PHASETEXT);
|
||||
}
|
||||
wxTextCtrl *GetFreqText() {
|
||||
return (wxTextCtrl *) FindWindow(ID_FREQTEXT);
|
||||
}
|
||||
wxTextCtrl *GetFreqOffText() {
|
||||
return (wxTextCtrl *) FindWindow(ID_FREQOFFTEXT);
|
||||
}
|
||||
|
||||
private:
|
||||
// WDR: member variable declarations for WahwahDialog
|
||||
|
||||
private:
|
||||
// WDR: handler declarations for WahwahDialog
|
||||
void OnResonanceSlider(wxCommandEvent & event);
|
||||
void OnDepthSlider(wxCommandEvent & event);
|
||||
void OnPhaseSlider(wxCommandEvent & event);
|
||||
void OnFreqSlider(wxCommandEvent & event);
|
||||
void OnFreqOffSlider(wxCommandEvent & event);
|
||||
void OnResonanceText(wxCommandEvent & event);
|
||||
void OnDepthText(wxCommandEvent & event);
|
||||
void OnPhaseText(wxCommandEvent & event);
|
||||
void OnFreqText(wxCommandEvent & event);
|
||||
void OnFreqOffText(wxCommandEvent & event);
|
||||
void OnPreview(wxCommandEvent &event);
|
||||
|
||||
private:
|
||||
EffectWahwah * mEffect;
|
||||
|
||||
public:
|
||||
float freq;
|
||||
float freqoff;
|
||||
float startphase;
|
||||
float res;
|
||||
float depth;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user