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 <noreply@anthropic.com>
This commit is contained in:
Michael Smith 2026-02-13 14:30:33 +01:00
parent b6728a7482
commit 2daf9f7955
2 changed files with 9 additions and 4 deletions

View File

@ -7,7 +7,7 @@
| Version | 1.0 | | Version | 1.0 |
| Status | Draft | | Status | Draft |
| Created | 2026-02-10 | | Created | 2026-02-10 |
| Updated | 2026-02-10 | | Updated | 2026-02-13 |
## 1. Purpose ## 1. Purpose
@ -43,6 +43,12 @@ This document specifies the functional requirements for an SDL2 based media play
## 6. Changelog ## 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 ### 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. - **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.

View File

@ -478,8 +478,7 @@ static void switch_file(int index) {
snprintf(title, sizeof(title), "SDLamp2 - %s", current_file); snprintf(title, sizeof(title), "SDLamp2 - %s", current_file);
SDL_SetWindowTitle(window, title); SDL_SetWindowTitle(window, title);
paused = SDL_FALSE; SDL_PauseAudioDevice(audio_device, paused);
SDL_PauseAudioDevice(audio_device, 0);
return; return;
} }
@ -630,7 +629,7 @@ int main(int argc, char** argv) {
for (int i = 0; i < num_joy; i++) { for (int i = 0; i < num_joy; i++) {
joystick = SDL_JoystickOpen(i); joystick = SDL_JoystickOpen(i);
if (joystick) { if (joystick) {
printf("Joystick: %s\n", SDL_JoystickName(joystick)); if (debug_mode) printf("Joystick: %s\n", SDL_JoystickName(joystick));
break; break;
} }
} }