| 346 | } |
| 347 | |
| 348 | auto EffectMenu() |
| 349 | { |
| 350 | // All of this is a bit hacky until we can get more things connected into |
| 351 | // the plugin manager...sorry! :-( |
| 352 | static auto menu = std::shared_ptr { Menu( |
| 353 | wxT("Effect"), XXO("Effe&ct"), |
| 354 | Section( |
| 355 | "Manage", Command( |
| 356 | wxT("ManageEffects"), XXO("Plugin Manager"), |
| 357 | OnManageEffects, AudioIONotBusyFlag())), |
| 358 | |
| 359 | Section( |
| 360 | "RealtimeEffects", |
| 361 | Command( |
| 362 | wxT("AddRealtimeEffects"), XXO("Add Realtime Effects"), |
| 363 | OnAddRealtimeEffects, HasTrackFocusFlag(), wxT("E")) |
| 364 | #if defined(__WXMSW__) || defined(__WXMAC__) |
| 365 | , Command( |
| 366 | wxT("GetMoreEffects"), XXO("Get more effects..."), |
| 367 | [](const CommandContext&) { |
| 368 | GetEffectsHelper::Get().GetEffects(); |
| 369 | }, |
| 370 | AlwaysEnabledFlag) |
| 371 | #endif |
| 372 | ), |
| 373 | Section( |
| 374 | "RepeatLast", |
| 375 | // Delayed evaluation: |
| 376 | [](AudacityProject& project) { |
| 377 | const auto &lastEffect = CommandManager::Get(project).mLastEffect; |
| 378 | TranslatableString buildMenuLabel; |
| 379 | if (!lastEffect.empty()) |
| 380 | buildMenuLabel = |
| 381 | XO("Repeat %s") |
| 382 | .Format(PluginManager::Get().GetName(lastEffect)); |
| 383 | else |
| 384 | buildMenuLabel = XO("Repeat Last Effect"); |
| 385 | |
| 386 | return Command( wxT("RepeatLastEffect"), buildMenuLabel, |
| 387 | OnRepeatLastEffect, |
| 388 | AudioIONotBusyFlag() | TimeSelectedFlag() | |
| 389 | WaveTracksSelectedFlag() | HasLastEffectFlag(), |
| 390 | wxT("Ctrl+R") ); |
| 391 | }), |
| 392 | |
| 393 | Section( |
| 394 | "Effects", |
| 395 | // Delayed evaluation: |
| 396 | [](AudacityProject&) { |
| 397 | auto result = Items(""); |
| 398 | MenuHelper::PopulateEffectsMenu( |
| 399 | *result, |
| 400 | EffectTypeProcess, |
| 401 | AudioIONotBusyFlag() | TimeSelectedFlag() | WaveTracksSelectedFlag(), |
| 402 | EffectsGroupBy.Read(), |
| 403 | &OnEffect); |
| 404 | return result; |
| 405 | })) |
no test coverage detected