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 (const 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

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

Detailed Description

Definition at line 53 of file LV2Preferences.h.

Constructor & Destructor Documentation

◆ Dialog()

LV2Preferences::Dialog::Dialog ( const EffectDefinitionInterface effect)
explicit

Definition at line 92 of file LV2Preferences.cpp.

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

References XO().

Here is the call graph for this function:

◆ ~Dialog()

LV2Preferences::Dialog::~Dialog ( )
virtual

Definition at line 104 of file LV2Preferences.cpp.

105{
106}

Member Function Documentation

◆ OnOk()

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

Definition at line 189 of file LV2Preferences.cpp.

190{
191 if (!Validate())
192 {
193 return;
194 }
195
198
199 using namespace LV2Preferences;
203
204 EndModal(wxID_OK);
205}
@ eIsGettingFromDialog
Definition: ShuttleGui.h:38
bool SetBufferSize(const EffectDefinitionInterface &effect, int bufferSize)
bool SetUseLatency(const EffectDefinitionInterface &effect, bool useLatency)
bool SetUseGUI(const 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 108 of file LV2Preferences.cpp.

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

const 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: