31#include <wx/dcclient.h>
32#include <wx/dcmemory.h>
33#include <wx/settings.h>
35#include <wx/stattext.h>
44#include "../widgets/valnum.h"
45#include "../widgets/RulerPanel.h"
46#include "../widgets/IntFormat.h"
47#include "../widgets/LinearDBFormat.h"
86 mUIParent =
S.GetParent();
88 S.SetSizerProportion(1);
89 S.StartMultiColumn(3, wxEXPAND);
101 S.GetParent(), wxID_ANY, wxVERTICAL,
113 .Position(wxALIGN_RIGHT | wxTOP)
114 .AddWindow(mdBRuler);
120 S.GetParent(), wxID_ANY,
121 this, mLoFreq, mNyquist
126 .Position(wxEXPAND | wxRIGHT)
127 .MinSize( { -1, -1 } )
130 S.StartVerticalLay();
132 S.AddVariableText(
XO(
"+ dB"),
false, wxCENTER);
135 .Style(wxSL_VERTICAL | wxSL_INVERSE)
136 .AddSlider( {}, 10, 20, 0);
137#if wxUSE_ACCESSIBILITY
138 mdBMaxSlider->SetAccessible(
safenew SliderAx(mdBMaxSlider,
XO(
"%d dB")));
142 .Style(wxSL_VERTICAL | wxSL_INVERSE)
143 .AddSlider( {}, -10, -10, -120);
144#if wxUSE_ACCESSIBILITY
145 mdBMinSlider->SetAccessible(
safenew SliderAx(mdBMinSlider,
XO(
"%d dB")));
148 S.AddVariableText(
XO(
"- dB"),
false, wxCENTER);
159 S.GetParent(), wxID_ANY, wxHORIZONTAL,
171 .Position(wxEXPAND | wxALIGN_LEFT | wxRIGHT)
172 .AddWindow(mfreqRuler);
181 S.SetSizerProportion(0);
182 S.StartMultiColumn(8, wxALIGN_CENTER);
184 wxASSERT(
nTypes == WXSIZEOF(kTypeStrings));
188 .Validator<wxGenericValidator>(&mFilterType)
189 .MinSize( { -1, -1 } )
190 .AddChoice(
XXO(
"&Filter Type:"),
195 .Validator<wxGenericValidator>(&mOrderIndex)
196 .MinSize( { -1, -1 } )
198 .AddChoice(
XXO(
"O&rder:"),
201 for (
int i = 1; i <= 10; i++)
208 mRippleCtlP =
S.AddVariableText(
XO(
"&Passband Ripple:"),
209 false, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
211 .Name(
XO(
"Passband Ripple (dB)"))
212 .Validator<FloatingPointValidator<float>>(
213 1, &mRipple, NumValidatorStyle::DEFAULT,
214 Passband.min, Passband.max)
215 .AddTextBox( {}, L
"", 10);
216 mRippleCtlU =
S.AddVariableText(
XO(
"dB"),
217 false, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
220 .Validator<wxGenericValidator>(&mFilterSubtype)
221 .MinSize( { -1, -1 } )
222 .AddChoice(
XXO(
"&Subtype:"),
223 Msgids(kSubTypeStrings, nSubTypes)
227 .Name(
XO(
"Cutoff (Hz)"))
228 .
Validator<FloatingPointValidator<float>>(
229 1, &mCutoff, NumValidatorStyle::DEFAULT,
230 Cutoff.min, mNyquist - 1)
231 .AddTextBox(
XXO(
"C&utoff:"), L
"", 10);
232 S.AddUnits(
XO(
"Hz"));
234 mStopbandRippleCtlP =
235 S.AddVariableText(
XO(
"Minimum S&topband Attenuation:"),
236 false, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
238 .Name(
XO(
"Minimum S&topband Attenuation (dB)"))
239 .
Validator<FloatingPointValidator<float>>(
240 1, &mStopbandRipple, NumValidatorStyle::DEFAULT,
241 Stopband.min, Stopband.max)
242 .AddTextBox( {}, L
"", 10);
243 mStopbandRippleCtlU =
244 S.AddVariableText(
XO(
"dB"),
245 false, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
307 tip.Printf(
_(
"%d dB"), (
int)
mdBMin);
315 tip.Printf(
_(
"%d dB"),(
int)
mdBMax);
453 wxWindow *parent, wxWindowID winid,
455:
wxPanelWrapper(parent, winid, wxDefaultPosition, wxSize(400, 200))
468 SetFreqRange(lo, hi);
508 GetSize(&width, &height);
517 wxBrush bkgndBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
527 memDC.SetBrush(bkgndBrush);
528 memDC.SetPen(*wxTRANSPARENT_PEN);
529 memDC.DrawRectangle(bkgndRect);
532 memDC.DrawRectangle(bkgndRect);
540 memDC.SetBrush(*wxWHITE_BRUSH);
541 memDC.SetPen(*wxBLACK_PEN);
542 memDC.DrawRectangle(border);
548 memDC.SetPen(wxPen(
theTheme.
Colour(clrGraphLines), 1, wxPENSTYLE_SOLID));
556 memDC.SetPen(wxPen(
theTheme.
Colour(clrResponseLines), 3, wxPENSTYLE_SOLID));
561 double step = log10(
mHiFreq) - loLog;
562 step /= ((double)
mEnvRect.width - 1.0);
564 int x, y, xlast = 0, ylast = 0;
565 for (
int i = 0; i <
mEnvRect.width; i++)
568 freq = pow(10.0, loLog + i * step);
577 yF = center-scale * yF;
580 yF = (double)
mEnvRect.height - 1.0;
586 y = (int) (yF + 0.5);
596 memDC.SetPen(*wxBLACK_PEN);
602 memDC.SelectObject(wxNullBitmap);
XXO("&Cut/Copy/Paste Toolbar")
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
std::vector< TranslatableString > TranslatableStrings
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static bool EnableApply(wxWindow *parent, bool enable=true)
Enable or disable the Apply button of the dialog that contains parent.
Performs effect computation.
Hold values to send to effect output meters.
void OnFilterSubtype(wxCommandEvent &evt)
EffectScienFilterPanel * mPanel
void OnSliderDBMAX(wxCommandEvent &evt)
wxStaticText * mRippleCtlU
void OnStopbandRipple(wxCommandEvent &evt)
void OnCutoff(wxCommandEvent &evt)
void EnableDisableRippleCtl(int FilterType)
wxChoice * mFilterSubTypeCtl
bool TransferDataFromWindow(EffectSettings &settings) override
wxChoice * mFilterTypeCtl
void OnFilterType(wxCommandEvent &evt)
wxChoice * mFilterOrderCtl
wxWeakRef< wxWindow > mUIParent
wxStaticText * mStopbandRippleCtlP
wxTextCtrl * mStopbandRippleCtl
bool TransferGraphLimitsFromWindow()
bool TransferDataToWindow(const EffectSettings &settings) override
void OnSliderDBMIN(wxCommandEvent &evt)
void OnOrder(wxCommandEvent &evt)
void OnRipple(wxCommandEvent &evt)
wxStaticText * mRippleCtlP
wxStaticText * mStopbandRippleCtlU
void OnSize(wxSizeEvent &evt)
EffectScienFilterPanel is used with EffectScienFilter and controls a graph for EffectScienFilter.
void OnPaint(wxPaintEvent &evt)
void OnSize(wxSizeEvent &evt)
virtual ~EffectScienFilterPanel()
void SetDbRange(double min, double max)
bool AcceptsFocus() const
bool AcceptsFocusFromKeyboard() const
EffectScienFilter * mEffect
std::unique_ptr< wxBitmap > mBitmap
void SetFreqRange(double lo, double hi)
void DrawGrid(wxDC &dc, int length, bool minor=true, bool major=true, int xOffset=0, int yOffset=0) const
void GetMaxSize(wxCoord *width, wxCoord *height)
void SetRange(double min, double max)
RulerPanel class allows you to work with a Ruler like any other wxWindow.
std::pair< double, double > Range
float FilterMagnAtFreq(float Freq)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
wxColour & Colour(int iIndex)
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.
A Validator is an object which checks whether a wxVariant satisfies a certain criterion....
BuiltinEffectsModule::Registration< EffectScienFilter > reg(false)
Externalized state of a plug-in.
Options & LabelEdges(bool l)