aboutsummaryrefslogtreecommitdiff
path: root/src/aoclocklabel.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2021-03-21 05:12:44 +0300
committerGitHub <noreply@github.com>2021-03-20 21:12:44 -0500
commit510c0f4b17f24eb534d22654a41e9157c89a8211 (patch)
tree079a0e3f799ed55ac80370b289b0ba9496eeb7c0 /src/aoclocklabel.cpp
parente3ba27c47e4846e1a93057d83464ecff027da7be (diff)
Add timer packets to demo playback (#494)
When the demo skips by some number of seconds, the timer will also skip forward by that duration. Co-authored-by: in1tiate <32779090+in1tiate@users.noreply.github.com> Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Diffstat (limited to 'src/aoclocklabel.cpp')
-rw-r--r--src/aoclocklabel.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/aoclocklabel.cpp b/src/aoclocklabel.cpp
index 67a82fe5..ce62f320 100644
--- a/src/aoclocklabel.cpp
+++ b/src/aoclocklabel.cpp
@@ -43,6 +43,17 @@ void AOClockLabel::stop()
timer.stop();
}
+void AOClockLabel::skip(qint64 msecs)
+{
+ qint64 ms_left = QDateTime::currentDateTime().msecsTo(target_time);
+ this->set(ms_left - msecs, true);
+}
+
+bool AOClockLabel::active()
+{
+ return timer.isActive();
+}
+
void AOClockLabel::timerEvent(QTimerEvent *event)
{
if (event->timerId() == timer.timerId()) {