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

Method PickEffect

src/RealtimeEffectPanel.cpp:131–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129 public:
130
131 static std::optional<wxString> PickEffect(AudacityProject& project, wxWindow* parent, const wxString& selectedEffectID)
132 {
133 wxMenu menu;
134 if(!selectedEffectID.empty())
135 {
136 //no need to handle language change since menu creates its own event loop
137 menu.Append(wxID_REMOVE, _("No Effect"));
138 menu.AppendSeparator();
139 }
140
141 RealtimeEffectsMenuVisitor visitor { menu };
142
143 Get().Populate(project, visitor);
144
145 int commandId = wxID_NONE;
146
147#if defined(__WXMSW__) || defined(__WXMAC__)
148 menu.AppendSeparator();
149 menu.Append(wxID_MORE, _("Get more effects..."));
150#endif
151 menu.Bind(wxEVT_MENU, [&](wxCommandEvent evt) { commandId = evt.GetId(); });
152
153 if(parent->PopupMenu(&menu, parent->GetClientRect().GetLeftBottom()) && commandId != wxID_NONE)
154 {
155 if(commandId == wxID_REMOVE)
156 return wxString {};
157 if(commandId == wxID_MORE)
158 GetEffectsHelper::Get().GetEffects();
159 else
160 return visitor.GetPluginID(commandId).GET();
161 }
162
163 return {};
164 }
165
166 private:
167

Callers

nothing calls this directly

Calls 8

GetFunction · 0.85
BindMethod · 0.80
GetIdMethod · 0.80
GetEffectsMethod · 0.80
GetPluginIDMethod · 0.80
emptyMethod · 0.45
AppendMethod · 0.45
PopulateMethod · 0.45

Tested by

no test coverage detected