Audacity 3.2.0
AudioUnitEffectOptionsDialog.cpp
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file AudioUnitEffectOptionsDialog.h
6
7 Dominic Mazzoni
8 Leland Lucius
9
10 Paul Licameli split from AudioUnitEffect.cpp
11
12**********************************************************************/
13
14#if USE_AUDIO_UNITS
16#include "AudioUnitEffectBase.h"
17#include "ConfigInterface.h"
18#include "ShuttleGui.h"
19
21//
22// AudioUnitEffectOptionsDialog
23//
25
29
31 const EffectDefinitionInterface &effect
32) : wxDialogWrapper{ nullptr, wxID_ANY, XO("Audio Unit Effect Options") }
33 , mEffect{ effect }
34{
35 // Consult preferences
36 // Decide mUseLatency, which affects GetLatency(), which is actually used
37 // so far only in destructive effect processing
39 mUseLatency, true);
40
41 wxString uiType;
43 uiType, FullValue.MSGID().GET() /* Config stores un-localized string */);
44 // Get the localization of the string for display to the user
45 mUITypeString = TranslatableString{ uiType, {} };
46
48 PopulateOrExchange(S);
49}
50
52{
53}
54
56{
57 S.SetBorder(5);
58 S.StartHorizontalLay(wxEXPAND, 1);
59 {
60 S.StartVerticalLay(false);
61 {
62 S.StartStatic(XO("Latency Compensation"));
63 {
64 S.AddVariableText(XO(
65"As part of their processing, some Audio Unit effects must delay returning "
66"audio to Audacity. When not compensating for this delay, you will "
67"notice that small silences have been inserted into the audio. "
68"Enabling this option will provide that compensation, but it may "
69"not work for all Audio Unit effects."),
70 false, 0, 650);
71
72 S.StartHorizontalLay(wxALIGN_LEFT);
73 {
74 S.TieCheckBox(XXO("Enable &compensation"),
76 }
77 S.EndHorizontalLay();
78 }
79 S.EndStatic();
80
81 S.StartStatic(XO("User Interface"));
82 {
83 S.AddVariableText(XO(
84"Select \"Full\" to use the graphical interface if supplied by the Audio Unit."
85" Select \"Generic\" to use the system supplied generic interface."
86#if defined(HAVE_AUDIOUNIT_BASIC_SUPPORT)
87" Select \"Basic\" for a basic text-only interface."
88#endif
89" Reopen the effect for this to take effect."),
90 false, 0, 650);
91
92 S.StartHorizontalLay(wxALIGN_LEFT);
93 {
94 S.TieChoice(XXO("Select &interface"),
96 {
99#if defined(HAVE_AUDIOUNIT_BASIC_SUPPORT)
101#endif
102 });
103 }
104 S.EndHorizontalLay();
105 }
106 S.EndStatic();
107 }
108 S.EndVerticalLay();
109 }
110 S.EndHorizontalLay();
111 S.AddStandardButtons();
112 Layout();
113 Fit();
114 Center();
115}
116
117void AudioUnitEffectOptionsDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
118{
119 if (!Validate())
120 return;
121
122 // This re-visits the controls, not to create them but to transfer values out
125
126 // un-translate the type
127 auto uiType = mUITypeString.MSGID().GET();
128
129 // Save changed values to the config file
133
134 EndModal(wxID_OK);
135}
136#endif
constexpr auto OptionsKey
constexpr auto UseLatencyKey
static const auto BasicValue
static const auto FullValue
static const auto GenericValue
constexpr auto UITypeKey
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
const EffectDefinitionInterface & mEffect
EffectDefinitionInterface is a ComponentInterface that adds some basic read-only information about ef...
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Holds a msgid for the translation catalog; may also bind format arguments.
Identifier MSGID() const
MSGID is the English lookup key in the catalog, not necessarily for user's eyes if locale is some oth...
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)