MCPcopy Create free account
hub / github.com/audacity/audacity / PopulateUI

Method PopulateUI

src/effects/lv2/LV2Effect.cpp:71–114  ·  view source on GitHub ↗

May come here before destructive processing Or maybe not (if you "Repeat Last Effect")

Source from the content-addressed store, hash-verified

69// May come here before destructive processing
70// Or maybe not (if you "Repeat Last Effect")
71std::unique_ptr<EffectEditor> LV2Effect::PopulateUI(const EffectPlugin &,
72 ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access,
73 const EffectOutputs *pOutputs) const
74{
75 auto &settings = access.Get();
76 auto parent = S.GetParent();
77
78 auto &myInstance = dynamic_cast<LV2Instance &>(instance);
79 auto pWrapper =
80 // Output port connection isn't needed for fancy UI wrapper. Its
81 // features are needed to make the suil_instance
82 myInstance.MakeWrapper(settings, mProjectRate, nullptr);
83 if (!pWrapper) {
84 AudacityMessageBox( XO("Couldn't instantiate effect") );
85 return nullptr;
86 }
87
88 // Determine if the GUI editor is supposed to be used or not
89 bool useGUI = false;
90 LV2Preferences::GetUseGUI(*this, useGUI);
91
92 // Until I figure out where to put the "Duration" control in the
93 // graphical editor, force usage of plain editor.
94 if (GetType() == EffectTypeGenerate)
95 useGUI = false;
96
97 auto result = std::make_unique<LV2Editor>(*this, GetType(), mPlug,
98 dynamic_cast<LV2Instance&>(instance),
99 access, pOutputs, mProjectRate, mFeatures, mPorts, parent, useGUI);
100
101#ifdef __WXMAC__
102 const auto vendor = GetVendor().Msgid().Translation();
103 const bool doX42Hack = vendor == "Robin Gareus";
104 result->mUI.mJustLeakMemory = doX42Hack;
105#endif
106
107 if (result->mUseGUI)
108 result->mUseGUI = result->BuildFancy(move(pWrapper), settings);
109 if (!result->mUseGUI && !result->BuildPlain(access))
110 return nullptr;
111 result->UpdateUI();
112
113 return result;
114}
115
116std::unique_ptr<EffectEditor> LV2Effect::MakeEditor(
117 ShuttleGui &, EffectInstance &, EffectSettingsAccess &,

Callers 1

MakeEditorMethod · 0.45

Calls 9

AudacityMessageBoxFunction · 0.85
moveFunction · 0.85
MakeWrapperMethod · 0.80
TranslationMethod · 0.80
BuildFancyMethod · 0.80
GetMethod · 0.45
GetParentMethod · 0.45
BuildPlainMethod · 0.45
UpdateUIMethod · 0.45

Tested by

no test coverage detected