[PR #266] Add --playback-speed CLI flag for controlling replay speed #262

Open
opened 2026-05-07 00:19:27 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/266
Author: @sh4wnbk
Created: 3/30/2026
Status: 🔄 Open

Base: mainHead: feature/playback-speed-flag


📝 Commits (1)

  • d95cd2f Add --playback-speed CLI flag for controlling replay speed

📊 Changes

1 file changed (+7 additions, -2 deletions)

View changed files

📝 main.py (+7 -2)

📄 Description

Summary

Adds a --playback-speed CLI flag so users can set the initial replay speed from the command line.

Closes #36

Problem

playback_speed was hardcoded to 1 in main.py with no way to control it via CLI. Users could only change playback speed interactively after the replay launched.

Changes

  • Added --playback-speed argument parsing in main.py, consistent with the existing --year and --round patterns
  • Defaults to 1.0 if the flag is not provided

Usage

python main.py --viewer --year 2024 --round 12 --playback-speed 2.0
python main.py --viewer --year 2024 --round 5 --playback-speed 0.5

Note: Valid speed values are constrained by PLAYBACK_SPEEDS in race_replay.py ([0.1, 0.2, 0.5, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0]). Values not in this list will fall back to 1.0 — this behaviour is inherited from the existing window logic and unchanged by this PR.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/266 **Author:** [@sh4wnbk](https://github.com/sh4wnbk) **Created:** 3/30/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/playback-speed-flag` --- ### 📝 Commits (1) - [`d95cd2f`](https://github.com/IAmTomShaw/f1-race-replay/commit/d95cd2fc125360a2f968a80ef63d22cbaad28256) Add --playback-speed CLI flag for controlling replay speed ### 📊 Changes **1 file changed** (+7 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+7 -2) </details> ### 📄 Description ## Summary Adds a `--playback-speed` CLI flag so users can set the initial replay speed from the command line. Closes #36 ## Problem `playback_speed` was hardcoded to `1` in `main.py` with no way to control it via CLI. Users could only change playback speed interactively after the replay launched. ## Changes - Added `--playback-speed` argument parsing in `main.py`, consistent with the existing `--year` and `--round` patterns - Defaults to `1.0` if the flag is not provided ## Usage ```bash python main.py --viewer --year 2024 --round 12 --playback-speed 2.0 python main.py --viewer --year 2024 --round 5 --playback-speed 0.5 ``` > **Note:** Valid speed values are constrained by `PLAYBACK_SPEEDS` in `race_replay.py` (`[0.1, 0.2, 0.5, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0]`). Values not in this list will fall back to `1.0` — this behaviour is inherited from the existing window logic and unchanged by this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#262
No description provided.