Skip to content

feat: add Kodi and RetroArch playback controls#554

Merged
wizzomafizzo merged 3 commits intomainfrom
feat/kodi-playback-controls
Mar 15, 2026
Merged

feat: add Kodi and RetroArch playback controls#554
wizzomafizzo merged 3 commits intomainfrom
feat/kodi-playback-controls

Conversation

@wizzomafizzo
Copy link
Member

Summary

  • Add **control ZapScript command for triggering launcher controls from scripts
  • Add Kodi playback controls (toggle_pause, stop, fast_forward, rewind, next, previous) to all Kodi launchers, with new JSON-RPC client methods (PlayPause, Stop, FastForward, Rewind, GoTo)
  • Add RetroArch controls (save_state, load_state, toggle_menu, toggle_pause, reset, fast_forward, stop) to EmuDeck launchers using script-based keyboard hotkeys — standalone emulators unaffected
  • Thread context.Context through ControlFunc for cancellation support
  • Extract ServiceContext to reduce parameter threading in service layer
  • Fix pre-existing lint issues across the codebase (gosec, noctx, prealloc, revive)

Add stop, play/pause, fast forward, rewind, next, and previous controls
to all Kodi launchers via shared kodiControls factory. Thread
context.Context through ControlFunc signature and Kodi client methods
for proper cancellation support. Add input validation for GoTo direction
parameter.
- Thread LauncherCtx from LauncherManager to all commands, not just
  media-launching ones, so control commands get a cancellable context
- Use sync.Once for ZapScript command map initialization instead of
  rebuilding on every lookup
- Rename ServiceContext fields for clarity: Cfg→Config,
  LSQ→LaunchSoftwareQueue, PLQ→PlaylistQueue
- Remove local variable aliases in readerManager, use svc.* consistently
- Add skipped test for expression propagation in control scripts,
  blocked by go-zapscript#2
Add playback controls (save_state, load_state, toggle_menu, toggle_pause,
reset, fast_forward, stop) to EmuDeck launchers using RetroArch emulators.
Uses script-based controls with RetroArch's default keyboard hotkeys.
Standalone emulator launchers are unaffected.

Also fix all pre-existing lint issues across the codebase: gosec G118
(context cancel), noctx (httptest), prealloc, and revive line-length.
@wizzomafizzo wizzomafizzo merged commit 032be7e into main Mar 15, 2026
11 checks passed
@wizzomafizzo wizzomafizzo deleted the feat/kodi-playback-controls branch March 15, 2026 10:49
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