mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-21 01:42:15 -07:00
implement thing
This commit is contained in:
parent
e0cd2d435a
commit
d660f2e101
2 changed files with 1 additions and 11 deletions
|
|
@ -106,20 +106,13 @@ void ReplayTimelineWidget::handleBackwardsSkip(bool doRewindBuffering)
|
|||
// The rewind only happens once the timer runs out.
|
||||
// If another backwards skip happens, the timer will just get reset instead of rewinding.
|
||||
rewindBufferingTimer->stop();
|
||||
rewindBufferingTimer->start(calcRewindBufferingTimeout());
|
||||
rewindBufferingTimer->start(SettingsCache::instance().getRewindBufferingMs());
|
||||
} else {
|
||||
// otherwise, process the rewind immediately
|
||||
processRewind();
|
||||
}
|
||||
}
|
||||
|
||||
/// The timeout scales based on the current event number, up to a limit
|
||||
int ReplayTimelineWidget::calcRewindBufferingTimeout() const
|
||||
{
|
||||
int extraTime = currentEvent / 100;
|
||||
return std::min(BASE_REWIND_BUFFERING_TIMEOUT_MS + extraTime, MAX_REWIND_BUFFERING_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
void ReplayTimelineWidget::processRewind()
|
||||
{
|
||||
// stop any queued-up rewinds
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ private:
|
|||
|
||||
static constexpr int TIMER_INTERVAL_MS = 200;
|
||||
static constexpr int BIN_LENGTH = 5000;
|
||||
static constexpr int BASE_REWIND_BUFFERING_TIMEOUT_MS = 180;
|
||||
static constexpr int MAX_REWIND_BUFFERING_TIMEOUT_MS = 280;
|
||||
|
||||
QTimer *replayTimer;
|
||||
QTimer *rewindBufferingTimer;
|
||||
|
|
@ -42,7 +40,6 @@ private:
|
|||
|
||||
void skipToTime(int newTime, bool doRewindBuffering);
|
||||
void handleBackwardsSkip(bool doRewindBuffering);
|
||||
int calcRewindBufferingTimeout() const;
|
||||
void processRewind();
|
||||
void processNewEvents(PlaybackMode playbackMode);
|
||||
private slots:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue