Skip to content

0.9.8: extract asks before replacing, image zoom, audio and video sound in the preview - #123

Merged
crustovsky merged 9 commits into
mainfrom
video-sound
Nov 30, 2026
Merged

crustovsky merged 9 commits into
mainfrom
video-sound

Conversation

@crustovsky

Copy link
Copy Markdown
Owner

The whole chain in one merge, replacing #120: #117 (fixes #116), #118 (fixes #114), #119 (fixes #115) and the video sound PR (fixes #121), plus smoke sessions, tidy fixes on the new code and the re-rendered screenshots.

Checked on this tip: ctest, and ctest plus tools/smoke.sh in an -fsanitize=address,undefined build.

Fixes #116
Fixes #114
Fixes #115
Fixes #121

🤖 Generated with Claude Code

crustovsky and others added 9 commits November 30, 2026 20:33
F5 inside an archive ran bsdtar straight into the destination, and
bsdtar replaces what is there: silent data loss, no conflict bar, no
policy for Unattended, one progress step, and an undo record that knew
only the new top-level entries.

bsdtar now unpacks into a hidden staging folder inside the destination
(same filesystem), and the entries are moved into place by the item loop
of a copy. That loop moved out of TransferJob into engine.h so both jobs
drive it; a staged run moves but records what it placed as created, and
names sources by their place in the archive. So an extract gets the
conflict bar with every answer and "for all", merge into folders that
exist, the policy set before the start, Unattended's skip and list, and
an undo that trashes what was placed and restores what was replaced.

While bsdtar runs, -v on a pipe is the progress: the open line names the
member in flight, its size on disk is the current bytes, and the totals
come from the listing the tab has. Pause stops the child (SIGSTOP), Abort
kills it, Skip leaves out the member it was writing (bsdtar cannot be
told, so it is written to the end and then dropped). Failures carry the
member's name where bsdtar gives one. A folder the archive holds
read-only could not be renamed out of the staging folder: it is opened
for the move and gets its mode back where it lands. The staging folder
is removed on every way out.

Fixes #116

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The file is to stay under 350 lines and the jobs paragraph grew by one.
"Extract and pack run bsdtar" still holds; how extract places what it
unpacked is in the headers of extract.h and engine.h.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The image preview only fitted the picture to the slot, so it could not
say whether a photo is sharp, which is the question when culling a
folder with Insert and F8.

PreviewZoom (Ctrl+0, the View menu, the help) switches a previewed
image between fit and 100%, around the pointer when it is over the
picture, else around the middle. Over the preview the wheel zooms
around the pointer between fit and 400% and a drag pans; the keyboard
has no pan and focus never leaves the list. The level is told on the
details ("Dimensions: 6000 × 4000, shown at 100%"), nothing is drawn
over the picture.

The picture widget moved out of preview.cpp into imageview.cpp. The
fitted frame is about the slot's size (rule 16), so past its resolution
the view asks for the file at its own size: a second ImageLoader decodes
it, the fitted frame stays up scaled until it arrives, and at 100% and
above the file's pixels are shown unsmoothed. Only the shown file's full
frame is kept; going back to fit or leaving the file frees it, and a
reply for a file since left is dropped by the loader (rule 4).
core::fullFrameAllowed bounds a full frame at 256 MiB (64 megapixels)
in 64-bit arithmetic; larger images stay at the fitted frame, and the
loader refuses a frame that turns out larger than that.

Zoom and position carry over to the next image of the same pixel size,
so a burst is compared on one detail a key at a time. Another size, a
file that is not an image, or closing the preview goes back to fit.
Thumbnails, PDF pages and video frames only fit.

Ctrl+0 has no function key beside it: every Ctrl+F slot is taken, and
it sits with the other keys of the preview's content (Ctrl+P,
Ctrl+PgUp), which are chords as well.

Fixes #114

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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>
A previewed video played without sound. That was a non-goal while
nothing in the app made a sound; since audio files play on Ctrl+P
(#115) a silent video was the odd one out. The reasons behind the
non-goal are kept: nothing is decoded in the process (rule 8) and
nothing starts unasked.

While a video plays, its sound plays through core::AudioPlayer, ffplay
in a second child beside the ffmpeg that decodes the frames, started at
the picture's position. Pause, the end, a hidden slot, a cursor move or
closing the preview stop it with the picture; a seek while playing
starts it again from there. The two children are only as much in step
as their starts, so the sound is started 0.15 s ahead to make up for
the player opening the file and the device: a preview's sync, not a
player's lip sync. A file with no audio stream (the same ffprobe call
an audio file gets) plays as before and nothing is said; a player that
fails is one line under the details and the picture goes on.

PreviewMute (Ctrl+M, the View menu, a button at the end of the
transport strip shown when the video has sound) switches the sound of
videos off or on. It is kept in the state file ([preview] videoSound)
and is on by default, since playing is always asked for by a key. Audio
files are not muted by it. Like Ctrl+P and Ctrl+0 it is a chord with no
function key beside it: the Ctrl layer is full.

The non-goals line is now "autoplay of video or sound". The smoke and
screenshot scripts set SDL_AUDIODRIVER=dummy so a scripted session
plays to nobody, and their clips carry a tone so the path is exercised.

Fixes #121

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@crustovsky
crustovsky merged commit bb2f6e7 into main Nov 30, 2026
4 checks passed
@crustovsky
crustovsky deleted the video-sound 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

1 participant