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 "ConfigInterface.h"
17#include "ShuttleGui.h"
18
20//
21// AudioUnitEffectOptionsDialog
22//
24
28
30 const EffectDefinitionInterface &effect
31) : wxDialogWrapper{ nullptr, wxID_ANY, XO("Audio Unit Effect Options") }
32 , mEffect{ effect }
33{
34 // Consult preferences
35 // Decide mUseLatency, which affects GetLatency(), which is actually used
36 // so far only in destructive effect processing
38 mUseLatency, true);
39
40 wxString uiType;
42 uiType, FullValue.MSGID().GET() /* Config stores un-localized string */);
43 // Get the localization of the string for display to the user
44 mUITypeString = TranslatableString{ uiType, {} };
45
47 PopulateOrExchange(S);
48}
49
51{
52}
53
55{
56 S.SetBorder(5);
57 S.StartHorizontalLay(wxEXPAND, 1);
58 {
59 S.StartVerticalLay(false);
60 {
61 S.StartStatic(XO("Latency Compensation"));
62 {
63 S.AddVariableText(XO(
64"As part of their processing, some Audio Unit effects must delay returning "
65"audio to Audacity. When not compensating for this delay, you will "
66"notice that small silences have been inserted into the audio. "
67"Enabling this option will provide that compensation, but it may "
68"not work for all Audio Unit effects."),
69 false, 0, 650);
70
71 S.StartHorizontalLay(wxALIGN_LEFT);
72 {
73 S.TieCheckBox(XXO("Enable &compensation"),
75 }
76 S.EndHorizontalLay();
77 }
78 S.EndStatic();
79
80 S.StartStatic(XO("User Interface"));
81 {
82 S.AddVariableText(XO(
83"Select \"Full\" to use the graphical interface if supplied by the Audio Unit."
84" Select \"Generic\" to use the system supplied generic interface."
85#if defined(HAVE_AUDIOUNIT_BASIC_SUPPORT)
86" Select \"Basic\" for a basic text-only interface."
87#endif
88" Reopen the effect for this to take effect."),
89 false, 0, 650);
90
91 S.StartHorizontalLay(wxALIGN_LEFT);
92 {
93 S.TieChoice(XXO("Select &interface"),
95 {
98#if defined(HAVE_AUDIOUNIT_BASIC_SUPPORT)
100#endif
101 });
102 }
103 S.EndHorizontalLay();
104 }
105 S.EndStatic();
106 }
107 S.EndVerticalLay();
108 }
109 S.EndHorizontalLay();
110 S.AddStandardButtons();
111 Layout();
112 Fit();
113 Center();
114}
115
116void AudioUnitEffectOptionsDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
117{
118 if (!Validate())
119 return;
120
121 // This re-visits the controls, not to create them but to transfer values out
124
125 // un-translate the type
126 auto uiType = mUITypeString.MSGID().GET();
127
128 // Save changed values to the config file
132
133 EndModal(wxID_OK);
134}
135#endif
static const auto BasicValue
static const auto FullValue
constexpr auto OptionsKey
constexpr auto UseLatencyKey
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:625
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)