2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef Q_NATIVE_PLAYBACK
|
|
|
|
#define Q_NATIVE_PLAYBACK
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
#include "qnativeevents.h"
|
|
|
|
|
|
|
|
class NativeEventList : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum Playback {ReturnImmediately, WaitUntilFinished};
|
|
|
|
|
|
|
|
NativeEventList(int defaultWaitMs = 20);
|
|
|
|
~NativeEventList();
|
|
|
|
|
|
|
|
void append(QNativeEvent *event);
|
2020-10-07 11:05:48 +00:00
|
|
|
void append(int waitMs, QNativeEvent *event = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
void play(Playback playback = WaitUntilFinished);
|
|
|
|
void stop();
|
|
|
|
void setTimeMultiplier(float multiplier);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void done();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void sendNextEvent();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void waitNextEvent();
|
|
|
|
|
|
|
|
QList<QPair<int, QNativeEvent *> > eventList;
|
|
|
|
float playbackMultiplier;
|
|
|
|
int currIndex;
|
|
|
|
bool wait;
|
|
|
|
int defaultWaitMs;
|
|
|
|
int debug;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|