Audacity 3.2.0
VSTEffectOptionsDialog.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 VSTEffectOptionsDialog.cpp
6
7 Dominic Mazzoni
8
9 Paul Licameli split from VSTEffect.cpp
10
11
12*//********************************************************************/
13
15
16#include "ShuttleGui.h"
17#include "../../widgets/valnum.h"
18
19#include "ConfigInterface.h"
20
24
26 const EffectDefinitionInterface &effect
27) : wxDialogWrapper{ nullptr, wxID_ANY, XO("VST Effect Options") }
28 , mEffect{ effect }
29{
30 GetConfig(mEffect, PluginSettings::Shared, wxT("Options"),
31 wxT("BufferSize"), mBufferSize, 8192);
32 GetConfig(mEffect, PluginSettings::Shared, wxT("Options"),
33 wxT("UseLatency"), mUseLatency, true);
34 GetConfig(mEffect, PluginSettings::Shared, wxT("Options"),
35 wxT("UseGUI"), mUseGUI, true);
36
38 PopulateOrExchange(S);
39}
40
42{
43}
44
46{
47 S.SetBorder(5);
48 S.StartHorizontalLay(wxEXPAND, 1);
49 {
50 S.StartVerticalLay(false);
51 {
52 S.StartStatic(XO("Buffer Size"));
53 {
54 S.AddVariableText( XO(
55"The buffer size controls the number of samples sent to the effect "
56"on each iteration. Smaller values will cause slower processing and "
57"some effects require 8192 samples or less to work properly. However "
58"most effects can accept large buffers and using them will greatly "
59"reduce processing time."),
60 false, 0, 650);
61
62 S.StartHorizontalLay(wxALIGN_LEFT);
63 {
64 wxTextCtrl *t;
65 t = S.Validator<IntegerValidator<int>>(
66 &mBufferSize, NumValidatorStyle::DEFAULT, 8, 1048576 * 1)
67 .MinSize( { 100, -1 } )
68 .TieNumericTextBox(XXO("&Buffer Size (8 to 1048576 samples):"),
70 12);
71 }
72 S.EndHorizontalLay();
73 }
74 S.EndStatic();
75
76 S.StartStatic(XO("Latency Compensation"));
77 {
78 S.AddVariableText( XO(
79"As part of their processing, some VST effects must delay returning "
80"audio to Audacity. When not compensating for this delay, you will "
81"notice that small silences have been inserted into the audio. "
82"Enabling this option will provide that compensation, but it may "
83"not work for all VST effects."),
84 false, 0, 650);
85
86 S.StartHorizontalLay(wxALIGN_LEFT);
87 {
88 S.TieCheckBox(XXO("Enable &compensation"),
90 }
91 S.EndHorizontalLay();
92 }
93 S.EndStatic();
94
95 S.StartStatic(XO("Graphical Mode"));
96 {
97 S.AddVariableText( XO(
98"Most VST effects have a graphical interface for setting parameter values."
99" A basic text-only method is also available. "
100" Reopen the effect for this to take effect."),
101 false, 0, 650);
102 S.TieCheckBox(XXO("Enable &graphical interface"),
103 mUseGUI);
104 }
105 S.EndStatic();
106 }
107 S.EndVerticalLay();
108 }
109 S.EndHorizontalLay();
110
111 S.AddStandardButtons();
112
113 Layout();
114 Fit();
115 Center();
116}
117
118void VSTEffectOptionsDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
119{
120 if (!Validate())
121 {
122 return;
123 }
124
127
129 wxT("BufferSize"), mBufferSize);
131 wxT("UseLatency"), mUseLatency);
133 wxT("UseGUI"), mUseGUI);
134
135 EndModal(wxID_OK);
136}
wxT("CloseDown"))
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...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
void OnOk(wxCommandEvent &evt)
const EffectDefinitionInterface & mEffect
void PopulateOrExchange(ShuttleGui &S)
bool SetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)
bool GetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)