Audacity  3.0.3
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, LV2Effect *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

LV2EffectmEffect
 
int mBufferSize
 
bool mUseLatency
 
bool mUseGUI
 

Detailed Description

Definition at line 197 of file LV2Effect.cpp.

Constructor & Destructor Documentation

◆ LV2EffectSettingsDialog()

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

Definition at line 220 of file LV2Effect.cpp.

221 : wxDialogWrapper(parent, wxID_ANY, XO("LV2 Effect Settings"))
222 {
223  mEffect = effect;
224 
225  mEffect->mHost->GetSharedConfig(wxT("Settings"), wxT("BufferSize"), mBufferSize, 8192);
226  mEffect->mHost->GetSharedConfig(wxT("Settings"), wxT("UseLatency"), mUseLatency, true);
227  mEffect->mHost->GetSharedConfig(wxT("Settings"), wxT("UseGUI"), mUseGUI, true);
228 
229  ShuttleGui S(this, eIsCreating);
231 }

References eIsCreating.

◆ ~LV2EffectSettingsDialog()

LV2EffectSettingsDialog::~LV2EffectSettingsDialog ( )
virtual

Definition at line 233 of file LV2Effect.cpp.

234 {
235 }

Member Function Documentation

◆ OnOk()

void LV2EffectSettingsDialog::OnOk ( wxCommandEvent &  evt)

Definition at line 318 of file LV2Effect.cpp.

319 {
320  if (!Validate())
321  {
322  return;
323  }
324 
327 
328  mEffect->mHost->SetSharedConfig(wxT("Settings"), wxT("BufferSize"), mBufferSize);
329  mEffect->mHost->SetSharedConfig(wxT("Settings"), wxT("UseLatency"), mUseLatency);
330  mEffect->mHost->SetSharedConfig(wxT("Settings"), wxT("UseGUI"), mUseGUI);
331 
332  EndModal(wxID_OK);
333 }

References eIsGettingFromDialog, mBufferSize, mEffect, LV2Effect::mHost, mUseGUI, mUseLatency, PopulateOrExchange(), and ConfigClientInterface::SetSharedConfig().

Here is the call graph for this function:

◆ PopulateOrExchange()

void LV2EffectSettingsDialog::PopulateOrExchange ( ShuttleGui S)

Definition at line 237 of file LV2Effect.cpp.

238 {
239  S.SetBorder(5);
240  S.StartHorizontalLay(wxEXPAND, 1);
241  {
242  S.StartVerticalLay(false);
243  {
244  // This really shouldn't be required for LV2 plugins because they have the ability
245  // to specify their exact requirements in the TTL file and/or to check the host
246  // supplied min/max values. However, I've run across one (Harrison Consoles XT-EQ)
247  // that crashed on sizes greater than 8192.
248  S.StartStatic(XO("Buffer Size"));
249  {
250  IntegerValidator<int> vld(&mBufferSize);
251  vld.SetRange(8, DEFAULT_BLOCKSIZE);
252 
253  S.AddVariableText( XO(
254 "The buffer size controls the number of samples sent to the effect "
255 "on each iteration. Smaller values will cause slower processing and "
256 "some effects require 8192 samples or less to work properly. However "
257 "most effects can accept large buffers and using them will greatly "
258 "reduce processing time."),
259  false, 0, 650);
260 
261  S.StartHorizontalLay(wxALIGN_LEFT);
262  {
263  wxTextCtrl *t;
264  t = S.TieNumericTextBox(
265  XXO("&Buffer Size (8 to %d) samples:")
267  mBufferSize,
268  12);
269  t->SetMinSize(wxSize(100, -1));
270  t->SetValidator(vld);
271  }
272  S.EndHorizontalLay();
273  }
274  S.EndStatic();
275 
276  S.StartStatic(XO("Latency Compensation"));
277  {
278  S.AddVariableText( XO(
279 "As part of their processing, some LV2 effects must delay returning "
280 "audio to Audacity. When not compensating for this delay, you will "
281 "notice that small silences have been inserted into the audio. "
282 "Enabling this setting will provide that compensation, but it may "
283 "not work for all LV2 effects."),
284  false, 0, 650);
285 
286  S.StartHorizontalLay(wxALIGN_LEFT);
287  {
288  S.TieCheckBox(XXO("Enable &compensation"),
289  mUseLatency);
290  }
291  S.EndHorizontalLay();
292  }
293  S.EndStatic();
294 
295  S.StartStatic(XO("Graphical Mode"));
296  {
297  S.AddVariableText( XO(
298 "LV2 effects can have a graphical interface for setting parameter values."
299 " A basic text-only method is also available. "
300 " Reopen the effect for this to take effect."),
301  false, 0, 650);
302  S.TieCheckBox(XXO("Enable &graphical interface"),
303  mUseGUI);
304  }
305  S.EndStatic();
306  }
307  S.EndVerticalLay();
308  }
309  S.EndHorizontalLay();
310 
311  S.AddStandardButtons();
312 
313  Layout();
314  Fit();
315  Center();
316 }

References ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddVariableText(), DEFAULT_BLOCKSIZE, ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndVerticalLay(), mBufferSize, mUseGUI, mUseLatency, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartVerticalLay(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieNumericTextBox(), XO, and XXO.

Referenced by OnOk().

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

Member Data Documentation

◆ mBufferSize

int LV2EffectSettingsDialog::mBufferSize
private

Definition at line 209 of file LV2Effect.cpp.

Referenced by OnOk(), and PopulateOrExchange().

◆ mEffect

LV2Effect* LV2EffectSettingsDialog::mEffect
private

Definition at line 208 of file LV2Effect.cpp.

Referenced by OnOk().

◆ mUseGUI

bool LV2EffectSettingsDialog::mUseGUI
private

Definition at line 211 of file LV2Effect.cpp.

Referenced by OnOk(), and PopulateOrExchange().

◆ mUseLatency

bool LV2EffectSettingsDialog::mUseLatency
private

Definition at line 210 of file LV2Effect.cpp.

Referenced by OnOk(), and PopulateOrExchange().


The documentation for this class was generated from the following file:
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
eIsGettingFromDialog
@ eIsGettingFromDialog
Definition: ShuttleGui.h:39
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
Format
Abstract base class used in importing a file.
DEFAULT_BLOCKSIZE
#define DEFAULT_BLOCKSIZE
Definition: LV2Effect.cpp:76
XO
#define XO(s)
Definition: Internat.h:31
LV2EffectSettingsDialog::mUseGUI
bool mUseGUI
Definition: LV2Effect.cpp:211
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
LV2Effect::mHost
EffectHostInterface * mHost
Definition: LV2Effect.h:451
LV2EffectSettingsDialog::mEffect
LV2Effect * mEffect
Definition: LV2Effect.cpp:208
ShuttleGuiBase::TieNumericTextBox
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1673
LV2EffectSettingsDialog::mUseLatency
bool mUseLatency
Definition: LV2Effect.cpp:210
ConfigClientInterface::GetSharedConfig
virtual bool GetSharedConfig(const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval)=0
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
LV2EffectSettingsDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: LV2Effect.cpp:237
ConfigClientInterface::SetSharedConfig
virtual bool SetSharedConfig(const RegistryPath &group, const RegistryPath &key, const wxString &value)=0
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
LV2EffectSettingsDialog::mBufferSize
int mBufferSize
Definition: LV2Effect.cpp:209
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:463
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631