| 269 | }; return flag; } |
| 270 | |
| 271 | auto 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 | |
| 321 | static const ReservedCommandFlag |
| 322 | &IsRealtimeNotActiveFlag() { static ReservedCommandFlag flag{ |