* Move run count increment back to PerformActions()
 * Rename variable
This commit is contained in:
WarmUpTill 2023-07-05 00:06:26 +02:00 committed by WarmUpTill
parent e5bb9162ef
commit 5d95069291

View File

@ -176,21 +176,14 @@ bool Macro::CeckMatch()
}
vblog(LOG_INFO, "Macro %s returned %d", _name.c_str(), _matched);
bool newLastMatched = _matched;
if (_matched && _matchOnChange && _lastMatched == _matched) {
bool matchedBeforeOnChangeCheck = _matched;
if (_matched && _matchOnChange && _lastMatched) {
vblog(LOG_INFO, "ignore match for Macro %s (on change)",
_name.c_str());
_matched = false;
SetOnChangeHighlight();
}
_lastMatched = newLastMatched;
// TODO: Move back to PerformAction() once new scene collection frontend
// events are available - see:
// https://github.com/obsproject/obs-studio/commit/feda1aaa283e8a99f6ba1159cfe6b9c1f2934a61
if (_matched && _runCount != std::numeric_limits<int>::max()) {
_runCount++;
}
_lastMatched = matchedBeforeOnChangeCheck;
_lastCheckTime = std::chrono::high_resolution_clock::now();
return _matched;
}
@ -218,6 +211,9 @@ bool Macro::PerformActions(bool forceParallel, bool ignorePause)
if (group) {
group->_lastExecutionTime = _lastExecutionTime;
}
if (_runCount != std::numeric_limits<int>::max()) {
_runCount++;
}
return ret;
}