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 ) : mUIServices{ uiServices }
41 , mUIParent{ uiParent }
42 , mName{ name }
43 , mCurvesList{ curvesList }
44 , mOptions{ options }
45 {}
46
48 std::unique_ptr<EffectEditor> PopulateOrExchange(
49 ShuttleGui & S, EffectInstance &instance,
50 EffectSettingsAccess &access, const EffectOutputs *pOutputs);
52
53private:
54 // Convenience function template for binding event handler functions
55 template<typename EventTag, typename Class, typename Event>
56 void BindTo(
57 wxEvtHandler &src, const EventTag& eventType, void (Class::*pmf)(Event &))
58 {
59 src.Bind(eventType, pmf, static_cast<Class *>(this));
60 }
61
62 void UpdateCurves();
63 void UpdateRuler();
64 void UpdateDraw();
65 void UpdateGraphic();
66
67 void OnSize( wxSizeEvent & event );
68 void OnInterp( wxCommandEvent & event );
69 void OnSliderM( wxCommandEvent & event );
70 void OnSliderDBMAX( wxCommandEvent & event );
71 void OnSliderDBMIN( wxCommandEvent & event );
72 void OnDrawMode( wxCommandEvent &event );
73 void OnGraphicMode( wxCommandEvent &event );
74 void OnCurve( wxCommandEvent & event );
75 void OnManage( wxCommandEvent & event );
76 void OnClear( wxCommandEvent & event );
77 void OnInvert( wxCommandEvent & event );
78 void OnGridOnOff( wxCommandEvent & event );
79 void OnLinFreq( wxCommandEvent & event );
80 void OnIdle( wxIdleEvent &event );
81
83 const wxWeakRef<wxWindow> &mUIParent;
86 const int mOptions;
87
90
91 wxSizer *szrC;
92 wxSizer *szrG;
93 wxSizer *szrV;
94 wxSizer *szrH;
95 wxSizer *szrI;
96 wxSizer *szrL;
97 wxSizer *szr1;
98 wxSizer *szr2;
99 wxSizer *szr3;
100 wxSizer *szr4;
101 wxSizer *szr5;
102
103 wxSizerItem *mLeftSpacer;
104
105 wxWeakRef<EqualizationPanel> mPanel{};
106 //wxPanel *mGraphicPanel;
107 wxRadioButton *mDraw{};
108 wxRadioButton *mGraphic{};
109 wxCheckBox *mLinFreq;
110 wxCheckBox *mGridOnOff;
111 wxChoice *mInterpChoice;
112 wxWeakRef<wxChoice> mCurve{};
113 wxButton *mManage;
114 wxStaticText *mMText;
115 wxSlider *mMSlider{};
116 wxSlider *mdBMinSlider;
117 wxSlider *mdBMaxSlider;
119
120 DECLARE_EVENT_TABLE()
121};
122#endif
wxString name
Definition: TagsEditor.cpp:166
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:51
Performs effect computation.
Hold values to send to effect output meters.
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
wxStaticText * mMText
RulerPanel * mFreqRuler
void OnLinFreq(wxCommandEvent &event)
void OnInterp(wxCommandEvent &event)
wxSizer * szr3
wxButton * mManage
wxSizerItem * mLeftSpacer
EffectUIServices & mUIServices
void OnCurve(wxCommandEvent &event)
EqualizationUI(EffectUIServices &uiServices, const wxWeakRef< wxWindow > &uiParent, const TranslatableString &name, EqualizationCurvesList &curvesList, int options)
wxSizer * szr2
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
void OnSliderM(wxCommandEvent &event)
std::unique_ptr< EffectEditor > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs)
wxSlider * mMSlider
wxSizer * szrL
bool TransferDataToWindow(const EffectSettings &settings)
RulerPanel * mdBRuler
void OnSize(wxSizeEvent &event)
wxRadioButton * mDraw
TranslatableString mName
wxSizer * szr1
wxSizer * szrI
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: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.