mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 09:03:57 -07:00
preliminary client-side replay watching code
This commit is contained in:
parent
65d4c77ee8
commit
4dc712286f
13 changed files with 1449 additions and 16 deletions
39
cockatrice/src/replay_timeline_widget.h
Normal file
39
cockatrice/src/replay_timeline_widget.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef REPLAY_TIMELINE_WIDGET
|
||||
#define REPLAY_TIMELINE_WIDGET
|
||||
|
||||
#include <QWidget>
|
||||
#include <QList>
|
||||
|
||||
class QPaintEvent;
|
||||
class QTimer;
|
||||
|
||||
class ReplayTimelineWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void processNextEvent();
|
||||
void replayFinished();
|
||||
private:
|
||||
QTimer *replayTimer;
|
||||
QList<int> replayTimeline;
|
||||
QList<int> histogram;
|
||||
static const int binLength;
|
||||
int maxBinValue, maxTime;
|
||||
qreal timeScaleFactor;
|
||||
int currentTime;
|
||||
int currentEvent;
|
||||
private slots:
|
||||
void replayTimerTimeout();
|
||||
public:
|
||||
ReplayTimelineWidget(QWidget *parent = 0);
|
||||
void setTimeline(const QList<int> &_replayTimeline);
|
||||
QSize sizeHint() const;
|
||||
void setTimeScaleFactor(qreal _timeScaleFactor);
|
||||
int getCurrentEvent() const { return currentEvent; }
|
||||
public slots:
|
||||
void startReplay();
|
||||
void stopReplay();
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue