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

Function GenerateMenu

src/menus/PluginMenus.cpp:271–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269 }; return flag; }
270
271auto GenerateMenu()
272{
273 // All of this is a bit hacky until we can get more things connected into
274 // the plugin manager...sorry! :-(
275 static auto menu = std::shared_ptr{
276 Menu( wxT("Generate"), XXO("&Generate"),
277 Section( "Manage",
278 Command( wxT("ManageGenerators"), XXO("Plugin Manager"),
279 OnManageGenerators, AudioIONotBusyFlag() )
280 ),
281
282 Section("RepeatLast",
283 // Delayed evaluation:
284 [](AudacityProject &project)
285 {
286 const auto &lastGenerator =
287 CommandManager::Get(project).mLastGenerator;
288 TranslatableString buildMenuLabel;
289 if (!lastGenerator.empty())
290 buildMenuLabel =
291 XO("Repeat %s")
292 .Format(PluginManager::Get().GetName(lastGenerator));
293 else
294 buildMenuLabel = XO("Repeat Last Generator");
295
296 return Command(wxT("RepeatLastGenerator"), buildMenuLabel,
297 OnRepeatLastGenerator,
298 AudioIONotBusyFlag() |
299 HasLastGeneratorFlag(),
300 Options{}.IsGlobal());
301 }
302 ),
303
304 Section( "Generators",
305 // Delayed evaluation:
306 [](AudacityProject &) {
307 auto result = Items("");
308 MenuHelper::PopulateEffectsMenu(
309 *result,
310 EffectTypeGenerate,
311 AudioIONotBusyFlag(),
312 EffectsGroupBy.Read(),
313 &OnEffect);
314 return result;
315 }
316 )
317 ) };
318 return menu;
319}
320
321static const ReservedCommandFlag
322&IsRealtimeNotActiveFlag() { static ReservedCommandFlag flag{

Callers 1

PluginMenus.cppFile · 0.85

Calls 5

SectionClass · 0.85
GetFunction · 0.85
emptyMethod · 0.45
GetNameMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected