2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
2010-06-15 23:49:51 +00:00
|
|
|
Equalization.h
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
Mitch Golden
|
|
|
|
Vaughan Johnson (Preview)
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
|
|
#ifndef __AUDACITY_EFFECT_EQUALIZATION__
|
|
|
|
#define __AUDACITY_EFFECT_EQUALIZATION__
|
|
|
|
#define NUMBER_OF_BANDS 31
|
|
|
|
#define NUM_PTS 180
|
2010-03-23 01:27:12 +00:00
|
|
|
#define PANELBORDER 1 // only increase from '1' for testing purposes - MJS
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-03-23 18:28:37 +00:00
|
|
|
#include <wx/setup.h> // for wxUSE_* macros
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
#include "Effect.h"
|
|
|
|
#include "../RealFFTf.h"
|
|
|
|
|
2019-03-22 11:10:41 +00:00
|
|
|
// Flags to specialise the UI
|
|
|
|
const int kEqOptionGraphic =1;
|
|
|
|
const int kEqOptionCurve =1<<1;
|
|
|
|
// The legacy version offers both Graphic and curve on the same UI.
|
|
|
|
const int kEqLegacy = kEqOptionGraphic + kEqOptionCurve;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2018-11-14 19:10:04 +00:00
|
|
|
class wxBitmap;
|
2019-03-28 07:29:15 +00:00
|
|
|
class wxBoxSizer;
|
2018-11-14 20:01:44 +00:00
|
|
|
class wxButton;
|
2018-11-11 22:30:55 +00:00
|
|
|
class wxCheckBox;
|
2018-11-14 16:07:06 +00:00
|
|
|
class wxChoice;
|
2018-11-14 20:23:25 +00:00
|
|
|
class wxListCtrl;
|
|
|
|
class wxListEvent;
|
2018-11-14 21:30:11 +00:00
|
|
|
class wxRadioButton;
|
2019-03-28 07:29:15 +00:00
|
|
|
class wxSizer;
|
|
|
|
class wxSizerItem;
|
2018-11-11 21:18:23 +00:00
|
|
|
class wxSlider;
|
2018-11-11 21:41:45 +00:00
|
|
|
class wxStaticText;
|
2015-07-05 15:25:32 +00:00
|
|
|
class Envelope;
|
2016-01-26 03:46:56 +00:00
|
|
|
class EnvelopeEditor;
|
2015-04-17 03:53:42 +00:00
|
|
|
class EqualizationPanel;
|
2019-03-30 20:07:00 +00:00
|
|
|
class RulerPanel;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// One point in a curve
|
|
|
|
//
|
|
|
|
class EQPoint
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EQPoint( const double f, const double d ) { Freq = f; dB = d; }
|
2018-02-02 18:24:53 +00:00
|
|
|
|
|
|
|
bool operator < (const EQPoint &p1) const
|
|
|
|
{
|
|
|
|
return Freq < p1.Freq;
|
|
|
|
}
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
double Freq;
|
|
|
|
double dB;
|
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// One curve in a list
|
|
|
|
//
|
2018-02-02 18:24:53 +00:00
|
|
|
// LLL: This "really" isn't needed as the array of points could be
|
2010-01-23 19:44:49 +00:00
|
|
|
// attached as wxClientData to the wxChoice entries. I
|
|
|
|
// didn't realize this until after the fact and am too
|
|
|
|
// lazy to change it. (But, hollar if you want me to.)
|
|
|
|
//
|
|
|
|
class EQCurve
|
|
|
|
{
|
|
|
|
public:
|
2019-03-15 18:28:30 +00:00
|
|
|
EQCurve( const wxString & name = {} ) { Name = name; }
|
2010-01-23 19:44:49 +00:00
|
|
|
EQCurve( const wxChar * name ) { Name = name; }
|
2018-02-02 18:24:53 +00:00
|
|
|
|
|
|
|
bool operator < (const EQCurve &that) const
|
|
|
|
{
|
|
|
|
return Name.CmpNoCase(that.Name) < 0;
|
|
|
|
}
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
wxString Name;
|
2018-02-02 18:24:53 +00:00
|
|
|
std::vector<EQPoint> points;
|
2010-01-23 19:44:49 +00:00
|
|
|
};
|
2018-02-02 18:24:53 +00:00
|
|
|
|
|
|
|
using EQCurveArray = std::vector<EQCurve>;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2014-01-16 17:55:35 +00:00
|
|
|
#ifdef EXPERIMENTAL_EQ_SSE_THREADED
|
|
|
|
class EffectEqualization48x;
|
|
|
|
#endif
|
|
|
|
|
2019-01-17 22:41:30 +00:00
|
|
|
class EffectEqualization : public Effect,
|
2015-04-17 03:53:42 +00:00
|
|
|
public XMLTagHandler
|
|
|
|
{
|
2010-01-23 19:44:49 +00:00
|
|
|
public:
|
2019-01-17 22:33:49 +00:00
|
|
|
static const ComponentInterfaceSymbol Symbol;
|
|
|
|
|
2019-01-17 22:41:30 +00:00
|
|
|
EffectEqualization(int Options = kEqLegacy);
|
2019-01-17 22:33:49 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
virtual ~EffectEqualization();
|
|
|
|
|
2018-11-02 15:31:44 +00:00
|
|
|
// ComponentInterface implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2018-11-02 15:31:44 +00:00
|
|
|
ComponentInterfaceSymbol GetSymbol() override;
|
2019-12-08 18:53:48 +00:00
|
|
|
TranslatableString GetDescription() override;
|
2021-06-06 16:18:35 +00:00
|
|
|
ManualPageID ManualPage() override;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
Automation: AudacityCommand
This is a squash of 50 commits.
This merges the capabilities of BatchCommands and Effects using a new
AudacityCommand class. AudacityCommand provides one function to specify the
parameters, and then we leverage that one function in automation, whether by chains,
mod-script-pipe or (future) Nyquist.
- Now have AudacityCommand which is using the same mechanism as Effect
- Has configurable parameters
- Has data-entry GUI (built using shuttle GUI)
- Registers with PluginManager.
- Menu commands now provided in chains, and to python batch.
- Tested with Zoom Toggle.
- ShuttleParams now can set, get, set defaults, validate and specify
the parameters.
- Bugfix: Don't overwrite values with defaults first time out.
- Add DefineParams function for all built-in effects.
- Extend CommandContext to carry output channels for results.
We abuse EffectsManager. It handles both Effects and
AudacityCommands now. In time an Effect should become a special case of
AudacityCommand and we'll split and rename the EffectManager class.
- Don't use 'default' as a parameter name.
- Massive renaming for CommandDefinitionInterface
- EffectIdentInterface becomes EffectDefinitionInterface
- EffectAutomationParameters becomes CommandAutomationParameters
- PluginType is now a bit field.
This way we can search for related types at the same time.
- Most old batch commands made into AudacityCommands.
The ones that weren't are for a reason. They are used by mod-script-pipe
to carry commands and responses across from a non-GUI thread to the GUI
thread.
- Major tidy up of ScreenshotCommand
- Reworking of SelectCommand
- GetPreferenceCommand and SetPreferenceCommand
- GetTrackInfo and SetTrackInfo
- GetInfoCommand
- Help, Open, Save, Import and Export commands.
- Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo
which are now better handled by other commands.
- JSONify "GetInfo: Commands" output, i.e. commas in the right places.
- General work on better Doxygen.
- Lyrics -> LyricsPanel
- Meter -> MeterPanel
- Updated Linux makefile.
- Scripting commands added into Extra menu.
- Distinct names for previously duplicated find-clipping parameters.
- Fixed longstanding error with erroneous status field number which
previously caused an ASSERT in debug.
- Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
|
|
|
// EffectDefinitionInterface implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
EffectType GetType() override;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// EffectClientInterface implementation
|
2010-01-23 19:44:49 +00:00
|
|
|
|
Automation: AudacityCommand
This is a squash of 50 commits.
This merges the capabilities of BatchCommands and Effects using a new
AudacityCommand class. AudacityCommand provides one function to specify the
parameters, and then we leverage that one function in automation, whether by chains,
mod-script-pipe or (future) Nyquist.
- Now have AudacityCommand which is using the same mechanism as Effect
- Has configurable parameters
- Has data-entry GUI (built using shuttle GUI)
- Registers with PluginManager.
- Menu commands now provided in chains, and to python batch.
- Tested with Zoom Toggle.
- ShuttleParams now can set, get, set defaults, validate and specify
the parameters.
- Bugfix: Don't overwrite values with defaults first time out.
- Add DefineParams function for all built-in effects.
- Extend CommandContext to carry output channels for results.
We abuse EffectsManager. It handles both Effects and
AudacityCommands now. In time an Effect should become a special case of
AudacityCommand and we'll split and rename the EffectManager class.
- Don't use 'default' as a parameter name.
- Massive renaming for CommandDefinitionInterface
- EffectIdentInterface becomes EffectDefinitionInterface
- EffectAutomationParameters becomes CommandAutomationParameters
- PluginType is now a bit field.
This way we can search for related types at the same time.
- Most old batch commands made into AudacityCommands.
The ones that weren't are for a reason. They are used by mod-script-pipe
to carry commands and responses across from a non-GUI thread to the GUI
thread.
- Major tidy up of ScreenshotCommand
- Reworking of SelectCommand
- GetPreferenceCommand and SetPreferenceCommand
- GetTrackInfo and SetTrackInfo
- GetInfoCommand
- Help, Open, Save, Import and Export commands.
- Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo
which are now better handled by other commands.
- JSONify "GetInfo: Commands" output, i.e. commas in the right places.
- General work on better Doxygen.
- Lyrics -> LyricsPanel
- Meter -> MeterPanel
- Updated Linux makefile.
- Scripting commands added into Extra menu.
- Distinct names for previously duplicated find-clipping parameters.
- Fixed longstanding error with erroneous status field number which
previously caused an ASSERT in debug.
- Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-01-14 18:51:41 +00:00
|
|
|
bool DefineParams( ShuttleParams & S ) override;
|
2018-02-21 14:24:25 +00:00
|
|
|
bool GetAutomationParameters(CommandParameters & parms) override;
|
|
|
|
bool SetAutomationParameters(CommandParameters & parms) override;
|
2016-02-24 06:06:47 +00:00
|
|
|
bool LoadFactoryDefaults() override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2019-08-24 12:55:54 +00:00
|
|
|
RegistryPaths GetFactoryPresets() override;
|
|
|
|
bool LoadFactoryPreset(int id) override;
|
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
// EffectUIClientInterface implementation
|
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
bool ValidateUI() override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
// Effect implementation
|
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
bool Startup() override;
|
|
|
|
bool Init() override;
|
|
|
|
bool Process() override;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-02-24 06:06:47 +00:00
|
|
|
bool CloseUI() override;
|
|
|
|
void PopulateOrExchange(ShuttleGui & S) override;
|
|
|
|
bool TransferDataToWindow() override;
|
|
|
|
bool TransferDataFromWindow() override;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// EffectEqualization implementation
|
2019-03-22 11:10:41 +00:00
|
|
|
wxString GetPrefsPrefix();
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// Number of samples in an FFT window
|
2016-04-14 16:35:15 +00:00
|
|
|
static const size_t windowSize = 16384u; //MJS - work out the optimum for this at run time? Have a dialog box for it?
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
// Low frequency of the FFT. 20Hz is the
|
|
|
|
// low range of human hearing
|
|
|
|
enum {loFreqI=20};
|
|
|
|
|
|
|
|
bool ProcessOne(int count, WaveTrack * t,
|
|
|
|
sampleCount start, sampleCount len);
|
2016-02-24 06:06:47 +00:00
|
|
|
bool CalcFilter();
|
2016-09-08 18:28:34 +00:00
|
|
|
void Filter(size_t len, float *buffer);
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2015-04-22 18:02:55 +00:00
|
|
|
void Flatten();
|
2015-08-15 17:45:16 +00:00
|
|
|
void ForceRecalc();
|
2010-01-23 19:44:49 +00:00
|
|
|
void EnvelopeUpdated();
|
|
|
|
void EnvelopeUpdated(Envelope *env, bool lin);
|
2015-08-15 17:45:16 +00:00
|
|
|
bool IsLinear();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-03-15 18:28:30 +00:00
|
|
|
void LoadCurves(const wxString &fileName = {}, bool append = false);
|
|
|
|
void SaveCurves(const wxString &fileName = {});
|
2016-08-08 13:50:55 +00:00
|
|
|
// Merge NEW curves only or update all factory presets.
|
2016-02-27 13:17:27 +00:00
|
|
|
void UpdateDefaultCurves( bool updateAll = false);
|
2010-01-23 19:44:49 +00:00
|
|
|
void Select(int sel);
|
|
|
|
void setCurve(int currentCurve);
|
2016-02-23 02:17:19 +00:00
|
|
|
void setCurve(const wxString &curveName);
|
2010-01-23 19:44:49 +00:00
|
|
|
void setCurve(void);
|
2016-02-27 21:15:48 +00:00
|
|
|
bool GetDefaultFileName(wxFileName &fileName);
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
// XMLTagHandler callback methods for loading and saving
|
2017-02-22 19:23:35 +00:00
|
|
|
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
|
|
|
|
XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
|
|
|
|
void WriteXML(XMLWriter &xmlFile) const;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-05-29 16:32:55 +00:00
|
|
|
void UpdateCurves();
|
2015-04-27 15:52:42 +00:00
|
|
|
void UpdateDraw();
|
|
|
|
|
2019-08-22 18:34:43 +00:00
|
|
|
//void LayoutEQSliders();
|
2010-01-23 19:44:49 +00:00
|
|
|
void UpdateGraphic(void);
|
|
|
|
void EnvLogToLin(void);
|
|
|
|
void EnvLinToLog(void);
|
|
|
|
void ErrMin(void);
|
2015-04-17 03:53:42 +00:00
|
|
|
void GraphicEQ(Envelope *env);
|
2016-04-14 16:35:15 +00:00
|
|
|
void spline(double x[], double y[], size_t n, double y2[]);
|
|
|
|
double splint(double x[], double y[], size_t n, double y2[], double xr);
|
2015-04-17 03:53:42 +00:00
|
|
|
|
2018-01-31 16:31:55 +00:00
|
|
|
void OnErase( wxEvent &event );
|
2015-04-17 03:53:42 +00:00
|
|
|
void OnSize( wxSizeEvent & event );
|
|
|
|
void OnSlider( wxCommandEvent & event );
|
|
|
|
void OnInterp( wxCommandEvent & event );
|
|
|
|
void OnSliderM( wxCommandEvent & event );
|
|
|
|
void OnSliderDBMAX( wxCommandEvent & event );
|
|
|
|
void OnSliderDBMIN( wxCommandEvent & event );
|
|
|
|
void OnDrawMode( wxCommandEvent &event );
|
|
|
|
void OnGraphicMode( wxCommandEvent &event );
|
|
|
|
void OnCurve( wxCommandEvent & event );
|
|
|
|
void OnManage( wxCommandEvent & event );
|
|
|
|
void OnClear( wxCommandEvent & event );
|
|
|
|
void OnInvert( wxCommandEvent & event );
|
|
|
|
void OnGridOnOff( wxCommandEvent & event );
|
|
|
|
void OnLinFreq( wxCommandEvent & event );
|
|
|
|
#ifdef EXPERIMENTAL_EQ_SSE_THREADED
|
|
|
|
void OnProcessingRadio( wxCommandEvent & event );
|
|
|
|
void OnBench( wxCommandEvent & event );
|
|
|
|
#endif
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
private:
|
2019-03-22 11:10:41 +00:00
|
|
|
int mOptions;
|
2015-04-17 03:53:42 +00:00
|
|
|
HFFT hFFT;
|
2016-04-14 16:35:15 +00:00
|
|
|
Floats mFFTBuffer, mFilterFuncR, mFilterFuncI;
|
2016-09-08 18:28:34 +00:00
|
|
|
size_t mM;
|
2015-04-17 03:53:42 +00:00
|
|
|
wxString mCurveName;
|
|
|
|
bool mLin;
|
|
|
|
float mdBMax;
|
|
|
|
float mdBMin;
|
|
|
|
bool mDrawMode;
|
|
|
|
int mInterp;
|
|
|
|
bool mDrawGrid;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
double mWhens[NUM_PTS];
|
|
|
|
double mWhenSliders[NUMBER_OF_BANDS+1];
|
2016-04-14 16:35:15 +00:00
|
|
|
size_t mBandsInUse;
|
2015-04-17 03:53:42 +00:00
|
|
|
RulerPanel *mdBRuler;
|
|
|
|
RulerPanel *mFreqRuler;
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
bool mDisallowCustom;
|
|
|
|
double mLoFreq;
|
|
|
|
double mHiFreq;
|
2016-09-08 18:28:34 +00:00
|
|
|
size_t mWindowSize;
|
2010-01-23 19:44:49 +00:00
|
|
|
bool mDirty;
|
2015-04-17 03:53:42 +00:00
|
|
|
int mSlidersOld[NUMBER_OF_BANDS];
|
|
|
|
double mEQVals[NUMBER_OF_BANDS+1];
|
|
|
|
|
|
|
|
EQCurveArray mCurves;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2016-08-04 11:33:22 +00:00
|
|
|
std::unique_ptr<Envelope> mLogEnvelope, mLinEnvelope;
|
2015-04-17 03:53:42 +00:00
|
|
|
Envelope *mEnvelope;
|
|
|
|
|
|
|
|
#ifdef EXPERIMENTAL_EQ_SSE_THREADED
|
|
|
|
bool mBench;
|
2016-08-04 11:33:22 +00:00
|
|
|
std::unique_ptr<EffectEqualization48x> mEffectEqualization48x;
|
2015-04-17 03:53:42 +00:00
|
|
|
friend class EffectEqualization48x;
|
|
|
|
#endif
|
|
|
|
|
2015-08-15 17:45:16 +00:00
|
|
|
wxSizer *szrC;
|
|
|
|
wxSizer *szrG;
|
|
|
|
wxSizer *szrV;
|
|
|
|
wxSizer *szrH;
|
|
|
|
wxSizer *szrI;
|
|
|
|
wxSizer *szrL;
|
|
|
|
wxSizer *szr1;
|
|
|
|
wxSizer *szr2;
|
|
|
|
wxSizer *szr3;
|
|
|
|
wxSizer *szr4;
|
|
|
|
wxSizer *szr5;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
wxSizerItem *mLeftSpacer;
|
|
|
|
|
|
|
|
EqualizationPanel *mPanel;
|
2017-10-20 16:45:27 +00:00
|
|
|
//wxPanel *mGraphicPanel;
|
2015-04-17 03:53:42 +00:00
|
|
|
wxRadioButton *mDraw;
|
|
|
|
wxRadioButton *mGraphic;
|
|
|
|
wxCheckBox *mLinFreq;
|
2010-01-23 19:44:49 +00:00
|
|
|
wxCheckBox *mGridOnOff;
|
2015-04-17 03:53:42 +00:00
|
|
|
wxChoice *mInterpChoice;
|
|
|
|
wxChoice *mCurve;
|
|
|
|
wxButton *mManage;
|
|
|
|
wxStaticText *mMText;
|
|
|
|
wxSlider *mMSlider;
|
|
|
|
wxSlider *mdBMinSlider;
|
|
|
|
wxSlider *mdBMaxSlider;
|
|
|
|
wxSlider *mSliders[NUMBER_OF_BANDS];
|
|
|
|
|
|
|
|
#ifdef EXPERIMENTAL_EQ_SSE_THREADED
|
|
|
|
wxRadioButton *mMathProcessingType[5]; // default, sse, sse threaded, AVX, AVX threaded (note AVX is not implemented yet
|
|
|
|
wxBoxSizer *szrM;
|
|
|
|
#endif
|
|
|
|
|
2016-09-18 14:26:29 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
friend class EqualizationPanel;
|
|
|
|
friend class EditCurvesDialog;
|
|
|
|
};
|
|
|
|
|
2019-01-17 22:41:30 +00:00
|
|
|
class EffectEqualizationCurve final : public EffectEqualization
|
|
|
|
{
|
|
|
|
public:
|
2019-01-17 22:33:49 +00:00
|
|
|
static const ComponentInterfaceSymbol Symbol;
|
|
|
|
|
2019-01-17 22:41:30 +00:00
|
|
|
EffectEqualizationCurve() : EffectEqualization( kEqOptionCurve ) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
class EffectEqualizationGraphic final : public EffectEqualization
|
|
|
|
{
|
|
|
|
public:
|
2019-01-17 22:33:49 +00:00
|
|
|
static const ComponentInterfaceSymbol Symbol;
|
|
|
|
|
2019-01-17 22:41:30 +00:00
|
|
|
EffectEqualizationGraphic() : EffectEqualization( kEqOptionGraphic ) {}
|
|
|
|
};
|
|
|
|
|
2016-06-25 18:18:23 +00:00
|
|
|
class EqualizationPanel final : public wxPanelWrapper
|
2015-04-17 03:53:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-10-20 16:06:29 +00:00
|
|
|
EqualizationPanel(
|
|
|
|
wxWindow *parent, wxWindowID winid, EffectEqualization *effect);
|
2015-04-17 03:53:42 +00:00
|
|
|
~EqualizationPanel();
|
|
|
|
|
|
|
|
// We don't need or want to accept focus.
|
|
|
|
bool AcceptsFocus() const { return false; }
|
2015-11-26 15:21:48 +00:00
|
|
|
// So that wxPanel is not included in Tab traversal - see wxWidgets bug 15581
|
|
|
|
bool AcceptsFocusFromKeyboard() const { return false; }
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
void ForceRecalc();
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
private:
|
2015-04-17 03:53:42 +00:00
|
|
|
void Recalc();
|
|
|
|
|
|
|
|
void OnMouseEvent(wxMouseEvent & event);
|
|
|
|
void OnCaptureLost(wxMouseCaptureLostEvent & event);
|
|
|
|
void OnPaint(wxPaintEvent & event);
|
|
|
|
void OnSize (wxSizeEvent & event);
|
|
|
|
|
|
|
|
public:
|
|
|
|
// int & mM;
|
|
|
|
// float & mdBMax;
|
|
|
|
// float & mdBMin;
|
|
|
|
// Envelope & mEnvelope;
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2015-04-17 03:53:42 +00:00
|
|
|
private:
|
|
|
|
wxWindow *mParent;
|
|
|
|
EffectEqualization *mEffect;
|
2017-09-10 02:51:14 +00:00
|
|
|
std::unique_ptr<EnvelopeEditor> mLinEditor, mLogEditor;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
bool mRecalcRequired;
|
|
|
|
|
2016-08-04 11:33:22 +00:00
|
|
|
std::unique_ptr<wxBitmap> mBitmap;
|
2015-04-17 03:53:42 +00:00
|
|
|
wxRect mEnvRect;
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
2016-09-08 18:28:34 +00:00
|
|
|
// size_t mWindowSize;
|
2015-04-17 03:53:42 +00:00
|
|
|
// float *mFilterFuncR;
|
|
|
|
// float *mFilterFuncI;
|
2016-04-14 16:35:15 +00:00
|
|
|
Floats mOutr, mOuti;
|
2015-04-17 03:53:42 +00:00
|
|
|
|
|
|
|
// double mLoFreq;
|
|
|
|
// double mHiFreq;
|
|
|
|
|
2016-09-18 14:26:29 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2010-01-23 19:44:49 +00:00
|
|
|
};
|
|
|
|
|
2010-06-15 23:49:51 +00:00
|
|
|
// EditCurvesDialog. Note that the 'modified' curve used to be called 'custom' but is now called 'unnamed'
|
|
|
|
// Some things that deal with 'unnamed' curves still use, for example, 'mCustomBackup' as variable names.
|
2016-07-10 21:10:50 +00:00
|
|
|
class EditCurvesDialog final : public wxDialogWrapper
|
2010-06-15 23:49:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-04-17 03:53:42 +00:00
|
|
|
EditCurvesDialog(wxWindow * parent, EffectEqualization * effect, int position);
|
2010-06-15 23:49:51 +00:00
|
|
|
~EditCurvesDialog();
|
|
|
|
|
|
|
|
private:
|
2010-06-27 22:20:58 +00:00
|
|
|
|
|
|
|
enum EQCurvesDialogControls
|
|
|
|
{
|
|
|
|
CurvesListID = 11000,
|
|
|
|
UpButtonID,
|
|
|
|
DownButtonID,
|
|
|
|
RenameButtonID,
|
|
|
|
DeleteButtonID,
|
|
|
|
ImportButtonID,
|
|
|
|
ExportButtonID,
|
|
|
|
LibraryButtonID,
|
|
|
|
DefaultsButtonID
|
|
|
|
};
|
|
|
|
|
2010-06-15 23:49:51 +00:00
|
|
|
wxListCtrl *mList; // List of curves.
|
|
|
|
EQCurveArray mEditCurves; // Copy of curves to muck about with
|
2015-04-17 03:53:42 +00:00
|
|
|
wxWindow *mParent; // the parent EQ Dialog
|
|
|
|
EffectEqualization *mEffect; // the parent EQ effect
|
2010-06-15 23:49:51 +00:00
|
|
|
int mPosition; // position of current curve in list
|
|
|
|
void Populate();
|
|
|
|
void PopulateOrExchange(ShuttleGui &S);
|
|
|
|
void PopulateList(int position);
|
|
|
|
void OnUp(wxCommandEvent &event);
|
|
|
|
void OnDown(wxCommandEvent &event);
|
|
|
|
long GetPreviousItem(long item);
|
|
|
|
void OnRename( wxCommandEvent &event );
|
|
|
|
void OnDelete( wxCommandEvent &event );
|
|
|
|
void OnImport( wxCommandEvent &event );
|
|
|
|
void OnExport( wxCommandEvent &event );
|
|
|
|
void OnLibrary( wxCommandEvent &event );
|
|
|
|
void OnDefaults( wxCommandEvent &event );
|
|
|
|
void OnOK(wxCommandEvent &event);
|
2016-06-22 23:08:47 +00:00
|
|
|
|
|
|
|
void OnListSelectionChange( wxListEvent &event );
|
2010-06-15 23:49:51 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
#endif
|