@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/scene.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nodetool-ai/timeline/scene — the render surface minus the GPU.
|
|
3
|
+
*
|
|
4
|
+
* `./render` re-exports {@link HeadlessFrameCompositor}, which imports
|
|
5
|
+
* `@nodetool-ai/gpu/webgpu` and through it TypeGPU. A caller that only needs to
|
|
6
|
+
* resolve what is on screen at a time and draw it on a Canvas 2D surface — the
|
|
7
|
+
* agent-facing frame preview — should not pay for that, so the GPU-free half is
|
|
8
|
+
* re-exported here: the scene model, the placement math, the text/shape/caption
|
|
9
|
+
* drawing rules and the Canvas 2D compositing rules.
|
|
10
|
+
*
|
|
11
|
+
* Import `./render` when you want the GPU compositor, `./scene` when you don't.
|
|
12
|
+
* Both draw from the same modules, so the two paths cannot drift.
|
|
13
|
+
*/
|
|
14
|
+
export * from "./render/sceneModel.js";
|
|
15
|
+
export * from "./render/model3dBakeSamples.js";
|
|
16
|
+
export * from "./render/transform.js";
|
|
17
|
+
export * from "./render/transition.js";
|
|
18
|
+
export * from "./render/draw.js";
|
|
19
|
+
export * from "./render/svgPath.js";
|
|
20
|
+
export * from "./render/shapeGeometry.js";
|
|
21
|
+
export * from "./render/textLayout.js";
|
|
22
|
+
export * from "./render/canvas2d.js";
|
|
23
|
+
export * from "./render/trackEffects.js";
|
|
24
|
+
export * from "./render/motionBlur.js";
|
|
25
|
+
export * from "./render/layout.js";
|
|
26
|
+
export * from "./render/spatial.js";
|
|
27
|
+
export * from "./render/temporal.js";
|
|
28
|
+
//# sourceMappingURL=scene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene.js","sourceRoot":"","sources":["../src/scene.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audio-led shot timing for a board linked to a script.
|
|
3
|
+
*
|
|
4
|
+
* A linked shot is as long as the words it covers: the sum of its lines'
|
|
5
|
+
* current takes plus the silence authored after each. Nothing is stored —
|
|
6
|
+
* `duration_seconds` stays whatever the board wrote — so a re-voice changes
|
|
7
|
+
* the cut the next time anything asks, exactly like `needsVoicing` in
|
|
8
|
+
* `script.ts`.
|
|
9
|
+
*
|
|
10
|
+
* Timeline package rather than protocol because the answer comes from
|
|
11
|
+
* `currentTake`, and it has to agree with `buildScriptTimeline` down to the
|
|
12
|
+
* placeholder used for a take of unknown length: the shot has to be long
|
|
13
|
+
* enough to hold the voiceover clips laid inside it.
|
|
14
|
+
*/
|
|
15
|
+
import type { Shot } from "@nodetool-ai/protocol";
|
|
16
|
+
import type { ScriptLine, ScriptSection } from "@nodetool-ai/protocol/api-schemas/scripts.js";
|
|
17
|
+
/** Lines of a script keyed by id, the lookup the shot mappings read. */
|
|
18
|
+
export declare const scriptLinesById: (sections: ScriptSection[]) => Map<string, ScriptLine>;
|
|
19
|
+
/**
|
|
20
|
+
* How much timeline one voiced line occupies: its take's length (or the
|
|
21
|
+
* placeholder, as in {@link buildScriptTimeline}) plus the silence after it.
|
|
22
|
+
* `null` when the line has no take backed by an audio asset — the same bar
|
|
23
|
+
* `isAssemblableLine` sets, so a line that is counted here is a line that gets
|
|
24
|
+
* a clip.
|
|
25
|
+
*/
|
|
26
|
+
export declare const linkedLineDurationMs: (line: ScriptLine) => number | null;
|
|
27
|
+
/**
|
|
28
|
+
* The audio-derived length of a shot, or `null` when audio must not decide it:
|
|
29
|
+
* the shot links no lines, one of them is unvoiced, a linked line is missing
|
|
30
|
+
* from the script, or the user pinned `duration_source: "manual"`. Callers fall
|
|
31
|
+
* back to the shot's own `duration_seconds` (`DEFAULT_SHOT_MS`).
|
|
32
|
+
*/
|
|
33
|
+
export declare function linkedShotDurationMs(shot: Shot, linesById: Map<string, ScriptLine>): number | null;
|
|
34
|
+
/** Where a shot's effective length came from. */
|
|
35
|
+
export type EffectiveDurationSource = "audio" | "manual";
|
|
36
|
+
export interface EffectiveShotDuration {
|
|
37
|
+
/** Seconds to render, or `undefined` to let the model's default decide. */
|
|
38
|
+
seconds: number | undefined;
|
|
39
|
+
source: EffectiveDurationSource;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The length a render should ask a video model for, and where it came from.
|
|
43
|
+
* Audio wins whenever {@link linkedShotDurationMs} has an answer; otherwise the
|
|
44
|
+
* shot's own `duration_seconds` does, which is also what an unlinked board and
|
|
45
|
+
* a `duration_source: "manual"` shot get.
|
|
46
|
+
*
|
|
47
|
+
* Seconds are rounded **up**: a clip that runs a fraction short of its takes
|
|
48
|
+
* leaves black under the voiceover, while an overlong one is trimmed by the
|
|
49
|
+
* timeline slot `buildLinkedTimeline` gives it.
|
|
50
|
+
*/
|
|
51
|
+
export declare function effectiveShotDuration(shot: Shot, linesById: Map<string, ScriptLine>): EffectiveShotDuration;
|
|
52
|
+
//# sourceMappingURL=script-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-link.d.ts","sourceRoot":"","sources":["../src/script-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACd,MAAM,8CAA8C,CAAC;AAGtD,wEAAwE;AACxE,eAAO,MAAM,eAAe,aAChB,aAAa,EAAE,KACxB,GAAG,CAAC,MAAM,EAAE,UAAU,CACsC,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,SAAU,UAAU,KAAG,MAAM,GAAG,IAQhE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GACjC,MAAM,GAAG,IAAI,CAqBf;AAED,iDAAiD;AACjD,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,2EAA2E;IAC3E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GACjC,qBAAqB,CAMvB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audio-led shot timing for a board linked to a script.
|
|
3
|
+
*
|
|
4
|
+
* A linked shot is as long as the words it covers: the sum of its lines'
|
|
5
|
+
* current takes plus the silence authored after each. Nothing is stored —
|
|
6
|
+
* `duration_seconds` stays whatever the board wrote — so a re-voice changes
|
|
7
|
+
* the cut the next time anything asks, exactly like `needsVoicing` in
|
|
8
|
+
* `script.ts`.
|
|
9
|
+
*
|
|
10
|
+
* Timeline package rather than protocol because the answer comes from
|
|
11
|
+
* `currentTake`, and it has to agree with `buildScriptTimeline` down to the
|
|
12
|
+
* placeholder used for a take of unknown length: the shot has to be long
|
|
13
|
+
* enough to hold the voiceover clips laid inside it.
|
|
14
|
+
*/
|
|
15
|
+
import { PLACEHOLDER_LINE_MS, currentTake, scriptLines } from "./script.js";
|
|
16
|
+
/** Lines of a script keyed by id, the lookup the shot mappings read. */
|
|
17
|
+
export const scriptLinesById = (sections) => new Map(scriptLines(sections).map((line) => [line.id, line]));
|
|
18
|
+
/**
|
|
19
|
+
* How much timeline one voiced line occupies: its take's length (or the
|
|
20
|
+
* placeholder, as in {@link buildScriptTimeline}) plus the silence after it.
|
|
21
|
+
* `null` when the line has no take backed by an audio asset — the same bar
|
|
22
|
+
* `isAssemblableLine` sets, so a line that is counted here is a line that gets
|
|
23
|
+
* a clip.
|
|
24
|
+
*/
|
|
25
|
+
export const linkedLineDurationMs = (line) => {
|
|
26
|
+
const take = currentTake(line);
|
|
27
|
+
if (!take || !take.assetId) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const durationMs = take.durationMs > 0 ? take.durationMs : PLACEHOLDER_LINE_MS;
|
|
31
|
+
return durationMs + Math.max(0, line.pauseAfterMs ?? 0);
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The audio-derived length of a shot, or `null` when audio must not decide it:
|
|
35
|
+
* the shot links no lines, one of them is unvoiced, a linked line is missing
|
|
36
|
+
* from the script, or the user pinned `duration_source: "manual"`. Callers fall
|
|
37
|
+
* back to the shot's own `duration_seconds` (`DEFAULT_SHOT_MS`).
|
|
38
|
+
*/
|
|
39
|
+
export function linkedShotDurationMs(shot, linesById) {
|
|
40
|
+
if (shot.duration_source === "manual") {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const lineIds = shot.script_line_ids ?? [];
|
|
44
|
+
if (lineIds.length === 0) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
let totalMs = 0;
|
|
48
|
+
for (const lineId of lineIds) {
|
|
49
|
+
const line = linesById.get(lineId);
|
|
50
|
+
if (!line) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const lineMs = linkedLineDurationMs(line);
|
|
54
|
+
if (lineMs === null) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
totalMs += lineMs;
|
|
58
|
+
}
|
|
59
|
+
return totalMs;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The length a render should ask a video model for, and where it came from.
|
|
63
|
+
* Audio wins whenever {@link linkedShotDurationMs} has an answer; otherwise the
|
|
64
|
+
* shot's own `duration_seconds` does, which is also what an unlinked board and
|
|
65
|
+
* a `duration_source: "manual"` shot get.
|
|
66
|
+
*
|
|
67
|
+
* Seconds are rounded **up**: a clip that runs a fraction short of its takes
|
|
68
|
+
* leaves black under the voiceover, while an overlong one is trimmed by the
|
|
69
|
+
* timeline slot `buildLinkedTimeline` gives it.
|
|
70
|
+
*/
|
|
71
|
+
export function effectiveShotDuration(shot, linesById) {
|
|
72
|
+
const audioMs = linkedShotDurationMs(shot, linesById);
|
|
73
|
+
if (audioMs !== null && audioMs > 0) {
|
|
74
|
+
return { seconds: Math.ceil(audioMs / 1000), source: "audio" };
|
|
75
|
+
}
|
|
76
|
+
return { seconds: shot.duration_seconds, source: "manual" };
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=script-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-link.js","sourceRoot":"","sources":["../src/script-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE5E,wEAAwE;AACxE,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,QAAyB,EACA,EAAE,CAC3B,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAgB,EAAiB,EAAE;IACtE,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC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AAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACjE,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9D,CAAC"}
|
package/dist/script.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script → timeline assembly, and the voicing rules around it.
|
|
3
|
+
*
|
|
4
|
+
* A script owns its text; audio is derived. Assembly projects each line's
|
|
5
|
+
* current take into a voiceover track: one asset-backed audio clip per voiced
|
|
6
|
+
* line, laid end to end in reading order with the line's authored
|
|
7
|
+
* `pauseAfterMs` gap. Every clip carries its take's word timings, the speaker
|
|
8
|
+
* label, and two linkage keys (`scriptId` + `scriptLineId`) so a later re-voice
|
|
9
|
+
* can round-trip its new take into the assembled sequence — the script mirror
|
|
10
|
+
* of the storyboard's board/shot bridge.
|
|
11
|
+
*
|
|
12
|
+
* One module because three surfaces need the same answer: the editor's "Send
|
|
13
|
+
* to timeline", the `nodetool.script.*` nodes, and the headless
|
|
14
|
+
* `assemble_script_timeline` agent tool. Types come from
|
|
15
|
+
* `@nodetool-ai/protocol` as types only, so this stays free of runtime deps.
|
|
16
|
+
*/
|
|
17
|
+
import type { ScriptLine, ScriptSection, Speaker, Take, VoiceBinding } from "@nodetool-ai/protocol/api-schemas/scripts.js";
|
|
18
|
+
import type { CaptionWord, TimelineClip, TimelineTrack } from "./types.js";
|
|
19
|
+
/** Clip length for a take whose duration could not be determined. */
|
|
20
|
+
export declare const PLACEHOLDER_LINE_MS = 3000;
|
|
21
|
+
export interface ScriptAssemblyInput {
|
|
22
|
+
/** Script id stamped onto each clip, linking the cut back to the script. */
|
|
23
|
+
scriptId: string;
|
|
24
|
+
cast: Speaker[];
|
|
25
|
+
sections: ScriptSection[];
|
|
26
|
+
}
|
|
27
|
+
export interface AssembledScriptTimeline {
|
|
28
|
+
tracks: TimelineTrack[];
|
|
29
|
+
clips: TimelineClip[];
|
|
30
|
+
/** Total length of the voiceover track in ms (last clip end). */
|
|
31
|
+
durationMs: number;
|
|
32
|
+
/** Lines skipped because they have no voiced current take. */
|
|
33
|
+
skippedLineIds: string[];
|
|
34
|
+
}
|
|
35
|
+
/** Every line of the script in reading order. */
|
|
36
|
+
export declare const scriptLines: (sections: ScriptSection[]) => ScriptLine[];
|
|
37
|
+
/** The current take of a line, if one is selected and present. */
|
|
38
|
+
export declare const currentTake: (line: ScriptLine) => Take | undefined;
|
|
39
|
+
/** The voice a line is voiced with: its own override, else its speaker's. */
|
|
40
|
+
export declare const effectiveVoice: (line: ScriptLine, cast: Speaker[]) => VoiceBinding | null;
|
|
41
|
+
/**
|
|
42
|
+
* Whether a line needs (re-)voicing: it has no current take, or the text or
|
|
43
|
+
* voice drifted from what that take was voiced from. Staleness is derived,
|
|
44
|
+
* never stored.
|
|
45
|
+
*/
|
|
46
|
+
export declare const needsVoicing: (line: ScriptLine, voice: VoiceBinding | null) => boolean;
|
|
47
|
+
/** A line is assemblable when its current take landed as an audio asset. */
|
|
48
|
+
export declare const isAssemblableLine: (line: ScriptLine) => boolean;
|
|
49
|
+
/** Copy a take's word timings into the timeline's `CaptionWord` shape. */
|
|
50
|
+
export declare const takeCaptionWords: (take: Take) => CaptionWord[];
|
|
51
|
+
export declare function buildScriptTimeline(input: ScriptAssemblyInput): AssembledScriptTimeline;
|
|
52
|
+
//# sourceMappingURL=script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,OAAO,EACP,IAAI,EACJ,YAAY,EACb,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3E,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,MAAM,WAAW,mBAAmB;IAClC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,iDAAiD;AACjD,eAAO,MAAM,WAAW,aAAc,aAAa,EAAE,KAAG,UAAU,EACpB,CAAC;AAE/C,kEAAkE;AAClE,eAAO,MAAM,WAAW,SAAU,UAAU,KAAG,IAAI,GAAG,SACK,CAAC;AAE5D,6EAA6E;AAC7E,eAAO,MAAM,cAAc,SACnB,UAAU,QACV,OAAO,EAAE,KACd,YAAY,GAAG,IAIjB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,SACjB,UAAU,SACT,YAAY,GAAG,IAAI,KACzB,OAOF,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,SAAU,UAAU,KAAG,OAGpD,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,SAAU,IAAI,KAAG,WAAW,EACsB,CAAC;AAEhF,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,mBAAmB,GACzB,uBAAuB,CAiDzB"}
|
package/dist/script.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script → timeline assembly, and the voicing rules around it.
|
|
3
|
+
*
|
|
4
|
+
* A script owns its text; audio is derived. Assembly projects each line's
|
|
5
|
+
* current take into a voiceover track: one asset-backed audio clip per voiced
|
|
6
|
+
* line, laid end to end in reading order with the line's authored
|
|
7
|
+
* `pauseAfterMs` gap. Every clip carries its take's word timings, the speaker
|
|
8
|
+
* label, and two linkage keys (`scriptId` + `scriptLineId`) so a later re-voice
|
|
9
|
+
* can round-trip its new take into the assembled sequence — the script mirror
|
|
10
|
+
* of the storyboard's board/shot bridge.
|
|
11
|
+
*
|
|
12
|
+
* One module because three surfaces need the same answer: the editor's "Send
|
|
13
|
+
* to timeline", the `nodetool.script.*` nodes, and the headless
|
|
14
|
+
* `assemble_script_timeline` agent tool. Types come from
|
|
15
|
+
* `@nodetool-ai/protocol` as types only, so this stays free of runtime deps.
|
|
16
|
+
*/
|
|
17
|
+
import { makeClip, makeTrack } from "./defaults.js";
|
|
18
|
+
/** Clip length for a take whose duration could not be determined. */
|
|
19
|
+
export const PLACEHOLDER_LINE_MS = 3000;
|
|
20
|
+
/** Every line of the script in reading order. */
|
|
21
|
+
export const scriptLines = (sections) => sections.flatMap((section) => section.lines);
|
|
22
|
+
/** The current take of a line, if one is selected and present. */
|
|
23
|
+
export const currentTake = (line) => line.takes.find((take) => take.id === line.currentTakeId);
|
|
24
|
+
/** The voice a line is voiced with: its own override, else its speaker's. */
|
|
25
|
+
export const effectiveVoice = (line, cast) => {
|
|
26
|
+
if (line.voiceOverride)
|
|
27
|
+
return line.voiceOverride;
|
|
28
|
+
const speaker = cast.find((s) => s.id === line.speakerId);
|
|
29
|
+
return speaker?.voice ?? null;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Whether a line needs (re-)voicing: it has no current take, or the text or
|
|
33
|
+
* voice drifted from what that take was voiced from. Staleness is derived,
|
|
34
|
+
* never stored.
|
|
35
|
+
*/
|
|
36
|
+
export const needsVoicing = (line, voice) => {
|
|
37
|
+
const take = currentTake(line);
|
|
38
|
+
if (!take)
|
|
39
|
+
return true;
|
|
40
|
+
return (take.textSnapshot !== line.text ||
|
|
41
|
+
JSON.stringify(take.voiceSnapshot ?? null) !== JSON.stringify(voice));
|
|
42
|
+
};
|
|
43
|
+
/** A line is assemblable when its current take landed as an audio asset. */
|
|
44
|
+
export const isAssemblableLine = (line) => {
|
|
45
|
+
const take = currentTake(line);
|
|
46
|
+
return !!take && typeof take.assetId === "string" && take.assetId.length > 0;
|
|
47
|
+
};
|
|
48
|
+
/** Copy a take's word timings into the timeline's `CaptionWord` shape. */
|
|
49
|
+
export const takeCaptionWords = (take) => take.words.map((w) => ({ word: w.word, startMs: w.startMs, endMs: w.endMs }));
|
|
50
|
+
export function buildScriptTimeline(input) {
|
|
51
|
+
const track = makeTrack({ type: "audio", name: "Voiceover", index: 0 });
|
|
52
|
+
const tracks = [track];
|
|
53
|
+
const clips = [];
|
|
54
|
+
const skippedLineIds = [];
|
|
55
|
+
const speakerName = (speakerId) => speakerId ? input.cast.find((s) => s.id === speakerId)?.name : undefined;
|
|
56
|
+
let cursorMs = 0;
|
|
57
|
+
for (const line of scriptLines(input.sections)) {
|
|
58
|
+
const take = currentTake(line);
|
|
59
|
+
if (!take || !take.assetId) {
|
|
60
|
+
skippedLineIds.push(line.id);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const durationMs = take.durationMs > 0 ? take.durationMs : PLACEHOLDER_LINE_MS;
|
|
64
|
+
const words = takeCaptionWords(take);
|
|
65
|
+
const voice = effectiveVoice(line, input.cast);
|
|
66
|
+
clips.push(makeClip({
|
|
67
|
+
trackId: track.id,
|
|
68
|
+
name: line.text.slice(0, 40) || "Line",
|
|
69
|
+
startMs: cursorMs,
|
|
70
|
+
durationMs,
|
|
71
|
+
mediaType: "audio",
|
|
72
|
+
// This is authored TTS, even though its audio asset already exists.
|
|
73
|
+
// Providers without word timings need the generated-clip prompt
|
|
74
|
+
// fallback so the transcript panel and script lane still show text.
|
|
75
|
+
sourceType: "generated",
|
|
76
|
+
bindingKind: "text-to-audio",
|
|
77
|
+
status: "generated",
|
|
78
|
+
currentAssetId: take.assetId,
|
|
79
|
+
prompt: line.text,
|
|
80
|
+
provider: voice?.provider,
|
|
81
|
+
model: voice?.model,
|
|
82
|
+
voice: voice?.voice,
|
|
83
|
+
speaker: speakerName(line.speakerId),
|
|
84
|
+
caption: words.length ? { words } : undefined,
|
|
85
|
+
scriptId: input.scriptId,
|
|
86
|
+
scriptLineId: line.id,
|
|
87
|
+
versions: []
|
|
88
|
+
}));
|
|
89
|
+
cursorMs += durationMs + Math.max(0, line.pauseAfterMs ?? 0);
|
|
90
|
+
}
|
|
91
|
+
return { tracks, clips, durationMs: cursorMs, skippedLineIds };
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script.js","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGpD,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAkBxC,iDAAiD;AACjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAyB,EAAgB,EAAE,CACrE,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAE/C,kEAAkE;AAClE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAgB,EAAoB,EAAE,CAChE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,aAAa,CAAC,CAAC;AAE5D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAgB,EAChB,IAAe,EACM,EAAE;IACvB,IAAI,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,CAAC,aAAa,CAAC;IAClD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,SAAS,CAAC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B,MAAM,EAAE,WAAW;YACnB,cAAc,EAAE,IAAI,CAAC,OAAO;YAC5B,MAAM,EAAE,IAAI,CAAC,IAAI;YACjB,QAAQ,EAAE,KAAK,EAAE,QAAQ;YACzB,KAAK,EAAE,KAAK,EAAE,KAAK;YACnB,KAAK,EAAE,KAAK,EAAE,KAAK;YACnB,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC;YACpC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS;YAC7C,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,YAAY,EAAE,IAAI,CAAC,EAAE;YACrB,QAAQ,EAAE,EAAE;SACb,CAAC,CACH,CAAC;QACF,QAAQ,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AACjE,CAAC"}
|
package/dist/snap.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snap.d.ts","sourceRoot":"","sources":["../src/snap.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAAE,EACpB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,MAAM,CAwBR"}
|
package/dist/snap.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function snap(timeMs, candidates, thresholdPx, msPerPx) {
|
|
2
|
+
const thresholdMs = thresholdPx * msPerPx;
|
|
3
|
+
let closest = timeMs;
|
|
4
|
+
let closestDistance = Number.POSITIVE_INFINITY;
|
|
5
|
+
for (const candidate of candidates) {
|
|
6
|
+
const distance = Math.abs(candidate - timeMs);
|
|
7
|
+
if (distance > thresholdMs) {
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
if (distance < closestDistance) {
|
|
11
|
+
closest = candidate;
|
|
12
|
+
closestDistance = distance;
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (distance === closestDistance && candidate < closest) {
|
|
16
|
+
closest = candidate;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return closest;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=snap.js.map
|
package/dist/snap.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snap.js","sourceRoot":"","sources":["../src/snap.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,IAAI,CAClB,MAAc,EACd,UAAoB,EACpB,WAAmB,EACnB,OAAe;IAEf,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;IAE1C,IAAI,OAAO,GAAG,MAAM,CAAC;IACrB,IAAI,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAE/C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;QAC9C,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;YAC3B,SAAS;QACX,CAAC;QAED,IAAI,QAAQ,GAAG,eAAe,EAAE,CAAC;YAC/B,OAAO,GAAG,SAAS,CAAC;YACpB,eAAe,GAAG,QAAQ,CAAC;YAC3B,SAAS;QACX,CAAC;QAED,IAAI,QAAQ,KAAK,eAAe,IAAI,SAAS,GAAG,OAAO,EAAE,CAAC;YACxD,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TimelineClip, TimelineMarker } from "../types.js";
|
|
2
|
+
export interface SnapPointSource {
|
|
3
|
+
clips?: ReadonlyArray<Pick<TimelineClip, "id" | "startMs" | "durationMs">>;
|
|
4
|
+
markers?: ReadonlyArray<Pick<TimelineMarker, "timeMs">>;
|
|
5
|
+
playheadMs?: number;
|
|
6
|
+
tickIntervalMs?: number;
|
|
7
|
+
maxTimeMs?: number;
|
|
8
|
+
excludeClipIds?: ReadonlySet<string>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build a sorted, deduplicated array of snap-point times (in milliseconds)
|
|
12
|
+
* from multiple sources: clip boundaries, markers, playhead, and regular
|
|
13
|
+
* interval ticks.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildSnapPoints(source: SnapPointSource): number[];
|
|
16
|
+
//# sourceMappingURL=buildSnapPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSnapPoints.d.ts","sourceRoot":"","sources":["../../src/snapping/buildSnapPoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC;IAC3E,OAAO,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,EAAE,CAmCjE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a sorted, deduplicated array of snap-point times (in milliseconds)
|
|
3
|
+
* from multiple sources: clip boundaries, markers, playhead, and regular
|
|
4
|
+
* interval ticks.
|
|
5
|
+
*/
|
|
6
|
+
export function buildSnapPoints(source) {
|
|
7
|
+
const set = new Set();
|
|
8
|
+
if (source.playheadMs !== undefined) {
|
|
9
|
+
set.add(source.playheadMs);
|
|
10
|
+
}
|
|
11
|
+
if (source.tickIntervalMs && source.tickIntervalMs > 0) {
|
|
12
|
+
const max = source.maxTimeMs ?? 0;
|
|
13
|
+
// Compute each tick as `i * interval` rather than accumulating `t += interval`
|
|
14
|
+
// so fractional intervals (e.g. 1000/30 ms frame ticks) don't drift over many
|
|
15
|
+
// steps and stay dedupable against integer clip/marker boundaries.
|
|
16
|
+
for (let i = 0;; i++) {
|
|
17
|
+
const t = i * source.tickIntervalMs;
|
|
18
|
+
if (t > max)
|
|
19
|
+
break;
|
|
20
|
+
set.add(t);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (source.markers) {
|
|
24
|
+
for (const m of source.markers) {
|
|
25
|
+
set.add(m.timeMs);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (source.clips) {
|
|
29
|
+
const exclude = source.excludeClipIds;
|
|
30
|
+
for (const c of source.clips) {
|
|
31
|
+
if (exclude?.has(c.id))
|
|
32
|
+
continue;
|
|
33
|
+
set.add(c.startMs);
|
|
34
|
+
set.add(c.startMs + c.durationMs);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return Array.from(set).sort((a, b) => a - b);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=buildSnapPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSnapPoints.js","sourceRoot":"","sources":["../../src/snapping/buildSnapPoints.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAE9B,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;Q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-0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snapping/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,WAAW,EACX,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/snapping/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAEhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,WAAW,GAEZ,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface SnapResolution {
|
|
2
|
+
/** The final time value (snapped or original). */
|
|
3
|
+
value: number;
|
|
4
|
+
/** Whether a snap actually occurred. */
|
|
5
|
+
snapped: boolean;
|
|
6
|
+
/** Distance from the original time to the snap target in ms. */
|
|
7
|
+
distanceMs: number;
|
|
8
|
+
/** Distance from the original time to the snap target in px. */
|
|
9
|
+
distancePx: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the closest snap candidate to `timeMs` within a pixel threshold.
|
|
13
|
+
*
|
|
14
|
+
* Returns the snapped value plus metadata (whether snapping occurred and
|
|
15
|
+
* the distance in both ms and px). This is the richer cousin of the
|
|
16
|
+
* legacy `snap()` function exported from `../snap.js`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveSnap(timeMs: number, candidates: number[], thresholdPx: number, msPerPx: number): SnapResolution;
|
|
19
|
+
//# sourceMappingURL=resolveSnap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveSnap.d.ts","sourceRoot":"","sources":["../../src/snapping/resolveSnap.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAAE,EACpB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,cAAc,CAoChB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the closest snap candidate to `timeMs` within a pixel threshold.
|
|
3
|
+
*
|
|
4
|
+
* Returns the snapped value plus metadata (whether snapping occurred and
|
|
5
|
+
* the distance in both ms and px). This is the richer cousin of the
|
|
6
|
+
* legacy `snap()` function exported from `../snap.js`.
|
|
7
|
+
*/
|
|
8
|
+
export function resolveSnap(timeMs, candidates, thresholdPx, msPerPx) {
|
|
9
|
+
const thresholdMs = thresholdPx * msPerPx;
|
|
10
|
+
let closest = timeMs;
|
|
11
|
+
let closestDistance = Number.POSITIVE_INFINITY;
|
|
12
|
+
// Tracks whether any candidate fell within the threshold and was adopted —
|
|
13
|
+
// distinct from `closest !== timeMs`, which would miss the case where the
|
|
14
|
+
// closest snap target lies exactly on `timeMs`.
|
|
15
|
+
let snapped = false;
|
|
16
|
+
for (const candidate of candidates) {
|
|
17
|
+
const distance = Math.abs(candidate - timeMs);
|
|
18
|
+
if (distance > thresholdMs) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (distance < closestDistance) {
|
|
22
|
+
closest = candidate;
|
|
23
|
+
closestDistance = distance;
|
|
24
|
+
snapped = true;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (distance === closestDistance && candidate < closest) {
|
|
28
|
+
closest = candidate;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const distanceMs = Math.abs(closest - timeMs);
|
|
32
|
+
return {
|
|
33
|
+
value: closest,
|
|
34
|
+
snapped,
|
|
35
|
+
distanceMs,
|
|
36
|
+
distancePx: msPerPx > 0 ? distanceMs / msPerPx : 0,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=resolveSnap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveSnap.js","sourceRoot":"","sources":["../../src/snapping/resolveSnap.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,UAAoB,EACpB,WAAmB,EACnB,OAAe;IAEf,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;IAE1C,IAAI,OAAO,GAAG,MAAM,CAAC;IACrB,IAAI,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC/C,2EAA2E;IAC3E,0EAA0E;IAC1E,gDAAgD;IAChD,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;QAC9C,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC;YAC3B,SAAS;QACX,CAAC;QAED,IAAI,QAAQ,GAAG,eAAe,EAAE,CAAC;YAC/B,OAAO,GAAG,SAAS,CAAC;YACpB,eAAe,GAAG,QAAQ,CAAC;YAC3B,OAAO,GAAG,IAAI,CAAC;YACf,SAAS;QACX,CAAC;QAED,IAAI,QAAQ,KAAK,eAAe,IAAI,SAAS,GAAG,OAAO,EAAE,CAAC;YACxD,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;IAE9C,OAAO;QACL,KAAK,EAAE,OAAO;QACd,OAAO;QACP,UAAU;QACV,UAAU,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TimelineClip } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Effective source-playback rate for a clip. When the speed change is baked
|
|
4
|
+
* into the asset the source plays 1:1 with the timeline; otherwise one
|
|
5
|
+
* timeline-millisecond consumes `speedMultiplier` source-milliseconds.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the rate the preview compositor uses (`sceneModel.ts`) so that
|
|
8
|
+
* timeline ⇄ source conversions in `splitClip` / `trimClip` stay consistent
|
|
9
|
+
* with playback. The `0.0001` floor guards against a zero/negative multiplier.
|
|
10
|
+
*/
|
|
11
|
+
export declare function sourceRate(clip: Pick<TimelineClip, "speedBaked" | "speedMultiplier">): number;
|
|
12
|
+
//# sourceMappingURL=sourceRate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceRate.d.ts","sourceRoot":"","sources":["../src/sourceRate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,iBAAiB,CAAC,GACzD,MAAM,CAER"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effective source-playback rate for a clip. When the speed change is baked
|
|
3
|
+
* into the asset the source plays 1:1 with the timeline; otherwise one
|
|
4
|
+
* timeline-millisecond consumes `speedMultiplier` source-milliseconds.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors the rate the preview compositor uses (`sceneModel.ts`) so that
|
|
7
|
+
* timeline ⇄ source conversions in `splitClip` / `trimClip` stay consistent
|
|
8
|
+
* with playback. The `0.0001` floor guards against a zero/negative multiplier.
|
|
9
|
+
*/
|
|
10
|
+
export function sourceRate(clip) {
|
|
11
|
+
return clip.speedBaked ? 1 : Math.max(0.0001, clip.speedMultiplier ?? 1);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=sourceRate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceRate.js","sourceRoot":"","sources":["../src/sourceRate.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CACxB,IAA0D;IAE1D,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|