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