Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
LV2Preferences::Dialog Class Referencefinal

#include <LV2Preferences.h>

Inheritance diagram for LV2Preferences::Dialog:
[legend]
Collaboration diagram for LV2Preferences::Dialog:
[legend]

Public Member Functions

 Dialog (wxWindow *parent, EffectDefinitionInterface &effect)
 
virtual ~Dialog ()
 
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 53 of file LV2Preferences.h.

Constructor & Destructor Documentation

◆ Dialog()

LV2Preferences::Dialog::Dialog ( wxWindow *  parent,
EffectDefinitionInterface effect 
)

Definition at line 92 of file LV2Preferences.cpp.

94: wxDialogWrapper(parent, wxID_ANY, XO("LV2 Effect Settings"))
95, mEffect{ effect }
96{
97 using namespace LV2Preferences;
101 ShuttleGui S(this, eIsCreating);
103}
XO("Cut/Copy/Paste")
@ eIsCreating
Definition: ShuttleGui.h:39
#define S(N)
Definition: ToChars.cpp:64
EffectDefinitionInterface & mEffect
void PopulateOrExchange(ShuttleGui &S)
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628
bool GetUseGUI(const EffectDefinitionInterface &effect, bool &useGUI)
bool GetUseLatency(const EffectDefinitionInterface &effect, bool &useLatency)
bool GetBufferSize(const EffectDefinitionInterface &effect, int &bufferSize)

◆ ~Dialog()

LV2Preferences::Dialog::~Dialog ( )
virtual

Definition at line 105 of file LV2Preferences.cpp.

106{
107}

Member Function Documentation

◆ OnOk()

void LV2Preferences::Dialog::OnOk ( wxCommandEvent &  evt)

Definition at line 190 of file LV2Preferences.cpp.

191{
192 if (!Validate())
193 {
194 return;
195 }
196
199
200 using namespace LV2Preferences;
204
205 EndModal(wxID_OK);
206}
@ eIsGettingFromDialog
Definition: ShuttleGui.h:40
bool SetUseLatency(EffectDefinitionInterface &effect, bool useLatency)
bool SetBufferSize(EffectDefinitionInterface &effect, int bufferSize)
bool SetUseGUI(EffectDefinitionInterface &effect, bool useGUI)

References eIsGettingFromDialog, S, LV2Preferences::SetBufferSize(), LV2Preferences::SetUseGUI(), and LV2Preferences::SetUseLatency().

Here is the call graph for this function:

◆ PopulateOrExchange()

void LV2Preferences::Dialog::PopulateOrExchange ( ShuttleGui S)

Definition at line 109 of file LV2Preferences.cpp.

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

References LV2Preferences::DEFAULT_BLOCKSIZE, S, XO(), and XXO().

Here is the call graph for this function:

Member Data Documentation

◆ mBufferSize

int LV2Preferences::Dialog::mBufferSize {}
private

Definition at line 65 of file LV2Preferences.h.

◆ mEffect

EffectDefinitionInterface& LV2Preferences::Dialog::mEffect
private

Definition at line 64 of file LV2Preferences.h.

◆ mUseGUI

bool LV2Preferences::Dialog::mUseGUI {}
private

Definition at line 67 of file LV2Preferences.h.

◆ mUseLatency

bool LV2Preferences::Dialog::mUseLatency {}
private

Definition at line 66 of file LV2Preferences.h.


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