Skip to content

feat: User-adjustable playback speed for slider play buttons (IMA-190) - #5

Merged
maragall merged 4 commits into
mainfrom
juliomaragall/ima-190-playback-speed
Jul 6, 2026
Merged

feat: User-adjustable playback speed for slider play buttons (IMA-190)#5
maragall merged 4 commits into
mainfrom
juliomaragall/ima-190-playback-speed

Conversation

@maragall

@maragall maragall commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace the hardcoded 10 fps slider playback (SLIDER_PLAY_INTERVAL_MS = 100) with a QSpinBox speed control: 1–10 fps, default 5, shared by the time and FOV play buttons
  • Changing the spinbox while playing retimes any active timer immediately (QTimer.setInterval)
  • Control sits in a fixed right-aligned slot below the sliders, visible whenever either slider row is (covers FOV-only datasets and mid-acquisition T-row reveals)
  • Structure-first history: characterization tests pinning old behavior → _toggle_play_animation extraction (deduplicates the twin play handlers) → feature
  • New tests/test_playback_speed.py: 35 tests in the house MagicMock pattern (no pytest-qt), incl. regression tests for the 10→5 fps default change
  • TODOS.md captures the two deferred items from the eng review (fps persistence; playback tick vs synchronous loads)

Test plan

  • pytest tests/ — 271 passed locally (3 pre-existing local-env failures in test_push_api unrelated to this change; pass in CI)
  • Real widget driven offscreen: default plays at 200 ms; live change to 2 fps retimes running timer to 500 ms; control appears when FOV rows do
  • black<26 --check clean on changed files (matches CI lint)

Closes IMA-190.

🤖 Generated with Claude Code

maragall and others added 4 commits July 5, 2026 02:08
Pin current playback behavior (both play buttons start their QTimer at
100 ms, looping step callbacks, iconify text fallback, shared stop
helper) so the upcoming playback-speed refactor and feature land on a
green baseline. Zero playback coverage existed before this.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Structure-only change: both play-button handlers were line-for-line
twins. The helper mirrors the existing _stop_play_animation and RETURNS
the (possibly newly created) timer so the thin wrappers can rebind
their instance attribute. Behavior pinned by the characterization tests
in the previous commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the hardcoded 10 fps animation interval with a QSpinBox speed
control (1-10 fps, default 5) in a fixed right-aligned slot below the
sliders, shared by both the time and FOV play buttons:

- DEFAULT_PLAYBACK_FPS/PLAYBACK_FPS_MIN/MAX replace
  SLIDER_PLAY_INTERVAL_MS; _fps_to_interval_ms converts (0-clamped)
- play handlers read the stored _playback_fps int
- changing the spinbox mid-playback retimes every active timer live
  via QTimer.setInterval
- control is visible whenever either slider row is, via
  _update_speed_control_visibility hooked into the three row-visibility
  sites (FOV helper + both live-acquisition T-row reveals)

Default drops 10 -> 5 fps per Nick's report that slider playback was
way too fast; 10 fps remains reachable via the control.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two items deferred from the IMA-190 review with full context:
fps persistence across sessions (QSettings) and the pre-existing
playback-tick-outruns-synchronous-loads issue.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@maragall
maragall merged commit ddea5f0 into main Jul 6, 2026
2 checks passed
@maragall
maragall deleted the juliomaragall/ima-190-playback-speed branch July 6, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant