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;
30
31#include <wx/weakref.h>
32
33class EqualizationUI : public wxEvtHandler {
34public:
36 EffectUIServices& uiServices,
37 const wxWeakRef<wxWindow> &uiParent,
39 int options
40 ) : mManager{ manager }
41 , mUIServices{ uiServices }
42 , mUIParent{ uiParent }
43 , mName{ name }
44 , mCurvesList{ curvesList }
45 , mOptions{ options }
46 {}
47
49 void Init() { mBands.Init(); }
50 void setCurve(int currentCurve);
51 void setCurve(const wxString &curveName);
52 std::unique_ptr<EffectEditor> PopulateOrExchange(
53 ShuttleGui & S, EffectInstance &instance,
54 EffectSettingsAccess &access, const EffectOutputs *pOutputs);
56
57private:
58 // Convenience function template for binding event handler functions
59 template<typename EventTag, typename Class, typename Event>
60 void BindTo(
61 wxEvtHandler &src, const EventTag& eventType, void (Class::*pmf)(Event &))
62 {
63 src.Bind(eventType, pmf, static_cast<Class *>(this));
64 }
65
66 void UpdateCurves();
67 void UpdateRuler();
68 void UpdateDraw();
69 void UpdateGraphic();
70
71 void OnSize( wxSizeEvent & event );
72 void OnInterp( wxCommandEvent & event );
73 void OnSliderM( wxCommandEvent & event );
74 void OnSliderDBMAX( wxCommandEvent & event );
75 void OnSliderDBMIN( wxCommandEvent & event );
76 void OnDrawMode( wxCommandEvent &event );
77 void OnGraphicMode( wxCommandEvent &event );
78 void OnCurve( wxCommandEvent & event );
79 void OnManage( wxCommandEvent & event );
80 void OnClear( wxCommandEvent & event );
81 void OnInvert( wxCommandEvent & event );
82 void OnGridOnOff( wxCommandEvent & event );
83 void OnLinFreq( wxCommandEvent & event );
84 void OnIdle( wxIdleEvent &event );
85
86 void setCurve();
87
90 const wxWeakRef<wxWindow> &mUIParent;
93 const int mOptions;
94
97
98 bool mDisallowCustom{ false };
99
100 wxSizer *szrC;
101 wxSizer *szrG;
102 wxSizer *szrV;
103 wxSizer *szrH;
104 wxSizer *szrI;
105 wxSizer *szrL;
106 wxSizer *szr1;
107 wxSizer *szr2;
108 wxSizer *szr3;
109 wxSizer *szr4;
110 wxSizer *szr5;
111
112 wxSizerItem *mLeftSpacer;
113
114 wxWeakRef<EqualizationPanel> mPanel{};
115 //wxPanel *mGraphicPanel;
116 wxRadioButton *mDraw{};
117 wxRadioButton *mGraphic{};
118 wxCheckBox *mLinFreq;
119 wxCheckBox *mGridOnOff;
120 wxChoice *mInterpChoice;
121 wxWeakRef<wxChoice> mCurve{};
122 wxButton *mManage;
123 wxStaticText *mMText;
124 wxSlider *mMSlider{};
125 wxSlider *mdBMinSlider;
126 wxSlider *mdBMaxSlider;
128
129 DECLARE_EVENT_TABLE()
130};
131#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:69
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....
void OnIdle(wxIdleEvent &event)
void OnSliderDBMAX(wxCommandEvent &event)
void OnDrawMode(wxCommandEvent &event)
void OnManage(wxCommandEvent &event)
EqualizationCurvesList & mCurvesList
void OnGraphicMode(wxCommandEvent &event)
wxRadioButton * mGraphic
wxWeakRef< EqualizationPanel > mPanel
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
EffectUIServices & mUIServices
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
void OnInvert(wxCommandEvent &event)
const wxWeakRef< wxWindow > & mUIParent
wxSlider * mdBMinSlider
wxSlider * mdBMaxSlider
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
EqualizationUI(EffectSettingsManager &manager, EffectUIServices &uiServices, const wxWeakRef< wxWindow > &uiParent, const TranslatableString &name, EqualizationCurvesList &curvesList, int options)
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:640
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.