@nodetool-ai/timeline 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/animation/bakedAnimation.d.ts +84 -0
- package/dist/animation/bakedAnimation.d.ts.map +1 -0
- package/dist/animation/bakedAnimation.js +95 -0
- package/dist/animation/bakedAnimation.js.map +1 -0
- package/dist/animation/beat.d.ts +7 -0
- package/dist/animation/beat.d.ts.map +1 -0
- package/dist/animation/beat.js +36 -0
- package/dist/animation/beat.js.map +1 -0
- package/dist/animation/compile.d.ts +184 -0
- package/dist/animation/compile.d.ts.map +1 -0
- package/dist/animation/compile.js +312 -0
- package/dist/animation/compile.js.map +1 -0
- package/dist/animation/custom.d.ts +183 -0
- package/dist/animation/custom.d.ts.map +1 -0
- package/dist/animation/custom.js +583 -0
- package/dist/animation/custom.js.map +1 -0
- package/dist/animation/easing.d.ts +34 -0
- package/dist/animation/easing.d.ts.map +1 -0
- package/dist/animation/easing.js +332 -0
- package/dist/animation/easing.js.map +1 -0
- package/dist/animation/index.d.ts +20 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/index.js +20 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/animation/links.d.ts +33 -0
- package/dist/animation/links.d.ts.map +1 -0
- package/dist/animation/links.js +126 -0
- package/dist/animation/links.js.map +1 -0
- package/dist/animation/presets.d.ts +86 -0
- package/dist/animation/presets.d.ts.map +1 -0
- package/dist/animation/presets.js +642 -0
- package/dist/animation/presets.js.map +1 -0
- package/dist/animation/sample.d.ts +145 -0
- package/dist/animation/sample.d.ts.map +1 -0
- package/dist/animation/sample.js +390 -0
- package/dist/animation/sample.js.map +1 -0
- package/dist/animation/simplify.d.ts +70 -0
- package/dist/animation/simplify.d.ts.map +1 -0
- package/dist/animation/simplify.js +278 -0
- package/dist/animation/simplify.js.map +1 -0
- package/dist/animation/sourceCurves.d.ts +45 -0
- package/dist/animation/sourceCurves.d.ts.map +1 -0
- package/dist/animation/sourceCurves.js +168 -0
- package/dist/animation/sourceCurves.js.map +1 -0
- package/dist/animation/styleTracks.d.ts +23 -0
- package/dist/animation/styleTracks.d.ts.map +1 -0
- package/dist/animation/styleTracks.js +341 -0
- package/dist/animation/styleTracks.js.map +1 -0
- package/dist/animation/types.d.ts +269 -0
- package/dist/animation/types.d.ts.map +1 -0
- package/dist/animation/types.js +173 -0
- package/dist/animation/types.js.map +1 -0
- package/dist/animation/typewriter.d.ts +8 -0
- package/dist/animation/typewriter.d.ts.map +1 -0
- package/dist/animation/typewriter.js +32 -0
- package/dist/animation/typewriter.js.map +1 -0
- package/dist/audioFade.d.ts +73 -0
- package/dist/audioFade.d.ts.map +1 -0
- package/dist/audioFade.js +134 -0
- package/dist/audioFade.js.map +1 -0
- package/dist/authoredStyles.d.ts +61 -0
- package/dist/authoredStyles.d.ts.map +1 -0
- package/dist/authoredStyles.js +90 -0
- package/dist/authoredStyles.js.map +1 -0
- package/dist/authoring.d.ts +50 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +207 -0
- package/dist/authoring.js.map +1 -0
- package/dist/beats.d.ts +103 -0
- package/dist/beats.d.ts.map +1 -0
- package/dist/beats.js +228 -0
- package/dist/beats.js.map +1 -0
- package/dist/clone.d.ts +32 -0
- package/dist/clone.d.ts.map +1 -0
- package/dist/clone.js +53 -0
- package/dist/clone.js.map +1 -0
- package/dist/composition.d.ts +87 -0
- package/dist/composition.d.ts.map +1 -0
- package/dist/composition.js +253 -0
- package/dist/composition.js.map +1 -0
- package/dist/crop.d.ts +48 -0
- package/dist/crop.d.ts.map +1 -0
- package/dist/crop.js +75 -0
- package/dist/crop.js.map +1 -0
- package/dist/defaults.d.ts +142 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +335 -0
- package/dist/defaults.js.map +1 -0
- package/dist/dependencyHash.d.ts +14 -0
- package/dist/dependencyHash.d.ts.map +1 -0
- package/dist/dependencyHash.js +19 -0
- package/dist/dependencyHash.js.map +1 -0
- package/dist/dropResolve.d.ts +40 -0
- package/dist/dropResolve.d.ts.map +1 -0
- package/dist/dropResolve.js +137 -0
- package/dist/dropResolve.js.map +1 -0
- package/dist/examples/node.d.ts +11 -0
- package/dist/examples/node.d.ts.map +1 -0
- package/dist/examples/node.js +87 -0
- package/dist/examples/node.js.map +1 -0
- package/dist/extension.d.ts +52 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +269 -0
- package/dist/extension.js.map +1 -0
- package/dist/extensionRequest.d.ts +40 -0
- package/dist/extensionRequest.d.ts.map +1 -0
- package/dist/extensionRequest.js +135 -0
- package/dist/extensionRequest.js.map +1 -0
- package/dist/fill-text.d.ts +30 -0
- package/dist/fill-text.d.ts.map +1 -0
- package/dist/fill-text.js +73 -0
- package/dist/fill-text.js.map +1 -0
- package/dist/fonts/catalog.d.ts +97 -0
- package/dist/fonts/catalog.d.ts.map +1 -0
- package/dist/fonts/catalog.js +276 -0
- package/dist/fonts/catalog.js.map +1 -0
- package/dist/fonts/css.d.ts +24 -0
- package/dist/fonts/css.d.ts.map +1 -0
- package/dist/fonts/css.js +50 -0
- package/dist/fonts/css.js.map +1 -0
- package/dist/fonts/index.d.ts +10 -0
- package/dist/fonts/index.d.ts.map +1 -0
- package/dist/fonts/index.js +10 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/fonts/register-node.d.ts +45 -0
- package/dist/fonts/register-node.d.ts.map +1 -0
- package/dist/fonts/register-node.js +71 -0
- package/dist/fonts/register-node.js.map +1 -0
- package/dist/generatedMatte.d.ts +86 -0
- package/dist/generatedMatte.d.ts.map +1 -0
- package/dist/generatedMatte.js +152 -0
- package/dist/generatedMatte.js.map +1 -0
- package/dist/generative.d.ts +145 -0
- package/dist/generative.d.ts.map +1 -0
- package/dist/generative.js +396 -0
- package/dist/generative.js.map +1 -0
- package/dist/group.d.ts +47 -0
- package/dist/group.d.ts.map +1 -0
- package/dist/group.js +131 -0
- package/dist/group.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/interchange.d.ts +47 -0
- package/dist/interchange.d.ts.map +1 -0
- package/dist/interchange.js +158 -0
- package/dist/interchange.js.map +1 -0
- package/dist/keyframes.d.ts +44 -0
- package/dist/keyframes.d.ts.map +1 -0
- package/dist/keyframes.js +148 -0
- package/dist/keyframes.js.map +1 -0
- package/dist/lineDelivery.d.ts +108 -0
- package/dist/lineDelivery.d.ts.map +1 -0
- package/dist/lineDelivery.js +154 -0
- package/dist/lineDelivery.js.map +1 -0
- package/dist/linked.d.ts +41 -0
- package/dist/linked.d.ts.map +1 -0
- package/dist/linked.js +166 -0
- package/dist/linked.js.map +1 -0
- package/dist/lipSyncRequest.d.ts +65 -0
- package/dist/lipSyncRequest.d.ts.map +1 -0
- package/dist/lipSyncRequest.js +73 -0
- package/dist/lipSyncRequest.js.map +1 -0
- package/dist/measureClipDurations.d.ts +7 -0
- package/dist/measureClipDurations.d.ts.map +1 -0
- package/dist/measureClipDurations.js +17 -0
- package/dist/measureClipDurations.js.map +1 -0
- package/dist/mediaTrack.d.ts +120 -0
- package/dist/mediaTrack.d.ts.map +1 -0
- package/dist/mediaTrack.js +269 -0
- package/dist/mediaTrack.js.map +1 -0
- package/dist/midi/cacheKey.d.ts +25 -0
- package/dist/midi/cacheKey.d.ts.map +1 -0
- package/dist/midi/cacheKey.js +54 -0
- package/dist/midi/cacheKey.js.map +1 -0
- package/dist/midi/edit.d.ts +48 -0
- package/dist/midi/edit.d.ts.map +1 -0
- package/dist/midi/edit.js +93 -0
- package/dist/midi/edit.js.map +1 -0
- package/dist/midi/engines/bl1.d.ts +29 -0
- package/dist/midi/engines/bl1.d.ts.map +1 -0
- package/dist/midi/engines/bl1.js +128 -0
- package/dist/midi/engines/bl1.js.map +1 -0
- package/dist/midi/engines/dr1.d.ts +28 -0
- package/dist/midi/engines/dr1.d.ts.map +1 -0
- package/dist/midi/engines/dr1.js +101 -0
- package/dist/midi/engines/dr1.js.map +1 -0
- package/dist/midi/engines/dsp.d.ts +126 -0
- package/dist/midi/engines/dsp.d.ts.map +1 -0
- package/dist/midi/engines/dsp.js +371 -0
- package/dist/midi/engines/dsp.js.map +1 -0
- package/dist/midi/engines/index.d.ts +13 -0
- package/dist/midi/engines/index.d.ts.map +1 -0
- package/dist/midi/engines/index.js +13 -0
- package/dist/midi/engines/index.js.map +1 -0
- package/dist/midi/engines/kits.d.ts +12 -0
- package/dist/midi/engines/kits.d.ts.map +1 -0
- package/dist/midi/engines/kits.js +121 -0
- package/dist/midi/engines/kits.js.map +1 -0
- package/dist/midi/engines/wavetables.d.ts +45 -0
- package/dist/midi/engines/wavetables.d.ts.map +1 -0
- package/dist/midi/engines/wavetables.js +334 -0
- package/dist/midi/engines/wavetables.js.map +1 -0
- package/dist/midi/engines/wt1.d.ts +30 -0
- package/dist/midi/engines/wt1.d.ts.map +1 -0
- package/dist/midi/engines/wt1.js +91 -0
- package/dist/midi/engines/wt1.js.map +1 -0
- package/dist/midi/grid.d.ts +51 -0
- package/dist/midi/grid.d.ts.map +1 -0
- package/dist/midi/grid.js +104 -0
- package/dist/midi/grid.js.map +1 -0
- package/dist/midi/index.d.ts +20 -0
- package/dist/midi/index.d.ts.map +1 -0
- package/dist/midi/index.js +20 -0
- package/dist/midi/index.js.map +1 -0
- package/dist/midi/instrument.d.ts +32 -0
- package/dist/midi/instrument.d.ts.map +1 -0
- package/dist/midi/instrument.js +73 -0
- package/dist/midi/instrument.js.map +1 -0
- package/dist/midi/notes.d.ts +46 -0
- package/dist/midi/notes.d.ts.map +1 -0
- package/dist/midi/notes.js +121 -0
- package/dist/midi/notes.js.map +1 -0
- package/dist/midi/notesEdit.d.ts +94 -0
- package/dist/midi/notesEdit.d.ts.map +1 -0
- package/dist/midi/notesEdit.js +159 -0
- package/dist/midi/notesEdit.js.map +1 -0
- package/dist/midi/presets.d.ts +29 -0
- package/dist/midi/presets.d.ts.map +1 -0
- package/dist/midi/presets.js +281 -0
- package/dist/midi/presets.js.map +1 -0
- package/dist/midi/tempo.d.ts +27 -0
- package/dist/midi/tempo.d.ts.map +1 -0
- package/dist/midi/tempo.js +57 -0
- package/dist/midi/tempo.js.map +1 -0
- package/dist/midi/ticks.d.ts +25 -0
- package/dist/midi/ticks.d.ts.map +1 -0
- package/dist/midi/ticks.js +35 -0
- package/dist/midi/ticks.js.map +1 -0
- package/dist/midi/voice.d.ts +148 -0
- package/dist/midi/voice.d.ts.map +1 -0
- package/dist/midi/voice.js +348 -0
- package/dist/midi/voice.js.map +1 -0
- package/dist/midi/wav.d.ts +14 -0
- package/dist/midi/wav.d.ts.map +1 -0
- package/dist/midi/wav.js +51 -0
- package/dist/midi/wav.js.map +1 -0
- package/dist/model3d.d.ts +41 -0
- package/dist/model3d.d.ts.map +1 -0
- package/dist/model3d.js +39 -0
- package/dist/model3d.js.map +1 -0
- package/dist/model3dBake.d.ts +80 -0
- package/dist/model3dBake.d.ts.map +1 -0
- package/dist/model3dBake.js +127 -0
- package/dist/model3dBake.js.map +1 -0
- package/dist/ops/apply.d.ts +32 -0
- package/dist/ops/apply.d.ts.map +1 -0
- package/dist/ops/apply.js +1595 -0
- package/dist/ops/apply.js.map +1 -0
- package/dist/ops/index.d.ts +13 -0
- package/dist/ops/index.d.ts.map +1 -0
- package/dist/ops/index.js +13 -0
- package/dist/ops/index.js.map +1 -0
- package/dist/ops/op.d.ts +407 -0
- package/dist/ops/op.d.ts.map +1 -0
- package/dist/ops/op.js +61 -0
- package/dist/ops/op.js.map +1 -0
- package/dist/ops/serialize.d.ts +77 -0
- package/dist/ops/serialize.d.ts.map +1 -0
- package/dist/ops/serialize.js +81 -0
- package/dist/ops/serialize.js.map +1 -0
- package/dist/ops/types.d.ts +150 -0
- package/dist/ops/types.d.ts.map +1 -0
- package/dist/ops/types.js +12 -0
- package/dist/ops/types.js.map +1 -0
- package/dist/pathSampling.d.ts +51 -0
- package/dist/pathSampling.d.ts.map +1 -0
- package/dist/pathSampling.js +111 -0
- package/dist/pathSampling.js.map +1 -0
- package/dist/placement/index.d.ts +2 -0
- package/dist/placement/index.d.ts.map +1 -0
- package/dist/placement/index.js +2 -0
- package/dist/placement/index.js.map +1 -0
- package/dist/placement/resolveTrackPlacement.d.ts +40 -0
- package/dist/placement/resolveTrackPlacement.d.ts.map +1 -0
- package/dist/placement/resolveTrackPlacement.js +71 -0
- package/dist/placement/resolveTrackPlacement.js.map +1 -0
- package/dist/production.d.ts +99 -0
- package/dist/production.d.ts.map +1 -0
- package/dist/production.js +328 -0
- package/dist/production.js.map +1 -0
- package/dist/reassemble.d.ts +68 -0
- package/dist/reassemble.d.ts.map +1 -0
- package/dist/reassemble.js +187 -0
- package/dist/reassemble.js.map +1 -0
- package/dist/recipe.d.ts +24 -0
- package/dist/recipe.d.ts.map +1 -0
- package/dist/recipe.js +89 -0
- package/dist/recipe.js.map +1 -0
- package/dist/recordedVoiceReplacement.d.ts +70 -0
- package/dist/recordedVoiceReplacement.d.ts.map +1 -0
- package/dist/recordedVoiceReplacement.js +82 -0
- package/dist/recordedVoiceReplacement.js.map +1 -0
- package/dist/reframe.d.ts +31 -0
- package/dist/reframe.d.ts.map +1 -0
- package/dist/reframe.js +227 -0
- package/dist/reframe.js.map +1 -0
- package/dist/render/canvas2d.d.ts +419 -0
- package/dist/render/canvas2d.d.ts.map +1 -0
- package/dist/render/canvas2d.js +1392 -0
- package/dist/render/canvas2d.js.map +1 -0
- package/dist/render/color.d.ts +26 -0
- package/dist/render/color.d.ts.map +1 -0
- package/dist/render/color.js +305 -0
- package/dist/render/color.js.map +1 -0
- package/dist/render/cpuLegacyEffects.d.ts +17 -0
- package/dist/render/cpuLegacyEffects.d.ts.map +1 -0
- package/dist/render/cpuLegacyEffects.js +347 -0
- package/dist/render/cpuLegacyEffects.js.map +1 -0
- package/dist/render/cpuVisualEffects.d.ts +13 -0
- package/dist/render/cpuVisualEffects.d.ts.map +1 -0
- package/dist/render/cpuVisualEffects.js +388 -0
- package/dist/render/cpuVisualEffects.js.map +1 -0
- package/dist/render/cubeLut.d.ts +12 -0
- package/dist/render/cubeLut.d.ts.map +1 -0
- package/dist/render/cubeLut.js +81 -0
- package/dist/render/cubeLut.js.map +1 -0
- package/dist/render/curveFitting.d.ts +28 -0
- package/dist/render/curveFitting.d.ts.map +1 -0
- package/dist/render/curveFitting.js +94 -0
- package/dist/render/curveFitting.js.map +1 -0
- package/dist/render/draw.d.ts +265 -0
- package/dist/render/draw.d.ts.map +1 -0
- package/dist/render/draw.js +929 -0
- package/dist/render/draw.js.map +1 -0
- package/dist/render/effects.d.ts +120 -0
- package/dist/render/effects.d.ts.map +1 -0
- package/dist/render/effects.js +804 -0
- package/dist/render/effects.js.map +1 -0
- package/dist/render/frameCompositor.d.ts +502 -0
- package/dist/render/frameCompositor.d.ts.map +1 -0
- package/dist/render/frameCompositor.js +1331 -0
- package/dist/render/frameCompositor.js.map +1 -0
- package/dist/render/index.d.ts +27 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +27 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/layout.d.ts +17 -0
- package/dist/render/layout.d.ts.map +1 -0
- package/dist/render/layout.js +197 -0
- package/dist/render/layout.js.map +1 -0
- package/dist/render/model3dBakeSamples.d.ts +45 -0
- package/dist/render/model3dBakeSamples.d.ts.map +1 -0
- package/dist/render/model3dBakeSamples.js +68 -0
- package/dist/render/model3dBakeSamples.js.map +1 -0
- package/dist/render/motionBlur.d.ts +170 -0
- package/dist/render/motionBlur.d.ts.map +1 -0
- package/dist/render/motionBlur.js +193 -0
- package/dist/render/motionBlur.js.map +1 -0
- package/dist/render/sceneModel.d.ts +577 -0
- package/dist/render/sceneModel.d.ts.map +1 -0
- package/dist/render/sceneModel.js +1460 -0
- package/dist/render/sceneModel.js.map +1 -0
- package/dist/render/shapeGeometry.d.ts +81 -0
- package/dist/render/shapeGeometry.d.ts.map +1 -0
- package/dist/render/shapeGeometry.js +460 -0
- package/dist/render/shapeGeometry.js.map +1 -0
- package/dist/render/spatial.d.ts +9 -0
- package/dist/render/spatial.d.ts.map +1 -0
- package/dist/render/spatial.js +58 -0
- package/dist/render/spatial.js.map +1 -0
- package/dist/render/svgPath.d.ts +80 -0
- package/dist/render/svgPath.d.ts.map +1 -0
- package/dist/render/svgPath.js +199 -0
- package/dist/render/svgPath.js.map +1 -0
- package/dist/render/temporal.d.ts +6 -0
- package/dist/render/temporal.d.ts.map +1 -0
- package/dist/render/temporal.js +74 -0
- package/dist/render/temporal.js.map +1 -0
- package/dist/render/textLayout.d.ts +159 -0
- package/dist/render/textLayout.d.ts.map +1 -0
- package/dist/render/textLayout.js +301 -0
- package/dist/render/textLayout.js.map +1 -0
- package/dist/render/trackEffects.d.ts +23 -0
- package/dist/render/trackEffects.d.ts.map +1 -0
- package/dist/render/trackEffects.js +93 -0
- package/dist/render/trackEffects.js.map +1 -0
- package/dist/render/transform.d.ts +54 -0
- package/dist/render/transform.d.ts.map +1 -0
- package/dist/render/transform.js +222 -0
- package/dist/render/transform.js.map +1 -0
- package/dist/render/transition.d.ts +109 -0
- package/dist/render/transition.d.ts.map +1 -0
- package/dist/render/transition.js +351 -0
- package/dist/render/transition.js.map +1 -0
- package/dist/retarget.d.ts +73 -0
- package/dist/retarget.d.ts.map +1 -0
- package/dist/retarget.js +305 -0
- package/dist/retarget.js.map +1 -0
- package/dist/rippleEdit.d.ts +83 -0
- package/dist/rippleEdit.d.ts.map +1 -0
- package/dist/rippleEdit.js +184 -0
- package/dist/rippleEdit.js.map +1 -0
- package/dist/scene.d.ts +28 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/scene.js +28 -0
- package/dist/scene.js.map +1 -0
- package/dist/script-link.d.ts +52 -0
- package/dist/script-link.d.ts.map +1 -0
- package/dist/script-link.js +78 -0
- package/dist/script-link.js.map +1 -0
- package/dist/script.d.ts +52 -0
- package/dist/script.d.ts.map +1 -0
- package/dist/script.js +93 -0
- package/dist/script.js.map +1 -0
- package/dist/snap.d.ts +2 -0
- package/dist/snap.d.ts.map +1 -0
- package/dist/snap.js +21 -0
- package/dist/snap.js.map +1 -0
- package/dist/snapping/buildSnapPoints.d.ts +16 -0
- package/dist/snapping/buildSnapPoints.d.ts.map +1 -0
- package/dist/snapping/buildSnapPoints.js +39 -0
- package/dist/snapping/buildSnapPoints.js.map +1 -0
- package/dist/snapping/index.d.ts +3 -0
- package/dist/snapping/index.d.ts.map +1 -0
- package/dist/snapping/index.js +3 -0
- package/dist/snapping/index.js.map +1 -0
- package/dist/snapping/resolveSnap.d.ts +19 -0
- package/dist/snapping/resolveSnap.d.ts.map +1 -0
- package/dist/snapping/resolveSnap.js +39 -0
- package/dist/snapping/resolveSnap.js.map +1 -0
- package/dist/sourceRate.d.ts +12 -0
- package/dist/sourceRate.d.ts.map +1 -0
- package/dist/sourceRate.js +13 -0
- package/dist/sourceRate.js.map +1 -0
- package/dist/spatialVideoRequest.d.ts +91 -0
- package/dist/spatialVideoRequest.d.ts.map +1 -0
- package/dist/spatialVideoRequest.js +175 -0
- package/dist/spatialVideoRequest.js.map +1 -0
- package/dist/splitClip.d.ts +3 -0
- package/dist/splitClip.d.ts.map +1 -0
- package/dist/splitClip.js +190 -0
- package/dist/splitClip.js.map +1 -0
- package/dist/stableSerialize.d.ts +11 -0
- package/dist/stableSerialize.d.ts.map +1 -0
- package/dist/stableSerialize.js +31 -0
- package/dist/stableSerialize.js.map +1 -0
- package/dist/staleSet.d.ts +41 -0
- package/dist/staleSet.d.ts.map +1 -0
- package/dist/staleSet.js +106 -0
- package/dist/staleSet.js.map +1 -0
- package/dist/storyboard.d.ts +221 -0
- package/dist/storyboard.d.ts.map +1 -0
- package/dist/storyboard.js +417 -0
- package/dist/storyboard.js.map +1 -0
- package/dist/subtitles.d.ts +61 -0
- package/dist/subtitles.d.ts.map +1 -0
- package/dist/subtitles.js +92 -0
- package/dist/subtitles.js.map +1 -0
- package/dist/takes.d.ts +76 -0
- package/dist/takes.d.ts.map +1 -0
- package/dist/takes.js +238 -0
- package/dist/takes.js.map +1 -0
- package/dist/timeRemap.d.ts +101 -0
- package/dist/timeRemap.d.ts.map +1 -0
- package/dist/timeRemap.js +183 -0
- package/dist/timeRemap.js.map +1 -0
- package/dist/trackOrder.d.ts +38 -0
- package/dist/trackOrder.d.ts.map +1 -0
- package/dist/trackOrder.js +54 -0
- package/dist/trackOrder.js.map +1 -0
- package/dist/transitionAtCut.d.ts +89 -0
- package/dist/transitionAtCut.d.ts.map +1 -0
- package/dist/transitionAtCut.js +217 -0
- package/dist/transitionAtCut.js.map +1 -0
- package/dist/trimClip.d.ts +13 -0
- package/dist/trimClip.d.ts.map +1 -0
- package/dist/trimClip.js +60 -0
- package/dist/trimClip.js.map +1 -0
- package/dist/types.d.ts +1772 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +84 -0
- package/dist/types.js.map +1 -0
- package/fonts/BebasNeue-Regular.ttf +0 -0
- package/fonts/Inter-ExtraBold.ttf +0 -0
- package/fonts/Inter-Italic-Variable.ttf +0 -0
- package/fonts/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter-Variable.ttf +0 -0
- package/fonts/JetBrainsMono-Italic-Variable.ttf +0 -0
- package/fonts/JetBrainsMono-Variable.ttf +0 -0
- package/fonts/Lora-Italic-Variable.ttf +0 -0
- package/fonts/Lora-Variable.ttf +0 -0
- package/fonts/OFL-BebasNeue.txt +93 -0
- package/fonts/OFL-Inter.txt +93 -0
- package/fonts/OFL-JetBrainsMono.txt +93 -0
- package/fonts/OFL-Lora.txt +93 -0
- package/fonts/OFL-PlayfairDisplay.txt +93 -0
- package/fonts/OFL-SpaceGrotesk.txt +93 -0
- package/fonts/PlayfairDisplay-Italic-Variable.ttf +0 -0
- package/fonts/PlayfairDisplay-Variable.ttf +0 -0
- package/fonts/SpaceGrotesk-Variable.ttf +0 -0
- package/package.json +108 -0
package/dist/takes.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Take switching, renaming and deletion — the shared logic behind the
|
|
3
|
+
* `select_take`/`rename_take`/`delete_take` agent ops and the equivalent
|
|
4
|
+
* `TimelineStore` actions (P0 AI Video, PRD § 8.10). A `ClipVersion` is a
|
|
5
|
+
* take; `clip.versions` is the take list.
|
|
6
|
+
*/
|
|
7
|
+
import type { TimelineClip } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* The take actually playing, derived rather than trusted from the stored
|
|
10
|
+
* alias. `activeTakeId` is a convenience field several asset writers besides
|
|
11
|
+
* `selectTake` can set `currentAssetId` without updating (direct generation,
|
|
12
|
+
* imports, agent ops) — `currentAssetId` is the field every renderer and
|
|
13
|
+
* export path actually reads, so a version whose `assetId` matches it is the
|
|
14
|
+
* active take even when `activeTakeId` still names an older one. Falls back
|
|
15
|
+
* to the stored alias only when no version's `assetId` matches at all (e.g.
|
|
16
|
+
* the current asset isn't a recorded take, or a 3D clip's bake history).
|
|
17
|
+
*/
|
|
18
|
+
export declare function activeTakeIdOf(clip: TimelineClip): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Record the clip's accepted asset as a take before an edit is submitted.
|
|
21
|
+
* Imported clips commonly have no version history, so the first candidate
|
|
22
|
+
* would otherwise have no explicit Original take to audition against.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ensureBaselineTake(clip: TimelineClip, createdAt?: string): TimelineClip;
|
|
25
|
+
/** Return a preview-only clip projection for a successful take. */
|
|
26
|
+
export declare function previewTake(clip: TimelineClip, takeId: string): TimelineClip | null;
|
|
27
|
+
export interface ApplyTakeResult {
|
|
28
|
+
clip: TimelineClip;
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Apply a successful take while preserving the editorial shape of its clip.
|
|
33
|
+
*
|
|
34
|
+
* Video-edit results are rendered from the submitted source window, so their
|
|
35
|
+
* source clock starts at zero. The result may be longer than the cut, but the
|
|
36
|
+
* cut keeps its existing duration and uses the remainder as handles. A result
|
|
37
|
+
* that cannot cover the cut is refused before the caller writes the document.
|
|
38
|
+
*/
|
|
39
|
+
export declare function applyTakeToClip(clip: TimelineClip, takeId: string): ApplyTakeResult;
|
|
40
|
+
/**
|
|
41
|
+
* Make a stored take current on a clip. Mirrors `TimelineStore.restoreVersion`
|
|
42
|
+
* so the browser store and the headless op run one rule for what switching a
|
|
43
|
+
* take does — `currentAssetId`, `activeTakeId`, `paramOverrides`,
|
|
44
|
+
* `lastGeneratedHash` and `status` — and, just as importantly, does not touch
|
|
45
|
+
* anything else (position, duration, effects, animations, ...).
|
|
46
|
+
*
|
|
47
|
+
* A no-op (returns `clip` unchanged) for a missing take, one that did not
|
|
48
|
+
* finish successfully, or a `model3d` clip — matching the existing
|
|
49
|
+
* `restoreVersion` guard. `ClipVersion` also carries `bake_model3d_clip`'s
|
|
50
|
+
* render history for a 3D clip: the baked movie lives in `versions` while
|
|
51
|
+
* `currentAssetId` deliberately stays the glTF `model3dStyle` renders from
|
|
52
|
+
* (`ops/apply.ts`'s `bake_model3d_clip` case never touches it). Generic take
|
|
53
|
+
* selection has no bake-aware path, so applying it here would overwrite the
|
|
54
|
+
* glTF with a rendered video and leave `model3dStyle.bake` pointing at a
|
|
55
|
+
* dependency hash the clip no longer matches. Bake-history selection needs
|
|
56
|
+
* its own op; this one refuses model3d clips until it exists.
|
|
57
|
+
*/
|
|
58
|
+
export declare function selectTake(clip: TimelineClip, takeId: string): TimelineClip;
|
|
59
|
+
/** Set a take's display label. A no-op for a take id not on this clip. */
|
|
60
|
+
export declare function renameTake(clip: TimelineClip, takeId: string, label: string): TimelineClip;
|
|
61
|
+
export interface DeleteTakeResult {
|
|
62
|
+
clip: TimelineClip;
|
|
63
|
+
/** Set when the delete was refused; `clip` is then the input, unchanged. */
|
|
64
|
+
error?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Remove a take from a clip's history.
|
|
68
|
+
*
|
|
69
|
+
* Refused (PRD § 8.10) when the take is the active one: deleting it would
|
|
70
|
+
* either leave the clip with zero takes (the sole take), or leave it pointing
|
|
71
|
+
* at an asset with no corresponding take record (one of several) — both read
|
|
72
|
+
* as "explicitly unresolved" rather than a clip that silently keeps playing a
|
|
73
|
+
* now-untracked asset. The caller must `select_take` a different take first.
|
|
74
|
+
*/
|
|
75
|
+
export declare function deleteTake(clip: TimelineClip, takeId: string): DeleteTakeResult;
|
|
76
|
+
//# sourceMappingURL=takes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"takes.d.ts","sourceRoot":"","sources":["../src/takes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAOrE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,YAAY,EAClB,SAAS,SAA2B,GACnC,YAAY,CA6Bd;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CACzB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,GACb,YAAY,GAAG,IAAI,CA4BrB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,GACb,eAAe,CAwDjB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAgC3E;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CACxB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,YAAY,CAOd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,GACb,gBAAgB,CA0BlB"}
|
package/dist/takes.js
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Take switching, renaming and deletion — the shared logic behind the
|
|
3
|
+
* `select_take`/`rename_take`/`delete_take` agent ops and the equivalent
|
|
4
|
+
* `TimelineStore` actions (P0 AI Video, PRD § 8.10). A `ClipVersion` is a
|
|
5
|
+
* take; `clip.versions` is the take list.
|
|
6
|
+
*/
|
|
7
|
+
import { makeClipVersion } from "./defaults.js";
|
|
8
|
+
/**
|
|
9
|
+
* The take actually playing, derived rather than trusted from the stored
|
|
10
|
+
* alias. `activeTakeId` is a convenience field several asset writers besides
|
|
11
|
+
* `selectTake` can set `currentAssetId` without updating (direct generation,
|
|
12
|
+
* imports, agent ops) — `currentAssetId` is the field every renderer and
|
|
13
|
+
* export path actually reads, so a version whose `assetId` matches it is the
|
|
14
|
+
* active take even when `activeTakeId` still names an older one. Falls back
|
|
15
|
+
* to the stored alias only when no version's `assetId` matches at all (e.g.
|
|
16
|
+
* the current asset isn't a recorded take, or a 3D clip's bake history).
|
|
17
|
+
*/
|
|
18
|
+
export function activeTakeIdOf(clip) {
|
|
19
|
+
const versions = clip.versions ?? [];
|
|
20
|
+
if (clip.currentAssetId !== undefined) {
|
|
21
|
+
const match = versions.find((v) => v.assetId === clip.currentAssetId);
|
|
22
|
+
if (match)
|
|
23
|
+
return match.id;
|
|
24
|
+
}
|
|
25
|
+
return clip.activeTakeId;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Record the clip's accepted asset as a take before an edit is submitted.
|
|
29
|
+
* Imported clips commonly have no version history, so the first candidate
|
|
30
|
+
* would otherwise have no explicit Original take to audition against.
|
|
31
|
+
*/
|
|
32
|
+
export function ensureBaselineTake(clip, createdAt = new Date().toISOString()) {
|
|
33
|
+
const assetId = clip.currentAssetId;
|
|
34
|
+
if (!assetId || (clip.versions ?? []).some((take) => take.assetId === assetId)) {
|
|
35
|
+
return clip;
|
|
36
|
+
}
|
|
37
|
+
const baseline = makeClipVersion({
|
|
38
|
+
id: `${clip.id}:baseline:${assetId}`,
|
|
39
|
+
createdAt,
|
|
40
|
+
workflowUpdatedAt: createdAt,
|
|
41
|
+
assetId,
|
|
42
|
+
dependencyHash: clip.dependencyHash ?? "",
|
|
43
|
+
paramOverridesSnapshot: { ...(clip.paramOverrides ?? {}) },
|
|
44
|
+
durationMs: clip.durationMs,
|
|
45
|
+
source: clip.sourceType === "imported" ? "imported" : "generated",
|
|
46
|
+
sourceMapping: {
|
|
47
|
+
...(clip.inPointMs !== undefined && { inPointMs: clip.inPointMs }),
|
|
48
|
+
...(clip.outPointMs !== undefined && { outPointMs: clip.outPointMs }),
|
|
49
|
+
...(clip.speedMultiplier !== undefined && {
|
|
50
|
+
speedMultiplier: clip.speedMultiplier
|
|
51
|
+
}),
|
|
52
|
+
...(clip.speedBaked !== undefined && { speedBaked: clip.speedBaked })
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
...clip,
|
|
57
|
+
versions: [...(clip.versions ?? []), baseline],
|
|
58
|
+
activeTakeId: baseline.id
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Return a preview-only clip projection for a successful take. */
|
|
62
|
+
export function previewTake(clip, takeId) {
|
|
63
|
+
const take = (clip.versions ?? []).find((candidate) => candidate.id === takeId && candidate.status === "success");
|
|
64
|
+
if (!take)
|
|
65
|
+
return null;
|
|
66
|
+
if (take.mediaEdit) {
|
|
67
|
+
return {
|
|
68
|
+
...clip,
|
|
69
|
+
currentAssetId: take.assetId,
|
|
70
|
+
// Generated edit results represent the selected source window from zero.
|
|
71
|
+
inPointMs: 0,
|
|
72
|
+
outPointMs: take.durationMs ?? clip.durationMs,
|
|
73
|
+
speedMultiplier: 1,
|
|
74
|
+
speedBaked: true,
|
|
75
|
+
timeRemap: undefined
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const preview = {
|
|
79
|
+
...clip,
|
|
80
|
+
currentAssetId: take.assetId
|
|
81
|
+
};
|
|
82
|
+
if (take.sourceMapping) {
|
|
83
|
+
preview.inPointMs = take.sourceMapping.inPointMs;
|
|
84
|
+
preview.outPointMs = take.sourceMapping.outPointMs;
|
|
85
|
+
preview.speedMultiplier = take.sourceMapping.speedMultiplier;
|
|
86
|
+
preview.speedBaked = take.sourceMapping.speedBaked;
|
|
87
|
+
}
|
|
88
|
+
return preview;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Apply a successful take while preserving the editorial shape of its clip.
|
|
92
|
+
*
|
|
93
|
+
* Video-edit results are rendered from the submitted source window, so their
|
|
94
|
+
* source clock starts at zero. The result may be longer than the cut, but the
|
|
95
|
+
* cut keeps its existing duration and uses the remainder as handles. A result
|
|
96
|
+
* that cannot cover the cut is refused before the caller writes the document.
|
|
97
|
+
*/
|
|
98
|
+
export function applyTakeToClip(clip, takeId) {
|
|
99
|
+
if (clip.mediaType === "model3d") {
|
|
100
|
+
return {
|
|
101
|
+
clip,
|
|
102
|
+
error: `Clip "${clip.name}" is a 3D clip — take application is not available.`
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const version = (clip.versions ?? []).find((take) => take.id === takeId);
|
|
106
|
+
if (!version) {
|
|
107
|
+
return { clip, error: `No take "${takeId}" on "${clip.name}".` };
|
|
108
|
+
}
|
|
109
|
+
if (version.status !== "success") {
|
|
110
|
+
return {
|
|
111
|
+
clip,
|
|
112
|
+
error: `Take "${takeId}" on "${clip.name}" did not finish successfully.`
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (clip.mediaType === "video") {
|
|
116
|
+
const resultDurationMs = version.durationMs;
|
|
117
|
+
if (resultDurationMs === undefined ||
|
|
118
|
+
!Number.isFinite(resultDurationMs) ||
|
|
119
|
+
resultDurationMs < clip.durationMs) {
|
|
120
|
+
return {
|
|
121
|
+
clip,
|
|
122
|
+
error: `Take "${takeId}" is shorter than the current ${clip.durationMs}ms cut.`
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (version.source === "extended") {
|
|
127
|
+
return {
|
|
128
|
+
clip,
|
|
129
|
+
error: "Choose Keep cut, Available space, or Ripple in the Extend section to apply this take."
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const selected = selectTake(clip, takeId);
|
|
133
|
+
if (selected === clip) {
|
|
134
|
+
return { clip, error: `Take "${takeId}" cannot be applied.` };
|
|
135
|
+
}
|
|
136
|
+
if (!version.mediaEdit)
|
|
137
|
+
return { clip: selected };
|
|
138
|
+
const applied = { ...selected };
|
|
139
|
+
applied.inPointMs = 0;
|
|
140
|
+
applied.outPointMs = clip.durationMs;
|
|
141
|
+
applied.speedMultiplier = 1;
|
|
142
|
+
applied.speedBaked = true;
|
|
143
|
+
delete applied.timeRemap;
|
|
144
|
+
return { clip: applied };
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Make a stored take current on a clip. Mirrors `TimelineStore.restoreVersion`
|
|
148
|
+
* so the browser store and the headless op run one rule for what switching a
|
|
149
|
+
* take does — `currentAssetId`, `activeTakeId`, `paramOverrides`,
|
|
150
|
+
* `lastGeneratedHash` and `status` — and, just as importantly, does not touch
|
|
151
|
+
* anything else (position, duration, effects, animations, ...).
|
|
152
|
+
*
|
|
153
|
+
* A no-op (returns `clip` unchanged) for a missing take, one that did not
|
|
154
|
+
* finish successfully, or a `model3d` clip — matching the existing
|
|
155
|
+
* `restoreVersion` guard. `ClipVersion` also carries `bake_model3d_clip`'s
|
|
156
|
+
* render history for a 3D clip: the baked movie lives in `versions` while
|
|
157
|
+
* `currentAssetId` deliberately stays the glTF `model3dStyle` renders from
|
|
158
|
+
* (`ops/apply.ts`'s `bake_model3d_clip` case never touches it). Generic take
|
|
159
|
+
* selection has no bake-aware path, so applying it here would overwrite the
|
|
160
|
+
* glTF with a rendered video and leave `model3dStyle.bake` pointing at a
|
|
161
|
+
* dependency hash the clip no longer matches. Bake-history selection needs
|
|
162
|
+
* its own op; this one refuses model3d clips until it exists.
|
|
163
|
+
*/
|
|
164
|
+
export function selectTake(clip, takeId) {
|
|
165
|
+
if (clip.mediaType === "model3d")
|
|
166
|
+
return clip;
|
|
167
|
+
const version = (clip.versions ?? []).find((v) => v.id === takeId);
|
|
168
|
+
if (!version || version.status !== "success")
|
|
169
|
+
return clip;
|
|
170
|
+
const restoredHash = version.dependencyHash;
|
|
171
|
+
const status = clip.dependencyHash === restoredHash ? "generated" : "stale";
|
|
172
|
+
const mapped = version.sourceMapping;
|
|
173
|
+
const next = {
|
|
174
|
+
...clip,
|
|
175
|
+
currentAssetId: version.assetId,
|
|
176
|
+
activeTakeId: version.id,
|
|
177
|
+
paramOverrides: version.paramOverridesSnapshot,
|
|
178
|
+
lastGeneratedHash: restoredHash,
|
|
179
|
+
status
|
|
180
|
+
};
|
|
181
|
+
if (mapped) {
|
|
182
|
+
next.inPointMs = mapped.inPointMs;
|
|
183
|
+
next.outPointMs = mapped.outPointMs;
|
|
184
|
+
next.speedMultiplier = mapped.speedMultiplier;
|
|
185
|
+
next.speedBaked = mapped.speedBaked;
|
|
186
|
+
}
|
|
187
|
+
if (version.mediaEdit) {
|
|
188
|
+
next.inPointMs = 0;
|
|
189
|
+
next.outPointMs = version.durationMs ?? clip.durationMs;
|
|
190
|
+
next.speedMultiplier = 1;
|
|
191
|
+
next.speedBaked = true;
|
|
192
|
+
delete next.timeRemap;
|
|
193
|
+
}
|
|
194
|
+
return next;
|
|
195
|
+
}
|
|
196
|
+
/** Set a take's display label. A no-op for a take id not on this clip. */
|
|
197
|
+
export function renameTake(clip, takeId, label) {
|
|
198
|
+
const versions = clip.versions ?? [];
|
|
199
|
+
const index = versions.findIndex((v) => v.id === takeId);
|
|
200
|
+
if (index === -1)
|
|
201
|
+
return clip;
|
|
202
|
+
const nextVersions = versions.slice();
|
|
203
|
+
nextVersions[index] = { ...nextVersions[index], label };
|
|
204
|
+
return { ...clip, versions: nextVersions };
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Remove a take from a clip's history.
|
|
208
|
+
*
|
|
209
|
+
* Refused (PRD § 8.10) when the take is the active one: deleting it would
|
|
210
|
+
* either leave the clip with zero takes (the sole take), or leave it pointing
|
|
211
|
+
* at an asset with no corresponding take record (one of several) — both read
|
|
212
|
+
* as "explicitly unresolved" rather than a clip that silently keeps playing a
|
|
213
|
+
* now-untracked asset. The caller must `select_take` a different take first.
|
|
214
|
+
*/
|
|
215
|
+
export function deleteTake(clip, takeId) {
|
|
216
|
+
const versions = clip.versions ?? [];
|
|
217
|
+
const index = versions.findIndex((v) => v.id === takeId);
|
|
218
|
+
if (index === -1) {
|
|
219
|
+
return { clip, error: `No take "${takeId}" on this clip.` };
|
|
220
|
+
}
|
|
221
|
+
const isActive = activeTakeIdOf(clip) === takeId;
|
|
222
|
+
if (isActive) {
|
|
223
|
+
if (versions.length === 1) {
|
|
224
|
+
return {
|
|
225
|
+
clip,
|
|
226
|
+
error: "Cannot delete the only take on this clip while it has an active " +
|
|
227
|
+
"asset — a clip must always keep at least one take."
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
clip,
|
|
232
|
+
error: "Cannot delete the active take while other takes exist — " +
|
|
233
|
+
"select_take a different take first, then delete this one."
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
return { clip: { ...clip, versions: versions.filter((v) => v.id !== takeId) } };
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=takes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"takes.js","sourceRoot":"","sources":["../src/takes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;A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IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time remapping: a clip's source position as a curve instead of a rate (D13).
|
|
3
|
+
*
|
|
4
|
+
* `speedMultiplier` can only say "play the source n times as fast for the whole
|
|
5
|
+
* clip". A remap says where in the source each instant of the clip sits, so a
|
|
6
|
+
* ramp, a hold and a reverse are all the same object — a list of
|
|
7
|
+
* `{t, sourceMs}` keyframes, `t` normalized over the clip's own window. A remap
|
|
8
|
+
* replaces the rate entirely; `speedMultiplier`, `speedBaked` and `inPointMs`
|
|
9
|
+
* do not shift a remapped clip's source time, because the keyframes already
|
|
10
|
+
* name absolute source milliseconds.
|
|
11
|
+
*
|
|
12
|
+
* The interpolation is the one `evalCurve` uses for animation curves
|
|
13
|
+
* (`animation/sample.ts`): the segment ending at keyframe *i* is eased by
|
|
14
|
+
* keyframe *i*'s own `easing`, and the value is held flat outside the first and
|
|
15
|
+
* last keyframes. So a single keyframe is a freeze frame, and the easing
|
|
16
|
+
* grammar is the one every other curve in the document already speaks.
|
|
17
|
+
*
|
|
18
|
+
* Keyframes are read in array order and are expected to ascend in `t`; the
|
|
19
|
+
* validator reports a document where they do not as `time_remap_not_monotonic`
|
|
20
|
+
* (an error), so this never sorts on the sampling path.
|
|
21
|
+
*
|
|
22
|
+
* Pure; no allocation.
|
|
23
|
+
*/
|
|
24
|
+
import type { ClipTimeRemap, TimelineClip } from "./types.js";
|
|
25
|
+
/** True when a clip's source position comes from a curve rather than a rate. */
|
|
26
|
+
export declare function hasTimeRemap(clip: Pick<TimelineClip, "timeRemap">): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Source position in milliseconds at normalized clip position `t`.
|
|
29
|
+
*
|
|
30
|
+
* `t` is clamped to `[0, 1]`: a caller asking outside the clip's window — a
|
|
31
|
+
* transition reaching past a cut, a motion-blur sample at the very edge of the
|
|
32
|
+
* first frame — gets the first or last keyframe's source position rather than
|
|
33
|
+
* an extrapolation off the end of the media.
|
|
34
|
+
*
|
|
35
|
+
* Returns `null` for a remap with no keyframes, which carries no information
|
|
36
|
+
* and must fall back to the clip's rate.
|
|
37
|
+
*/
|
|
38
|
+
export declare function evaluateTimeRemapMs(remap: ClipTimeRemap, t: number): number | null;
|
|
39
|
+
/**
|
|
40
|
+
* The source position (ms) a remapped clip shows at timeline position
|
|
41
|
+
* `currentTimeMs`, or `null` when the clip carries no usable remap and the
|
|
42
|
+
* caller should fall back to `sourceRate`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function clipRemapSourceMs(clip: Pick<TimelineClip, "timeRemap" | "startMs" | "durationMs">, currentTimeMs: number): number | null;
|
|
45
|
+
/**
|
|
46
|
+
* The source position (ms) a clip shows at timeline position `currentTimeMs` —
|
|
47
|
+
* the remap curve when there is one, otherwise the in-point plus the elapsed
|
|
48
|
+
* clip time at the clip's rate. Never negative.
|
|
49
|
+
*
|
|
50
|
+
* This is `clipSourceTimeSec` (`render/sceneModel.ts`) in milliseconds and
|
|
51
|
+
* without the render dependency, so the pure editing math — the source-anchored
|
|
52
|
+
* animation curves in particular — resolves a clip's source time exactly the
|
|
53
|
+
* way the compositor seeks its video.
|
|
54
|
+
*/
|
|
55
|
+
export declare function clipSourceMsAt(clip: Pick<TimelineClip, "timeRemap" | "startMs" | "durationMs" | "inPointMs" | "speedMultiplier" | "speedBaked">, currentTimeMs: number): number;
|
|
56
|
+
/**
|
|
57
|
+
* One stretch of a clip over which the source runs at a constant rate.
|
|
58
|
+
*
|
|
59
|
+
* `rate` is Δsource / Δtimeline, the same quantity `sourceRate` names for an
|
|
60
|
+
* un-remapped clip: 2 plays the source twice as fast, 0.5 half as fast.
|
|
61
|
+
*/
|
|
62
|
+
export interface TimeRemapAudioSegment {
|
|
63
|
+
timelineStartMs: number;
|
|
64
|
+
timelineEndMs: number;
|
|
65
|
+
sourceStartMs: number;
|
|
66
|
+
sourceEndMs: number;
|
|
67
|
+
rate: number;
|
|
68
|
+
/**
|
|
69
|
+
* The source does not run forwards over this stretch (`rate <= 0`) — a
|
|
70
|
+
* reverse or a freeze. Neither host can sound it; both drop it.
|
|
71
|
+
*/
|
|
72
|
+
reverse: boolean;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The clip's source position as a list of constant-rate stretches — what a
|
|
76
|
+
* sample-rate-based player needs from a curve that a frame-by-frame picture
|
|
77
|
+
* reads point by point.
|
|
78
|
+
*
|
|
79
|
+
* A clip with no remap yields exactly one segment carrying `sourceRate(clip)`
|
|
80
|
+
* and the clip's own in-point, so a host that schedules from these segments
|
|
81
|
+
* plays an ordinary clip the way it did before the curve existed.
|
|
82
|
+
*
|
|
83
|
+
* With a remap, one segment per keyframe pair, cut into `samplesPerSegment`
|
|
84
|
+
* linear pieces when the pair is eased so the pitch tracks the curve instead of
|
|
85
|
+
* jumping at the keyframe. `t` outside the first and last keyframes is held
|
|
86
|
+
* flat by `evaluateTimeRemapMs`, so those stretches appear as freeze segments
|
|
87
|
+
* (`reverse`, rate 0) rather than being left out of the clip's window.
|
|
88
|
+
*/
|
|
89
|
+
export declare function timeRemapAudioSegments(clip: Pick<TimelineClip, "timeRemap" | "startMs" | "durationMs" | "inPointMs" | "speedMultiplier" | "speedBaked">, samplesPerSegment?: number): TimeRemapAudioSegment[];
|
|
90
|
+
/**
|
|
91
|
+
* The refusal split and trim share. A remap makes "the source time at this
|
|
92
|
+
* timeline instant" a curve over the clip's own window, so cutting the window
|
|
93
|
+
* in two or moving its edges would re-normalize `t` and move every frame the
|
|
94
|
+
* clip shows — a cut that silently retimes both halves. Baking the curve into
|
|
95
|
+
* the media first is the only edit that keeps what the user approved (D13).
|
|
96
|
+
*
|
|
97
|
+
* There is no `bakeTimeRemap` in this build: T29 shipped the refusal, and the
|
|
98
|
+
* bake it names is a separate change.
|
|
99
|
+
*/
|
|
100
|
+
export declare function assertNotTimeRemapped(clip: Pick<TimelineClip, "timeRemap">, op: "splitClip" | "trimClip"): void;
|
|
101
|
+
//# sourceMappingURL=timeRemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeRemap.d.ts","sourceRoot":"","sources":["../src/timeRemap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9D,gFAAgF;AAChF,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GACpC,OAAO,CAET;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,aAAa,EACpB,CAAC,EAAE,MAAM,GACR,MAAM,GAAG,IAAI,CAiBf;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC,EAChE,aAAa,EAAE,MAAM,GACpB,MAAM,GAAG,IAAI,CAMf;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,CACR,YAAY,EACV,WAAW,GACX,SAAS,GACT,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,YAAY,CACf,EACD,aAAa,EAAE,MAAM,GACpB,MAAM,CAKR;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAKD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,CACR,YAAY,EACV,WAAW,GACX,SAAS,GACT,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,YAAY,CACf,EACD,iBAAiB,SAA8B,GAC9C,qBAAqB,EAAE,CAsDzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,EACrC,EAAE,EAAE,WAAW,GAAG,UAAU,GAC3B,IAAI,CAQN"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time remapping: a clip's source position as a curve instead of a rate (D13).
|
|
3
|
+
*
|
|
4
|
+
* `speedMultiplier` can only say "play the source n times as fast for the whole
|
|
5
|
+
* clip". A remap says where in the source each instant of the clip sits, so a
|
|
6
|
+
* ramp, a hold and a reverse are all the same object — a list of
|
|
7
|
+
* `{t, sourceMs}` keyframes, `t` normalized over the clip's own window. A remap
|
|
8
|
+
* replaces the rate entirely; `speedMultiplier`, `speedBaked` and `inPointMs`
|
|
9
|
+
* do not shift a remapped clip's source time, because the keyframes already
|
|
10
|
+
* name absolute source milliseconds.
|
|
11
|
+
*
|
|
12
|
+
* The interpolation is the one `evalCurve` uses for animation curves
|
|
13
|
+
* (`animation/sample.ts`): the segment ending at keyframe *i* is eased by
|
|
14
|
+
* keyframe *i*'s own `easing`, and the value is held flat outside the first and
|
|
15
|
+
* last keyframes. So a single keyframe is a freeze frame, and the easing
|
|
16
|
+
* grammar is the one every other curve in the document already speaks.
|
|
17
|
+
*
|
|
18
|
+
* Keyframes are read in array order and are expected to ascend in `t`; the
|
|
19
|
+
* validator reports a document where they do not as `time_remap_not_monotonic`
|
|
20
|
+
* (an error), so this never sorts on the sampling path.
|
|
21
|
+
*
|
|
22
|
+
* Pure; no allocation.
|
|
23
|
+
*/
|
|
24
|
+
import { ease } from "./animation/easing.js";
|
|
25
|
+
import { sourceRate } from "./sourceRate.js";
|
|
26
|
+
/** True when a clip's source position comes from a curve rather than a rate. */
|
|
27
|
+
export function hasTimeRemap(clip) {
|
|
28
|
+
return (clip.timeRemap?.keyframes.length ?? 0) > 0;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Source position in milliseconds at normalized clip position `t`.
|
|
32
|
+
*
|
|
33
|
+
* `t` is clamped to `[0, 1]`: a caller asking outside the clip's window — a
|
|
34
|
+
* transition reaching past a cut, a motion-blur sample at the very edge of the
|
|
35
|
+
* first frame — gets the first or last keyframe's source position rather than
|
|
36
|
+
* an extrapolation off the end of the media.
|
|
37
|
+
*
|
|
38
|
+
* Returns `null` for a remap with no keyframes, which carries no information
|
|
39
|
+
* and must fall back to the clip's rate.
|
|
40
|
+
*/
|
|
41
|
+
export function evaluateTimeRemapMs(remap, t) {
|
|
42
|
+
const kfs = remap.keyframes;
|
|
43
|
+
if (kfs.length === 0)
|
|
44
|
+
return null;
|
|
45
|
+
const first = kfs[0];
|
|
46
|
+
if (t <= first.t)
|
|
47
|
+
return first.sourceMs;
|
|
48
|
+
const last = kfs[kfs.length - 1];
|
|
49
|
+
if (t >= last.t)
|
|
50
|
+
return last.sourceMs;
|
|
51
|
+
for (let i = 1; i < kfs.length; i++) {
|
|
52
|
+
const b = kfs[i];
|
|
53
|
+
if (t > b.t)
|
|
54
|
+
continue;
|
|
55
|
+
const a = kfs[i - 1];
|
|
56
|
+
const span = b.t - a.t;
|
|
57
|
+
const segT = span > 0 ? (t - a.t) / span : 0;
|
|
58
|
+
const eased = ease(b.easing ?? "linear", segT);
|
|
59
|
+
return a.sourceMs + (b.sourceMs - a.sourceMs) * eased;
|
|
60
|
+
}
|
|
61
|
+
return last.sourceMs;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The source position (ms) a remapped clip shows at timeline position
|
|
65
|
+
* `currentTimeMs`, or `null` when the clip carries no usable remap and the
|
|
66
|
+
* caller should fall back to `sourceRate`.
|
|
67
|
+
*/
|
|
68
|
+
export function clipRemapSourceMs(clip, currentTimeMs) {
|
|
69
|
+
const remap = clip.timeRemap;
|
|
70
|
+
if (!remap || remap.keyframes.length === 0)
|
|
71
|
+
return null;
|
|
72
|
+
const span = clip.durationMs;
|
|
73
|
+
const t = span > 0 ? (currentTimeMs - clip.startMs) / span : 0;
|
|
74
|
+
return evaluateTimeRemapMs(remap, t);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The source position (ms) a clip shows at timeline position `currentTimeMs` —
|
|
78
|
+
* the remap curve when there is one, otherwise the in-point plus the elapsed
|
|
79
|
+
* clip time at the clip's rate. Never negative.
|
|
80
|
+
*
|
|
81
|
+
* This is `clipSourceTimeSec` (`render/sceneModel.ts`) in milliseconds and
|
|
82
|
+
* without the render dependency, so the pure editing math — the source-anchored
|
|
83
|
+
* animation curves in particular — resolves a clip's source time exactly the
|
|
84
|
+
* way the compositor seeks its video.
|
|
85
|
+
*/
|
|
86
|
+
export function clipSourceMsAt(clip, currentTimeMs) {
|
|
87
|
+
const remapped = clipRemapSourceMs(clip, currentTimeMs);
|
|
88
|
+
if (remapped !== null)
|
|
89
|
+
return Math.max(0, remapped);
|
|
90
|
+
const intoClipMs = currentTimeMs - clip.startMs;
|
|
91
|
+
return Math.max(0, intoClipMs * sourceRate(clip) + (clip.inPointMs ?? 0));
|
|
92
|
+
}
|
|
93
|
+
/** An eased keyframe pair is cut into this many linear pieces by default. */
|
|
94
|
+
const DEFAULT_REMAP_AUDIO_SAMPLES = 8;
|
|
95
|
+
/**
|
|
96
|
+
* The clip's source position as a list of constant-rate stretches — what a
|
|
97
|
+
* sample-rate-based player needs from a curve that a frame-by-frame picture
|
|
98
|
+
* reads point by point.
|
|
99
|
+
*
|
|
100
|
+
* A clip with no remap yields exactly one segment carrying `sourceRate(clip)`
|
|
101
|
+
* and the clip's own in-point, so a host that schedules from these segments
|
|
102
|
+
* plays an ordinary clip the way it did before the curve existed.
|
|
103
|
+
*
|
|
104
|
+
* With a remap, one segment per keyframe pair, cut into `samplesPerSegment`
|
|
105
|
+
* linear pieces when the pair is eased so the pitch tracks the curve instead of
|
|
106
|
+
* jumping at the keyframe. `t` outside the first and last keyframes is held
|
|
107
|
+
* flat by `evaluateTimeRemapMs`, so those stretches appear as freeze segments
|
|
108
|
+
* (`reverse`, rate 0) rather than being left out of the clip's window.
|
|
109
|
+
*/
|
|
110
|
+
export function timeRemapAudioSegments(clip, samplesPerSegment = DEFAULT_REMAP_AUDIO_SAMPLES) {
|
|
111
|
+
const span = clip.durationMs;
|
|
112
|
+
const remap = clip.timeRemap;
|
|
113
|
+
const kfs = remap?.keyframes ?? [];
|
|
114
|
+
if (!remap || kfs.length === 0 || span <= 0) {
|
|
115
|
+
const rate = sourceRate(clip);
|
|
116
|
+
const sourceStartMs = clip.inPointMs ?? 0;
|
|
117
|
+
return [
|
|
118
|
+
{
|
|
119
|
+
timelineStartMs: clip.startMs,
|
|
120
|
+
timelineEndMs: clip.startMs + span,
|
|
121
|
+
sourceStartMs,
|
|
122
|
+
sourceEndMs: sourceStartMs + span * rate,
|
|
123
|
+
rate,
|
|
124
|
+
reverse: rate <= 0
|
|
125
|
+
}
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
const segments = [];
|
|
129
|
+
const clamp01 = (t) => Math.min(1, Math.max(0, t));
|
|
130
|
+
const push = (t0, t1) => {
|
|
131
|
+
if (t1 <= t0)
|
|
132
|
+
return;
|
|
133
|
+
const timelineStartMs = clip.startMs + t0 * span;
|
|
134
|
+
const timelineEndMs = clip.startMs + t1 * span;
|
|
135
|
+
const sourceStartMs = evaluateTimeRemapMs(remap, t0) ?? 0;
|
|
136
|
+
const sourceEndMs = evaluateTimeRemapMs(remap, t1) ?? 0;
|
|
137
|
+
const rate = (sourceEndMs - sourceStartMs) / (timelineEndMs - timelineStartMs);
|
|
138
|
+
segments.push({
|
|
139
|
+
timelineStartMs,
|
|
140
|
+
timelineEndMs,
|
|
141
|
+
sourceStartMs,
|
|
142
|
+
sourceEndMs,
|
|
143
|
+
rate,
|
|
144
|
+
reverse: rate <= 0
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
const firstT = clamp01(kfs[0].t);
|
|
148
|
+
const lastT = clamp01(kfs[kfs.length - 1].t);
|
|
149
|
+
push(0, firstT);
|
|
150
|
+
const pieces = Math.max(1, Math.floor(samplesPerSegment));
|
|
151
|
+
for (let i = 1; i < kfs.length; i++) {
|
|
152
|
+
const a = clamp01(kfs[i - 1].t);
|
|
153
|
+
const b = clamp01(kfs[i].t);
|
|
154
|
+
if (b <= a)
|
|
155
|
+
continue;
|
|
156
|
+
const easing = kfs[i].easing;
|
|
157
|
+
const n = easing && easing !== "linear" ? pieces : 1;
|
|
158
|
+
for (let j = 0; j < n; j++) {
|
|
159
|
+
push(a + ((b - a) * j) / n, a + ((b - a) * (j + 1)) / n);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
push(lastT, 1);
|
|
163
|
+
return segments;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The refusal split and trim share. A remap makes "the source time at this
|
|
167
|
+
* timeline instant" a curve over the clip's own window, so cutting the window
|
|
168
|
+
* in two or moving its edges would re-normalize `t` and move every frame the
|
|
169
|
+
* clip shows — a cut that silently retimes both halves. Baking the curve into
|
|
170
|
+
* the media first is the only edit that keeps what the user approved (D13).
|
|
171
|
+
*
|
|
172
|
+
* There is no `bakeTimeRemap` in this build: T29 shipped the refusal, and the
|
|
173
|
+
* bake it names is a separate change.
|
|
174
|
+
*/
|
|
175
|
+
export function assertNotTimeRemapped(clip, op) {
|
|
176
|
+
if (!hasTimeRemap(clip))
|
|
177
|
+
return;
|
|
178
|
+
throw new Error(`${op} cannot edit a clip that carries a time remap — the curve is ` +
|
|
179
|
+
"normalized over the clip's window, so changing the window would retime " +
|
|
180
|
+
"every frame. Bake the remap into the media first (`bake_time_remap`), " +
|
|
181
|
+
"or clear `timeRemap` to edit at the clip's rate.");
|
|
182
|
+
}
|
|
183
|
+
//# sourceM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