Audacity 3.2.0
LadspaEffectOptionsDialog.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 LadspaEffectOptionsDialog.cpp
6
7 Dominic Mazzoni
8
9 Paul Licameli split from LadspaEffect.cpp
10
11*//*******************************************************************/
13#include "LadspaInstance.h"
14#include "ConfigInterface.h"
15#include "ShuttleGui.h"
16
20
22 const EffectDefinitionInterface &effect
23) : wxDialogWrapper{ nullptr, wxID_ANY, XO("LADSPA Effect Options") }
24 , mEffect{ effect }
25 , mUseLatency{ LadspaInstance::LoadUseLatency(mEffect) }
26{
28 PopulateOrExchange(S);
29}
30
32{
33}
34
36{
37 S.SetBorder(5);
38 S.StartHorizontalLay(wxEXPAND, 1);
39 {
40 S.StartVerticalLay(false);
41 {
42 S.StartStatic(XO("Latency Compensation"));
43 {
44 S.AddVariableText( XO(
45"As part of their processing, some LADSPA effects must delay returning "
46"audio to Audacity. When not compensating for this delay, you will "
47"notice that small silences have been inserted into the audio. "
48"Enabling this option will provide that compensation, but it may "
49"not work for all LADSPA effects."),
50 false, 0, 650);
51
52 S.StartHorizontalLay(wxALIGN_LEFT);
53 {
54 S.TieCheckBox(XXO("Enable &compensation"),
56 }
57 S.EndHorizontalLay();
58 }
59 S.EndStatic();
60 }
61 S.EndVerticalLay();
62 }
63 S.EndHorizontalLay();
64
65 S.AddStandardButtons();
66
67 Layout();
68 Fit();
69 Center();
70}
71
72void LadspaEffectOptionsDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
73{
74 if (!Validate())
75 {
76 return;
77 }
78
80 // Note this call re-visits the controls, not to create them but to fetch
81 // the values, in this case mUseLatency
83
85
86 EndModal(wxID_OK);
87}
END_EVENT_TABLE()
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
@ eIsCreating
Definition: ShuttleGui.h:37
@ eIsGettingFromDialog
Definition: ShuttleGui.h:38
#define S(N)
Definition: ToChars.cpp:64
EffectDefinitionInterface is a ComponentInterface that adds some basic read-only information about ef...
const EffectDefinitionInterface & mEffect
void OnOk(wxCommandEvent &evt)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
static bool LoadUseLatency(const EffectDefinitionInterface &effect)
Get the preference for using latency.
static bool SaveUseLatency(const EffectDefinitionInterface &effect, bool value)
Set the preference for using latency.