Cockatrice 2026-06-01-Development-3.1.0-beta.3
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
ReplayTimelineWidget Class Reference

#include <replay_timeline_widget.h>

Inheritance diagram for ReplayTimelineWidget:
[legend]
Collaboration diagram for ReplayTimelineWidget:
[legend]

Public Slots

void startReplay ()
void stopReplay ()
void skipByAmount (int amount)

Signals

void processNextEvent (EventProcessingOptions options)
void replayFinished ()
void rewound ()

Public Member Functions

 ReplayTimelineWidget (QWidget *parent=nullptr)
void setTimeline (const QList< int > &_replayTimeline)
QSize sizeHint () const override
QSize minimumSizeHint () const override
void setTimeScaleFactor (qreal _timeScaleFactor)
int getCurrentEvent () const

Static Public Attributes

static constexpr int SMALL_SKIP_MS = 1000
static constexpr int BIG_SKIP_MS = 10000
static constexpr qreal FAST_FORWARD_SCALE_FACTOR = 10.0

Protected Member Functions

void paintEvent (QPaintEvent *event) override
void mousePressEvent (QMouseEvent *event) override

Private Types

enum  PlaybackMode { NORMAL_PLAYBACK , FORWARD_SKIP , BACKWARD_SKIP }

Private Slots

void replayTimerTimeout ()

Private Member Functions

void skipToTime (int newTime, bool doRewindBuffering)
void handleBackwardsSkip (bool doRewindBuffering)
 Handles a backwards skip in the replay timeline.
void processRewind ()
void processNewEvents (PlaybackMode playbackMode)
 Processes all unprocessed events up to the current time.

Private Attributes

QTimer * replayTimer
QTimer * rewindBufferingTimer
QList< int > replayTimeline
QList< int > histogram
int maxBinValue
int maxTime
qreal timeScaleFactor
int currentVisualTime
int currentProcessedTime
int currentEvent

Static Private Attributes

static constexpr int TIMER_INTERVAL_MS = 200
static constexpr int BIN_LENGTH = 5000

Member Enumeration Documentation

◆ PlaybackMode

Enumerator
NORMAL_PLAYBACK 
FORWARD_SKIP 
BACKWARD_SKIP 

Constructor & Destructor Documentation

◆ ReplayTimelineWidget()

ReplayTimelineWidget::ReplayTimelineWidget ( QWidget * parent = nullptr)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ getCurrentEvent()

int ReplayTimelineWidget::getCurrentEvent ( ) const
inlinenodiscard

◆ handleBackwardsSkip()

void ReplayTimelineWidget::handleBackwardsSkip ( bool doRewindBuffering)
private

Handles a backwards skip in the replay timeline.

Parameters
doRewindBufferingWhen true, if multiple backward skips are made in quick succession, only a single rewind is processed at the end. When false, the backwards skip will always cause an immediate rewind.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ minimumSizeHint()

QSize ReplayTimelineWidget::minimumSizeHint ( ) const
nodiscardoverride

◆ mousePressEvent()

void ReplayTimelineWidget::mousePressEvent ( QMouseEvent * event)
overrideprotected
Here is the call graph for this function:

◆ paintEvent()

void ReplayTimelineWidget::paintEvent ( QPaintEvent * event)
overrideprotected

◆ processNewEvents()

void ReplayTimelineWidget::processNewEvents ( PlaybackMode playbackMode)
private

Processes all unprocessed events up to the current time.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processNextEvent

void ReplayTimelineWidget::processNextEvent ( EventProcessingOptions options)
signal
Here is the caller graph for this function:

◆ processRewind()

void ReplayTimelineWidget::processRewind ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ replayFinished

void ReplayTimelineWidget::replayFinished ( )
signal
Here is the caller graph for this function:

◆ replayTimerTimeout

void ReplayTimelineWidget::replayTimerTimeout ( )
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rewound

void ReplayTimelineWidget::rewound ( )
signal
Here is the caller graph for this function:

◆ setTimeline()

void ReplayTimelineWidget::setTimeline ( const QList< int > & _replayTimeline)

◆ setTimeScaleFactor()

void ReplayTimelineWidget::setTimeScaleFactor ( qreal _timeScaleFactor)

◆ sizeHint()

QSize ReplayTimelineWidget::sizeHint ( ) const
nodiscardoverride

◆ skipByAmount

void ReplayTimelineWidget::skipByAmount ( int amount)
slot
Here is the call graph for this function:

◆ skipToTime()

void ReplayTimelineWidget::skipToTime ( int newTime,
bool doRewindBuffering )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startReplay

void ReplayTimelineWidget::startReplay ( )
slot

◆ stopReplay

void ReplayTimelineWidget::stopReplay ( )
slot

Member Data Documentation

◆ BIG_SKIP_MS

int ReplayTimelineWidget::BIG_SKIP_MS = 10000
staticconstexpr

◆ BIN_LENGTH

int ReplayTimelineWidget::BIN_LENGTH = 5000
staticconstexprprivate

◆ currentEvent

int ReplayTimelineWidget::currentEvent
private

◆ currentProcessedTime

int ReplayTimelineWidget::currentProcessedTime
private

◆ currentVisualTime

int ReplayTimelineWidget::currentVisualTime
private

◆ FAST_FORWARD_SCALE_FACTOR

qreal ReplayTimelineWidget::FAST_FORWARD_SCALE_FACTOR = 10.0
staticconstexpr

◆ histogram

QList<int> ReplayTimelineWidget::histogram
private

◆ maxBinValue

int ReplayTimelineWidget::maxBinValue
private

◆ maxTime

int ReplayTimelineWidget::maxTime
private

◆ replayTimeline

QList<int> ReplayTimelineWidget::replayTimeline
private

◆ replayTimer

QTimer* ReplayTimelineWidget::replayTimer
private

◆ rewindBufferingTimer

QTimer* ReplayTimelineWidget::rewindBufferingTimer
private

◆ SMALL_SKIP_MS

int ReplayTimelineWidget::SMALL_SKIP_MS = 1000
staticconstexpr

◆ TIMER_INTERVAL_MS

int ReplayTimelineWidget::TIMER_INTERVAL_MS = 200
staticconstexprprivate

◆ timeScaleFactor

qreal ReplayTimelineWidget::timeScaleFactor
private

The documentation for this class was generated from the following files: