Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
EffectPhaser::Editor Struct Reference
Inheritance diagram for EffectPhaser::Editor:
[legend]
Collaboration diagram for EffectPhaser::Editor:
[legend]

Public Member Functions

 Editor (const EffectUIServices &services, EffectSettingsAccess &access, const EffectPhaserSettings &settings)
 
virtual ~Editor ()=default
 
bool ValidateUI () override
 Get settings data from the panel; may make error dialogs and return false. More...
 
bool UpdateUI () override
 Update appearance of the panel for changes in settings. More...
 
void PopulateOrExchange (ShuttleGui &S)
 
void OnStagesSlider (wxCommandEvent &evt)
 
void OnDryWetSlider (wxCommandEvent &evt)
 
void OnFeedbackSlider (wxCommandEvent &evt)
 
void OnDepthSlider (wxCommandEvent &evt)
 
void OnPhaseSlider (wxCommandEvent &evt)
 
void OnFreqSlider (wxCommandEvent &evt)
 
void OnGainSlider (wxCommandEvent &evt)
 
void OnStagesText (wxCommandEvent &evt)
 
void OnDryWetText (wxCommandEvent &evt)
 
void OnFeedbackText (wxCommandEvent &evt)
 
void OnDepthText (wxCommandEvent &evt)
 
void OnPhaseText (wxCommandEvent &evt)
 
void OnFreqText (wxCommandEvent &evt)
 
void OnGainText (wxCommandEvent &evt)
 
void EnableApplyFromValidate ()
 
bool EnableApplyFromTransferDataFromWindow ()
 
- Public Member Functions inherited from EffectEditor
 EffectEditor (const EffectUIServices &services, EffectSettingsAccess &access)
 
virtual ~EffectEditor ()
 
virtual bool ValidateUI ()=0
 Get settings data from the panel; may make error dialogs and return false. More...
 
virtual bool UpdateUI ()
 Update appearance of the panel for changes in settings. More...
 
virtual bool IsGraphicalUI ()
 
virtual void Disconnect ()
 On the first call only, may disconnect from further event handling. More...
 
virtual void OnClose ()
 
- Public Member Functions inherited from Observer::Publisher< EffectSettingChanged >
 Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={})
 Constructor supporting type-erased custom allocation/deletion. More...
 
 Publisher (Publisher &&)=default
 
Publisheroperator= (Publisher &&)=default
 
Subscription Subscribe (Callback callback)
 Connect a callback to the Publisher; later-connected are called earlier. More...
 
Subscription Subscribe (Object &obj, Return(Object::*callback)(Args...))
 Overload of Subscribe takes an object and pointer-to-member-function. More...
 

Public Attributes

wxWeakRef< wxWindow > mUIParent
 
EffectPhaserSettings mSettings
 
wxTextCtrl * mStagesT
 
wxTextCtrl * mDryWetT
 
wxTextCtrl * mFreqT
 
wxTextCtrl * mPhaseT
 
wxTextCtrl * mDepthT
 
wxTextCtrl * mFeedbackT
 
wxTextCtrl * mOutGainT
 
wxSlider * mStagesS
 
wxSlider * mDryWetS
 
wxSlider * mFreqS
 
wxSlider * mPhaseS
 
wxSlider * mDepthS
 
wxSlider * mFeedbackS
 
wxSlider * mOutGainS
 

Additional Inherited Members

- Public Types inherited from Observer::Publisher< EffectSettingChanged >
using message_type = EffectSettingChanged
 
using CallbackReturn = std::conditional_t< true, void, bool >
 
using Callback = std::function< CallbackReturn(const EffectSettingChanged &) >
 Type of functions that can be connected to the Publisher. More...
 
- Static Public Member Functions inherited from EffectEditor
static bool EnableApply (wxWindow *parent, bool enable=true)
 Enable or disable the Apply button of the dialog that contains parent. More...
 
static bool EnablePreview (wxWindow *parent, bool enable=true)
 
- Static Public Attributes inherited from EffectEditor
static constexpr int kPlayID = 20102
 
- Static Public Attributes inherited from Observer::Publisher< EffectSettingChanged >
static constexpr bool notifies_all
 
- Protected Member Functions inherited from EffectEditor
template<typename EventTag , typename Class , typename Event >
void BindTo (wxEvtHandler &src, const EventTag &eventType, void(Class::*pmf)(Event &))
 
- Protected Member Functions inherited from Observer::Publisher< EffectSettingChanged >
CallbackReturn Publish (const EffectSettingChanged &message)
 Send a message to connected callbacks. More...
 
- Protected Attributes inherited from EffectEditor
const EffectUIServicesmUIServices
 
EffectSettingsAccessmAccess
 
bool mUIClosed { false }
 

Detailed Description

Definition at line 26 of file Phaser.cpp.

Constructor & Destructor Documentation

◆ Editor()

EffectPhaser::Editor::Editor ( const EffectUIServices services,
EffectSettingsAccess access,
const EffectPhaserSettings settings 
)
inline

Definition at line 29 of file Phaser.cpp.

31 : EffectEditor{ services, access }
33 {}
static Settings & settings()
Definition: TrackInfo.cpp:51
EffectPhaserSettings mSettings
Definition: Phaser.cpp:42

◆ ~Editor()

virtual EffectPhaser::Editor::~Editor ( )
virtualdefault

Member Function Documentation

◆ EnableApplyFromTransferDataFromWindow()

bool EffectPhaser::Editor::EnableApplyFromTransferDataFromWindow ( )
inline

Definition at line 82 of file Phaser.cpp.

83 {
84 return EnableApply(mUIParent, mUIParent->TransferDataFromWindow());
85 }
static bool EnableApply(wxWindow *parent, bool enable=true)
Enable or disable the Apply button of the dialog that contains parent.
wxWeakRef< wxWindow > mUIParent
Definition: Phaser.cpp:41

References EffectEditor::EnableApply(), and mUIParent.

Here is the call graph for this function:

◆ EnableApplyFromValidate()

void EffectPhaser::Editor::EnableApplyFromValidate ( )
inline

Definition at line 77 of file Phaser.cpp.

78 {
79 EnableApply(mUIParent, mUIParent->Validate());
80 }

References EffectEditor::EnableApply(), and mUIParent.

Here is the call graph for this function:

◆ OnDepthSlider()

void EffectPhaser::Editor::OnDepthSlider ( wxCommandEvent &  evt)

Definition at line 318 of file Phaser.cpp.

319{
320 auto& ms = mSettings;
321
322 ms.mDepth = evt.GetInt() / Depth.scale;
323 mDepthT->GetValidator()->TransferToWindow();
325
326 ValidateUI();
328}
CallbackReturn Publish(const EffectSettingChanged &message)
Send a message to connected callbacks.
Definition: Observer.h:207
static constexpr EffectParameter Depth
Definition: PhaserBase.h:178
const Type scale
Scaling factor, for slider control.
bool ValidateUI() override
Get settings data from the panel; may make error dialogs and return false.
Definition: Phaser.cpp:236
wxTextCtrl * mDepthT
Definition: Phaser.cpp:48
void EnableApplyFromValidate()
Definition: Phaser.cpp:77
Message sent by EffectEditor when a setting is changed by the user.
Definition: EffectEditor.h:26

References PhaserBase::Depth, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDepthText()

void EffectPhaser::Editor::OnDepthText ( wxCommandEvent &  evt)

Definition at line 418 of file Phaser.cpp.

419{
420 auto& ms = mSettings;
421
423 {
424 return;
425 }
426
427 mDepthS->SetValue((int) (ms.mDepth * Depth.scale));
428
429 ValidateUI();
431}
bool EnableApplyFromTransferDataFromWindow()
Definition: Phaser.cpp:82
wxSlider * mDepthS
Definition: Phaser.cpp:56

References PhaserBase::Depth, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDryWetSlider()

void EffectPhaser::Editor::OnDryWetSlider ( wxCommandEvent &  evt)

Definition at line 278 of file Phaser.cpp.

279{
280 auto& ms = mSettings;
281
282 ms.mDryWet = evt.GetInt() / DryWet.scale;
283 mDryWetT->GetValidator()->TransferToWindow();
285
286 ValidateUI();
288}
static constexpr EffectParameter DryWet
Definition: PhaserBase.h:155
wxTextCtrl * mDryWetT
Definition: Phaser.cpp:45

References PhaserBase::DryWet, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDryWetText()

void EffectPhaser::Editor::OnDryWetText ( wxCommandEvent &  evt)

Definition at line 373 of file Phaser.cpp.

374{
375 auto& ms = mSettings;
376
378 {
379 return;
380 }
381
382 mDryWetS->SetValue((int) (ms.mDryWet * DryWet.scale));
383
384 ValidateUI();
386}
wxSlider * mDryWetS
Definition: Phaser.cpp:53

References PhaserBase::DryWet, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFeedbackSlider()

void EffectPhaser::Editor::OnFeedbackSlider ( wxCommandEvent &  evt)

Definition at line 330 of file Phaser.cpp.

331{
332 auto& ms = mSettings;
333
334 int val = evt.GetInt();
335 val = ((val + (val > 0 ? 5 : -5)) / 10) * 10; // round to nearest multiple of 10
336 val = val > Feedback.max * Feedback.scale ? Feedback.max * Feedback.scale : val;
337 mFeedbackS->SetValue(val);
338 ms.mFeedback = val / Feedback.scale;
339 mFeedbackT->GetValidator()->TransferToWindow();
341
342 ValidateUI();
344}
static constexpr EffectParameter Feedback
Definition: PhaserBase.h:185
const Type max
Maximum value.
wxSlider * mFeedbackS
Definition: Phaser.cpp:57
wxTextCtrl * mFeedbackT
Definition: Phaser.cpp:49

References PhaserBase::Feedback, EffectParameter< Structure, Member, Type, Value >::max, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFeedbackText()

void EffectPhaser::Editor::OnFeedbackText ( wxCommandEvent &  evt)

Definition at line 433 of file Phaser.cpp.

434{
435 auto& ms = mSettings;
436
438 {
439 return;
440 }
441
442 mFeedbackS->SetValue((int) (ms.mFeedback * Feedback.scale));
443
444 ValidateUI();
446}

References PhaserBase::Feedback, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFreqSlider()

void EffectPhaser::Editor::OnFreqSlider ( wxCommandEvent &  evt)

Definition at line 290 of file Phaser.cpp.

291{
292 auto& ms = mSettings;
293
294 ms.mFreq = (double) evt.GetInt() / Freq.scale;
295 if (ms.mFreq < Freq.min) ms.mFreq = Freq.min;
296 mFreqT->GetValidator()->TransferToWindow();
298
299 ValidateUI();
301}
static constexpr EffectParameter Freq
Definition: PhaserBase.h:164
const Type min
Minimum value.
wxTextCtrl * mFreqT
Definition: Phaser.cpp:46

References PhaserBase::Freq, EffectParameter< Structure, Member, Type, Value >::min, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFreqText()

void EffectPhaser::Editor::OnFreqText ( wxCommandEvent &  evt)

Definition at line 388 of file Phaser.cpp.

389{
390 auto& ms = mSettings;
391
393 {
394 return;
395 }
396
397 mFreqS->SetValue((int) (ms.mFreq * Freq.scale));
398
399 ValidateUI();
401}
wxSlider * mFreqS
Definition: Phaser.cpp:54

References PhaserBase::Freq, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnGainSlider()

void EffectPhaser::Editor::OnGainSlider ( wxCommandEvent &  evt)

Definition at line 346 of file Phaser.cpp.

347{
348 auto& ms = mSettings;
349
350 ms.mOutGain = evt.GetInt() / OutGain.scale;
351 mOutGainT->GetValidator()->TransferToWindow();
353
354 ValidateUI();
356}
static constexpr EffectParameter OutGain
Definition: PhaserBase.h:194
wxTextCtrl * mOutGainT
Definition: Phaser.cpp:50

References PhaserBase::OutGain, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnGainText()

void EffectPhaser::Editor::OnGainText ( wxCommandEvent &  evt)

Definition at line 448 of file Phaser.cpp.

449{
450 auto& ms = mSettings;
451
453 {
454 return;
455 }
456
457 mOutGainS->SetValue((int) (ms.mOutGain * OutGain.scale));
458
459 ValidateUI();
461}
wxSlider * mOutGainS
Definition: Phaser.cpp:58

References PhaserBase::OutGain, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnPhaseSlider()

void EffectPhaser::Editor::OnPhaseSlider ( wxCommandEvent &  evt)

Definition at line 303 of file Phaser.cpp.

304{
305 auto& ms = mSettings;
306
307 int val = ((evt.GetInt() + 5) / 10) * 10; // round to nearest multiple of 10
308 val = val > Phase.max * Phase.scale ? Phase.max * Phase.scale : val;
309 mPhaseS->SetValue(val);
310 ms.mPhase = (double) val / Phase.scale;
311 mPhaseT->GetValidator()->TransferToWindow();
313
314 ValidateUI();
316}
static constexpr EffectParameter Phase
Definition: PhaserBase.h:171
wxSlider * mPhaseS
Definition: Phaser.cpp:55
wxTextCtrl * mPhaseT
Definition: Phaser.cpp:47

References EffectParameter< Structure, Member, Type, Value >::max, PhaserBase::Phase, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnPhaseText()

void EffectPhaser::Editor::OnPhaseText ( wxCommandEvent &  evt)

Definition at line 403 of file Phaser.cpp.

404{
405 auto& ms = mSettings;
406
408 {
409 return;
410 }
411
412 mPhaseS->SetValue((int) (ms.mPhase * Phase.scale));
413
414 ValidateUI();
416}

References PhaserBase::Phase, EffectParameter< Structure, Member, Type, Value >::scale, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnStagesSlider()

void EffectPhaser::Editor::OnStagesSlider ( wxCommandEvent &  evt)

Definition at line 266 of file Phaser.cpp.

267{
268 auto& ms = mSettings;
269
270 ms.mStages = (evt.GetInt() / Stages.scale) & ~1; // must be even;
271 mStagesT->GetValidator()->TransferToWindow();
273
274 ValidateUI();
276}
static constexpr EffectParameter Stages
Definition: PhaserBase.h:146
wxTextCtrl * mStagesT
Definition: Phaser.cpp:44

References EffectParameter< Structure, Member, Type, Value >::scale, PhaserBase::Stages, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnStagesText()

void EffectPhaser::Editor::OnStagesText ( wxCommandEvent &  evt)

Definition at line 358 of file Phaser.cpp.

359{
360 auto& ms = mSettings;
361
363 {
364 return;
365 }
366
367 mStagesS->SetValue((int) (ms.mStages * Stages.scale));
368
369 ValidateUI();
371}
wxSlider * mStagesS
Definition: Phaser.cpp:52

References EffectParameter< Structure, Member, Type, Value >::scale, PhaserBase::Stages, and BasicEffectUIServices::ValidateUI().

Referenced by PopulateOrExchange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopulateOrExchange()

void EffectPhaser::Editor::PopulateOrExchange ( ShuttleGui S)

Definition at line 102 of file Phaser.cpp.

103{
104 mUIParent = S.GetParent();
105 auto& ms = mSettings;
106
107 S.SetBorder(5);
108 S.AddSpace(0, 5);
109
110 S.StartMultiColumn(3, wxEXPAND);
111 {
112 S.SetStretchyCol(2);
113
114 mStagesT = S
115 .Validator<IntegerValidator<int>>(
116 &ms.mStages, NumValidatorStyle::DEFAULT, Stages.min, Stages.max)
117 .AddTextBox(XXO("&Stages:"), L"", 15);
118 BindTo(*mStagesT, wxEVT_TEXT, &Editor::OnStagesText);
119
120 mStagesS = S
121 .Name(XO("Stages"))
122 .Style(wxSL_HORIZONTAL)
123 .MinSize( { 100, -1 } )
124 .AddSlider( {}, Stages.def * Stages.scale, Stages.max * Stages.scale, Stages.min * Stages.scale);
125 mStagesS->SetLineSize(2);
126 BindTo(*mStagesS, wxEVT_SLIDER, &Editor::OnStagesSlider);
127
128 mDryWetT = S
129 .Validator<IntegerValidator<int>>(
130 &ms.mDryWet, NumValidatorStyle::DEFAULT, DryWet.min, DryWet.max)
131 .AddTextBox(XXO("&Dry/Wet:"), L"", 15);
132 BindTo(*mDryWetT, wxEVT_TEXT, &Editor::OnDryWetText);
133
134 mDryWetS = S
135 .Name(XO("Dry Wet"))
136 .Style(wxSL_HORIZONTAL)
137 .MinSize( { 100, -1 } )
138 .AddSlider( {}, DryWet.def * DryWet.scale, DryWet.max * DryWet.scale, DryWet.min * DryWet.scale);
139 BindTo(*mDryWetS, wxEVT_SLIDER, &Editor::OnDryWetSlider);
140
141 mFreqT = S
142 .Validator<FloatingPointValidator<double>>(
143 5, &ms.mFreq, NumValidatorStyle::ONE_TRAILING_ZERO, Freq.min, Freq.max)
144 .AddTextBox(XXO("LFO Freq&uency (Hz):"), L"", 15);
145 BindTo(*mFreqT, wxEVT_TEXT, &Editor::OnFreqText);
146
147 mFreqS = S
148 .Name(XO("LFO frequency in hertz"))
149 .Style(wxSL_HORIZONTAL)
150 .MinSize( { 100, -1 } )
151 .AddSlider( {}, Freq.def * Freq.scale, Freq.max * Freq.scale, 0.0);
152 BindTo(*mFreqS, wxEVT_SLIDER, &Editor::OnFreqSlider);
153
154 mPhaseT = S
155 .Validator<FloatingPointValidator<double>>(
156 1, &ms.mPhase, NumValidatorStyle::DEFAULT, Phase.min, Phase.max)
157 .AddTextBox(XXO("LFO Sta&rt Phase (deg.):"), L"", 15);
158 BindTo(*mPhaseT, wxEVT_TEXT, &Editor::OnPhaseText);
159
160 mPhaseS = S
161 .Name(XO("LFO start phase in degrees"))
162 .Style(wxSL_HORIZONTAL)
163 .MinSize( { 100, -1 } )
164 .AddSlider( {}, Phase.def * Phase.scale, Phase.max * Phase.scale, Phase.min * Phase.scale);
165 mPhaseS->SetLineSize(10);
166 BindTo(*mPhaseS, wxEVT_SLIDER, &Editor::OnPhaseSlider);
167
168 mDepthT = S
169 .Validator<IntegerValidator<int>>(
170 &ms.mDepth, NumValidatorStyle::DEFAULT, Depth.min, Depth.max)
171 .AddTextBox(XXO("Dept&h:"), L"", 15);
172 BindTo(*mDepthT, wxEVT_TEXT, &Editor::OnDepthText);
173
174 mDepthS = S
175 .Name(XO("Depth in percent"))
176 .Style(wxSL_HORIZONTAL)
177 .MinSize( { 100, -1 } )
178 .AddSlider( {}, Depth.def * Depth.scale, Depth.max * Depth.scale, Depth.min * Depth.scale);
179 BindTo(*mDepthS, wxEVT_SLIDER, &Editor::OnDepthSlider);
180
181 mFeedbackT = S
182 .Validator<IntegerValidator<int>>(
183 &ms.mFeedback, NumValidatorStyle::DEFAULT, Feedback.min, Feedback.max)
184 .AddTextBox(XXO("Feedbac&k (%):"), L"", 15);
186
187 mFeedbackS = S
188 .Name(XO("Feedback in percent"))
189 .Style(wxSL_HORIZONTAL)
190 .MinSize( { 100, -1 } )
192 mFeedbackS->SetLineSize(10);
194
195 mOutGainT = S
196 .Validator<FloatingPointValidator<double>>(
197 1, &ms.mOutGain, NumValidatorStyle::DEFAULT, OutGain.min, OutGain.max)
198 .AddTextBox(XXO("&Output gain (dB):"), L"", 12);
199 BindTo(*mOutGainT, wxEVT_TEXT, &Editor::OnGainText);
200
201 mOutGainS = S
202 .Name(XO("Output gain (dB)"))
203 .Style(wxSL_HORIZONTAL)
204 .MinSize( { 100, -1 } )
206 BindTo(*mOutGainS, wxEVT_SLIDER, &Editor::OnGainSlider);
207 }
208 S.EndMultiColumn();
209
210}
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define S(N)
Definition: ToChars.cpp:64
void BindTo(wxEvtHandler &src, const EventTag &eventType, void(Class::*pmf)(Event &))
Definition: EffectEditor.h:85
const Type def
Default value.
void OnGainSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:346
void OnStagesSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:266
void OnFreqSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:290
void OnGainText(wxCommandEvent &evt)
Definition: Phaser.cpp:448
void OnFeedbackSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:330
void OnPhaseSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:303
void OnPhaseText(wxCommandEvent &evt)
Definition: Phaser.cpp:403
void OnFeedbackText(wxCommandEvent &evt)
Definition: Phaser.cpp:433
void OnDryWetText(wxCommandEvent &evt)
Definition: Phaser.cpp:373
void OnDryWetSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:278
void OnDepthSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:318
void OnFreqText(wxCommandEvent &evt)
Definition: Phaser.cpp:388
void OnStagesText(wxCommandEvent &evt)
Definition: Phaser.cpp:358
void OnDepthText(wxCommandEvent &evt)
Definition: Phaser.cpp:418

References EffectEditor::BindTo(), EffectParameter< Structure, Member, Type, Value >::def, PhaserBase::Depth, PhaserBase::DryWet, PhaserBase::Feedback, PhaserBase::Freq, EffectParameter< Structure, Member, Type, Value >::max, mDepthS, mDepthT, mDryWetS, mDryWetT, mFeedbackS, mFeedbackT, mFreqS, mFreqT, EffectParameter< Structure, Member, Type, Value >::min, mOutGainS, mOutGainT, mPhaseS, mPhaseT, mSettings, mStagesS, mStagesT, mUIParent, OnDepthSlider(), OnDepthText(), OnDryWetSlider(), OnDryWetText(), OnFeedbackSlider(), OnFeedbackText(), OnFreqSlider(), OnFreqText(), OnGainSlider(), OnGainText(), OnPhaseSlider(), OnPhaseText(), OnStagesSlider(), OnStagesText(), PhaserBase::OutGain, PhaserBase::Phase, S, EffectParameter< Structure, Member, Type, Value >::scale, PhaserBase::Stages, XO(), and XXO().

Here is the call graph for this function:

◆ UpdateUI()

bool EffectPhaser::Editor::UpdateUI ( )
overridevirtual

Update appearance of the panel for changes in settings.

Default implementation does nothing, returns true

Returns
true if successful

Reimplemented from EffectEditor.

Definition at line 212 of file Phaser.cpp.

213{
214 // get the settings from the MessageBuffer and write them to our local copy
215 const auto& settings = mAccess.Get();
216
218
219 if (!mUIParent->TransferDataToWindow())
220 {
221 return false;
222 }
223
224 mStagesS-> SetValue((int) (mSettings.mStages * Stages.scale));
225 mDryWetS-> SetValue((int) (mSettings.mDryWet * DryWet.scale));
226 mFreqS-> SetValue((int) (mSettings.mFreq * Freq.scale));
227 mPhaseS-> SetValue((int) (mSettings.mPhase * Phase.scale));
228 mDepthS-> SetValue((int) (mSettings.mDepth * Depth.scale));
229 mFeedbackS->SetValue((int) (mSettings.mFeedback * Feedback.scale));
230 mOutGainS-> SetValue((int) (mSettings.mOutGain * OutGain.scale));
231
232 return true;
233}
EffectSettingsAccess & mAccess
Definition: EffectEditor.h:92
virtual const EffectSettings & Get()=0
static EffectPhaserSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: Effect.h:166

References PhaserBase::Depth, PhaserBase::DryWet, PhaserBase::Feedback, PhaserBase::Freq, EffectWithSettings< EffectPhaserSettings, PerTrackEffect >::GetSettings(), PhaserBase::OutGain, PhaserBase::Phase, EffectParameter< Structure, Member, Type, Value >::scale, settings(), and PhaserBase::Stages.

Here is the call graph for this function:

◆ ValidateUI()

bool EffectPhaser::Editor::ValidateUI ( )
overridevirtual

Get settings data from the panel; may make error dialogs and return false.

Returns
true only if panel settings are acceptable

Implements EffectEditor.

Definition at line 236 of file Phaser.cpp.

237{
238 // This bit was copied from the original override of TransferDataFromWindow
239 if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
240 {
241 return false;
242 }
243
244 auto& ms = mSettings;
245
246 if (ms.mStages & 1) // must be even
247 {
248 ms.mStages &= ~1;
249 mStagesT->GetValidator()->TransferToWindow();
250 }
251
253 (
254 [this](EffectSettings& settings)
255 {
256 // pass back the modified settings to the MessageBuffer
257
259 return nullptr;
260 }
261 );
262
263 return true;
264}
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
Externalized state of a plug-in.

References EffectWithSettings< EffectPhaserSettings, PerTrackEffect >::GetSettings(), and settings().

Here is the call graph for this function:

Member Data Documentation

◆ mDepthS

wxSlider* EffectPhaser::Editor::mDepthS

Definition at line 56 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mDepthT

wxTextCtrl* EffectPhaser::Editor::mDepthT

Definition at line 48 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mDryWetS

wxSlider* EffectPhaser::Editor::mDryWetS

Definition at line 53 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mDryWetT

wxTextCtrl* EffectPhaser::Editor::mDryWetT

Definition at line 45 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mFeedbackS

wxSlider* EffectPhaser::Editor::mFeedbackS

Definition at line 57 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mFeedbackT

wxTextCtrl* EffectPhaser::Editor::mFeedbackT

Definition at line 49 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mFreqS

wxSlider* EffectPhaser::Editor::mFreqS

Definition at line 54 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mFreqT

wxTextCtrl* EffectPhaser::Editor::mFreqT

Definition at line 46 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mOutGainS

wxSlider* EffectPhaser::Editor::mOutGainS

Definition at line 58 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mOutGainT

wxTextCtrl* EffectPhaser::Editor::mOutGainT

Definition at line 50 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mPhaseS

wxSlider* EffectPhaser::Editor::mPhaseS

Definition at line 55 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mPhaseT

wxTextCtrl* EffectPhaser::Editor::mPhaseT

Definition at line 47 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mSettings

EffectPhaserSettings EffectPhaser::Editor::mSettings

Definition at line 42 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mStagesS

wxSlider* EffectPhaser::Editor::mStagesS

Definition at line 52 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mStagesT

wxTextCtrl* EffectPhaser::Editor::mStagesT

Definition at line 44 of file Phaser.cpp.

Referenced by PopulateOrExchange().

◆ mUIParent

wxWeakRef<wxWindow> EffectPhaser::Editor::mUIParent

The documentation for this struct was generated from the following file: