mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
make rewind buffering timeout configurable (#5227)
* update settingsCache * implement thing * add new setting to window * rename setting * make it compile on qt5 * fix typo * somehow changing the order here fixes a bug? The loaded value was getting clamped to 99
This commit is contained in:
parent
10f11213d3
commit
a39de270cd
8 changed files with 40 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue