Commit Graph
3 Commits
Author SHA1 Message Date
Dylan M. Taylor 5e24ea380e Avoid duplicated timeline time primitives 2026-11-13 07:47:44 +00:00
97080c57f8 craft-timeline: drop-frame field carry and FrameRate::frames_between (ports of two FilmCraft PRs) (#1061)
* craft-timeline: carry overflowing time code fields before drop-frame counting

A drop-frame time code with a field past its range (01;00;00;30) was
counted as non-drop frames. The fields now carry into the next one
first, so it reads as the frame 01;00;01;00 names. Non-drop overflow is
counted as before.

Ported from the time part of storytold/filmcraft#4096 (also in #4088).

* craft-timeline: FrameRate::frames_between counts the frames between two boundaries

At a rate whose frame is not a whole number of ticks (11, 13, 23.5 fps),
the ticks between two frame boundaries can be one fewer than the exact
length of those frames, so frame_at(end - start) reads one short.
frames_between counts frame_at(end) - frame_at(start), saturating.

Ported from the time part of storytold/filmcraft#4291.

---------

Co-authored-by: JonRC <jonarc06@gmail.com>
Co-authored-by: ItsJustChrisE <53130043+ItsJustChrisE@users.noreply.github.com>
2026-11-11 21:38:25 -05:00
Dylan M. TaylorandNetterSilver 2f8f9ad8c9 craft-timeline: exact media time, reports, ALE and CMX 3600 EDL (from FilmCraft) (#911)
* craft-timeline: exact media time, reports, media paths, ALE and CMX 3600 EDL

New crate for editorial timeline interchange (#782), moved from FilmCraft at
4bec22bd:

- time: filmcraft-time whole (Tick, FrameRate, TimeRange, SMPTE timecode,
  feet+frames, typed-timecode parsing) with its tests.
- report: Report / Level / ReportEntry.
- path: file URL and path conversion, relative references joined to a folder.
- rate: timebase+ntsc and floating rates to exact rates, MAX_RATE.
- ale: AleDoc, parse, write, standard heading and columns.
- edl: the parser (events, lines, timecode fields, M2, AUD, comment extensions),
  the frame-rate guess, and the line layout of the writer, on frame counts.
- Format, detect_text, decode_text.

Each format module gives the document as the format writes it. Mapping onto an
application's timeline stays in the application.

* craft-timeline: strip a UTF-8 byte order mark when parsing ALE files

An ALE saved with a BOM was refused as "not an ALE file": the mark made the
first line something other than "Heading".

Ported from storytold/filmcraft#4531.

---------

Co-authored-by: NetterSilver <133535268+Silvertree2010@users.noreply.github.com>
2026-11-11 17:32:53 -05:00