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

Method PromptForParamsFor

src/BatchCommands.cpp:457–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457wxString 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
486wxString MacroCommands::PromptForPresetFor(const CommandID & command, const wxString & params, wxWindow *parent)
487{

Callers

nothing calls this directly

Calls 9

GetFunction · 0.85
moveFunction · 0.85
SetEffectParametersMethod · 0.80
IsBatchProcessingMethod · 0.80
GetEffectParametersMethod · 0.80
emptyMethod · 0.45
SetBatchProcessingMethod · 0.45
ShowHostInterfaceMethod · 0.45
PromptUserMethod · 0.45

Tested by

no test coverage detected