| 455 | } |
| 456 | |
| 457 | wxString MacroCommands::PromptForParamsFor( |
| 458 | const CommandID& command, const wxString& params, AudacityProject& project) |
| 459 | { |
| 460 | const PluginID& ID = PluginManager::Get().GetByCommandIdentifier(command); |
| 461 | if (ID.empty()) |
| 462 | return wxEmptyString; // effect not found |
| 463 | |
| 464 | wxString res = params; |
| 465 | auto cleanup = EffectAndCommandPluginManager::Get().SetBatchProcessing(ID); |
| 466 | if (EffectAndCommandPluginManager::Get().SetEffectParameters(ID, params)) |
| 467 | { |
| 468 | auto dialogInvoker = |
| 469 | [&]( |
| 470 | Effect& effect, EffectSettings& settings, |
| 471 | std::shared_ptr<EffectInstance>& pInstance) -> bool { |
| 472 | const auto pServices = dynamic_cast<EffectUIServices*>(&effect); |
| 473 | return pServices && pServices->ShowHostInterface(effect, |
| 474 | GetProjectFrame(project), EffectUI::DialogFactory, |
| 475 | pInstance, |
| 476 | *std::make_shared<SimpleEffectSettingsAccess>(settings), |
| 477 | effect.IsBatchProcessing() ) != 0; |
| 478 | }; |
| 479 | if (EffectAndCommandPluginManager::Get().PromptUser( |
| 480 | ID, project, std::move(dialogInvoker))) |
| 481 | res = EffectAndCommandPluginManager::Get().GetEffectParameters(ID); |
| 482 | } |
| 483 | return res; |
| 484 | } |
| 485 | |
| 486 | wxString MacroCommands::PromptForPresetFor(const CommandID & command, const wxString & params, wxWindow *parent) |
| 487 | { |
nothing calls this directly
no test coverage detected