Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
LV2EffectSettingsDialog Class Referencefinal
Inheritance diagram for LV2EffectSettingsDialog:
[legend]
Collaboration diagram for LV2EffectSettingsDialog:
[legend]

Public Member Functions

 LV2EffectSettingsDialog (wxWindow *parent, EffectDefinitionInterface &effect)
 
virtual ~LV2EffectSettingsDialog ()
 
void PopulateOrExchange (ShuttleGui &S)
 
void OnOk (wxCommandEvent &evt)
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Attributes

EffectDefinitionInterfacemEffect
 
int mBufferSize {}
 
bool mUseLatency {}
 
bool mUseGUI {}
 

Detailed Description

Definition at line 76 of file LV2Effect.cpp.

Constructor & Destructor Documentation

◆ LV2EffectSettingsDialog()

LV2EffectSettingsDialog::LV2EffectSettingsDialog ( wxWindow *  parent,
EffectDefinitionInterface effect 
)

Definition at line 99 of file LV2Effect.cpp.

101: wxDialogWrapper(parent, wxID_ANY, XO("LV2 Effect Settings"))
102, mEffect{ effect }
103{
104 GetConfig(mEffect, PluginSettings::Shared, wxT("Settings"),
105 wxT("BufferSize"), mBufferSize, 8192);
106 GetConfig(mEffect, PluginSettings::Shared, wxT("Settings"),
107 wxT("UseLatency"), mUseLatency, true);
108 GetConfig(mEffect, PluginSettings::Shared, wxT("Settings"),
109 wxT("UseGUI"), mUseGUI, true);
110
111 ShuttleGui S(this, eIsCreating);
113}
#define XO(s)
Definition: Internat.h:31
@ eIsCreating
Definition: ShuttleGui.h:39
#define S(N)
Definition: ToChars.cpp:64
void PopulateOrExchange(ShuttleGui &S)
Definition: LV2Effect.cpp:119
EffectDefinitionInterface & mEffect
Definition: LV2Effect.cpp:87
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628
bool GetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)

◆ ~LV2EffectSettingsDialog()

LV2EffectSettingsDialog::~LV2EffectSettingsDialog ( )
virtual

Definition at line 115 of file LV2Effect.cpp.

116{
117}

Member Function Documentation

◆ OnOk()

void LV2EffectSettingsDialog::OnOk ( wxCommandEvent &  evt)

Definition at line 200 of file LV2Effect.cpp.

201{
202 if (!Validate())
203 {
204 return;
205 }
206
209
210 SetConfig(mEffect, PluginSettings::Shared, wxT("Settings"),
211 wxT("BufferSize"), mBufferSize);
212 SetConfig(mEffect, PluginSettings::Shared, wxT("Settings"),
213 wxT("UseLatency"), mUseLatency);
214 SetConfig(mEffect, PluginSettings::Shared, wxT("Settings"),
215 wxT("UseGUI"), mUseGUI);
216
217 EndModal(wxID_OK);
218}
@ eIsGettingFromDialog
Definition: ShuttleGui.h:40
bool SetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)

References eIsGettingFromDialog, mBufferSize, mEffect, mUseGUI, mUseLatency, PopulateOrExchange(), S, PluginSettings::SetConfig(), and PluginSettings::Shared.

Here is the call graph for this function:

◆ PopulateOrExchange()

void LV2EffectSettingsDialog::PopulateOrExchange ( ShuttleGui S)

Definition at line 119 of file LV2Effect.cpp.

120{
121 S.SetBorder(5);
122 S.StartHorizontalLay(wxEXPAND, 1);
123 {
124 S.StartVerticalLay(false);
125 {
126 // This really shouldn't be required for LV2 plugins because they have the ability
127 // to specify their exact requirements in the TTL file and/or to check the host
128 // supplied min/max values. However, I've run across one (Harrison Consoles XT-EQ)
129 // that crashed on sizes greater than 8192.
130 S.StartStatic(XO("Buffer Size"));
131 {
132 IntegerValidator<int> vld(&mBufferSize);
133 vld.SetRange(8, DEFAULT_BLOCKSIZE);
134
135 S.AddVariableText( XO(
136"The buffer size controls the number of samples sent to the effect "
137"on each iteration. Smaller values will cause slower processing and "
138"some effects require 8192 samples or less to work properly. However "
139"most effects can accept large buffers and using them will greatly "
140"reduce processing time."),
141 false, 0, 650);
142
143 S.StartHorizontalLay(wxALIGN_LEFT);
144 {
145 wxTextCtrl *t;
146 t = S.TieNumericTextBox(
147 XXO("&Buffer Size (8 to %d) samples:")
150 12);
151 t->SetMinSize(wxSize(100, -1));
152 t->SetValidator(vld);
153 }
154 S.EndHorizontalLay();
155 }
156 S.EndStatic();
157
158 S.StartStatic(XO("Latency Compensation"));
159 {
160 S.AddVariableText( XO(
161"As part of their processing, some LV2 effects must delay returning "
162"audio to Audacity. When not compensating for this delay, you will "
163"notice that small silences have been inserted into the audio. "
164"Enabling this setting will provide that compensation, but it may "
165"not work for all LV2 effects."),
166 false, 0, 650);
167
168 S.StartHorizontalLay(wxALIGN_LEFT);
169 {
170 S.TieCheckBox(XXO("Enable &compensation"),
172 }
173 S.EndHorizontalLay();
174 }
175 S.EndStatic();
176
177 S.StartStatic(XO("Graphical Mode"));
178 {
179 S.AddVariableText( XO(
180"LV2 effects can have a graphical interface for setting parameter values."
181" A basic text-only method is also available. "
182" Reopen the effect for this to take effect."),
183 false, 0, 650);
184 S.TieCheckBox(XXO("Enable &graphical interface"),
185 mUseGUI);
186 }
187 S.EndStatic();
188 }
189 S.EndVerticalLay();
190 }
191 S.EndHorizontalLay();
192
193 S.AddStandardButtons();
194
195 Layout();
196 Fit();
197 Center();
198}
#define XXO(s)
Definition: Internat.h:44
#define DEFAULT_BLOCKSIZE
Abstract base class used in importing a file.

References DEFAULT_BLOCKSIZE, mBufferSize, mUseGUI, mUseLatency, S, XO, and XXO.

Referenced by OnOk().

Here is the caller graph for this function:

Member Data Documentation

◆ mBufferSize

int LV2EffectSettingsDialog::mBufferSize {}
private

Definition at line 88 of file LV2Effect.cpp.

Referenced by OnOk(), and PopulateOrExchange().

◆ mEffect

EffectDefinitionInterface& LV2EffectSettingsDialog::mEffect
private

Definition at line 87 of file LV2Effect.cpp.

Referenced by OnOk().

◆ mUseGUI

bool LV2EffectSettingsDialog::mUseGUI {}
private

Definition at line 90 of file LV2Effect.cpp.

Referenced by OnOk(), and PopulateOrExchange().

◆ mUseLatency

bool LV2EffectSettingsDialog::mUseLatency {}
private

Definition at line 89 of file LV2Effect.cpp.

Referenced by OnOk(), and PopulateOrExchange().


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