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

Method ApplyCommandInBatchMode

src/BatchCommands.cpp:619–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619bool MacroCommands::ApplyCommandInBatchMode(
620 const TranslatableString &friendlyCommand,
621 const CommandID & command, const wxString &params,
622 CommandContext const * pContext)
623{
624 assert(!pContext || &pContext->project == &GetProject());
625 AudacityProject *project = &mProject;
626 auto &settings = ProjectSettings::Get( *project );
627 // Recalc flags and enable items that may have become enabled.
628 CommandManager::Get(*project).UpdateMenus(false);
629 // enter batch mode...
630 project->mBatchMode++;
631 auto cleanup = finally( [&] {
632 // exit batch mode...
633 project->mBatchMode--;
634 } );
635
636 return ApplyCommand( friendlyCommand, command, params, pContext );
637}
638
639static int MacroReentryCount = 0;
640// ApplyMacro returns true on success, false otherwise.

Callers 1

ApplyMethod · 0.80

Calls 3

GetFunction · 0.85
finallyFunction · 0.85
UpdateMenusMethod · 0.45

Tested by

no test coverage detected