| 421 | } |
| 422 | |
| 423 | auto AnalyzeMenu() |
| 424 | { |
| 425 | // All of this is a bit hacky until we can get more things connected into |
| 426 | // the plugin manager...sorry! :-( |
| 427 | static auto menu = std::shared_ptr{ |
| 428 | Menu( wxT("Analyze"), XXO("&Analyze"), |
| 429 | Section( "Manage", |
| 430 | Command( wxT("ManageAnalyzers"), XXO("Plugin Manager"), |
| 431 | OnManageAnalyzers, AudioIONotBusyFlag() ) |
| 432 | ), |
| 433 | |
| 434 | Section("RepeatLast", |
| 435 | // Delayed evaluation: |
| 436 | [](AudacityProject &project) |
| 437 | { |
| 438 | const auto &lastAnalyzer = |
| 439 | CommandManager::Get(project).mLastAnalyzer; |
| 440 | TranslatableString buildMenuLabel; |
| 441 | if (!lastAnalyzer.empty()) |
| 442 | buildMenuLabel = |
| 443 | XO("Repeat %s") |
| 444 | .Format(PluginManager::Get().GetName(lastAnalyzer)); |
| 445 | else |
| 446 | buildMenuLabel = XO("Repeat Last Analyzer"); |
| 447 | |
| 448 | return Command(wxT("RepeatLastAnalyzer"), buildMenuLabel, |
| 449 | OnRepeatLastAnalyzer, |
| 450 | AudioIONotBusyFlag() | TimeSelectedFlag() | |
| 451 | WaveTracksSelectedFlag() | HasLastAnalyzerFlag(), |
| 452 | Options{}.IsGlobal()); |
| 453 | } |
| 454 | ), |
| 455 | |
| 456 | Section( "Analyzers", |
| 457 | Items( "Windows" ), |
| 458 | |
| 459 | // Delayed evaluation: |
| 460 | [](AudacityProject &) { |
| 461 | auto result = Items(""); |
| 462 | MenuHelper::PopulateEffectsMenu( |
| 463 | *result, |
| 464 | EffectTypeAnalyze, |
| 465 | AudioIONotBusyFlag() | TimeSelectedFlag() | WaveTracksSelectedFlag(), |
| 466 | EffectsGroupBy.Read(), |
| 467 | &OnEffect); |
| 468 | return result; |
| 469 | } |
| 470 | ) |
| 471 | ) }; |
| 472 | return menu; |
| 473 | } |
| 474 | |
| 475 | AttachedItem sAttachment3{ Indirect(AnalyzeMenu()) }; |
| 476 | |