21#include <wx/checkbox.h>
23#include <wx/spinctrl.h>
27#include "../widgets/valnum.h"
51#define SpinSlider(n) \
52 wxSpinCtrl *m ## n ## T; \
53 wxSlider *m ## n ## S;
67 wxCheckBox* mWetOnlyC;
70#define SpinSliderHandlers(n) \
71 void On ## n ## Slider(wxCommandEvent & evt); \
72 void On ## n ## Text(wxCommandEvent & evt);
84#undef SpinSliderHandlers
86 void OnCheckbox(wxCommandEvent &evt);
96 rs.mPreDelay = mPreDelayS->GetValue();
97 rs.mReverberance = mReverberanceS->GetValue();
98 rs.mHfDamping = mHfDampingS->GetValue();
99 rs.mToneLow = mToneLowS->GetValue();
100 rs.mToneHigh = mToneHighS->GetValue();
101 rs.mWetGain = mWetGainS->GetValue();
102 rs.mDryGain = mDryGainS->GetValue();
103 rs.mStereoWidth = mStereoWidthS->GetValue();
104 rs.mWetOnly = mWetOnlyC->GetValue();
120std::shared_ptr<EffectInstance>
123 return std::make_shared<Instance>(*
this);
134 auto result = std::make_unique<Editor>(*
this, access, myEffSettings);
135 result->PopulateOrExchange(
S);
144 S.StartMultiColumn(3, wxEXPAND);
148#define SpinSlider(n, p) \
149 m ## n ## T = S.AddSpinCtrl( p, n.def, n.max, n.min); \
150 BindTo(*m ## n ## T, wxEVT_SPINCTRL, &Editor::On ## n ## Text);\
152 m ## n ## S = S.Style(wxSL_HORIZONTAL).AddSlider( {}, n.def, n.max, n.min); \
153 BindTo(*m ## n ## S, wxEVT_SLIDER, &Editor::On ## n ## Slider);
170 S.StartHorizontalLay(wxCENTER,
false);
174 BindTo(*mWetOnlyC, wxEVT_CHECKBOX, &Editor::OnCheckbox);
176 S.EndHorizontalLay();
185 auto& rs = mSettings;
187#define SetSpinSlider(n) \
188 m ## n ## S->SetValue((int) rs.m ## n); \
189 m ## n ## T->SetValue(wxString::Format(wxT("%d"), (int) rs.m ## n));
203 mWetOnlyC->SetValue((
int) rs.mWetOnly);
209#define SpinSliderHandlers(n) \
210 void EffectReverb::Editor::On ## n ## Slider(wxCommandEvent & evt) \
212 if (mProcessingEvent) return; \
213 mProcessingEvent = true; \
214 m ## n ## T->SetValue(wxString::Format(wxT("%d"), evt.GetInt())); \
215 mProcessingEvent = false; \
217 Publish(EffectSettingChanged{}); \
219 void EffectReverb::Editor::On ## n ## Text(wxCommandEvent & evt) \
221 if (mProcessingEvent) return; \
222 mProcessingEvent = true; \
223 m ## n ## S->SetValue(std::clamp<long>(evt.GetInt(), n.min, n.max)); \
224 mProcessingEvent = false; \
226 Publish(EffectSettingChanged{}); \
239void EffectReverb::Editor::OnCheckbox(wxCommandEvent &evt)
245#undef SpinSliderHandlers
XXO("&Cut/Copy/Paste Toolbar")
#define SpinSliderHandlers(n)
static Settings & settings()
bool ValidateUI(const EffectPlugin &context, EffectSettings &) const override
EffectSettingsAccess & mAccess
Performs effect computation.
Hold values to send to effect output meters.
std::unique_ptr< EffectEditor > MakeEditor(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectOutputs *pOutputs) const override
Called only from PopulateUI, to add controls to effect panel.
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
void ModifySettings(Function &&function)
Do a correct read-modify-write of settings.
virtual const EffectSettings & Get()=0
static ReverbSettings & GetSettings(EffectSettings &settings)
Assume settings originated from MakeSettings() and copies thereof.
static constexpr EffectParameter WetOnly
static constexpr EffectParameter StereoWidth
static constexpr EffectParameter RoomSize
static constexpr EffectParameter HfDamping
static constexpr EffectParameter PreDelay
static constexpr EffectParameter Reverberance
static constexpr EffectParameter WetGain
static constexpr EffectParameter DryGain
static constexpr EffectParameter ToneHigh
static constexpr EffectParameter ToneLow
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
BuiltinEffectsModule::Registration< EffectReverb > reg
const Type def
Default value.
SpinSlider(RoomSize) SpinSlider(PreDelay) SpinSlider(Reverberance) SpinSlider(HfDamping) SpinSlider(ToneLow) SpinSlider(ToneHigh) SpinSlider(WetGain) SpinSlider(DryGain) SpinSlider(StereoWidth) wxCheckBox *mWetOnlyC
bool UpdateUI() override
Update appearance of the panel for changes in settings.
bool ValidateUI() override
Get settings data from the panel; may make error dialogs and return false.
Editor(const EffectUIServices &services, EffectSettingsAccess &access, const ReverbSettings &settings)
SpinSliderHandlers(RoomSize) SpinSliderHandlers(PreDelay) SpinSliderHandlers(Reverberance) SpinSliderHandlers(HfDamping) SpinSliderHandlers(ToneLow) SpinSliderHandlers(ToneHigh) SpinSliderHandlers(WetGain) SpinSliderHandlers(DryGain) SpinSliderHandlers(StereoWidth) void OnCheckbox(wxCommandEvent &evt)
void PopulateOrExchange(ShuttleGui &S)
virtual ~Editor()=default
Message sent by EffectEditor when a setting is changed by the user.
Externalized state of a plug-in.