22#include <wx/checkbox.h>
23#include <wx/dcclient.h>
25#include <wx/stattext.h>
31#include "../widgets/LinearUpdater.h"
32#include "../widgets/Ruler.h"
33#include "../widgets/LinearDBFormat.h"
34#include "../widgets/LinearUpdater.h"
62{
return XO(
"%3d dB").Format(value); }
65{
return XO(
"%.2f secs").Format( value ); }
68{
return XO(
"%.1f secs").Format( value ); }
72 auto format = (sliderValue % 10 == 0)
79 return format.Format( value );
84 auto format = (sliderValue % 10 == 0)
85 ?
XO(
"Ratio %.0f to 1")
86 :
XO(
"Ratio %.1f to 1");
87 return format.Format( value );
98 S.StartHorizontalLay(wxEXPAND,
true);
104 .Position(wxEXPAND | wxALL)
105 .MinSize( { 400, 200 } )
109 S.EndHorizontalLay();
113 S.StartMultiColumn(3, wxEXPAND);
117 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
119 .Name(
XO(
"Threshold"))
120 .Style(wxSL_HORIZONTAL)
126 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
129 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
131 .Name(
XO(
"Noise Floor"))
132 .Style(wxSL_HORIZONTAL)
138 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
141 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
144 .Style(wxSL_HORIZONTAL)
151 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
157 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
162 .Name(
XO(
"Attack Time"))
163 .Style(wxSL_HORIZONTAL)
170 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
176 wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
181 .Name(
XO(
"Release Time"))
182 .Style(wxSL_HORIZONTAL)
190 true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
196 S.StartHorizontalLay(wxCENTER,
false);
206 S.EndHorizontalLay();
293 wxWindow* parent, wxWindowID winid,
double& threshold,
double& noiseFloor,
296 , threshold(threshold)
297 , noiseFloor(noiseFloor)
307 GetSize(&width, &height);
316 vRuler.SetBounds(0, 0, width, height);
317 vRuler.SetOrientation(wxVERTICAL);
318 vRuler.SetRange(0, -rangeDB);
319 vRuler.SetUnits(
XO(
"dB"));
320 vRuler.GetMaxSize(&w, NULL);
323 hRuler.SetBounds(0, 0, width, height);
324 hRuler.SetOrientation(wxHORIZONTAL);
325 hRuler.SetRange(-rangeDB, 0);
326 hRuler.SetUnits(
XO(
"dB"));
327 hRuler.SetFlip(
true);
328 hRuler.GetMaxSize(NULL, &h);
330 vRuler.SetBounds(0, 0, w, height - h);
331 hRuler.SetBounds(w, height - h, width, height);
336#if defined(__WXMSW__)
343 border.width = width - w;
344 border.height = height - h + 1;
346 dc.SetBrush(*wxWHITE_BRUSH);
347 dc.SetPen(*wxBLACK_PEN);
348 dc.DrawRectangle(border);
350 wxRect envRect = border;
351 envRect.Deflate( 2, 2 );
356 int finalY = envRect.height;
375 envRect.y + envRect.height - startY,
376 envRect.x + kneeX - 1,
377 envRect.y + envRect.height - kneeY);
381 envRect.y + envRect.height - kneeY,
382 envRect.x + envRect.width - 1,
383 envRect.y + envRect.height - finalY);
386 dc.SetBrush(*wxTRANSPARENT_BRUSH);
387 dc.SetPen(*wxBLACK_PEN);
388 dc.DrawRectangle(border);
XXO("&Cut/Copy/Paste Toolbar")
static wxPen WideEnvelopePen
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Performs effect computation.
bool TransferDataFromWindow(EffectSettings &settings) override
wxStaticText * mRatioLabel
wxSlider * mThresholdSlider
wxWeakRef< wxWindow > mUIParent
wxStaticText * mRatioText
wxCheckBox * mGainCheckBox
wxCheckBox * mPeakCheckBox
bool TransferDataToWindow(const EffectSettings &settings) override
wxStaticText * mNoiseFloorText
wxStaticText * mAttackLabel
wxStaticText * mDecayLabel
wxStaticText * mThresholdText
wxStaticText * mNoiseFloorLabel
wxStaticText * mAttackText
std::unique_ptr< EffectEditor > PopulateOrExchange(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) override
Add controls to effect panel; always succeeds.
bool DoTransferDataFromWindow()
void OnSlider(wxCommandEvent &evt)
wxStaticText * mThresholdLabel
wxSlider * mNoiseFloorSlider
EffectLegacyCompressorPanel * mPanel
wxStaticText * mDecayText
void OnPaint(wxPaintEvent &evt)
void OnSize(wxSizeEvent &evt)
Hold values to send to effect output meters.
static constexpr EffectParameter ReleaseTime
static constexpr EffectParameter Ratio
static constexpr EffectParameter Normalize
static constexpr EffectParameter AttackTime
static constexpr EffectParameter NoiseFloor
static constexpr EffectParameter UsePeak
static constexpr EffectParameter Threshold
static const LinearUpdater & Instance()
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
wxColour & Colour(int iIndex)
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
TranslatableString RatioLabelFormat(int sliderValue, double value)
TranslatableString AttackTimeFormat(double value)
TranslatableString DecayTimeFormat(double value)
TranslatableString RatioTextFormat(int sliderValue, double value)
TranslatableString ThresholdFormat(int value)
BuiltinEffectsModule::Registration< EffectLegacyCompressor > reg
const Type scale
Scaling factor, for slider control.
const Type def
Default value.
const Type min
Minimum value.
const Type max
Maximum value.
Externalized state of a plug-in.