forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on a3e9dc2d50d8a2595e06b8d5fbcde7eeb078b2bc

2026-08-10

🔀 merge(playback): audio-only sessions carry their frame count for trimAhmet Kaan Gümüş · a3e9dc2
🔀 merge(playback): audio-only sessions carry their frame count for trim

The audio-only branch predates the trim feature's per-source counts;
open_audio_only now feeds them like open does (verifier-prescribed seam fix).
🔀 merge(main): edge trim beside the colour drag on the root carriersAhmet Kaan Gümüş · dcd2d0f
🔀 merge(main): edge trim beside the colour drag on the root carriers

Both features hang a drag off the root's mouse-move and mouse-up, which is
where they collided. Kept both, in press-target order: equalizer, trim,
colour, scrub. They cannot overlap -- a gesture belongs to whatever was
pressed, and no two of those hitboxes are the same element.
✨ feat(audio): a song opens as a timeline of its ownAhmet Kaan Gümüş · eb9a278
✨ feat(audio): a song opens as a timeline of its own

An audio file could not start a project: `PlaybackSession::open` refused
every `is_audio` path because a timeline was scaffolded from source 0's
*picture*. It now scaffolds the canvas instead -- 1080p at 30 fps H.264,
the rate a later video import is held to -- takes its length from the
audio, puts the one clip on `A1` and leaves the video lane empty, so the
existing gap path plays it black while the song keeps the clock.

`open_project` does the same when source 0 has no picture, so an
audio-only `.edith` loads. An mp4 of such a timeline is refused by name
in `export::start` (it would be black over the sound) and the export
card says so on the MP4 row before a destination is picked; WAV and FLAC
export as they always did. The Export button now re-asks that question
too, since mp4 is the default and a timeline can lose its picture after
the format was chosen.
🐛 fix(timeline): a ripple-closed clip's head no longer overflows on grabAhmet Kaan Gümüş · affa0a3
🐛 fix(timeline): a ripple-closed clip's head no longer overflows on grab

`trim_room` read a clip's head room as `start - in_frame`, which assumes a
clip never carries more source in front of it than the timeline has room for.
A ripple delete leaves exactly that: cut at 5, delete the first piece, and
the survivor slides back to frame 0 still holding in-point 5. Grabbing its
left edge then subtracted with overflow -- a panic in debug on every pointer
sample of the drag, and a wrapped `lo` in release, which is a clamp that
means nothing.

Saturating, because frame 0 is the other wall that room was always bounded
by: a head can be pulled back to the start of the timeline and no further,
whatever the file still has behind it.
🔒 fix(export): an empty timeline is refused by the engine, in every formatAhmet Kaan Gümüş · dc82aff
🔒 fix(export): an empty timeline is refused by the engine, in every format

Grafted from the rival empty-timeline candidate: the app's `is_empty`
refusal was the only fence, so an export started by anything that is not
that button still wrote a file of no frames. The refusal now lives in
`export::start`, in the rival's exact words.

Placed ahead of the format match rather than inside `run`, so a WAV and a
FLAC refuse in the same words an mp4 does -- `run_audio` would otherwise
have written a zero-sample file or refused as "no audio to export", which
names the wrong thing. The app keeps its own check: two fences, and only
the app's has a keystroke to blame.

The end-to-end test asserts the exact message for all three formats and
that no file is left behind.
✨ feat(timeline): clips are trimmed by dragging their edgesAhmet Kaan Gümüş · 222336b
✨ feat(timeline): clips are trimmed by dragging their edges

A 6 px strip at each end of a clip box takes the press the body-drag would
otherwise take (gpui `occlude`), so one gesture stays one thing: an edge
trims, the middle still moves the clip to another lane, and both ends still
select and open the clip menu. The box follows the pointer while the button
is down and the engine hears about it once, at the release -- one edit, one
undo step for the whole drag, exactly as an equalizer gesture works.

`Project::trim` clamps rather than refuses: one frame of clip always
survives, an edge never crosses its neighbour on the lane, an in-point never
walks back past the source's first frame, and an out-point never runs past
the file's own last frame -- a clip ending past it is a project that will not
open again. `Project` does not know how long a file is, so `PlaybackSession`
now keeps the frame counts it already computes at every import and fills them
in. Linked halves trim together to one clamped edge, the tightest wall of the
group winning, because a link is one span on however many lanes.

`trim_room` is the same clamp without the mutation: the drag asks it where
the edge may land, so the width drawn is the width the release commits. A
timeline drawn to fit the window has no room past its own last frame, so
while a tail is dragged the bed is drawn out to as far as that tail may go --
without it the last clip could be pulled in and never let back out.
✨ feat(colour): sliders are dragged and the graded frame is drawn over themAhmet Kaan Gümüş · 8d8d880
✨ feat(colour): sliders are dragged and the graded frame is drawn over them

The colour card loses its stepper buttons: each row's bar is now pressed and
pulled straight to a value, which is what a slider is for. The press takes the
undo step and every sample after it is a live write (`set_color_live`), so a
whole drag is one `z` rather than one per pixel -- and because a live write
reseeks like any other edit, the picture regrades under the hand.

Above the rows, an RGB histogram of the frame on screen: counted off the BGRA
the decoder handed over, which is already through the grade, so pulling
brightness tilts the graph as it moves. Every 253rd pixel of a 1080p frame
(HIST_SAMPLES), 64 bins a channel, square-rooted so a flat black area does not
draw the rest as a line.

The arrow keys still move the same values, on the same 0.05 grid a drag snaps
to, and the bar is 4 px to look at but a whole row to hit.
✨ feat(timeline): the last clip deletes and the timeline emptiesAhmet Kaan Gümüş · 9a6ef81
✨ feat(timeline): the last clip deletes and the timeline empties

The never-empty-TIMELINE invariant is gone: an emptied timeline is now a
state of the model, not an edge case a refusal kept unreachable. Emptiness
is honest all the way down -- `PlaybackSession::span` is an `Option<Span>`
whose `None` *is* the empty timeline, and `start_span` feeds it one black
frame, so the viewer shows the nothing that is there rather than the last
picture of the clip that was deleted.

* `Project::lift` and `Project::ripple_delete` refuse only what is not an
  edit (a bad index, an empty range, a delete with nothing left to take --
  the last so a no-op still costs no undo step);
* `Project::from_parts` and the `.edith` loader take an all-empty project
  and refuse a *laneless* one instead, which is the invariant that was
  really being defended;
* `without_orphan_sources` keeps source 0 when no clip names anything: it
  carries the frame rate the timeline counts in, and pruning it wrote a
  project that could not be loaded back;
* the app's two "the timeline cannot be emptied" notices are gone, and an
  export of an empty timeline is refused by name instead of writing a file
  of no frames.

The never-empty-CLIP invariant (len >= 1) is untouched.
✨ feat(eq): the equalizer is a curve you drag, not five barsAhmet Kaan Gümüş · df00890
✨ feat(eq): the equalizer is a curve you drag, not five bars

The card now draws the clip's own frequency response across a log axis
(20 Hz - 20 kHz) with a handle per band on it: press anywhere in the box
and the nearest band follows the pointer up and down, and the curve
redraws on every sample of the drag, so the shape bends under the hand.
One undo step per gesture, as before -- the write is still the release's.

The curve is read from `EqParams::response_db`, which evaluates the very
biquad coefficients `EqState` filters with at z = e^jw. There is no
second copy of the maths, so a drawn curve cannot drift from what is
heard; a new test measures a sine through `process` at nine frequencies
and holds it to what the curve claimed, within half a dB.

The keyboard path is untouched: 1-5 pick a band, up/down move it, r
flattens, esc closes -- and a readout under the graph names the picked
band, which the sum of five curves cannot.
✨ feat(timeline): clips drag from one track to anotherAhmet Kaan Gümüş · 28fe52d
✨ feat(timeline): clips drag from one track to another

A clip already on the timeline is now a drag source, and a lane bed takes
one: dropped on another lane of the same kind it moves there, keeping the
timeline frames it covered, as a single undo step.

Its group id travels with it, which desyncs nothing -- a link means "one
span, however many lanes" and names no lane -- so a picture moved to V2 is
still the take its sound belongs to.

Refused by name rather than overwriting: a picture let go on an audio lane
(and the other way round), and a landing that would touch a clip already
there, which `place` would have painted over.
✨ feat(export): the done notice opens the file's locationAhmet Kaan Gümüş · cbb8a50
✨ feat(export): the done notice opens the file's location

A finished export names a file that is now on disk, so the bar it announces
itself in became the way to it: clicking the DONE line asks the desktop's
FileManager1 to show that file selected, falling back to opening its folder
with xdg-open, and retires the notice as any click always did. The path is
kept beside the notice and read only while that line is the one showing, so a
later message turns the bar back into a plain dismissal.
🐛 fix(engine,ui): paste respects lane kinds; bounds and rebind capture hardenedAhmet Kaan Gümüş · 11603ec
🐛 fix(engine,ui): paste respects lane kinds; bounds and rebind capture hardened

Four bugs a hunter sweep found, each with the door it comes in through:

- `Project::paste` put the clipboard clip in the first lane of *every* kind,
  so an audio-only clip copied off A1 landed on V1 too: a wav as a video
  source, a decode that fails, and a save the next open refuses. It now asks
  the source what it is, the same question `place_stream_at` asks an import,
  and reaches A1 only when there is no picture.
- The `resolution` line was applied unbounded while the keystroke capped at
  8K, so a crafted `resolution 4294967295 4294967295` panicked `open_black`
  with a capacity overflow. One bound now (`engine::is_resolution`) with both
  doors asking it, and the load door refuses by line like every other
  malformed line.
- `open_room` shifted starts unbounded, and the file format permits a clip
  ending at the very last frame: a paste wrapped it round to the front of the
  lane -- a debug panic, or in release an overlap no reload accepts. The edit
  door refuses the paste that would push anything past `u32::MAX`; the load
  bound stays where it is, since the wrap was the edit's to prevent.
- A rebind captured whatever gpui reported, so shift+= wrote `play +` and the
  next load threw the *whole* keybindings file away, losing every other
  rebind. Capture now takes only a chord the file can spell and read back, and
  a line the parser cannot use costs that line alone -- the magic line is the
  only thing that still refuses the file.
✨ feat(timeline): clips select from the keyboardAhmet Kaan Gümüş · cc90921
✨ feat(timeline): clips select from the keyboard

tab selects the clip under the playhead -- again for the next lane's --
and [ / ] walk the selection along its own lane, wrapping at both ends.
shift+tab stays unspellable (a chord carries only ctrl and parse refuses
an uppercase key), so the brackets are the pair.

One selection and not a second: every door -- click, right-click, all
three keys -- goes through Player::select, so the group-scoped tint a
click draws is the tint a key draws. Project::lane_clip_at is what the
walk asks, per lane, rather than the UI re-deriving where a clip ends.

This is what makes delete, lift, the equalizer and the grade reachable
with no pointer at all: the equalizer card had never been rendered live,
because nothing but a click could select the audio clip it needs.
✨ feat(engine): project resolution stands apart from media resolutionAhmet Kaan Gümüş · 19e294a
✨ feat(engine): project resolution stands apart from media resolution

A timeline had one resolution because its first source did: import refused
anything else by name, and there was nowhere to say otherwise. A project now
carries its own picture size and every clip is composed onto it, so media of
different resolutions share a timeline the way they do in any editor.

* scale::Composer is the one definition of that composition -- fit_rect,
  scale_i420, compose_i420 onto a black canvas -- and both playback and export
  call it, so what is written is what was watched. A canvas of the picture's
  own size is a pass-through that allocates nothing and touches no byte.
* Grade first, place second: a grade belongs to the clip's pixels at the
  resolution they were shot at, and the letterbox bars are not the clip.
* Per-clip fit policy (fit/fill/stretch/centre), one byte inline in Clip -- it
  lands in padding the clip already had.
* .edith v7: a `resolution <w> <h>` line and a fit word per clip line. v6..v1
  still load, defaulting to source 0's picture and Fit, which is what those
  projects always meant.
* The fps refusal stays: mixing frame rates is resampling the timeline, a
  different problem, and a refusal is the honest answer until it is solved.
* UI: `p` cycles the fit policy of the clip on screen (and a clip-menu item),
  ctrl+r cycles the project resolution through the usual sizes with the media's
  own among them, and the export card says which size it writes.
🐛 fix(engine): hvc1-tagged HEVC files import tooAhmet Kaan Gümüş · 8dd1c77
🐛 fix(engine): hvc1-tagged HEVC files import too

mp4 0.14 recognises only a hev1 sample entry, so an hvc1-tagged HEVC file -- what Apple and ffmpeg's mov muxer write -- read back as no video track at all. Its sample tables parse regardless of the entry the crate dropped, so the fourcc is read out of stsd by hand and the track is taken as HEVC; the parameter sets come from hvcC either way.
✨ feat(video): per-clip color grade is live in render and exportAhmet Kaan Gümüş · bd89527
✨ feat(video): per-clip color grade is live in render and export

The grade a clip carries now reaches the picture. `Project::composite_clip_at`
names the clip the composite shows at a frame and `composite_color_at` its
grade, so playback's decode worker (folded into `i420_to_bgra_with`, free in
the loop that was reading those samples anyway) and the export's encoder (onto
per-span scratch, since the planes are borrowed) grade from one answer.

`PlaybackSession::set_color` is an edit like any other, so it reseeks -- which
is what repaints the frame already on screen, paused or playing.

The card: `k` (or the clip menu's Colour…) opens four sliders on the selected
video clip, or on the clip under the playhead when nothing is selected, so it
is reachable with no pointer at all. Arrows pick and move a slider, r resets,
esc closes; a slider walked back to the middle takes the grade off, which keeps
an ungraded project byte-identical -- verified: the same two-clip export before
and after this slice is md5 98522c19cefac2f7851b51de6416a493 both times.
✨ feat(audio): per-clip equalizer is live in playback and exportAhmet Kaan Gümüş · 4d92155
✨ feat(audio): per-clip equalizer is live in playback and export

The model, the format and the filter have all existed with no callers. This
wires them: `Project::audio_eqs_from` hands one curve per segment beside the
play list `audio_segments_from` already builds, `open_mixed_streams_eq` gives
each lane's worker those curves, and `emit` -- the one place both readers hand
their samples over -- filters a segment after it is trimmed and before it is
sent. Playback and an audio export therefore get the same filtered stream by
construction rather than by two call sites agreeing.

A parallel list, not a fourth element of the segment tuple: that tuple is what
every opener, the packet-copy path and a dozen tests speak, and an effect is not
part of which samples a segment names. A short list plays flat, so a mismatch
can neither panic nor shift a curve onto the wrong clip.

Live editing needs no channel into a running worker: `set_eq` is an edit and
every edit reseeks, so the workers are rebuilt from the new curves where the
playhead is standing.

An mp4 export copies AAC packets and no filter can reach a copy, so an
equalized clip is refused by name and by timecode rather than written flat.

The card is the third of its kind (same scrim, width and rows as keys and
export): a row per band, dragged from the middle out, with `q` to open it and
1-5 / up / down / r as its own keyboard, every one of them listed in the keys
menu by the registry the guard test reads.
✨ feat(timeline): every lane draws and tracks can be addedAhmet Kaan Gümüş · 30e8aae
✨ feat(timeline): every lane draws and tracks can be added

The panel drew V1 and A1 and nothing else, so the N-lane model, the
composite playback and the v6 format had no way into the window. It now
draws a row per project lane, labelled from Lane::label, and grows the
panel per row up to a cap past which the lane column scrolls.

+ V / + A -- and the v / a chords, in the registry so the keys menu lists
them -- add a track; undo takes one back like any other edit.

The V1/A1 pinning the last two slices flagged is gone: delete_clip takes
the lane its index belongs to (Project::delete_in), a drop names the lane
it was let go over (place_stream_at's onto), and whole_take decides
ripple-or-lift per lane -- a clip on an added track is a layer and is
lifted, while the first pair keeps exactly the semantics it had.
Project::paste now inserts into V1/A1 only while still opening room
everywhere, or an Add with three lanes would have played one sound twice.

The export card greys MP4 out with its reason when more than one audio
lane carries sound, on the row and on the m chord both, so the engine's
refusal arrives before a destination is picked.
✨ feat(engine): per-clip color persists in .edith v6Ahmet Kaan Gümüş · 0530fc9
✨ feat(engine): per-clip color persists in .edith v6

A clip names a colour grade the way it names an equalizer: an index into an append-only Project table, deduped on set, pruned at save, inherited by both halves of a split and carried by copy, paste and undo.

The file format grows a color <b>:<c>:<s>:<t> line and a 7th clip field; v5..v1 still load and every one of them re-saves as v6. Clip grew from 32 to 40 bytes -- the eq index fit the padding hole, the colour one did not.
🐛 fix(engine): the mp4 audio copy follows the lane that holds the soundAhmet Kaan Gümüş · 000621a
🐛 fix(engine): the mp4 audio copy follows the lane that holds the sound

The refusal gate counted non-empty audio lanes but the copy still read A1's
play list, so a project that leaves A1 empty and places everything on A2 passed
the gate as "one lane", played its sound, and exported an mp4 with no audio
track at all -- silently, which is the one failure nobody notices until they
play the file back.

The copy now takes the single list `audio_segments_from` already resolved for
playback, so "which lane holds the sound" is asked once and answered the same
way everywhere. The gate keeps its wording: that list is never empty, so the
refusal is still exactly the >1-lane case.
✨ feat(engine): N-lane compositing in playback and exportAhmet Kaan Gümüş · 08af6bc
✨ feat(engine): N-lane compositing in playback and export

Video: the topmost video lane with a clip there wins, topmost being the last
lane in display order (V2 over V1, the overlay convention). No blending, so
exactly one lane is visible per frame and the composite is itself a span list
-- Project::composite_span_at -- which one decoder plays. N video lanes never
mean N decoders; a lane change costs the one decoder reopen a cut already
costs.

Audio: every audio lane that holds something gets a play list
(Project::audio_segments_from) and AudioSession::open_mixed_streams sums them,
clamped, each lane keeping its own gap rule so the master clock counts a sample
per sample of timeline. One lane skips the mixer entirely and is the byte-for-
byte path it always was.

Export walks the same composite and mixes the same lanes for WAV/FLAC. The mp4
path copies AAC packets and cannot mix, so a timeline whose sound is spread
over two lanes is refused there by name rather than silently exported without
half of it.
✨ feat(engine): per-clip EQ persists in .edith v5Ahmet Kaan Gümüş · 782fc53
✨ feat(engine): per-clip EQ persists in .edith v5

A clip names its equalizer by index into a project-level table, the way it
already names its source: `Clip` stays `Copy`, so a split hands both halves the
same settings, a clipboard copy carries them and an undo restores whichever
index the clip had. The table is append-only within a session -- an index on a
clipboard clip or in an undo snapshot can never dangle -- and only a save prunes
it, exactly as an undone import leaves its source entry behind.

The file grows `eq <band>...` lines (freq:gain:q:shape, printed `{:?}` so every
f32 comes back bit for bit) and one more clip field naming one of them. v4, v3,
v2 and v1 still load and re-save as v5.
✨ feat(engine): AV1 import via the VA-API pluginAhmet Kaan Gümüş · 6d3e3ba
✨ feat(engine): AV1 import via the VA-API plugin

AV1 arrives in Matroska, never in an mp4 -- `mp4 0.14` knows no `av01`
sample entry at all -- so the demuxer grows a second container:
`MkvDemuxer` walks the EBML itself, indexes every block of the AV1 track
in one header-only pass (payloads are seeked over) and hands each block
to the decoder as the temporal unit it is, with the `av1C` sequence
header re-injected ahead of every keyframe the way the H.264 parameter
sets are.

Matroska indexes neither the frame count nor the frame rate, which is why
that walk exists: the count is the blocks of the track and the rate is
`DefaultDuration` in nanoseconds (33333333 = 30 fps to seven digits,
where the millisecond block timestamps beside it would say 30.30).
Keyframe flags come out of the same pass, so a seek lands on a sync point
without a Cues element and without guessing at the bitstream.

Audio is picture-only for now: a Matroska file is a silent source and
says so by name ("A_AAC audio in a Matroska file is not wired to the
decoder yet") rather than failing in the mp4 reader's words. 10- and
12-bit AV1 are refused at open like HEVC Main 10, for the same 8-bit
read-back reason.

No new dependency: symphonia's mkv reader drops the keyframe flag and
`DefaultDuration` and offers no frame count, so it could not have done
the job. edith keeps its 7 DT_NEEDED entries.
✨ feat(engine): I420 scaler and fit geometryAhmet Kaan Gümüş · dd54308
✨ feat(engine): I420 scaler and fit geometry

Bilinear 16.16 rescale, four fit policies handing back chroma-grid-aligned
placement and crop rects, and a canvas blit -- the primitive a project
resolution decoupled from media resolution needs. 3.82 ms/frame for
1280x720 -> 1920x1080 in release; nothing is wired to it yet.