Audacity 3.2.0
ScienFilter.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5EffectScienFilter.h
6
7Norm C
8Mitch Golden
9Vaughan Johnson (Preview)
10
11***********************************************************************/
12
13#ifndef __AUDACITY_EFFECT_SCIENFILTER__
14#define __AUDACITY_EFFECT_SCIENFILTER__
15
16#include <wx/setup.h> // for wxUSE_* macros
17
18#include "ScienFilterBase.h"
20#include "wxPanelWrapper.h"
21
22class wxBitmap;
23class wxChoice;
24class wxSlider;
25class wxStaticText;
26class wxTextCtrl;
27class RulerPanel;
28class ShuttleGui;
29
31
32class EffectScienFilter final :
33 public ScienFilterBase,
35{
36public:
37 std::unique_ptr<EffectEditor> PopulateOrExchange(
39 const EffectOutputs* pOutputs) override;
40 bool TransferDataToWindow(const EffectSettings& settings) override;
42
43 DECLARE_EVENT_TABLE()
44private:
46 void EnableDisableRippleCtl(int FilterType);
47
48 void OnSize(wxSizeEvent& evt);
49 void OnSlider(wxCommandEvent& evt);
50
51 void OnOrder(wxCommandEvent& evt);
52 void OnCutoff(wxCommandEvent& evt);
53 void OnRipple(wxCommandEvent& evt);
54 void OnStopbandRipple(wxCommandEvent& evt);
55 void OnFilterType(wxCommandEvent& evt);
56 void OnFilterSubtype(wxCommandEvent& evt);
57
58 void OnSliderDBMAX(wxCommandEvent& evt);
59 void OnSliderDBMIN(wxCommandEvent& evt);
60
61 wxWeakRef<wxWindow> mUIParent {};
62
64 wxSlider* mdBMinSlider;
65 wxSlider* mdBMaxSlider;
66
67 wxStaticText* mRippleCtlP;
68 wxTextCtrl* mRippleCtl;
69 wxStaticText* mRippleCtlU;
70
71 wxTextCtrl* mCutoffCtl;
72
73 wxStaticText* mStopbandRippleCtlP;
74 wxTextCtrl* mStopbandRippleCtl;
75 wxStaticText* mStopbandRippleCtlU;
76
77 wxChoice* mFilterTypeCtl;
79 wxChoice* mFilterOrderCtl;
80
83
85};
86
88{
89public:
91 wxWindow *parent, wxWindowID winid,
92 EffectScienFilter *effect, double lo, double hi);
94
95 // We don't need or want to accept focus.
96 bool AcceptsFocus() const;
97 // So that wxPanel is not included in Tab traversal - see wxWidgets bug 15581
98 bool AcceptsFocusFromKeyboard() const;
99
100 void SetFreqRange(double lo, double hi);
101 void SetDbRange(double min, double max);
102
103private:
104 void OnPaint(wxPaintEvent & evt);
105 void OnSize(wxSizeEvent & evt);
106
107private:
109 wxWindow *mParent;
110
111 double mLoFreq;
112 double mHiFreq;
113
114 double mDbMin;
115 double mDbMax;
116
117 std::unique_ptr<wxBitmap> mBitmap;
118 wxRect mEnvRect;
121
122 friend class EffectScienFilter;
123
124 DECLARE_EVENT_TABLE()
125};
126
127#endif
int min(int a, int b)
#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.
void OnFilterSubtype(wxCommandEvent &evt)
EffectScienFilterPanel * mPanel
Definition: ScienFilter.h:63
void OnSliderDBMAX(wxCommandEvent &evt)
wxStaticText * mRippleCtlU
Definition: ScienFilter.h:69
void OnStopbandRipple(wxCommandEvent &evt)
void OnCutoff(wxCommandEvent &evt)
wxTextCtrl * mRippleCtl
Definition: ScienFilter.h:68
void EnableDisableRippleCtl(int FilterType)
wxChoice * mFilterSubTypeCtl
Definition: ScienFilter.h:78
void OnSlider(wxCommandEvent &evt)
bool TransferDataFromWindow(EffectSettings &settings) override
wxTextCtrl * mCutoffCtl
Definition: ScienFilter.h:71
wxSlider * mdBMaxSlider
Definition: ScienFilter.h:65
wxChoice * mFilterTypeCtl
Definition: ScienFilter.h:77
void OnFilterType(wxCommandEvent &evt)
wxChoice * mFilterOrderCtl
Definition: ScienFilter.h:79
wxWeakRef< wxWindow > mUIParent
Definition: ScienFilter.h:61
wxStaticText * mStopbandRippleCtlP
Definition: ScienFilter.h:73
std::unique_ptr< EffectEditor > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) override
Add controls to effect panel; always succeeds.
Definition: ScienFilter.cpp:82
RulerPanel * mdBRuler
Definition: ScienFilter.h:81
wxTextCtrl * mStopbandRippleCtl
Definition: ScienFilter.h:74
bool TransferGraphLimitsFromWindow()
bool TransferDataToWindow(const EffectSettings &settings) override
void OnSliderDBMIN(wxCommandEvent &evt)
void OnOrder(wxCommandEvent &evt)
void OnRipple(wxCommandEvent &evt)
RulerPanel * mfreqRuler
Definition: ScienFilter.h:82
wxStaticText * mRippleCtlP
Definition: ScienFilter.h:67
wxStaticText * mStopbandRippleCtlU
Definition: ScienFilter.h:75
void OnSize(wxSizeEvent &evt)
wxSlider * mdBMinSlider
Definition: ScienFilter.h:64
EffectScienFilterPanel is used with EffectScienFilter and controls a graph for EffectScienFilter.
Definition: ScienFilter.h:88
void OnPaint(wxPaintEvent &evt)
EffectScienFilterPanel(wxWindow *parent, wxWindowID winid, EffectScienFilter *effect, double lo, double hi)
void OnSize(wxSizeEvent &evt)
virtual ~EffectScienFilterPanel()
void SetDbRange(double min, double max)
bool AcceptsFocus() const
bool AcceptsFocusFromKeyboard() const
EffectScienFilter * mEffect
Definition: ScienFilter.h:108
std::unique_ptr< wxBitmap > mBitmap
Definition: ScienFilter.h:117
void SetFreqRange(double lo, double hi)
RulerPanel class allows you to work with a Ruler like any other wxWindow.
Definition: RulerPanel.h:19
An Effect that applies 'classical' IIR filters.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Externalized state of a plug-in.