Skip to content

Preview: audio files show their details and play on Ctrl+P - #119

Closed
crustovsky wants to merge 4 commits into
image-zoomfrom
audio-preview
Closed

crustovsky wants to merge 4 commits into
image-zoomfrom
audio-preview

Conversation

@crustovsky

Copy link
Copy Markdown
Owner

Fixes #115. Stacked on #118.

  • An audio file's preview adds length, codec, sample rate, channels, bitrate and the tags title, artist, album, track, year, from ffprobe in a child. Tags are shown as one line of text, control characters removed, capped at 200 characters.
  • Ctrl+P plays through ffplay -nodisp -autoexit in a child; Ctrl+P again stops and keeps the position. Ctrl+PgUp / Ctrl+PgDown seek 10 s; the strip shows the playhead, position and length.
  • Never autoplay. Cursor move, closing the preview, a hidden slot, leaving the folder or quitting kills the child.
  • Without ffmpeg the lines say so.
  • Non-goals line changes from "sound or autoplay for video" to "autoplay, and sound for video".
  • The lines are in the details block above the cover art (where all details are), not under it.

Tests: test_core audioProbeAndPlay (parsing, stand-in tools, killed on stop / replace / destroy, ended, failed, not installed), test_hostile audioTagsAreSomebodyElsesText, test_window audioPlaysOnTheKeyOnly. ctest passes.

🤖 Generated with Claude Code

crustovsky and others added 3 commits November 30, 2026 20:47
An audio file in the preview showed its cover art or the generic type
and dates, and nothing about it as sound; choosing among recordings or
samples meant opening each in another app.

The preview now adds what ffprobe says, read in a child: length, codec,
sample rate, channels, bitrate, and the tags title, artist, album, track
and year. Tags are text only: one line, control characters out, cut at
200 characters. Ctrl+P plays the file through ffplay (-nodisp -autoexit)
in a child; Ctrl+P again stops it and keeps the place. The strip is the
transport as for a video: playhead, position and length, and Ctrl+PgUp /
Ctrl+PgDown seek by 10 s (ffplay takes no orders, so a seek while
playing is a new child started with -ss). The position is the app's own
clock from the second the child was started at.

Nothing starts by itself. Moving the cursor, closing the preview,
hiding its slot, leaving the folder or quitting kills the child; there
is one preview per window, so one player. No volume, queue or device
choice: that is the mixer's. Without ffmpeg the lines say which tool is
missing.

This narrows a non-goal on purpose: it was "sound or autoplay for
video" and is now "autoplay, and sound for video". The reasons behind
it hold: no decoder in the process (rule 8), nothing plays unasked, and
video stays silent.

The lines sit in the details block above the cover art, where every
other kind's details are, not under the picture.

Fixes #115

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
tools/smoke.sh gains scripted sessions for the three changes of this
release: F5 inside an archive onto a folder that has a member (the
conflict bar answered with Skip, then Overwrite; no staging folder
left), Ctrl+0 on a previewed image, and Ctrl+P on a previewed tone
played to SDL's dummy driver, after which no ffplay may be left.

clang-tidy (bugprone, cert, performance, clang-analyzer) on the new
files: a reserve before a loop of push_back, a widening multiplication,
llround for a rounded cast, unsigned mode masks, and the ffprobe entry
list as one named string.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Re-rendered by tools/screenshots.sh on this tree, as before every
release; the help shot with the version this becomes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The zoom carried over only to an image of exactly the same pixel size,
so in any folder of mixed pictures (screenshots, downloads) every
cursor move went back to fit and the level seemed not to be kept at
all.

The level the user chose now stays for the images that follow, whatever
their size, at the same place in the picture as a fraction of it (which
is the same pixel when the sizes match, so a burst is still compared on
one detail). It ends when the key or the wheel goes back to fit, when
something that is not an image is previewed, or when the preview
closes. An image so large that the level is below its fit is fitted,
and the level waits for the next one.

Refs #114

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@crustovsky

Copy link
Copy Markdown
Owner Author

Merged into main through #123.

@crustovsky crustovsky closed this Nov 30, 2026
@crustovsky
crustovsky deleted the audio-preview branch November 30, 2026 21:00
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