mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
Timeline seeks only expose whole timer intervals, so jumping to an event could leave that event unprocessed until the next tick. Add an event-time seek that also applies events at the target timestamp.
64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
/**
|
|
* @file replay_widget.h
|
|
* @ingroup Core
|
|
* @ingroup Replay
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef REPLAY_WIDGET_H
|
|
#define REPLAY_WIDGET_H
|
|
|
|
#include <QList>
|
|
#include <QWidget>
|
|
#include <libcockatrice/game/player/event_processing_options.h>
|
|
#include <qtmetamacros.h>
|
|
|
|
class ReplayManager;
|
|
class ReplayQuickSettingsWidget;
|
|
class GameEventContainer;
|
|
class GameReplay;
|
|
class QAction;
|
|
class QToolButton;
|
|
class ReplayTimelineWidget;
|
|
|
|
/**
|
|
* @brief The top-level widget that is put in the replay dock widget.
|
|
* Contains the replay timeline as well as the buttons.
|
|
*/
|
|
class ReplayWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
/**
|
|
* @param parent The parent widget
|
|
* @param replay Cannot be null. Takes ownership of the replay.
|
|
*/
|
|
ReplayWidget(QWidget *parent, GameReplay *replay);
|
|
|
|
[[nodiscard]] const QList<int> &getReplayTimeline() const;
|
|
|
|
public slots:
|
|
void seekToEvent(int eventIndex);
|
|
|
|
signals:
|
|
void rewound();
|
|
void timeChanged(int time);
|
|
void eventReplayed(const GameEventContainer &cont, EventProcessingOptions options);
|
|
|
|
private:
|
|
ReplayManager *replayManager;
|
|
|
|
ReplayTimelineWidget *timelineWidget;
|
|
QToolButton *replayPlayButton, *replayFastForwardButton;
|
|
ReplayQuickSettingsWidget *settingsWidget;
|
|
QAction *aReplaySkipForward, *aReplaySkipBackward, *aReplaySkipForwardBig, *aReplaySkipBackwardBig;
|
|
|
|
private slots:
|
|
void replayFinished();
|
|
void replayPlayButtonToggled(bool checked);
|
|
void updateTimeScaleFactor(bool checked);
|
|
void refreshShortcuts();
|
|
};
|
|
|
|
#endif // REPLAY_WIDGET_H
|