Repository navigation
v0.2.1 — Frame-accurate timing + polish
Polish patch in response to community feedback on v0.2.0. Same v0.2.0 feature surface (transitions, speed, ducking), with frame-accurate timing throughout the API and full DocC documentation.
Highlights
- Frame-accurate timing. Every time-related API now accepts
CMTimefor frame-precise edits, withTimeIntervalretained as ergonomic overloads. Engine arithmetic operates inCMTimeend-to-end (fade halving viaCMTimeMultiplyByRatio, validation viaCMTimeCompare). - DocC across the public surface. New
FrameAccuracycatalog article explains when to reach forCMTimevsTimeInterval, the wall-clock vs media-time distinction, and the engine's precision guarantees. - API consistency.
VideoClip.trimmedargument labels unified across overloads (both forms now useto:). - Better diagnostics. Transition validation emits a specific error when an adjacent clip is an untrimmed
VideoClip, pointing the user at.trimmed(to:). - Tests: 80 → 103 (new
CMTimeAPITestsandEdgeCasesTestssuites — precision round-trips, mixed-timescale CMTime, speed × reverse, speed × dissolve, boundary clip durations, multi-track ducking).
Frame-accurate now possible
// Before v0.2.1: 1.0/30.0 = 0.03333… (binary fraction, never exactly 1 frame)
// Now: exact 1 frame at 30fps, no float drift
Transition.fade(duration: CMTime(value: 1, timescale: 30))
// Trim by frame count
clip.trimmed(to: CMTimeRange(
start: CMTime(value: 30, timescale: 30), // exactly second 1
duration: CMTime(value: 90, timescale: 30) // exactly 3 seconds
))Existing TimeInterval call sites continue to work unchanged via static factory overloads:
clip.trimmed(to: 0...10)
Transition.fade(duration: 0.5)Breaking changes (pre-1.0)
- Pattern-matching
Transitioncases (case .fade(let d)) now bindsd: CMTimeinstead ofd: TimeInterval. All non-pattern-matching call sites continue to work unchanged.
Component PRs
| Theme | PR |
|---|---|
| CMTime API surface (community feedback) | #11 |
trimmed(to:) argument label consistency |
#12 |
| DocC docs + FrameAccuracy article | #13 |
| Edge-case bug bash + improved validation error | #14 |
See CHANGELOG.md for the full entry.