mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 00:19:27 +02:00
Limit message output while macro tracing is enabled
This commit is contained in:
parent
7b8a977f15
commit
b0367049b9
@ -15,6 +15,7 @@ processing. See also MacrosWindow and ApplyMacroDialog.
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#define wxLOG_COMPONENT "MacroCommands"
|
||||
|
||||
#include "Audacity.h" // for USE_* macros
|
||||
#include "BatchCommands.h"
|
||||
@ -734,9 +735,17 @@ bool MacroCommands::ApplyMacro(
|
||||
|
||||
mAbort = false;
|
||||
|
||||
// Is tracing enabled?
|
||||
bool trace;
|
||||
gPrefs->Read(wxT("/EnableMacroTracing"), &trace, false);
|
||||
|
||||
// If so, then block most other messages while running the macro
|
||||
wxLogLevel prevLevel = wxLog::GetComponentLevel("");
|
||||
if (trace) {
|
||||
wxLog::SetComponentLevel("", wxLOG_FatalError);
|
||||
wxLog::SetComponentLevel(wxLOG_COMPONENT, wxLOG_Info);
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
for (; i < mCommandMacro.size(); i++) {
|
||||
const auto &command = mCommandMacro[i];
|
||||
@ -768,6 +777,11 @@ bool MacroCommands::ApplyMacro(
|
||||
break;
|
||||
}
|
||||
|
||||
// Restore message level
|
||||
if (trace) {
|
||||
wxLog::SetComponentLevel("", prevLevel);
|
||||
}
|
||||
|
||||
res = (i == mCommandMacro.size());
|
||||
if (!res)
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user