Audacity 3.2.0
EqualizationUI.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 EqualizationUI.h
6
7 Mitch Golden
8 Vaughan Johnson (Preview)
9
10 Paul Licameli split from Equalization.h
11
12***********************************************************************/
13#ifndef __AUDACITY_EFFECT_EQUALIZATION_UI__
14#define __AUDACITY_EFFECT_EQUALIZATION_UI__
15
16#include "EffectPlugin.h"
18
19class wxButton;
20class wxCheckBox;
21class wxChoice;
22class wxRadioButton;
23class wxSizer;
24class wxSizerItem;
25class wxStaticText;
26class EffectEditor;
28class RulerPanel;
29
30#include <wx/weakref.h>
31
32class EqualizationUI : public wxEvtHandler {
33public:
35 const wxWeakRef<wxWindow> &uiParent,
37 int options
38 ) : mManager{ manager }
39 , mUIParent{ uiParent }
40 , mName{ name }
41 , mCurvesList{ curvesList }
42 , mOptions{ options }
43 {}
44
46 void Init() { mBands.Init(); }
47 void setCurve(int currentCurve);
48 void setCurve(const wxString &curveName);
49 std::unique_ptr<EffectEditor> PopulateOrExchange(
50 ShuttleGui & S, EffectInstance &instance,
51 EffectSettingsAccess &access, const EffectOutputs *pOutputs);
53
54private:
55 // Convenience function template for binding event handler functions
56 template<typename EventTag, typename Class, typename Event>
57 void BindTo(
58 wxEvtHandler &src, const EventTag& eventType, void (Class::*pmf)(Event &))
59 {
60 src.Bind(eventType, pmf, static_cast<Class *>(this));
61 }
62
63 void UpdateCurves();
64 void UpdateRuler();
65 void UpdateDraw();
66 void UpdateGraphic();
67
68 void OnSize( wxSizeEvent & event );
69 void OnInterp( wxCommandEvent & event );
70 void OnSliderM( wxCommandEvent & event );
71 void OnSliderDBMAX( wxCommandEvent & event );
72 void OnSliderDBMIN( wxCommandEvent & event );
73 void OnDrawMode( wxCommandEvent &event );
74 void OnGraphicMode( wxCommandEvent &event );
75 void OnCurve( wxCommandEvent & event );
76 void OnManage( wxCommandEvent & event );
77 void OnClear( wxCommandEvent & event );
78 void OnInvert( wxCommandEvent & event );
79 void OnGridOnOff( wxCommandEvent & event );
80 void OnLinFreq( wxCommandEvent & event );
81 void OnIdle( wxIdleEvent &event );
82
83 void setCurve();
84
86 const wxWeakRef<wxWindow> &mUIParent;
89 const int mOptions;
90
93
94 bool mDisallowCustom{ false };
95
96 wxSizer *szrC;
97 wxSizer *szrG;
98 wxSizer *szrV;
99 wxSizer *szrH;
100 wxSizer *szrI;
101 wxSizer *szrL;
102 wxSizer *szr1;
103 wxSizer *szr2;
104 wxSizer *szr3;
105 wxSizer *szr4;
106 wxSizer *szr5;
107
108 wxSizerItem *mLeftSpacer;
109
110 wxWeakRef<EqualizationPanel> mPanel{};
111 //wxPanel *mGraphicPanel;
112 wxRadioButton *mDraw{};
113 wxRadioButton *mGraphic{};
114 wxCheckBox *mLinFreq;
115 wxCheckBox *mGridOnOff;
116 wxChoice *mInterpChoice;
117 wxWeakRef<wxChoice> mCurve{};
118 wxButton *mManage;
119 wxStaticText *mMText;
120 wxSlider *mMSlider{};
121 wxSlider *mdBMinSlider;
122 wxSlider *mdBMaxSlider;
124
125 DECLARE_EVENT_TABLE()
126};
127#endif
const TranslatableString name
Definition: Distortion.cpp:76
static const AttachedProjectObjects::RegisteredFactory manager
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:87
Performs effect computation.
Hold values to send to effect output meters.
EffectSettingsManager is an EffectDefinitionInterface that adds a factory function for EffectSettings...
EqualizationPanel is used with EqualizationDialog and controls a graph for EffectEqualization....
wxSizer * szrH
void OnIdle(wxIdleEvent &event)
void OnSliderDBMAX(wxCommandEvent &event)
wxSizer * szrC
void OnDrawMode(wxCommandEvent &event)
void OnManage(wxCommandEvent &event)
EqualizationCurvesList & mCurvesList
void OnGraphicMode(wxCommandEvent &event)
wxRadioButton * mGraphic
wxWeakRef< EqualizationPanel > mPanel
wxSizer * szrV
wxCheckBox * mGridOnOff
void OnClear(wxCommandEvent &event)
wxChoice * mInterpChoice
EffectSettingsManager & mManager
wxStaticText * mMText
RulerPanel * mFreqRuler
void OnLinFreq(wxCommandEvent &event)
void OnInterp(wxCommandEvent &event)
wxButton * mManage
wxSizerItem * mLeftSpacer
void OnCurve(wxCommandEvent &event)
void BindTo(wxEvtHandler &src, const EventTag &eventType, void(Class::*pmf)(Event &))
const int mOptions
void OnSliderDBMIN(wxCommandEvent &event)
EqualizationBandSliders mBands
bool ValidateUI(EffectSettings &settings)
wxCheckBox * mLinFreq
wxSizer * szrG
void OnInvert(wxCommandEvent &event)
const wxWeakRef< wxWindow > & mUIParent
wxSlider * mdBMinSlider
wxSlider * mdBMaxSlider
EqualizationUI(EffectSettingsManager &manager, const wxWeakRef< wxWindow > &uiParent, const TranslatableString &name, EqualizationCurvesList &curvesList, int options)
void OnSliderM(wxCommandEvent &event)
std::unique_ptr< EffectEditor > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs)
wxSlider * mMSlider
bool TransferDataToWindow(const EffectSettings &settings)
RulerPanel * mdBRuler
void OnSize(wxSizeEvent &event)
wxRadioButton * mDraw
TranslatableString mName
wxWeakRef< wxChoice > mCurve
void OnGridOnOff(wxCommandEvent &event)
RulerPanel class allows you to work with a Ruler like any other wxWindow.
Definition: RulerPanel.h:19
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:625
Holds a msgid for the translation catalog; may also bind format arguments.
Externalized state of a plug-in.
Maintains a list of preset curves for Equalization effects.