mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Add MacroWasPausedSince()
It will allow you to query if the macro was paused since a given time point. It checks this by comparing the time point against the time point at which the macro was last paused.
This commit is contained in:
@@ -327,6 +327,12 @@ bool Macro::DockIsVisible() const
|
||||
return _dock && _dockAction && _dock->isVisible();
|
||||
}
|
||||
|
||||
bool Macro::WasPausedSince(
|
||||
const std::chrono::high_resolution_clock::time_point &time) const
|
||||
{
|
||||
return _lastUnpauseTime > time;
|
||||
}
|
||||
|
||||
void Macro::SetMatchOnChange(bool onChange)
|
||||
{
|
||||
_performActionsOnChange = onChange;
|
||||
@@ -335,6 +341,7 @@ void Macro::SetMatchOnChange(bool onChange)
|
||||
void Macro::SetPaused(bool pause)
|
||||
{
|
||||
if (_paused && !pause) {
|
||||
_lastUnpauseTime = std::chrono::high_resolution_clock::now();
|
||||
ResetTimers();
|
||||
}
|
||||
_paused = pause;
|
||||
|
||||
Reference in New Issue
Block a user