mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-03 01:19:24 +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 "Audacity.h" // for USE_* macros
|
||||||
#include "BatchCommands.h"
|
#include "BatchCommands.h"
|
||||||
@ -734,9 +735,17 @@ bool MacroCommands::ApplyMacro(
|
|||||||
|
|
||||||
mAbort = false;
|
mAbort = false;
|
||||||
|
|
||||||
|
// Is tracing enabled?
|
||||||
bool trace;
|
bool trace;
|
||||||
gPrefs->Read(wxT("/EnableMacroTracing"), &trace, false);
|
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;
|
size_t i = 0;
|
||||||
for (; i < mCommandMacro.size(); i++) {
|
for (; i < mCommandMacro.size(); i++) {
|
||||||
const auto &command = mCommandMacro[i];
|
const auto &command = mCommandMacro[i];
|
||||||
@ -768,6 +777,11 @@ bool MacroCommands::ApplyMacro(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore message level
|
||||||
|
if (trace) {
|
||||||
|
wxLog::SetComponentLevel("", prevLevel);
|
||||||
|
}
|
||||||
|
|
||||||
res = (i == mCommandMacro.size());
|
res = (i == mCommandMacro.size());
|
||||||
if (!res)
|
if (!res)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user