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 64 of file Phaser.cpp.

Constructor & Destructor Documentation

◆ Editor()

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

Definition at line 67 of file Phaser.cpp.

69 : EffectEditor{ services, access }
71 {}
static Settings & settings()
Definition: TrackInfo.cpp:69
EffectPhaserSettings mSettings
Definition: Phaser.cpp:80

◆ ~Editor()

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

Member Function Documentation

◆ EnableApplyFromTransferDataFromWindow()

bool EffectPhaser::Editor::EnableApplyFromTransferDataFromWindow ( )
inline

Definition at line 120 of file Phaser.cpp.

121 {
122 return EnableApply(mUIParent, mUIParent->TransferDataFromWindow());
123 }
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:79

References EffectEditor::EnableApply(), and mUIParent.

Here is the call graph for this function:

◆ EnableApplyFromValidate()

void EffectPhaser::Editor::EnableApplyFromValidate ( )
inline

Definition at line 115 of file Phaser.cpp.

116 {
117 EnableApply(mUIParent, mUIParent->Validate());
118 }

References EffectEditor::EnableApply(), and mUIParent.

Here is the call graph for this function:

◆ OnDepthSlider()

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

Definition at line 587 of file Phaser.cpp.

588{
589 auto& ms = mSettings;
590
591 ms.mDepth = evt.GetInt() / Depth.scale;
592 mDepthT->GetValidator()->TransferToWindow();
594
595 ValidateUI();
597}
static constexpr EffectParameter Depth
Definition: Phaser.h:131
CallbackReturn Publish(const EffectSettingChanged &message)
Send a message to connected callbacks.
Definition: Observer.h:207
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:427
wxTextCtrl * mDepthT
Definition: Phaser.cpp:86
void EnableApplyFromValidate()
Definition: Phaser.cpp:115
Message sent by EffectEditor when a setting is changed by the user.
Definition: EffectEditor.h:26

References EffectPhaser::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 687 of file Phaser.cpp.

688{
689 auto& ms = mSettings;
690
692 {
693 return;
694 }
695
696 mDepthS->SetValue((int) (ms.mDepth * Depth.scale));
697
698 ValidateUI();
700}
bool EnableApplyFromTransferDataFromWindow()
Definition: Phaser.cpp:120
wxSlider * mDepthS
Definition: Phaser.cpp:94

References EffectPhaser::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 547 of file Phaser.cpp.

548{
549 auto& ms = mSettings;
550
551 ms.mDryWet = evt.GetInt() / DryWet.scale;
552 mDryWetT->GetValidator()->TransferToWindow();
554
555 ValidateUI();
557}
static constexpr EffectParameter DryWet
Definition: Phaser.h:119
wxTextCtrl * mDryWetT
Definition: Phaser.cpp:83

References EffectPhaser::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 642 of file Phaser.cpp.

643{
644 auto& ms = mSettings;
645
647 {
648 return;
649 }
650
651 mDryWetS->SetValue((int) (ms.mDryWet * DryWet.scale));
652
653 ValidateUI();
655}
wxSlider * mDryWetS
Definition: Phaser.cpp:91

References EffectPhaser::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 599 of file Phaser.cpp.

600{
601 auto& ms = mSettings;
602
603 int val = evt.GetInt();
604 val = ((val + (val > 0 ? 5 : -5)) / 10) * 10; // round to nearest multiple of 10
605 val = val > Feedback.max * Feedback.scale ? Feedback.max * Feedback.scale : val;
606 mFeedbackS->SetValue(val);
607 ms.mFeedback = val / Feedback.scale;
608 mFeedbackT->GetValidator()->TransferToWindow();
610
611 ValidateUI();
613}
static constexpr EffectParameter Feedback
Definition: Phaser.h:135
const Type max
Maximum value.
wxSlider * mFeedbackS
Definition: Phaser.cpp:95
wxTextCtrl * mFeedbackT
Definition: Phaser.cpp:87

References EffectPhaser::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 702 of file Phaser.cpp.

703{
704 auto& ms = mSettings;
705
707 {
708 return;
709 }
710
711 mFeedbackS->SetValue((int) (ms.mFeedback * Feedback.scale));
712
713 ValidateUI();
715}

References EffectPhaser::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 559 of file Phaser.cpp.

560{
561 auto& ms = mSettings;
562
563 ms.mFreq = (double) evt.GetInt() / Freq.scale;
564 if (ms.mFreq < Freq.min) ms.mFreq = Freq.min;
565 mFreqT->GetValidator()->TransferToWindow();
567
568 ValidateUI();
570}
static constexpr EffectParameter Freq
Definition: Phaser.h:123
const Type min
Minimum value.
wxTextCtrl * mFreqT
Definition: Phaser.cpp:84

References EffectPhaser::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 657 of file Phaser.cpp.

658{
659 auto& ms = mSettings;
660
662 {
663 return;
664 }
665
666 mFreqS->SetValue((int) (ms.mFreq * Freq.scale));
667
668 ValidateUI();
670}
wxSlider * mFreqS
Definition: Phaser.cpp:92

References EffectPhaser::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 615 of file Phaser.cpp.

616{
617 auto& ms = mSettings;
618
619 ms.mOutGain = evt.GetInt() / OutGain.scale;
620 mOutGainT->GetValidator()->TransferToWindow();
622
623 ValidateUI();
625}
static constexpr EffectParameter OutGain
Definition: Phaser.h:139
wxTextCtrl * mOutGainT
Definition: Phaser.cpp:88

References EffectPhaser::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 717 of file Phaser.cpp.

718{
719 auto& ms = mSettings;
720
722 {
723 return;
724 }
725
726 mOutGainS->SetValue((int) (ms.mOutGain * OutGain.scale));
727
728 ValidateUI();
730}
wxSlider * mOutGainS
Definition: Phaser.cpp:96

References EffectPhaser::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 572 of file Phaser.cpp.

573{
574 auto& ms = mSettings;
575
576 int val = ((evt.GetInt() + 5) / 10) * 10; // round to nearest multiple of 10
577 val = val > Phase.max * Phase.scale ? Phase.max * Phase.scale : val;
578 mPhaseS->SetValue(val);
579 ms.mPhase = (double) val / Phase.scale;
580 mPhaseT->GetValidator()->TransferToWindow();
582
583 ValidateUI();
585}
static constexpr EffectParameter Phase
Definition: Phaser.h:127
wxSlider * mPhaseS
Definition: Phaser.cpp:93
wxTextCtrl * mPhaseT
Definition: Phaser.cpp:85

References EffectParameter< Structure, Member, Type, Value >::max, EffectPhaser::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 672 of file Phaser.cpp.

673{
674 auto& ms = mSettings;
675
677 {
678 return;
679 }
680
681 mPhaseS->SetValue((int) (ms.mPhase * Phase.scale));
682
683 ValidateUI();
685}

References EffectPhaser::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 535 of file Phaser.cpp.

536{
537 auto& ms = mSettings;
538
539 ms.mStages = (evt.GetInt() / Stages.scale) & ~1; // must be even;
540 mStagesT->GetValidator()->TransferToWindow();
542
543 ValidateUI();
545}
static constexpr EffectParameter Stages
Definition: Phaser.h:115
wxTextCtrl * mStagesT
Definition: Phaser.cpp:82

References EffectParameter< Structure, Member, Type, Value >::scale, EffectPhaser::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 627 of file Phaser.cpp.

628{
629 auto& ms = mSettings;
630
632 {
633 return;
634 }
635
636 mStagesS->SetValue((int) (ms.mStages * Stages.scale));
637
638 ValidateUI();
640}
wxSlider * mStagesS
Definition: Phaser.cpp:90

References EffectParameter< Structure, Member, Type, Value >::scale, EffectPhaser::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 293 of file Phaser.cpp.

294{
295 mUIParent = S.GetParent();
296 auto& ms = mSettings;
297
298 S.SetBorder(5);
299 S.AddSpace(0, 5);
300
301 S.StartMultiColumn(3, wxEXPAND);
302 {
303 S.SetStretchyCol(2);
304
305 mStagesT = S
306 .Validator<IntegerValidator<int>>(
307 &ms.mStages, NumValidatorStyle::DEFAULT, Stages.min, Stages.max)
308 .AddTextBox(XXO("&Stages:"), L"", 15);
309 BindTo(*mStagesT, wxEVT_TEXT, &Editor::OnStagesText);
310
311 mStagesS = S
312 .Name(XO("Stages"))
313 .Style(wxSL_HORIZONTAL)
314 .MinSize( { 100, -1 } )
315 .AddSlider( {}, Stages.def * Stages.scale, Stages.max * Stages.scale, Stages.min * Stages.scale);
316 mStagesS->SetLineSize(2);
317 BindTo(*mStagesS, wxEVT_SLIDER, &Editor::OnStagesSlider);
318
319 mDryWetT = S
320 .Validator<IntegerValidator<int>>(
321 &ms.mDryWet, NumValidatorStyle::DEFAULT, DryWet.min, DryWet.max)
322 .AddTextBox(XXO("&Dry/Wet:"), L"", 15);
323 BindTo(*mDryWetT, wxEVT_TEXT, &Editor::OnDryWetText);
324
325 mDryWetS = S
326 .Name(XO("Dry Wet"))
327 .Style(wxSL_HORIZONTAL)
328 .MinSize( { 100, -1 } )
329 .AddSlider( {}, DryWet.def * DryWet.scale, DryWet.max * DryWet.scale, DryWet.min * DryWet.scale);
330 BindTo(*mDryWetS, wxEVT_SLIDER, &Editor::OnDryWetSlider);
331
332 mFreqT = S
333 .Validator<FloatingPointValidator<double>>(
334 5, &ms.mFreq, NumValidatorStyle::ONE_TRAILING_ZERO, Freq.min, Freq.max)
335 .AddTextBox(XXO("LFO Freq&uency (Hz):"), L"", 15);
336 BindTo(*mFreqT, wxEVT_TEXT, &Editor::OnFreqText);
337
338 mFreqS = S
339 .Name(XO("LFO frequency in hertz"))
340 .Style(wxSL_HORIZONTAL)
341 .MinSize( { 100, -1 } )
342 .AddSlider( {}, Freq.def * Freq.scale, Freq.max * Freq.scale, 0.0);
343 BindTo(*mFreqS, wxEVT_SLIDER, &Editor::OnFreqSlider);
344
345 mPhaseT = S
346 .Validator<FloatingPointValidator<double>>(
347 1, &ms.mPhase, NumValidatorStyle::DEFAULT, Phase.min, Phase.max)
348 .AddTextBox(XXO("LFO Sta&rt Phase (deg.):"), L"", 15);
349 BindTo(*mPhaseT, wxEVT_TEXT, &Editor::OnPhaseText);
350
351 mPhaseS = S
352 .Name(XO("LFO start phase in degrees"))
353 .Style(wxSL_HORIZONTAL)
354 .MinSize( { 100, -1 } )
355 .AddSlider( {}, Phase.def * Phase.scale, Phase.max * Phase.scale, Phase.min * Phase.scale);
356 mPhaseS->SetLineSize(10);
357 BindTo(*mPhaseS, wxEVT_SLIDER, &Editor::OnPhaseSlider);
358
359 mDepthT = S
360 .Validator<IntegerValidator<int>>(
361 &ms.mDepth, NumValidatorStyle::DEFAULT, Depth.min, Depth.max)
362 .AddTextBox(XXO("Dept&h:"), L"", 15);
363 BindTo(*mDepthT, wxEVT_TEXT, &Editor::OnDepthText);
364
365 mDepthS = S
366 .Name(XO("Depth in percent"))
367 .Style(wxSL_HORIZONTAL)
368 .MinSize( { 100, -1 } )
369 .AddSlider( {}, Depth.def * Depth.scale, Depth.max * Depth.scale, Depth.min * Depth.scale);
370 BindTo(*mDepthS, wxEVT_SLIDER, &Editor::OnDepthSlider);
371
372 mFeedbackT = S
373 .Validator<IntegerValidator<int>>(
374 &ms.mFeedback, NumValidatorStyle::DEFAULT, Feedback.min, Feedback.max)
375 .AddTextBox(XXO("Feedbac&k (%):"), L"", 15);
377
378 mFeedbackS = S
379 .Name(XO("Feedback in percent"))
380 .Style(wxSL_HORIZONTAL)
381 .MinSize( { 100, -1 } )
383 mFeedbackS->SetLineSize(10);
385
386 mOutGainT = S
387 .Validator<FloatingPointValidator<double>>(
388 1, &ms.mOutGain, NumValidatorStyle::DEFAULT, OutGain.min, OutGain.max)
389 .AddTextBox(XXO("&Output gain (dB):"), L"", 12);
390 BindTo(*mOutGainT, wxEVT_TEXT, &Editor::OnGainText);
391
392 mOutGainS = S
393 .Name(XO("Output gain (dB)"))
394 .Style(wxSL_HORIZONTAL)
395 .MinSize( { 100, -1 } )
397 BindTo(*mOutGainS, wxEVT_SLIDER, &Editor::OnGainSlider);
398 }
399 S.EndMultiColumn();
400
401}
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:615
void OnStagesSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:535
void OnFreqSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:559
void OnGainText(wxCommandEvent &evt)
Definition: Phaser.cpp:717
void OnFeedbackSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:599
void OnPhaseSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:572
void OnPhaseText(wxCommandEvent &evt)
Definition: Phaser.cpp:672
void OnFeedbackText(wxCommandEvent &evt)
Definition: Phaser.cpp:702
void OnDryWetText(wxCommandEvent &evt)
Definition: Phaser.cpp:642
void OnDryWetSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:547
void OnDepthSlider(wxCommandEvent &evt)
Definition: Phaser.cpp:587
void OnFreqText(wxCommandEvent &evt)
Definition: Phaser.cpp:657
void OnStagesText(wxCommandEvent &evt)
Definition: Phaser.cpp:627
void OnDepthText(wxCommandEvent &evt)
Definition: Phaser.cpp:687

References EffectParameter< Structure, Member, Type, Value >::def, EffectPhaser::Depth, EffectPhaser::DryWet, EffectPhaser::Feedback, EffectPhaser::Freq, EffectParameter< Structure, Member, Type, Value >::max, EffectParameter< Structure, Member, Type, Value >::min, OnDepthSlider(), OnDepthText(), OnDryWetSlider(), OnDryWetText(), OnFeedbackSlider(), OnFeedbackText(), OnFreqSlider(), OnFreqText(), OnGainSlider(), OnGainText(), OnPhaseSlider(), OnPhaseText(), OnStagesSlider(), OnStagesText(), EffectPhaser::OutGain, EffectPhaser::Phase, S, EffectParameter< Structure, Member, Type, Value >::scale, EffectPhaser::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 403 of file Phaser.cpp.

404{
405 // get the settings from the MessageBuffer and write them to our local copy
406 const auto& settings = mAccess.Get();
407
409
410 if (!mUIParent->TransferDataToWindow())
411 {
412 return false;
413 }
414
415 mStagesS-> SetValue((int) (mSettings.mStages * Stages.scale));
416 mDryWetS-> SetValue((int) (mSettings.mDryWet * DryWet.scale));
417 mFreqS-> SetValue((int) (mSettings.mFreq * Freq.scale));
418 mPhaseS-> SetValue((int) (mSettings.mPhase * Phase.scale));
419 mDepthS-> SetValue((int) (mSettings.mDepth * Depth.scale));
420 mFeedbackS->SetValue((int) (mSettings.mFeedback * Feedback.scale));
421 mOutGainS-> SetValue((int) (mSettings.mOutGain * OutGain.scale));
422
423 return true;
424}
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:169

References EffectPhaser::Depth, EffectPhaser::DryWet, EffectPhaser::Feedback, EffectPhaser::Freq, EffectWithSettings< EffectPhaserSettings, StatelessPerTrackEffect >::GetSettings(), EffectPhaser::OutGain, EffectPhaser::Phase, EffectParameter< Structure, Member, Type, Value >::scale, settings(), and EffectPhaser::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 427 of file Phaser.cpp.

428{
429 // This bit was copied from the original override of TransferDataFromWindow
430 if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
431 {
432 return false;
433 }
434
435 auto& ms = mSettings;
436
437 if (ms.mStages & 1) // must be even
438 {
439 ms.mStages &= ~1;
440 mStagesT->GetValidator()->TransferToWindow();
441 }
442
444 (
445 [this](EffectSettings& settings)
446 {
447 // pass back the modified settings to the MessageBuffer
448
450 return nullptr;
451 }
452 );
453
454 return true;
455}
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
Externalized state of a plug-in.

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

Here is the call graph for this function:

Member Data Documentation

◆ mDepthS

wxSlider* EffectPhaser::Editor::mDepthS

Definition at line 94 of file Phaser.cpp.

◆ mDepthT

wxTextCtrl* EffectPhaser::Editor::mDepthT

Definition at line 86 of file Phaser.cpp.

◆ mDryWetS

wxSlider* EffectPhaser::Editor::mDryWetS

Definition at line 91 of file Phaser.cpp.

◆ mDryWetT

wxTextCtrl* EffectPhaser::Editor::mDryWetT

Definition at line 83 of file Phaser.cpp.

◆ mFeedbackS

wxSlider* EffectPhaser::Editor::mFeedbackS

Definition at line 95 of file Phaser.cpp.

◆ mFeedbackT

wxTextCtrl* EffectPhaser::Editor::mFeedbackT

Definition at line 87 of file Phaser.cpp.

◆ mFreqS

wxSlider* EffectPhaser::Editor::mFreqS

Definition at line 92 of file Phaser.cpp.

◆ mFreqT

wxTextCtrl* EffectPhaser::Editor::mFreqT

Definition at line 84 of file Phaser.cpp.

◆ mOutGainS

wxSlider* EffectPhaser::Editor::mOutGainS

Definition at line 96 of file Phaser.cpp.

◆ mOutGainT

wxTextCtrl* EffectPhaser::Editor::mOutGainT

Definition at line 88 of file Phaser.cpp.

◆ mPhaseS

wxSlider* EffectPhaser::Editor::mPhaseS

Definition at line 93 of file Phaser.cpp.

◆ mPhaseT

wxTextCtrl* EffectPhaser::Editor::mPhaseT

Definition at line 85 of file Phaser.cpp.

◆ mSettings

EffectPhaserSettings EffectPhaser::Editor::mSettings

Definition at line 80 of file Phaser.cpp.

◆ mStagesS

wxSlider* EffectPhaser::Editor::mStagesS

Definition at line 90 of file Phaser.cpp.

◆ mStagesT

wxTextCtrl* EffectPhaser::Editor::mStagesT

Definition at line 82 of file Phaser.cpp.

◆ mUIParent

wxWeakRef<wxWindow> EffectPhaser::Editor::mUIParent

Definition at line 79 of file Phaser.cpp.

Referenced by EnableApplyFromTransferDataFromWindow(), and EnableApplyFromValidate().


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