Skip to content

Native Converter: media conversion, audio and video preview, performance checks - #30

Merged
Sylphera merged 52 commits into
slint/nativefrom
claude/project-thread-5ttlcz
Oct 22, 2026
Merged

Sylphera merged 52 commits into
slint/nativefrom
claude/project-thread-5ttlcz

Conversation

@Sylphera

@Sylphera Sylphera commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Requested by Java · project thread

Completes the native Converter started in slint/converter-native (1eccd26). Approved by Java in the native window on 8179b05 (2026-10-22).

Changes

  • halation-core::playback:
    • Waveform summary in 480 columns.
    • Audio playback: FFmpeg decodes in a separate process, and the sound goes out through shared-mode WASAPI.
    • Video playback: one FFmpeg process for the sound and one for RGBA frames. Frames fit 1280 × 720 at most 30 fps and follow the sound clock; a silent video follows the wall clock.
    • Nothing runs at rest.
  • Canvas player for audio and video:
    • Vector waveform (audio) or the video picture.
    • −5 s, play/pause, +5 s, an m:ss clock, a seek track, mute and volume.
    • When paused, seeking shows the still at the playhead.
    • Playback stops on leaving the page, changing file or closing the app.
  • Files rows have a × that takes a file off the list. The file stays on disk, and files that are queued or converting keep their place.
  • Spec parity:
    • A Recommended badge and an "Audio only" caption for video's audio outputs.
    • Each output shows its description and a consequence line.
    • Durations as m:ss; finished rows show the size before and after.
    • Footers aligned.
  • UI-thread fixes:
    • The export location is written off the UI thread, and only when it changes.
    • Rebuilding the rows takes one job snapshot instead of one per row; with 256 files each update had taken 70–260 ms.
  • measure_converter example and the report research/performance/2026-10-22-converter-native.md.
  • Merges slint/native. Drape optimization and native motion (hover-first) #27 is exactly a59fd87, which this branch already contains, so the merge leaves the tree unchanged.

Checks (Linux container)

  • cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace (122 passed) and tools/check-docs.py.
  • WASAPI code type-checked against x86_64-pc-windows-msvc.
  • Stream copy takes 1.8 % of the re-encode time (the spec's limit is 5 %).
  • UI updates during a 256-file batch: 95th percentile 3–4 ms (the test asserts under 50 ms).
  • verify_converter fails at running-encoder cancellation on Linux, before and after this change. On non-Windows systems process.rs does not kill the process tree.

Not covered yet

Send to and sessions, and timings measured on Windows.

Skia converted every RGB frame to RGBA on the UI thread (about 30 ms a frame at
1080p). Frames are now opaque RGBA, two window-sized buffers are written in turn
and the working memory is kept, so a frame allocates nothing (17 -> 13 ms on the
decoding thread in the container).
- Motion tokens computed in Rust (motion.rs) into the Motion global; reduced
  motion sets every duration to 0 and the press scale to 100 %.
- Hover on every control, fast in and soft out, colour only.
- Shared hover and selection pills (PillList) gliding on Slint's spring in the
  sidebar, the Settings categories and Home's strip; a segmented control with a
  sliding selection for Open the window and Mode.
- Press sinks at once and returns on release; tooltips wait on a Timer and fade
  their colours; sidebar labels fade in; the switch's knob springs.
- Tests: the cost rules read from the .slint sources, the pills under pointer
  events, reduced motion.
The transform-scale shorthand with animated -x/-y axes generated no scale binding in Slint 1.18,
so the press containers drew at scale 0 under Skia (the software renderer of the screenshots
ignores transforms). The cost-rules test now rejects the shorthand.
…rip tools, faster tokens

Pills are drawn between two edges: the leading one moves in glide (55 ms), the trailing one in trail
(110 ms), so a pill stretches towards the new row and closes up on it. The sidebar's selection has
an accent bar beside it and the active icon is no longer tinted; groups get a visible separator,
open or collapsed. Home's strip tools share one width. Every token is shorter (nothing over 120 ms).
…and group label

The hover pill moves both edges in glide (30 ms) and no longer stretches: a trailing edge restarted
at every row smeared it over several rows on fast sweeps. Only the selection stretches (30/65 ms).
An open sidebar group is 38 px, leaving about 10 px between its separator and its label.
…ng diagnostic

Java wants fluidity, not speed: the tokens return to their earlier values (the sidebar keeps its
120 ms panel). The hover pill glides whole on a spring; the selection still stretches (160/240 ms).
Open, the sidebar shows group names only; collapsed, separator lines only.
--diagnostic-scene frames measures frame intervals and render times in the real window on Home at
rest, Home while the sidebar moves, and Settings while it moves, then closes.
The winit window and its renderer are made inside the event loop, so a notifier set before never
ran. It is now set 1.5 s after launch, once the window is shown and maximized.
Back to the timings Java preferred (hover 40/90, glide 55, trail 110, release 70, fade 80, panel 120)
with the stretching hover and selection pills. Their edges now use spring(0): the ease curve starts
from standstill, so a pointer sweep, which retargets the pill at every row, stopped and restarted it
at each one. A test sweeps two rows and checks the pill keeps moving through the retarget.
Separators stay collapsed-only. The frames diagnostic is removed: the default Skia surface on
Windows (Direct3D) never calls the rendering notifier.
…ady sidebar contents

The hover pill shortens its glide when the pointer crosses rows faster than twice the glide time,
down to 30 %, from the time between row crossings (one sum per crossing, no frames added).
The focus ring shows for keyboard focus only; the active sidebar icon is accent.
Opening or closing the sidebar moves nothing but its edge: group headers are 24 px in both
states, icons and the mark stay centred in the collapsed column, and names, group titles and
separators keep their width, are cut by the edge and fade both ways.
The hover pill's pace is averaged with the previous crossing and never drops under 65 % (36 ms
lead), so an uneven sweep no longer jolts it from row to row. The active sidebar row's name is
accent like its icon.
…each row

The pill's glide now follows the time between row crossings (about 0.8 of it, between 65 % and
three times glide, averaged with the last crossing): it is still on its way when the next row
turns it, so a sweep no longer moves it in steps. From rest it uses glide. A test sweeps three
rows 120 ms apart and checks the pill never stops.
Near the selection, while it moves, the hover pill joins it through a neck: one Path with fixed
commands from the nearer end of one pill to the other's, its sides bowed in by their distance
(reach 18 px), and the hover pill takes the selection's colour as it closes in, so the joined
shape is one surface. At rest side by side they stand apart. The Tauri app's shell.js was read
only to understand the effect; no code was taken.
Two-stop gradient fills, gradient 1 px edges brighter at the top and a dark
contact edge under raised pieces; no blur. Applied to buttons, switch, select
and menu, fields, segmented control, sidebar and Settings selection, Home's
strip, drop zone and recent files, tooltips. Group titles as tracked caps.
…itles, Schibsted Grotesk interface; chrome lifted to the panels' tone
… wordmark; hovering a selected row keeps its relief
…psed sidebar rows with larger icons, taller open rows, larger drop zone and stacked recent files
The mark and name at the top of the sidebar fold and unfold it, as a row with the
same hover pill; the Collapse row at the foot is removed (Ctrl+B unchanged). The
Settings category tabs stand 6 px apart.
The header shows the Collapse row (icon, label, hover pill, tooltip) instead of
the mark and name; no toggle row at the foot. Ctrl+B unchanged.
…n the tabs' row

The Activity dot leaves the global actions for the top bar's title. Settings' search
and Restore defaults move from the top bar to the right of the category tabs;
short of room the search narrows and Restore defaults shows only its icon.
The search takes all the width left beside the tabs. The top bar's icon buttons are
32 px with 17 px icons, 6 px apart, and raised pieces when hovered or pressed.
The header row was laid before the hover pill, so a hover covered its icon and label.
…p bar; more room in Settings

Sidebar tooltips show what each tool does (catalog about lines), a BETA badge and
what it still needs, with a nub; top bar tooltips show the shortcut as a key cap.
Both slide 4 px out as they fade in. The line before Settings stays open or
collapsed. Settings cells, pairs and panels get more room; segmented options stand
apart; the Vocal Remover select fits its options.
… hover in segmented controls

Tooltips drop the nub, description, badge and state line: the name and its key cap
on the toolbar's colour. The sidebar toggle has no pill, press or transition. The
hover pill of segmented controls and Settings tabs is half as strong as the
selection until they fuse.
…of the selection

The hover pill joins the selection only when it leaves or reaches the selected row.
The top bar's global actions drop their tooltips: the bar grows down under them,
right-aligned, to show the hovered button's name and shortcut.
The grown surface runs to the right frame and gives the page its corner back below
it, instead of stopping short beside the page's curve. Its width is measured from
the name and key cap.
Every category tab is 96 px wide, narrowing together when the row is short of room.
Java's settings from the glow lab, drawn once by tools/render-wordmark-glow.js into
assets/halation-wordmark-glow.png and shown beneath the wordmark; the letters at 94 %.
Java's second settings: no halation or fringe, a white bloom and a faint haze; the
letters at full brightness. The glow image shrinks to 960 x 428.
Greys take a faint warm bias, the text warms, the accent turns gold and Activity
amber at the same luminance; the warning moves to orange to stay apart. The Drape's
recorded silver-blue is turned golden as it is coloured, at the same luma.
The warm variant is reverted as the default and becomes the Gold theme of the new
docs/features/themes.md draft, pending the choice of scope.
Settings > Interface gains a Theme group: Silver (default) or Gold, and an accent
hue strip whose colour keeps the theme accent's luminance, so every text pair
still passes AA. Dragging previews the accent without saving; release, click or
arrow keys save it, Default returns to the theme's own. The material's fills are
bindings on the theme's base colours; the Drape's colour table and still frame
are recoloured for Gold. Restore defaults returns to Silver.
… drag

The strip saved only on a left-button up event; a press taken over by the
page's scrolling ended without one. It now saves when the press ends in any
way. A UI test and a test through the controller drag the strip and check the
preview, the saved hue and the theme colour.
The brand mark is now a vector stroke (docs/brand/source/halation-mark.svg) drawn in code,
replacing the raster mark extracted from halation.logo.png. icons.js builds the transparent
UI mark, the app icon, PNG/ICO sizes, favicon and Windows identity assets from it. Home,
Welcome, About and the Home tab size the square mark; tests, branding doc, decision and
README hero follow.
assets/halation-mark.png is now the hand-drawn stroke (docs/media/brand/source/halation-mark.svg) and the new
assets/halation-app-icon.png (the mark on a #111111 rounded square) is the window and taskbar icon.
tools/render-brand.js renders both and the brand copies; the raster source and its extraction notes are retired.
The mark's ToolIcon now draws a square mark.
- halation-core::playback: waveform summary and playback decoded by FFmpeg, played through
  shared-mode WASAPI; nothing decodes or polls while paused
- Canvas player: vector waveform, heard part and head, play/pause, clock, drag to seek,
  arrow keys and Space; stops when leaving the page, changing file or closing
- Output list: Recommended badge, Audio only caption, description plus consequence line;
  durations as m:ss; finished rows show the size before and after
- The remembered export location is written off the UI thread and only when it changes
- measure_converter example and research report: copy is 1.8 % of re-encoding; UI updates
  during a 256-file batch stay under 50 ms (asserted)
- Video preview plays with sound-synced frames (one FFmpeg for sound, one for
  RGBA frames fitted to 1280x720, at most 30 fps); a paused seek shows the still
  at the head.
- Transport for audio and video: -5 s, play/pause, +5 s, mute and volume.
- Files rows can be taken off the list (never off the disk).
- Canvas and inspector footers aligned at one height.
- Row rebuild takes one job snapshot instead of one per row.
- Offscreen captures use an absolute profile path.
@Sylphera Sylphera changed the title Native Converter: media conversion, audio preview and performance checks Native Converter: media conversion, audio and video preview, performance checks Oct 22, 2026
@Sylphera
Sylphera merged commit 5fe0d3e into slint/native Oct 22, 2026
1 check passed
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