Rename "count" to "runCount"

This commit is contained in:
WarmUpTill
2023-01-02 18:59:03 +01:00
committed by WarmUpTill
parent 378bf4dfd6
commit f9de63bc88
5 changed files with 12 additions and 12 deletions

View File

@@ -429,7 +429,7 @@ void SwitcherData::Start()
void ResetMacros()
{
for (auto &m : switcher->macros) {
m->ResetCount();
m->ResetRunCount();
m->ResetTimers();
}
}

View File

@@ -33,7 +33,7 @@ bool MacroActionMacro::PerformAction()
_macro->SetPaused(false);
break;
case PerformMacroAction::RESET_COUNTER:
_macro->ResetCount();
_macro->ResetRunCount();
break;
case PerformMacroAction::RUN:
if (!_macro->Paused()) {

View File

@@ -88,11 +88,11 @@ bool MacroConditionMacro::CheckCountCondition()
switch (_counterCondition) {
case CounterCondition::BELOW:
return _macro->GetCount() < _count;
return _macro->RunCount() < _count;
case CounterCondition::ABOVE:
return _macro->GetCount() > _count;
return _macro->RunCount() > _count;
case CounterCondition::EQUAL:
return _macro->GetCount() == _count;
return _macro->RunCount() == _count;
default:
break;
}
@@ -477,14 +477,14 @@ void MacroConditionMacroEdit::ResetClicked()
return;
}
_entryData->_macro->ResetCount();
_entryData->_macro->ResetRunCount();
}
void MacroConditionMacroEdit::UpdateCount()
{
if (_entryData && _entryData->_macro.get()) {
_currentCount->setText(
QString::number(_entryData->_macro->GetCount()));
QString::number(_entryData->_macro->RunCount()));
} else {
_currentCount->setText("-");
}

View File

@@ -114,8 +114,8 @@ bool Macro::CeckMatch()
// TODO: Move back to PerformAction() once new scene collection frontend
// events are available - see:
// https://github.com/obsproject/obs-studio/commit/feda1aaa283e8a99f6ba1159cfe6b9c1f2934a61
if (_matched && _count != std::numeric_limits<int>::max()) {
_count++;
if (_matched && _runCount != std::numeric_limits<int>::max()) {
_runCount++;
}
_lastCheckTime = std::chrono::high_resolution_clock::now();
return _matched;

View File

@@ -32,8 +32,8 @@ public:
bool Paused() { return _paused; }
void SetMatchOnChange(bool onChange) { _matchOnChange = onChange; }
bool MatchOnChange() { return _matchOnChange; }
int GetCount() { return _count; };
void ResetCount() { _count = 0; };
int RunCount() { return _runCount; };
void ResetRunCount() { _runCount = 0; };
void AddHelperThread(std::thread &&);
bool GetStop() { return _stop; }
void Stop();
@@ -80,7 +80,7 @@ private:
bool _lastMatched = false;
bool _matchOnChange = false;
bool _paused = false;
int _count = 0;
int _runCount = 0;
bool _registerHotkeys = true;
obs_hotkey_id _pauseHotkey = OBS_INVALID_HOTKEY_ID;
obs_hotkey_id _unpauseHotkey = OBS_INVALID_HOTKEY_ID;