From 2daf9f7955d9923f8dd0fbcebfa664ec93f76bad Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 13 Feb 2026 14:30:33 +0100 Subject: [PATCH] Start paused, respect pause state on next-tape, quiet joystick log Player was autoplaying on startup and on file switch. Now switch_file() preserves the current paused state so the app launches paused and "next tape" only continues playing if already playing. Joystick name printf moved behind --debug flag. Co-Authored-By: Claude Opus 4.6 --- docs/sdlamp2-fsd.md | 8 +++++++- src/sdlamp2.c | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/sdlamp2-fsd.md b/docs/sdlamp2-fsd.md index 25cfd7a..1c47657 100644 --- a/docs/sdlamp2-fsd.md +++ b/docs/sdlamp2-fsd.md @@ -7,7 +7,7 @@ | Version | 1.0 | | Status | Draft | | Created | 2026-02-10 | -| Updated | 2026-02-10 | +| Updated | 2026-02-13 | ## 1. Purpose @@ -43,6 +43,12 @@ This document specifies the functional requirements for an SDL2 based media play ## 6. Changelog +### 2026-02-13 — Start paused, fix next-tape autoplay, quiet joystick log + +- **Start paused**: The player no longer autoplays on startup; it opens the last file at the saved position but waits for the user to press Play. +- **Next tape respects pause state**: `switch_file()` no longer forces playback. Pressing "next tape" while paused switches the file and stays paused; pressing it while playing switches and continues playing. +- **Joystick log behind --debug**: The "Joystick: ..." message is now only printed when `--debug` is passed. + ### 2026-02-13 — arm64 Docker build container - **New build container**: Replaced the broken Buildroot cross-compilation toolchain (`docker/`) with an arm64 Ubuntu 22.04 Docker container (`docker-arm64/`). Runs via QEMU user-mode emulation on x86 hosts and matches the target device exactly (same distro, same glibc, same library versions). The project's native `make` works as-is inside the container — no cross-compilation flags needed. diff --git a/src/sdlamp2.c b/src/sdlamp2.c index 7eae181..6838406 100644 --- a/src/sdlamp2.c +++ b/src/sdlamp2.c @@ -478,8 +478,7 @@ static void switch_file(int index) { snprintf(title, sizeof(title), "SDLamp2 - %s", current_file); SDL_SetWindowTitle(window, title); - paused = SDL_FALSE; - SDL_PauseAudioDevice(audio_device, 0); + SDL_PauseAudioDevice(audio_device, paused); return; } @@ -630,7 +629,7 @@ int main(int argc, char** argv) { for (int i = 0; i < num_joy; i++) { joystick = SDL_JoystickOpen(i); if (joystick) { - printf("Joystick: %s\n", SDL_JoystickName(joystick)); + if (debug_mode) printf("Joystick: %s\n", SDL_JoystickName(joystick)); break; } }