Audacity 3.2.0
NoiseReduction.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 NoiseReduction.cpp
6
7 Dominic Mazzoni
8
9 detailed rewriting by
10 Paul Licameli
11
12*******************************************************************/
15#include "NoiseReduction.h"
16
17#include "LoadEffects.h"
18#include "EffectManager.h"
19#include "EffectPreview.h"
20#include "EffectUI.h"
21
22#include "ShuttleGui.h"
23#include "HelpSystem.h"
24
25#include "AudacityMessageBox.h"
26#include "../widgets/valnum.h"
27
28#if defined(__WXMSW__) && !defined(__CYGWIN__)
29#include <float.h>
30#define finite(x) _finite(x)
31#endif
32
33#include <wx/button.h>
34#include <wx/choice.h>
35#include <wx/radiobut.h>
36#include <wx/slider.h>
37#include <wx/valtext.h>
38#include <wx/textctrl.h>
39
40/****************************************************************//*****************************************************************/
46
47//----------------------------------------------------------------------------
48// EffectNoiseReduction::Dialog
49//----------------------------------------------------------------------------
50
52{
53public:
54 // constructors and destructors
57 wxWindow *parent, bool bHasProfile,
58 bool bAllowTwiddleSettings);
59
60 void PopulateOrExchange(ShuttleGui & S) override;
61 bool TransferDataToWindow() override;
62 bool TransferDataFromWindow() override;
63
65 { return mTempSettings; }
66
67private:
69
70#ifdef ADVANCED_SETTINGS
71 void EnableDisableSensitivityControls();
72#endif
73
74 // handlers
75 void OnGetProfile( wxCommandEvent &event );
76 void OnNoiseReductionChoice( wxCommandEvent &event );
77#ifdef ADVANCED_SETTINGS
78 void OnMethodChoice(wxCommandEvent &);
79#endif
80 void OnPreview(wxCommandEvent &event) override;
81 void OnReduceNoise( wxCommandEvent &event );
82 void OnCancel( wxCommandEvent &event );
83 void OnHelp( wxCommandEvent &event );
84
85 void OnText(wxCommandEvent &event);
86 void OnSlider(wxCommandEvent &event);
87
88 // data members
89
95
98
99
100 wxRadioButton *mKeepSignal;
101#ifdef ISOLATE_CHOICE
102 wxRadioButton *mKeepNoise;
103#endif
104#ifdef RESIDUE_CHOICE
105 wxRadioButton *mResidue;
106#endif
107
108private:
109 DECLARE_EVENT_TABLE()
110};
111
113
114namespace
115{
118 EffectSettingsAccess& access, wxWindow& parent, bool bHasProfile,
119 bool bAllowTwiddleSettings)
120{
122 effect, access, &settings, &parent, bHasProfile, bAllowTwiddleSettings);
123
124 dlog.CentreOnParent();
125 dlog.ShowModal();
126
127 const auto returnCode = dlog.GetReturnCode();
128 if (!returnCode)
129 return 0;
130
131 settings = dlog.GetTempSettings();
132 settings.mDoProfile = (returnCode == 1);
133
134 if (!settings.PrefsIO(false))
135 return 0;
136 return returnCode;
137}
138} // namespace
139
142
147 wxWindow &parent, const EffectDialogFactory &,
148 std::shared_ptr<EffectInstance> &pInstance, EffectSettingsAccess &access,
149 bool forceModal)
150{
151 // Assign the out parameter
152 pInstance = MakeInstance();
153
154 // to do: use forceModal correctly
155
156 // Doesn't use the factory but substitutes its own dialog
157
158 // We may want to twiddle the levels if we are setting
159 // from a macro editing dialog
160 return PromptUser(*mSettings, this, access, parent,
162}
163
164//----------------------------------------------------------------------------
165// EffectNoiseReduction::Dialog
166//----------------------------------------------------------------------------
167
168enum {
171#ifdef ISOLATE_CHOICE
172 ID_RADIOBUTTON_KEEPNOISE,
173#endif
174#ifdef RESIDUE_CHOICE
175 ID_RADIOBUTTON_RESIDUE,
176#endif
177
178#ifdef ADVANCED_SETTINGS
179 ID_CHOICE_METHOD,
180#endif
181
182 // Slider/text pairs
185
188
189#ifdef ATTACK_AND_RELEASE
190 ID_ATTACK_TIME_SLIDER,
191 ID_ATTACK_TIME_TEXT,
192
193 ID_RELEASE_TIME_SLIDER,
194 ID_RELEASE_TIME_TEXT,
195#endif
196
199
201
202#ifdef ADVANCED_SETTINGS
203 ID_OLD_SENSITIVITY_SLIDER = END_OF_BASIC_SLIDERS,
204 ID_OLD_SENSITIVITY_TEXT,
205
206 END_OF_ADVANCED_SLIDERS,
207 END_OF_SLIDERS = END_OF_ADVANCED_SLIDERS,
208#else
210#endif
211
213};
214
215namespace {
216
219
220 double Value(long sliderSetting) const
221 {
222 return
223 valueMin +
224 (double(sliderSetting) / sliderMax) * (valueMax - valueMin);
225 }
226
227 long SliderSetting(double value) const
228 {
229 return std::clamp<long>(
230 0.5 + sliderMax * (value - valueMin) / (valueMax - valueMin),
231 0, sliderMax);
232 }
233
234 wxString Text(double value) const
235 {
236 if (formatAsInt)
237 return wxString::Format(format, (int)(value));
238 else
239 return wxString::Format(format, value);
240 }
241
242 void CreateControls(int id, ShuttleGui &S) const
243 {
244 wxTextCtrl *const text = S.Id(id + 1)
245 .Validator<FloatingPointValidator<double>>(
246 formatAsInt ? 0 : 2,
247 nullptr,
248 NumValidatorStyle::DEFAULT,
249 valueMin, valueMax
250 )
251 .AddTextBox(textBoxCaption, wxT(""), 0);
252
253 wxSlider *const slider =
254 S.Id(id)
255 .Name( sliderName )
256 .Style(wxSL_HORIZONTAL)
257 .MinSize( { 150, -1 } )
258 .AddSlider( {}, 0, sliderMax);
259 }
260
262 double valueMin;
263 double valueMax;
265 // (valueMin - valueMax) / sliderMax is the value increment of the slider
266 const wxChar* format;
270
271 ControlInfo(MemberPointer f, double vMin, double vMax, long sMax, const wxChar* fmt, bool fAsInt,
272 const TranslatableString &caption, const TranslatableString &name)
273 : field(f), valueMin(vMin), valueMax(vMax), sliderMax(sMax), format(fmt), formatAsInt(fAsInt)
274 , textBoxCaption(caption), sliderName(name)
275 {
276 }
277};
278
280 static const ControlInfo table[] = {
282 0.0, 48.0, 48, wxT("%d"), true,
283 XXO("&Noise reduction (dB):"), XO("Noise reduction")),
285 0.01, 24.0, 48, wxT("%.2f"), false,
286 XXO("&Sensitivity:"), XO("Sensitivity")),
287#ifdef ATTACK_AND_RELEASE
289 0, 1.0, 100, wxT("%.2f"), false,
290 XXO("Attac&k time (secs):"), XO("Attack time")),
292 0, 1.0, 100, wxT("%.2f"), false,
293 XXO("R&elease time (secs):"), XO("Release time")),
294#endif
296 0, 12, 12, wxT("%d"), true,
297 XXO("&Frequency smoothing (bands):"), XO("Frequency smoothing")),
298
299#ifdef ADVANCED_SETTINGS
301 -20.0, 20.0, 4000, wxT("%.2f"), false,
302 XXO("Sensiti&vity (dB):"), XO("Old Sensitivity")),
303 // add here
304#endif
305 };
306
307return table;
308}
309
310} // namespace
311
312
319
321#ifdef ISOLATE_CHOICE
322 EVT_RADIOBUTTON(ID_RADIOBUTTON_KEEPNOISE, EffectNoiseReduction::Dialog::OnNoiseReductionChoice)
323#endif
324#ifdef RESIDUE_CHOICE
325 EVT_RADIOBUTTON(ID_RADIOBUTTON_RESIDUE, EffectNoiseReduction::Dialog::OnNoiseReductionChoice)
326#endif
327
328#ifdef ADVANCED_SETTINGS
329 EVT_CHOICE(ID_CHOICE_METHOD, EffectNoiseReduction::Dialog::OnMethodChoice)
330#endif
331
334
337
340
341#ifdef ATTACK_AND_RELEASE
342 EVT_SLIDER(ID_ATTACK_TIME_SLIDER, EffectNoiseReduction::Dialog::OnSlider)
343 EVT_TEXT(ID_ATTACK_TIME_TEXT, EffectNoiseReduction::Dialog::OnText)
344
345 EVT_SLIDER(ID_RELEASE_TIME_SLIDER, EffectNoiseReduction::Dialog::OnSlider)
346 EVT_TEXT(ID_RELEASE_TIME_TEXT, EffectNoiseReduction::Dialog::OnText)
347#endif
348
349
350#ifdef ADVANCED_SETTINGS
351 EVT_SLIDER(ID_OLD_SENSITIVITY_SLIDER, EffectNoiseReduction::Dialog::OnSlider)
352 EVT_TEXT(ID_OLD_SENSITIVITY_TEXT, EffectNoiseReduction::Dialog::OnText)
353#endif
355
357 EffectSettingsAccess &access,
359 wxWindow *parent, bool bHasProfile, bool bAllowTwiddleSettings)
360 : EffectDialog( parent, XO("Noise Reduction"), EffectTypeProcess,wxDEFAULT_DIALOG_STYLE, eHelpButton )
361 , m_pEffect(effect)
362 , mAccess{access}
363 , m_pSettings(settings) // point to
364 , mTempSettings(*settings) // copy
365 , mbHasProfile(bHasProfile)
366 , mbAllowTwiddleSettings(bAllowTwiddleSettings)
367 // NULL out the control members until the controls are created.
368 , mKeepSignal(NULL)
369#ifdef ISOLATE_CHOICE
370 , mKeepNoise(NULL)
371#endif
372#ifdef RESIDUE_CHOICE
373 , mResidue(NULL)
374#endif
375{
377
378 wxButton *const pButtonPreview =
379 (wxButton *)wxWindow::FindWindowById(ID_EFFECT_PREVIEW, this);
380 wxButton *const pButtonReduceNoise =
381 (wxButton *)wxWindow::FindWindowById(wxID_OK, this);
382
383 if (mbHasProfile || mbAllowTwiddleSettings) {
384 pButtonPreview->Enable(!mbAllowTwiddleSettings);
385 pButtonReduceNoise->SetFocus();
386 }
387 else {
388 pButtonPreview->Enable(false);
389 pButtonReduceNoise->Enable(false);
390 }
391}
392
394{
395 // If Isolate is chosen, disable controls that define
396 // "what to do with noise" rather than "what is noise."
397 // Else, enable them.
398 // This does NOT include sensitivity, NEW or old, nor
399 // the choice of window functions, size, or step.
400 // The method choice is not included, because it affects
401 // which sensitivity slider is operative, and that is part
402 // of what defines noise.
403
404 static const int toDisable[] = {
407
410
411#ifdef ATTACK_AND_RELEASE
412 ID_ATTACK_TIME_SLIDER,
413 ID_ATTACK_TIME_TEXT,
414
415 ID_RELEASE_TIME_SLIDER,
416 ID_RELEASE_TIME_TEXT,
417#endif
418 };
419 static const auto nToDisable = sizeof(toDisable) / sizeof(toDisable[0]);
420
421 bool bIsolating =
422#ifdef ISOLATE_CHOICE
423 mKeepNoise->GetValue();
424#else
425 false;
426#endif
427 for (auto ii = nToDisable; ii--;)
428 wxWindow::FindWindowById(toDisable[ii], this)->Enable(!bIsolating);
429}
430
431#ifdef ADVANCED_SETTINGS
432void EffectNoiseReduction::Dialog::EnableDisableSensitivityControls()
433{
434 wxChoice *const pChoice =
435 static_cast<wxChoice*>(wxWindow::FindWindowById(ID_CHOICE_METHOD, this));
436 const bool bOldMethod =
437 pChoice->GetSelection() == DM_OLD_METHOD;
438 wxWindow::FindWindowById(ID_OLD_SENSITIVITY_SLIDER, this)->Enable(bOldMethod);
439 wxWindow::FindWindowById(ID_OLD_SENSITIVITY_TEXT, this)->Enable(bOldMethod);
440 wxWindow::FindWindowById(ID_NEW_SENSITIVITY_SLIDER, this)->Enable(!bOldMethod);
441 wxWindow::FindWindowById(ID_NEW_SENSITIVITY_TEXT, this)->Enable(!bOldMethod);
442}
443#endif
444
445void EffectNoiseReduction::Dialog::OnGetProfile(wxCommandEvent & WXUNUSED(event))
446{
447 // Project has not be changed so skip pushing state
449
451 return;
452
453 // Return code distinguishes this first step from the actual effect
454 EndModal(1);
455}
456
457// This handles the whole radio group
458void EffectNoiseReduction::Dialog::OnNoiseReductionChoice( wxCommandEvent & WXUNUSED(event))
459{
460 if (mKeepSignal->GetValue())
461 mTempSettings.mNoiseReductionChoice = NRC_REDUCE_NOISE;
462#ifdef ISOLATE_CHOICE
463 else if (mKeepNoise->GetValue())
464 mTempSettings.mNoiseReductionChoice = NRC_ISOLATE_NOISE;
465#endif
466#ifdef RESIDUE_CHOICE
467 else
468 mTempSettings.mNoiseReductionChoice = NRC_LEAVE_RESIDUE;
469#endif
470 DisableControlsIfIsolating();
471}
472
473#ifdef ADVANCED_SETTINGS
474void EffectNoiseReduction::Dialog::OnMethodChoice(wxCommandEvent &)
475{
476 EnableDisableSensitivityControls();
477}
478#endif
479
480void EffectNoiseReduction::Dialog::OnPreview(wxCommandEvent & WXUNUSED(event))
481{
483 return;
484
485 // Save & restore parameters around Preview, because we didn't do OK.
486 auto cleanup = valueRestorer( *m_pSettings );
487 *m_pSettings = mTempSettings;
488 m_pSettings->mDoProfile = false;
489
490 EffectPreview(*m_pEffect, mAccess,
491 // Don't need any UI updates for preview
492 {},
493 false);
494}
495
496void EffectNoiseReduction::Dialog::OnReduceNoise( wxCommandEvent & WXUNUSED(event))
497{
499 return;
500
501 EndModal(2);
502}
503
504void EffectNoiseReduction::Dialog::OnCancel(wxCommandEvent & WXUNUSED(event))
505{
506 EndModal(0);
507}
508
509void EffectNoiseReduction::Dialog::OnHelp(wxCommandEvent & WXUNUSED(event))
510{
511 HelpSystem::ShowHelp(this, "Noise_Reduction", true);
512}
513
515{
516 S.StartStatic(XO("Step 1"));
517 {
518 S.AddVariableText(XO(
519"Select a few seconds of just noise so Audacity knows what to filter out,\nthen click Get Noise Profile:"));
520 //m_pButton_GetProfile =
521 S.Id(ID_BUTTON_GETPROFILE).AddButton(XXO("&Get Noise Profile"));
522 }
523 S.EndStatic();
524
525 S.StartStatic(XO("Step 2"));
526 {
527 S.AddVariableText(XO(
528"Select all of the audio you want filtered, choose how much noise you want\nfiltered out, and then click 'OK' to reduce noise.\n"));
529
530 S.StartMultiColumn(3, wxEXPAND);
531 S.SetStretchyCol(2);
532 {
533 for (int id = FIRST_SLIDER; id < END_OF_BASIC_SLIDERS; id += 2) {
534 const ControlInfo &info = controlInfo()[(id - FIRST_SLIDER) / 2];
535 info.CreateControls(id, S);
536 }
537 }
538 S.EndMultiColumn();
539
540 S.StartMultiColumn(
541 2
542#ifdef RESIDUE_CHOICE
543 +1
544#endif
545#ifdef ISOLATE_CHOICE
546 +1
547#endif
548 ,
549 wxALIGN_CENTER_HORIZONTAL);
550 {
551 S.AddPrompt(XXO("Noise:"));
552 mKeepSignal = S.Id(ID_RADIOBUTTON_KEEPSIGNAL)
553 /* i18n-hint: Translate differently from "Residue" ! */
554 .AddRadioButton(XXO("Re&duce"));
555#ifdef ISOLATE_CHOICE
556 mKeepNoise = S.Id(ID_RADIOBUTTON_KEEPNOISE)
557 .AddRadioButtonToGroup(XXO("&Isolate"));
558#endif
559#ifdef RESIDUE_CHOICE
560 mResidue = S.Id(ID_RADIOBUTTON_RESIDUE)
561 /* i18n-hint: Means the difference between effect and original sound. Translate differently from "Reduce" ! */
562 .AddRadioButtonToGroup(XXO("Resid&ue"));
563#endif
564 }
565 S.EndMultiColumn();
566 }
567 S.EndStatic();
568
569
570#ifdef ADVANCED_SETTINGS
571 S.StartStatic(XO("Advanced Settings"));
572 {
573 S.StartMultiColumn(2);
574 {
575 S.TieChoice(XXO("&Window types:"),
576 mTempSettings.mWindowTypes,
577 []{
578 TranslatableStrings windowTypeChoices;
579 for (size_t ii = 0; ii < WT_N_WINDOW_TYPES; ++ii)
580 windowTypeChoices.push_back(windowTypesInfo[ii].name);
581 return windowTypeChoices;
582 }()
583 );
584
585 S.TieChoice(XXO("Window si&ze:"),
586 mTempSettings.mWindowSizeChoice,
587 {
588 XO("8") ,
589 XO("16") ,
590 XO("32") ,
591 XO("64") ,
592 XO("128") ,
593 XO("256") ,
594 XO("512") ,
595 XO("1024") ,
596 XO("2048 (default)") ,
597 XO("4096") ,
598 XO("8192") ,
599 XO("16384") ,
600 }
601 );
602
603 S.TieChoice(XXO("S&teps per window:"),
604 mTempSettings.mStepsPerWindowChoice,
605 {
606 XO("2") ,
607 XO("4 (default)") ,
608 XO("8") ,
609 XO("16") ,
610 XO("32") ,
611 XO("64") ,
612 }
613 );
614
615 S.Id(ID_CHOICE_METHOD)
616 .TieChoice(XXO("Discrimination &method:"),
617 mTempSettings.mMethod,
618 []{
619 TranslatableStrings methodChoices;
620 auto nn = DM_N_METHODS;
621#ifndef OLD_METHOD_AVAILABLE
622 --nn;
623#endif
624 for (auto ii = 0; ii < nn; ++ii)
625 methodChoices.push_back(discriminationMethodInfo[ii].name);
626 return methodChoices;
627 }());
628 }
629 S.EndMultiColumn();
630
631 S.StartMultiColumn(3, wxEXPAND);
632 S.SetStretchyCol(2);
633 {
634 for (int id = END_OF_BASIC_SLIDERS; id < END_OF_ADVANCED_SLIDERS; id += 2) {
635 const ControlInfo &info = controlInfo()[(id - FIRST_SLIDER) / 2];
636 info.CreateControls(id, S);
637 }
638 }
639 S.EndMultiColumn();
640 }
641 S.EndStatic();
642#endif
643}
644
646{
647 // Do the choice controls:
649 return false;
650
651 for (int id = FIRST_SLIDER; id < END_OF_SLIDERS; id += 2) {
652 wxSlider* slider =
653 static_cast<wxSlider*>(wxWindow::FindWindowById(id, this));
654 wxTextCtrl* text =
655 static_cast<wxTextCtrl*>(wxWindow::FindWindowById(id + 1, this));
656 const ControlInfo &info = controlInfo()[(id - FIRST_SLIDER) / 2];
657 const double field = mTempSettings.*(info.field);
658 text->SetValue(info.Text(field));
659 slider->SetValue(info.SliderSetting(field));
660 }
661
662 mKeepSignal->SetValue(mTempSettings.mNoiseReductionChoice == NRC_REDUCE_NOISE);
663#ifdef ISOLATE_CHOICE
664 mKeepNoise->SetValue(mTempSettings.mNoiseReductionChoice == NRC_ISOLATE_NOISE);
665#endif
666#ifdef RESIDUE_CHOICE
667 mResidue->SetValue(mTempSettings.mNoiseReductionChoice == NRC_LEAVE_RESIDUE);
668#endif
669
670 // Set the enabled states of controls
671 DisableControlsIfIsolating();
672#ifdef ADVANCED_SETTINGS
673 EnableDisableSensitivityControls();
674#endif
675
676 return true;
677}
678
680{
681 if( !wxWindow::Validate() )
682 return false;
683 // Do the choice controls:
685 return false;
686
687 wxCommandEvent dummy;
688 OnNoiseReductionChoice(dummy);
689
690 return mTempSettings.Validate(m_pEffect);
691}
692
693void EffectNoiseReduction::Dialog::OnText(wxCommandEvent &event)
694{
695 int id = event.GetId();
696 int idx = (id - FIRST_SLIDER - 1) / 2;
697 const ControlInfo &info = controlInfo()[idx];
698 wxTextCtrl* text =
699 static_cast<wxTextCtrl*>(wxWindow::FindWindowById(id, this));
700 wxSlider* slider =
701 static_cast<wxSlider*>(wxWindow::FindWindowById(id - 1, this));
702 double &field = mTempSettings.*(info.field);
703
704 text->GetValue().ToDouble(&field);
705 slider->SetValue(info.SliderSetting(field));
706}
707
708void EffectNoiseReduction::Dialog::OnSlider(wxCommandEvent &event)
709{
710 int id = event.GetId();
711 int idx = (id - FIRST_SLIDER) / 2;
712 const ControlInfo &info = controlInfo()[idx];
713 wxSlider* slider =
714 static_cast<wxSlider*>(wxWindow::FindWindowById(id, this));
715 wxTextCtrl* text =
716 static_cast<wxTextCtrl*>(wxWindow::FindWindowById(id + 1, this));
717 double &field = mTempSettings.*(info.field);
718
719 field = info.Value(slider->GetValue());
720 text->SetValue(info.Text(field));
721}
wxT("CloseDown"))
END_EVENT_TABLE()
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
#define ID_EFFECT_PREVIEW
Definition: Effect.h:187
@ EffectTypeProcess
void EffectPreview(EffectBase &effect, EffectSettingsAccess &access, std::function< void()> updateUI, bool dryOnly)
Calculate temporary tracks of limited length with effect applied and play.
std::function< DialogFactoryResults(wxWindow &parent, EffectBase &, EffectUIServices &, EffectSettingsAccess &) > EffectDialogFactory
Type of function that creates a dialog for an effect.
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define field(n, t)
Definition: ImportAUP.cpp:165
ValueRestorer< T > valueRestorer(T &var)
inline functions provide convenient parameter type deduction
Definition: MemoryX.h:253
@ ID_GAIN_TEXT
@ ID_BUTTON_GETPROFILE
@ ID_GAIN_SLIDER
@ ID_NEW_SENSITIVITY_SLIDER
@ ID_FREQ_SLIDER
@ END_OF_SLIDERS
@ END_OF_BASIC_SLIDERS
@ ID_NEW_SENSITIVITY_TEXT
@ ID_RADIOBUTTON_KEEPSIGNAL
@ FIRST_SLIDER
@ ID_FREQ_TEXT
#define RESIDUE_CHOICE
@ NRC_REDUCE_NOISE
@ NRC_LEAVE_RESIDUE
@ NRC_ISOLATE_NOISE
@ eHelpButton
Definition: ShuttleGui.h:613
wxString name
Definition: TagsEditor.cpp:166
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:51
std::vector< TranslatableString > TranslatableStrings
Base class for many of the effects in Audacity.
Definition: EffectBase.h:33
bool TransferDataToWindow() override
Definition: EffectUI.cpp:1195
bool TransferDataFromWindow() override
Definition: EffectUI.cpp:1203
bool IsBatchProcessing() const override
Definition: Effect.cpp:295
void SetSkipStateFlag(bool flag)
static EffectManager & Get()
Dialog used with EffectNoiseReduction.
const Settings & GetTempSettings() const
void OnNoiseReductionChoice(wxCommandEvent &event)
void OnSlider(wxCommandEvent &event)
void OnHelp(wxCommandEvent &event)
bool TransferDataToWindow() override
EffectNoiseReduction::Settings mTempSettings
EffectSettingsAccess & mAccess
This dialog is modal, so mAccess will live long enough for it.
void PopulateOrExchange(ShuttleGui &S) override
void OnText(wxCommandEvent &event)
Dialog(EffectNoiseReduction *effect, EffectSettingsAccess &access, Settings *settings, wxWindow *parent, bool bHasProfile, bool bAllowTwiddleSettings)
void OnReduceNoise(wxCommandEvent &event)
void OnPreview(wxCommandEvent &event) override
EffectNoiseReduction * m_pEffect
void OnGetProfile(wxCommandEvent &event)
void OnCancel(wxCommandEvent &event)
EffectNoiseReduction::Settings * m_pSettings
bool TransferDataFromWindow() override
int ShowHostInterface(EffectBase &plugin, wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false) override
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:231
std::unique_ptr< Settings > mSettings
std::unique_ptr< Statistics > mStatistics
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
virtual bool TransferDataFromWindow(EffectSettings &settings)
Holds a msgid for the translation catalog; may also bind format arguments.
BuiltinEffectsModule::Registration< EffectNoiseReduction > reg
int PromptUser(EffectNoiseReduction::Settings &settings, EffectNoiseReduction *effect, EffectSettingsAccess &access, wxWindow &parent, bool bHasProfile, bool bAllowTwiddleSettings)
const struct anonymous_namespace{NoiseReductionBase.cpp}::WindowTypesInfo windowTypesInfo[WT_N_WINDOW_TYPES]
const struct anonymous_namespace{NoiseReductionBase.cpp}::DiscriminationMethodInfo discriminationMethodInfo[DM_N_METHODS]
void CreateControls(int id, ShuttleGui &S) const
doubleEffectNoiseReduction::Settings::* MemberPointer
ControlInfo(MemberPointer f, double vMin, double vMax, long sMax, const wxChar *fmt, bool fAsInt, const TranslatableString &caption, const TranslatableString &name)