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

Public Member Functions

 Validator (EffectUIClientInterface &effect, EffectSettingsAccess &access, const EffectPhaserSettings &settings)
 
virtual ~Validator ()=default
 
EffectGetEffect () const
 
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 EffectUIValidator
 EffectUIValidator (EffectUIClientInterface &effect, EffectSettingsAccess &access)
 
virtual ~EffectUIValidator ()
 
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 EffectUIValidator
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 EffectUIValidator
static constexpr int kPlayID = 20102
 
- Static Public Attributes inherited from Observer::Publisher< EffectSettingChanged >
static constexpr bool notifies_all
 
- Protected Member Functions inherited from EffectUIValidator
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 EffectUIValidator
EffectUIClientInterfacemEffect
 
EffectSettingsAccessmAccess
 
bool mUIClosed { false }
 

Detailed Description

Definition at line 65 of file Phaser.cpp.

Constructor & Destructor Documentation

◆ Validator()

EffectPhaser::Validator::Validator ( EffectUIClientInterface effect,
EffectSettingsAccess access,
const EffectPhaserSettings settings 
)
inline

Definition at line 68 of file Phaser.cpp.

70 : EffectUIValidator{ effect, access }
72 {}
static Settings & settings()
Definition: TrackInfo.cpp:87
Interface for transferring values from a panel of effect controls.
Definition: EffectPlugin.h:239
EffectPhaserSettings mSettings
Definition: Phaser.cpp:83

◆ ~Validator()

virtual EffectPhaser::Validator::~Validator ( )
virtualdefault

Member Function Documentation

◆ EnableApplyFromTransferDataFromWindow()

bool EffectPhaser::Validator::EnableApplyFromTransferDataFromWindow ( )
inline

Definition at line 123 of file Phaser.cpp.

124 {
125 return EnableApply(mUIParent, mUIParent->TransferDataFromWindow());
126 }
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:82

References EffectUIValidator::EnableApply(), and mUIParent.

Here is the call graph for this function:

◆ EnableApplyFromValidate()

void EffectPhaser::Validator::EnableApplyFromValidate ( )
inline

Definition at line 118 of file Phaser.cpp.

119 {
120 EnableApply(mUIParent, mUIParent->Validate());
121 }

References EffectUIValidator::EnableApply(), and mUIParent.

Here is the call graph for this function:

◆ GetEffect()

Effect & EffectPhaser::Validator::GetEffect ( ) const
inline

Definition at line 75 of file Phaser.cpp.

75{ return static_cast<Effect&>(mEffect); }
Base class for many of the effects in Audacity.
Definition: Effect.h:62
EffectUIClientInterface & mEffect
Definition: EffectPlugin.h:296

References EffectUIValidator::mEffect.

◆ OnDepthSlider()

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

Definition at line 593 of file Phaser.cpp.

594{
595 auto& ms = mSettings;
596
597 ms.mDepth = evt.GetInt() / Depth.scale;
598 mDepthT->GetValidator()->TransferToWindow();
600
601 ValidateUI();
603}
static constexpr EffectParameter Depth
Definition: Phaser.h:128
CallbackReturn Publish(const EffectSettingChanged &message)
Send a message to connected callbacks.
Definition: Observer.h:207
const Type scale
Scaling factor, for slider control.
Definition: Shuttle.h:32
void EnableApplyFromValidate()
Definition: Phaser.cpp:118
wxTextCtrl * mDepthT
Definition: Phaser.cpp:89
bool ValidateUI() override
Get settings data from the panel; may make error dialogs and return false.
Definition: Phaser.cpp:432
Message sent by validator when a setting is changed by a user.
Definition: EffectPlugin.h:225

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

Referenced by PopulateOrExchange().

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

◆ OnDepthText()

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

Definition at line 693 of file Phaser.cpp.

694{
695 auto& ms = mSettings;
696
698 {
699 return;
700 }
701
702 mDepthS->SetValue((int) (ms.mDepth * Depth.scale));
703
704 ValidateUI();
706}
wxSlider * mDepthS
Definition: Phaser.cpp:97
bool EnableApplyFromTransferDataFromWindow()
Definition: Phaser.cpp:123

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

Referenced by PopulateOrExchange().

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

◆ OnDryWetSlider()

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

Definition at line 553 of file Phaser.cpp.

554{
555 auto& ms = mSettings;
556
557 ms.mDryWet = evt.GetInt() / DryWet.scale;
558 mDryWetT->GetValidator()->TransferToWindow();
560
561 ValidateUI();
563}
static constexpr EffectParameter DryWet
Definition: Phaser.h:116
wxTextCtrl * mDryWetT
Definition: Phaser.cpp:86

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

Referenced by PopulateOrExchange().

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

◆ OnDryWetText()

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

Definition at line 648 of file Phaser.cpp.

649{
650 auto& ms = mSettings;
651
653 {
654 return;
655 }
656
657 mDryWetS->SetValue((int) (ms.mDryWet * DryWet.scale));
658
659 ValidateUI();
661}
wxSlider * mDryWetS
Definition: Phaser.cpp:94

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

Referenced by PopulateOrExchange().

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

◆ OnFeedbackSlider()

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

Definition at line 605 of file Phaser.cpp.

606{
607 auto& ms = mSettings;
608
609 int val = evt.GetInt();
610 val = ((val + (val > 0 ? 5 : -5)) / 10) * 10; // round to nearest multiple of 10
611 val = val > Feedback.max * Feedback.scale ? Feedback.max * Feedback.scale : val;
612 mFeedbackS->SetValue(val);
613 ms.mFeedback = val / Feedback.scale;
614 mFeedbackT->GetValidator()->TransferToWindow();
616
617 ValidateUI();
619}
static constexpr EffectParameter Feedback
Definition: Phaser.h:132
const Type max
Maximum value.
Definition: Shuttle.h:31
wxSlider * mFeedbackS
Definition: Phaser.cpp:98
wxTextCtrl * mFeedbackT
Definition: Phaser.cpp:90

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

Referenced by PopulateOrExchange().

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

◆ OnFeedbackText()

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

Definition at line 708 of file Phaser.cpp.

709{
710 auto& ms = mSettings;
711
713 {
714 return;
715 }
716
717 mFeedbackS->SetValue((int) (ms.mFeedback * Feedback.scale));
718
719 ValidateUI();
721}

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

Referenced by PopulateOrExchange().

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

◆ OnFreqSlider()

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

Definition at line 565 of file Phaser.cpp.

566{
567 auto& ms = mSettings;
568
569 ms.mFreq = (double) evt.GetInt() / Freq.scale;
570 if (ms.mFreq < Freq.min) ms.mFreq = Freq.min;
571 mFreqT->GetValidator()->TransferToWindow();
573
574 ValidateUI();
576}
static constexpr EffectParameter Freq
Definition: Phaser.h:120
const Type min
Minimum value.
Definition: Shuttle.h:30
wxTextCtrl * mFreqT
Definition: Phaser.cpp:87

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

Referenced by PopulateOrExchange().

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

◆ OnFreqText()

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

Definition at line 663 of file Phaser.cpp.

664{
665 auto& ms = mSettings;
666
668 {
669 return;
670 }
671
672 mFreqS->SetValue((int) (ms.mFreq * Freq.scale));
673
674 ValidateUI();
676}

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

Referenced by PopulateOrExchange().

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

◆ OnGainSlider()

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

Definition at line 621 of file Phaser.cpp.

622{
623 auto& ms = mSettings;
624
625 ms.mOutGain = evt.GetInt() / OutGain.scale;
626 mOutGainT->GetValidator()->TransferToWindow();
628
629 ValidateUI();
631}
static constexpr EffectParameter OutGain
Definition: Phaser.h:136
wxTextCtrl * mOutGainT
Definition: Phaser.cpp:91

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

Referenced by PopulateOrExchange().

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

◆ OnGainText()

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

Definition at line 723 of file Phaser.cpp.

724{
725 auto& ms = mSettings;
726
728 {
729 return;
730 }
731
732 mOutGainS->SetValue((int) (ms.mOutGain * OutGain.scale));
733
734 ValidateUI();
736}
wxSlider * mOutGainS
Definition: Phaser.cpp:99

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

Referenced by PopulateOrExchange().

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

◆ OnPhaseSlider()

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

Definition at line 578 of file Phaser.cpp.

579{
580 auto& ms = mSettings;
581
582 int val = ((evt.GetInt() + 5) / 10) * 10; // round to nearest multiple of 10
583 val = val > Phase.max * Phase.scale ? Phase.max * Phase.scale : val;
584 mPhaseS->SetValue(val);
585 ms.mPhase = (double) val / Phase.scale;
586 mPhaseT->GetValidator()->TransferToWindow();
588
589 ValidateUI();
591}
static constexpr EffectParameter Phase
Definition: Phaser.h:124
wxSlider * mPhaseS
Definition: Phaser.cpp:96
wxTextCtrl * mPhaseT
Definition: Phaser.cpp:88

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

Referenced by PopulateOrExchange().

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

◆ OnPhaseText()

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

Definition at line 678 of file Phaser.cpp.

679{
680 auto& ms = mSettings;
681
683 {
684 return;
685 }
686
687 mPhaseS->SetValue((int) (ms.mPhase * Phase.scale));
688
689 ValidateUI();
691}

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

Referenced by PopulateOrExchange().

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

◆ OnStagesSlider()

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

Definition at line 541 of file Phaser.cpp.

542{
543 auto& ms = mSettings;
544
545 ms.mStages = (evt.GetInt() / Stages.scale) & ~1; // must be even;
546 mStagesT->GetValidator()->TransferToWindow();
548
549 ValidateUI();
551}
static constexpr EffectParameter Stages
Definition: Phaser.h:112
wxTextCtrl * mStagesT
Definition: Phaser.cpp:85

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

Referenced by PopulateOrExchange().

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

◆ OnStagesText()

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

Definition at line 633 of file Phaser.cpp.

634{
635 auto& ms = mSettings;
636
638 {
639 return;
640 }
641
642 mStagesS->SetValue((int) (ms.mStages * Stages.scale));
643
644 ValidateUI();
646}
wxSlider * mStagesS
Definition: Phaser.cpp:93

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

Referenced by PopulateOrExchange().

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

◆ PopulateOrExchange()

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

Definition at line 296 of file Phaser.cpp.

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

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, Effect::mUIParent, 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::Validator::UpdateUI ( )
overridevirtual

Update appearance of the panel for changes in settings.

Default implementation does nothing, returns true

Returns
true if successful

Reimplemented from EffectUIValidator.

Definition at line 406 of file Phaser.cpp.

407{
408 // get the settings from the MessageBuffer and write them to our local copy
409 const auto& settings = mAccess.Get();
410
412
413 Effect& actualEffect = static_cast<Effect&>(mEffect);
414
415 if (!mUIParent->TransferDataToWindow())
416 {
417 return false;
418 }
419
420 mStagesS-> SetValue((int) (mSettings.mStages * Stages.scale));
421 mDryWetS-> SetValue((int) (mSettings.mDryWet * DryWet.scale));
422 mFreqS-> SetValue((int) (mSettings.mFreq * Freq.scale));
423 mPhaseS-> SetValue((int) (mSettings.mPhase * Phase.scale));
424 mDepthS-> SetValue((int) (mSettings.mDepth * Depth.scale));
425 mFeedbackS->SetValue((int) (mSettings.mFeedback * Feedback.scale));
426 mOutGainS-> SetValue((int) (mSettings.mOutGain * OutGain.scale));
427
428 return true;
429}
virtual const EffectSettings & Get()=0
EffectSettingsAccess & mAccess
Definition: EffectPlugin.h:297
static EffectPhaserSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
Definition: Effect.h:262

References EffectPhaser::Depth, EffectPhaser::DryWet, EffectPhaser::Feedback, EffectPhaser::Freq, EffectWithSettings< EffectPhaserSettings, PerTrackEffect >::GetSettings(), Effect::mUIParent, 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::Validator::ValidateUI ( )
overridevirtual

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

Returns
true only if panel settings are acceptable

Implements EffectUIValidator.

Definition at line 432 of file Phaser.cpp.

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

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

Here is the call graph for this function:

Member Data Documentation

◆ mDepthS

wxSlider* EffectPhaser::Validator::mDepthS

Definition at line 97 of file Phaser.cpp.

◆ mDepthT

wxTextCtrl* EffectPhaser::Validator::mDepthT

Definition at line 89 of file Phaser.cpp.

◆ mDryWetS

wxSlider* EffectPhaser::Validator::mDryWetS

Definition at line 94 of file Phaser.cpp.

◆ mDryWetT

wxTextCtrl* EffectPhaser::Validator::mDryWetT

Definition at line 86 of file Phaser.cpp.

◆ mFeedbackS

wxSlider* EffectPhaser::Validator::mFeedbackS

Definition at line 98 of file Phaser.cpp.

◆ mFeedbackT

wxTextCtrl* EffectPhaser::Validator::mFeedbackT

Definition at line 90 of file Phaser.cpp.

◆ mFreqS

wxSlider* EffectPhaser::Validator::mFreqS

Definition at line 95 of file Phaser.cpp.

◆ mFreqT

wxTextCtrl* EffectPhaser::Validator::mFreqT

Definition at line 87 of file Phaser.cpp.

◆ mOutGainS

wxSlider* EffectPhaser::Validator::mOutGainS

Definition at line 99 of file Phaser.cpp.

◆ mOutGainT

wxTextCtrl* EffectPhaser::Validator::mOutGainT

Definition at line 91 of file Phaser.cpp.

◆ mPhaseS

wxSlider* EffectPhaser::Validator::mPhaseS

Definition at line 96 of file Phaser.cpp.

◆ mPhaseT

wxTextCtrl* EffectPhaser::Validator::mPhaseT

Definition at line 88 of file Phaser.cpp.

◆ mSettings

EffectPhaserSettings EffectPhaser::Validator::mSettings

Definition at line 83 of file Phaser.cpp.

◆ mStagesS

wxSlider* EffectPhaser::Validator::mStagesS

Definition at line 93 of file Phaser.cpp.

◆ mStagesT

wxTextCtrl* EffectPhaser::Validator::mStagesT

Definition at line 85 of file Phaser.cpp.

◆ mUIParent

wxWeakRef<wxWindow> EffectPhaser::Validator::mUIParent

Definition at line 82 of file Phaser.cpp.

Referenced by EnableApplyFromTransferDataFromWindow(), and EnableApplyFromValidate().


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