| 617 | } |
| 618 | |
| 619 | bool MacroCommands::ApplyCommandInBatchMode( |
| 620 | const TranslatableString &friendlyCommand, |
| 621 | const CommandID & command, const wxString ¶ms, |
| 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 | |
| 639 | static int MacroReentryCount = 0; |
| 640 | // ApplyMacro returns true on success, false otherwise. |
no test coverage detected