@tscaps/engine 0.2.1 → 0.3.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 +47 -7
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/bidi/BidiAnalyzer.d.ts +23 -0
- package/dist/modules/bidi/BidiAnalyzer.d.ts.map +1 -0
- package/dist/modules/bidi/BidiAnalyzer.js +2 -0
- package/dist/modules/bidi/BidiAnalyzer.js.map +1 -0
- package/dist/modules/bidi/BidiCharacterClassifier.d.ts +13 -0
- package/dist/modules/bidi/BidiCharacterClassifier.d.ts.map +1 -0
- package/dist/modules/bidi/BidiCharacterClassifier.js +2 -0
- package/dist/modules/bidi/BidiCharacterClassifier.js.map +1 -0
- package/dist/modules/bidi/BidiJsAnalyzer.d.ts +14 -0
- package/dist/modules/bidi/BidiJsAnalyzer.d.ts.map +1 -0
- package/dist/modules/bidi/BidiJsAnalyzer.js +19 -0
- package/dist/modules/bidi/BidiJsAnalyzer.js.map +1 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts +8 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts.map +1 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.js +19 -0
- package/dist/modules/bidi/BidiJsCharacterClassifier.js.map +1 -0
- package/dist/modules/bidi/CursiveScriptDetector.d.ts +12 -0
- package/dist/modules/bidi/CursiveScriptDetector.d.ts.map +1 -0
- package/dist/modules/bidi/CursiveScriptDetector.js +20 -0
- package/dist/modules/bidi/CursiveScriptDetector.js.map +1 -0
- package/dist/modules/bidi/HorizontalSide.d.ts +18 -0
- package/dist/modules/bidi/HorizontalSide.d.ts.map +1 -0
- package/dist/modules/bidi/HorizontalSide.js +3 -0
- package/dist/modules/bidi/HorizontalSide.js.map +1 -0
- package/dist/modules/bidi/HorizontalSideResolver.d.ts +21 -0
- package/dist/modules/bidi/HorizontalSideResolver.d.ts.map +1 -0
- package/dist/modules/bidi/HorizontalSideResolver.js +27 -0
- package/dist/modules/bidi/HorizontalSideResolver.js.map +1 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts +24 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts.map +1 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js +34 -0
- package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js.map +1 -0
- package/dist/modules/bidi/TextDirection.d.ts +9 -0
- package/dist/modules/bidi/TextDirection.d.ts.map +1 -0
- package/dist/modules/bidi/TextDirection.js +2 -0
- package/dist/modules/bidi/TextDirection.js.map +1 -0
- package/dist/modules/bidi/TextDirectionDetector.d.ts +12 -0
- package/dist/modules/bidi/TextDirectionDetector.d.ts.map +1 -0
- package/dist/modules/bidi/TextDirectionDetector.js +2 -0
- package/dist/modules/bidi/TextDirectionDetector.js.map +1 -0
- package/dist/modules/bidi/WordFragment.d.ts +34 -0
- package/dist/modules/bidi/WordFragment.d.ts.map +1 -0
- package/dist/modules/bidi/WordFragment.js +2 -0
- package/dist/modules/bidi/WordFragment.js.map +1 -0
- package/dist/modules/bidi/WordFragmenter.d.ts +43 -0
- package/dist/modules/bidi/WordFragmenter.d.ts.map +1 -0
- package/dist/modules/bidi/WordFragmenter.js +112 -0
- package/dist/modules/bidi/WordFragmenter.js.map +1 -0
- package/dist/modules/bidi/index.d.ts +14 -0
- package/dist/modules/bidi/index.d.ts.map +1 -0
- package/dist/modules/bidi/index.js +8 -0
- package/dist/modules/bidi/index.js.map +1 -0
- package/dist/modules/css/CssBlockSealer.d.ts +30 -0
- package/dist/modules/css/CssBlockSealer.d.ts.map +1 -0
- package/dist/modules/css/CssBlockSealer.js +64 -0
- package/dist/modules/css/CssBlockSealer.js.map +1 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts +13 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts.map +1 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.js +24 -0
- package/dist/modules/css/CssCustomPropertyDefinitionScanner.js.map +1 -0
- package/dist/modules/css/CssFilterReferenceScanner.d.ts +15 -0
- package/dist/modules/css/CssFilterReferenceScanner.d.ts.map +1 -0
- package/dist/modules/css/CssFilterReferenceScanner.js +22 -0
- package/dist/modules/css/CssFilterReferenceScanner.js.map +1 -0
- package/dist/modules/css/CssFragmentParser.d.ts +53 -0
- package/dist/modules/css/CssFragmentParser.d.ts.map +1 -0
- package/dist/modules/css/CssFragmentParser.js +127 -0
- package/dist/modules/css/CssFragmentParser.js.map +1 -0
- package/dist/modules/css/CssKeyframeNamespacer.d.ts +21 -0
- package/dist/modules/css/CssKeyframeNamespacer.d.ts.map +1 -0
- package/dist/modules/css/CssKeyframeNamespacer.js +48 -0
- package/dist/modules/css/CssKeyframeNamespacer.js.map +1 -0
- package/dist/modules/css/CssKeyframesScanner.d.ts +29 -0
- package/dist/modules/css/CssKeyframesScanner.d.ts.map +1 -0
- package/dist/modules/css/CssKeyframesScanner.js +102 -0
- package/dist/modules/css/CssKeyframesScanner.js.map +1 -0
- package/dist/modules/css/CssLayer.d.ts +20 -0
- package/dist/modules/css/CssLayer.d.ts.map +1 -0
- package/dist/modules/css/CssLayer.js +21 -0
- package/dist/modules/css/CssLayer.js.map +1 -0
- package/dist/modules/css/CssScoper.d.ts +11 -2
- package/dist/modules/css/CssScoper.d.ts.map +1 -1
- package/dist/modules/css/CssScoper.js +53 -37
- package/dist/modules/css/CssScoper.js.map +1 -1
- package/dist/modules/css/CssSelectorClassScanner.d.ts +25 -0
- package/dist/modules/css/CssSelectorClassScanner.d.ts.map +1 -0
- package/dist/modules/css/CssSelectorClassScanner.js +91 -0
- package/dist/modules/css/CssSelectorClassScanner.js.map +1 -0
- package/dist/modules/css/CssVarReferenceScanner.d.ts +8 -5
- package/dist/modules/css/CssVarReferenceScanner.d.ts.map +1 -1
- package/dist/modules/css/CssVarReferenceScanner.js +14 -7
- package/dist/modules/css/CssVarReferenceScanner.js.map +1 -1
- package/dist/modules/css/index.d.ts +8 -0
- package/dist/modules/css/index.d.ts.map +1 -1
- package/dist/modules/css/index.js +8 -0
- package/dist/modules/css/index.js.map +1 -1
- package/dist/modules/document/CssClass.d.ts +20 -0
- package/dist/modules/document/CssClass.d.ts.map +1 -0
- package/dist/modules/document/CssClass.js +21 -0
- package/dist/modules/document/CssClass.js.map +1 -0
- package/dist/modules/document/CssVariable.d.ts +0 -6
- package/dist/modules/document/CssVariable.d.ts.map +1 -1
- package/dist/modules/document/CssVariable.js +0 -6
- package/dist/modules/document/CssVariable.js.map +1 -1
- package/dist/modules/document/DataAttribute.d.ts +26 -0
- package/dist/modules/document/DataAttribute.d.ts.map +1 -0
- package/dist/modules/document/DataAttribute.js +27 -0
- package/dist/modules/document/DataAttribute.js.map +1 -0
- package/dist/modules/document/DocumentEditor.d.ts +40 -9
- package/dist/modules/document/DocumentEditor.d.ts.map +1 -1
- package/dist/modules/document/DocumentEditor.js +69 -17
- package/dist/modules/document/DocumentEditor.js.map +1 -1
- package/dist/modules/document/DocumentNodeId.d.ts +23 -0
- package/dist/modules/document/DocumentNodeId.d.ts.map +1 -0
- package/dist/modules/document/DocumentNodeId.js +31 -0
- package/dist/modules/document/DocumentNodeId.js.map +1 -0
- package/dist/modules/document/Line.d.ts +1 -1
- package/dist/modules/document/Line.d.ts.map +1 -1
- package/dist/modules/document/Line.js +2 -1
- package/dist/modules/document/Line.js.map +1 -1
- package/dist/modules/document/Section.d.ts +1 -4
- package/dist/modules/document/Section.d.ts.map +1 -1
- package/dist/modules/document/Section.js +2 -17
- package/dist/modules/document/Section.js.map +1 -1
- package/dist/modules/document/Segment.d.ts +14 -7
- package/dist/modules/document/Segment.d.ts.map +1 -1
- package/dist/modules/document/Segment.js +26 -1
- package/dist/modules/document/Segment.js.map +1 -1
- package/dist/modules/document/Word.d.ts +1 -1
- package/dist/modules/document/Word.d.ts.map +1 -1
- package/dist/modules/document/Word.js +2 -1
- package/dist/modules/document/Word.js.map +1 -1
- package/dist/modules/document/index.d.ts +4 -2
- package/dist/modules/document/index.d.ts.map +1 -1
- package/dist/modules/document/index.js +3 -1
- package/dist/modules/document/index.js.map +1 -1
- package/dist/modules/effect/GapFreeEffect.d.ts +15 -0
- package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -1
- package/dist/modules/effect/GapFreeEffect.js +29 -4
- package/dist/modules/effect/GapFreeEffect.js.map +1 -1
- package/dist/modules/pipeline/RenderPipelineBuilder.js +3 -3
- package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +4 -1
- package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -1
- package/dist/modules/rendering/HorizontalPlacementResolver.d.ts +27 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.d.ts.map +1 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.js +31 -0
- package/dist/modules/rendering/HorizontalPlacementResolver.js.map +1 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +2 -0
- package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/index.d.ts +7 -4
- package/dist/modules/rendering/index.d.ts.map +1 -1
- package/dist/modules/rendering/index.js +5 -2
- package/dist/modules/rendering/index.js.map +1 -1
- package/dist/modules/rendering/styles/BaselineCssComposer.d.ts +19 -1
- package/dist/modules/rendering/styles/BaselineCssComposer.d.ts.map +1 -1
- package/dist/modules/rendering/styles/BaselineCssComposer.js +32 -8
- package/dist/modules/rendering/styles/BaselineCssComposer.js.map +1 -1
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts.map +1 -1
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js +5 -4
- package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js.map +1 -1
- package/dist/modules/rendering/styles/FrozenFrameCss.d.ts +28 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.js +28 -0
- package/dist/modules/rendering/styles/FrozenFrameCss.js.map +1 -0
- package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts +0 -7
- package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts.map +1 -1
- package/dist/modules/rendering/styles/InlineStyleEmitter.js +0 -9
- package/dist/modules/rendering/styles/InlineStyleEmitter.js.map +1 -1
- package/dist/modules/rendering/styles/{VideoFrameLayerClass.d.ts → VideoFrameLayerBaselineCss.d.ts} +3 -10
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.d.ts.map +1 -0
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js +15 -0
- package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js.map +1 -0
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts +3 -1
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js +9 -4
- package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js.map +1 -1
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts +23 -9
- package/dist/modules/rendering/subtitle/AnimationProbe.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/AnimationProbe.js +86 -81
- package/dist/modules/rendering/subtitle/AnimationProbe.js.map +1 -1
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts +1 -0
- package/dist/modules/rendering/subtitle/BatchPlanner.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/BatchPlanner.js +16 -14
- package/dist/modules/rendering/subtitle/BatchPlanner.js.map +1 -1
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts +1 -0
- package/dist/modules/rendering/subtitle/PreparedStyle.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js +1 -1
- package/dist/modules/rendering/subtitle/PreparedStyleFactory.js.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js +7 -4
- package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts +30 -2
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js +85 -27
- package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts +3 -8
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js +31 -40
- package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js.map +1 -1
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts +2 -0
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js +18 -9
- package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js.map +1 -1
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts +8 -15
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js +10 -20
- package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js.map +1 -1
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts.map +1 -1
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js +12 -3
- package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js.map +1 -1
- package/dist/modules/rendering/types/AlignmentConfig.d.ts +16 -4
- package/dist/modules/rendering/types/AlignmentConfig.d.ts.map +1 -1
- package/dist/modules/rendering/types/AlignmentConfig.js +2 -1
- package/dist/modules/rendering/types/AlignmentConfig.js.map +1 -1
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts +8 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.d.ts.map +1 -1
- package/dist/modules/rendering/types/ElementRenderOverrides.js +28 -0
- package/dist/modules/rendering/types/ElementRenderOverrides.js.map +1 -1
- package/dist/modules/rendering/types/RenderingConfig.d.ts +7 -2
- package/dist/modules/rendering/types/RenderingConfig.d.ts.map +1 -1
- package/dist/modules/rendering/types/ScopedRenderOverride.d.ts +9 -4
- package/dist/modules/rendering/types/ScopedRenderOverride.d.ts.map +1 -1
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts +53 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js +133 -0
- package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts +20 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js +31 -0
- package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts +21 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js +33 -0
- package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCue.d.ts +18 -0
- package/dist/modules/subtitle-file/SubtitleCue.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCue.js +20 -0
- package/dist/modules/subtitle-file/SubtitleCue.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts +38 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.js +106 -0
- package/dist/modules/subtitle-file/SubtitleCueBuilder.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.d.ts +17 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.js +2 -0
- package/dist/modules/subtitle-file/SubtitleFileJob.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts +36 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.js +44 -0
- package/dist/modules/subtitle-file/SubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.d.ts +11 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.js +2 -0
- package/dist/modules/subtitle-file/SubtitleGranularity.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleRow.d.ts +11 -0
- package/dist/modules/subtitle-file/SubtitleRow.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleRow.js +14 -0
- package/dist/modules/subtitle-file/SubtitleRow.js.map +1 -0
- package/dist/modules/subtitle-file/SubtitleToken.d.ts +13 -0
- package/dist/modules/subtitle-file/SubtitleToken.d.ts.map +1 -0
- package/dist/modules/subtitle-file/SubtitleToken.js +15 -0
- package/dist/modules/subtitle-file/SubtitleToken.js.map +1 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts +19 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js +24 -0
- package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/Timecode.d.ts +20 -0
- package/dist/modules/subtitle-file/Timecode.d.ts.map +1 -0
- package/dist/modules/subtitle-file/Timecode.js +32 -0
- package/dist/modules/subtitle-file/Timecode.js.map +1 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts +22 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js +57 -0
- package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts +21 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts.map +1 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js +39 -0
- package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js.map +1 -0
- package/dist/modules/subtitle-file/index.d.ts +10 -0
- package/dist/modules/subtitle-file/index.d.ts.map +1 -0
- package/dist/modules/subtitle-file/index.js +8 -0
- package/dist/modules/subtitle-file/index.js.map +1 -0
- package/dist/modules/svg-filter/SvgFilter.d.ts +8 -1
- package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilter.js +9 -1
- package/dist/modules/svg-filter/SvgFilter.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +1 -0
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +9 -1
- package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -1
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts +44 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts.map +1 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.js +47 -0
- package/dist/modules/svg-filter/SvgFilterDefsRenderer.js.map +1 -0
- package/dist/modules/svg-filter/index.d.ts +2 -0
- package/dist/modules/svg-filter/index.d.ts.map +1 -1
- package/dist/modules/svg-filter/index.js +1 -0
- package/dist/modules/svg-filter/index.js.map +1 -1
- package/dist/modules/tagging/PauseTagger.d.ts.map +1 -1
- package/dist/modules/tagging/PauseTagger.js +2 -1
- package/dist/modules/tagging/PauseTagger.js.map +1 -1
- package/dist/modules/tagging/RegexTagger.js +1 -1
- package/dist/modules/tagging/RegexTagger.js.map +1 -1
- package/dist/modules/tagging/SpanTagger.js +1 -1
- package/dist/modules/tagging/SpanTagger.js.map +1 -1
- package/dist/modules/tagging/StructureTagger.d.ts +0 -1
- package/dist/modules/tagging/StructureTagger.d.ts.map +1 -1
- package/dist/modules/tagging/StructureTagger.js +3 -8
- package/dist/modules/tagging/StructureTagger.js.map +1 -1
- package/dist/modules/tagging/WordlistTagger.js +1 -1
- package/dist/modules/tagging/WordlistTagger.js.map +1 -1
- package/dist/modules/tags/AndTagCondition.d.ts +10 -0
- package/dist/modules/tags/AndTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/AndTagCondition.js +14 -0
- package/dist/modules/tags/AndTagCondition.js.map +1 -0
- package/dist/modules/tags/HasTagCondition.d.ts +10 -0
- package/dist/modules/tags/HasTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/HasTagCondition.js +18 -0
- package/dist/modules/tags/HasTagCondition.js.map +1 -0
- package/dist/modules/tags/NotTagCondition.d.ts +10 -0
- package/dist/modules/tags/NotTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/NotTagCondition.js +14 -0
- package/dist/modules/tags/NotTagCondition.js.map +1 -0
- package/dist/modules/tags/OrTagCondition.d.ts +10 -0
- package/dist/modules/tags/OrTagCondition.d.ts.map +1 -0
- package/dist/modules/tags/OrTagCondition.js +14 -0
- package/dist/modules/tags/OrTagCondition.js.map +1 -0
- package/dist/modules/{document/Tag.d.ts → tags/StructureTag.d.ts} +2 -11
- package/dist/modules/tags/StructureTag.d.ts.map +1 -0
- package/dist/modules/{document/Tag.js → tags/StructureTag.js} +1 -19
- package/dist/modules/tags/StructureTag.js.map +1 -0
- package/dist/modules/tags/Tag.d.ts +8 -0
- package/dist/modules/tags/Tag.d.ts.map +1 -0
- package/dist/modules/tags/Tag.js +16 -0
- package/dist/modules/tags/Tag.js.map +1 -0
- package/dist/modules/tags/TagCondition.d.ts +12 -0
- package/dist/modules/tags/TagCondition.d.ts.map +1 -0
- package/dist/modules/tags/TagCondition.js +2 -0
- package/dist/modules/tags/TagCondition.js.map +1 -0
- package/dist/modules/tags/TagConditionParser.d.ts +21 -0
- package/dist/modules/tags/TagConditionParser.d.ts.map +1 -0
- package/dist/modules/tags/TagConditionParser.js +75 -0
- package/dist/modules/tags/TagConditionParser.js.map +1 -0
- package/dist/modules/tags/index.d.ts +9 -0
- package/dist/modules/tags/index.d.ts.map +1 -0
- package/dist/modules/tags/index.js +8 -0
- package/dist/modules/tags/index.js.map +1 -0
- package/dist/modules/transcription/AudioDecoder.d.ts +9 -4
- package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -1
- package/dist/modules/transcription/BatchedMonoResampler.d.ts +45 -0
- package/dist/modules/transcription/BatchedMonoResampler.d.ts.map +1 -0
- package/dist/modules/transcription/BatchedMonoResampler.js +116 -0
- package/dist/modules/transcription/BatchedMonoResampler.js.map +1 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.d.ts +38 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.d.ts.map +1 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.js +86 -0
- package/dist/modules/transcription/CacheStorageModelFileCache.js.map +1 -0
- package/dist/modules/transcription/CueDocumentBuilder.d.ts +40 -0
- package/dist/modules/transcription/CueDocumentBuilder.d.ts.map +1 -0
- package/dist/modules/transcription/CueDocumentBuilder.js +77 -0
- package/dist/modules/transcription/CueDocumentBuilder.js.map +1 -0
- package/dist/modules/transcription/CueParseResult.d.ts +16 -0
- package/dist/modules/transcription/CueParseResult.d.ts.map +1 -0
- package/dist/modules/transcription/CueParseResult.js +2 -0
- package/dist/modules/transcription/CueParseResult.js.map +1 -0
- package/dist/modules/transcription/CueTextTokenizer.d.ts +10 -0
- package/dist/modules/transcription/CueTextTokenizer.d.ts.map +1 -0
- package/dist/modules/transcription/CueTextTokenizer.js +21 -0
- package/dist/modules/transcription/CueTextTokenizer.js.map +1 -0
- package/dist/modules/transcription/CueTimecodeReader.d.ts +19 -0
- package/dist/modules/transcription/CueTimecodeReader.d.ts.map +1 -0
- package/dist/modules/transcription/CueTimecodeReader.js +45 -0
- package/dist/modules/transcription/CueTimecodeReader.js.map +1 -0
- package/dist/modules/transcription/CueWordReader.d.ts +12 -0
- package/dist/modules/transcription/CueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/CueWordReader.js +2 -0
- package/dist/modules/transcription/CueWordReader.js.map +1 -0
- package/dist/modules/transcription/EstimatedCueWordReader.d.ts +16 -0
- package/dist/modules/transcription/EstimatedCueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/EstimatedCueWordReader.js +17 -0
- package/dist/modules/transcription/EstimatedCueWordReader.js.map +1 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.d.ts +43 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.d.ts.map +1 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.js +72 -0
- package/dist/modules/transcription/LogitsProcessorListFactory.js.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts +27 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts.map +1 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.js +76 -0
- package/dist/modules/transcription/MediaBunnyAudioDecoder.js.map +1 -0
- package/dist/modules/transcription/ModelFileCache.d.ts +20 -0
- package/dist/modules/transcription/ModelFileCache.d.ts.map +1 -0
- package/dist/modules/transcription/ModelFileCache.js +2 -0
- package/dist/modules/transcription/ModelFileCache.js.map +1 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts +18 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts.map +1 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.js +18 -0
- package/dist/modules/transcription/ModelFileCacheUnavailableError.js.map +1 -0
- package/dist/modules/transcription/SrtTranscriber.d.ts +24 -15
- package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/SrtTranscriber.js +32 -90
- package/dist/modules/transcription/SrtTranscriber.js.map +1 -1
- package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts +22 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts.map +1 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.js +22 -0
- package/dist/modules/transcription/SubtitleFileUnreadableError.js.map +1 -0
- package/dist/modules/transcription/TimestampedCueWordReader.d.ts +27 -0
- package/dist/modules/transcription/TimestampedCueWordReader.d.ts.map +1 -0
- package/dist/modules/transcription/TimestampedCueWordReader.js +52 -0
- package/dist/modules/transcription/TimestampedCueWordReader.js.map +1 -0
- package/dist/modules/transcription/Transcriber.d.ts +13 -0
- package/dist/modules/transcription/Transcriber.d.ts.map +1 -1
- package/dist/modules/transcription/TransformersRuntime.d.ts +50 -0
- package/dist/modules/transcription/TransformersRuntime.d.ts.map +1 -0
- package/dist/modules/transcription/TransformersRuntime.js +79 -0
- package/dist/modules/transcription/TransformersRuntime.js.map +1 -0
- package/dist/modules/transcription/VttTranscriber.d.ts +25 -7
- package/dist/modules/transcription/VttTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/VttTranscriber.js +36 -15
- package/dist/modules/transcription/VttTranscriber.js.map +1 -1
- package/dist/modules/transcription/WhisperChunkStitcher.d.ts +51 -0
- package/dist/modules/transcription/WhisperChunkStitcher.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperChunkStitcher.js +101 -0
- package/dist/modules/transcription/WhisperChunkStitcher.js.map +1 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts +16 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.js +16 -0
- package/dist/modules/transcription/WhisperDeviceUnavailableError.js.map +1 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.d.ts +16 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.js +16 -0
- package/dist/modules/transcription/WhisperInferenceFailedError.js.map +1 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts +61 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.js +102 -0
- package/dist/modules/transcription/WhisperInferenceProgressTracker.js.map +1 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts +38 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js +94 -0
- package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js.map +1 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts +15 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.js +15 -0
- package/dist/modules/transcription/WhisperModelLoadFailedError.js.map +1 -0
- package/dist/modules/transcription/WhisperTranscriber.d.ts +106 -7
- package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -1
- package/dist/modules/transcription/WhisperTranscriber.js +312 -25
- package/dist/modules/transcription/WhisperTranscriber.js.map +1 -1
- package/dist/modules/transcription/WhisperWindowCoverage.d.ts +79 -0
- package/dist/modules/transcription/WhisperWindowCoverage.d.ts.map +1 -0
- package/dist/modules/transcription/WhisperWindowCoverage.js +129 -0
- package/dist/modules/transcription/WhisperWindowCoverage.js.map +1 -0
- package/dist/modules/transcription/WordTimingEstimator.d.ts +14 -0
- package/dist/modules/transcription/WordTimingEstimator.d.ts.map +1 -0
- package/dist/modules/transcription/WordTimingEstimator.js +33 -0
- package/dist/modules/transcription/WordTimingEstimator.js.map +1 -0
- package/dist/modules/transcription/index.d.ts +8 -2
- package/dist/modules/transcription/index.d.ts.map +1 -1
- package/dist/modules/transcription/index.js +5 -1
- package/dist/modules/transcription/index.js.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js +8 -0
- package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js.map +1 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +3 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -1
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +33 -23
- package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -1
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js +1 -1
- package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js.map +1 -1
- package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts +6 -7
- package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts.map +1 -1
- package/package.json +16 -10
- package/dist/modules/document/Tag.d.ts.map +0 -1
- package/dist/modules/document/Tag.js.map +0 -1
- package/dist/modules/rendering/styles/BehindActorBaselineCss.d.ts +0 -19
- package/dist/modules/rendering/styles/BehindActorBaselineCss.d.ts.map +0 -1
- package/dist/modules/rendering/styles/BehindActorBaselineCss.js +0 -19
- package/dist/modules/rendering/styles/BehindActorBaselineCss.js.map +0 -1
- package/dist/modules/rendering/styles/VideoFrameLayerClass.d.ts.map +0 -1
- package/dist/modules/rendering/styles/VideoFrameLayerClass.js +0 -21
- package/dist/modules/rendering/styles/VideoFrameLayerClass.js.map +0 -1
- package/dist/modules/rendering/types/BehindActorRequirement.d.ts +0 -12
- package/dist/modules/rendering/types/BehindActorRequirement.d.ts.map +0 -1
- package/dist/modules/rendering/types/BehindActorRequirement.js +0 -2
- package/dist/modules/rendering/types/BehindActorRequirement.js.map +0 -1
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts +0 -13
- package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +0 -1
- package/dist/modules/transcription/BrowserAudioDecoder.js +0 -34
- package/dist/modules/transcription/BrowserAudioDecoder.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgFilterMaterializer.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/subtitle/SvgFilterMaterializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SvgFilterMaterializer.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/subtitle/SvgFilterMaterializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AACtG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAI/E;;;;;;;;;GASG;AACH,qBAAa,qBAAqB;IAG9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc;gBADd,YAAY,EAAE,qBAAqB,EACnC,cAAc,EAAE,MAAM;IAGzC,WAAW,CACT,KAAK,EAAE,aAAa,EACpB,CAAC,EAAE,MAAM,EACT,UAAU,EAAE,cAAc,EAC1B,OAAO,EAAE,MAAM,MAAM,GACpB,aAAa;CAajB"}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
1
|
import { SvgFilterScope } from '../../svg-filter/SvgFilterScope';
|
|
2
|
+
const EMPTY_DEFS = { defs: '', bindings: new Map() };
|
|
2
3
|
/**
|
|
3
4
|
* Materializes the SVG `<filter>` defs declared by a style's filter
|
|
4
|
-
* bundle for one render tile.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* collide in the sprite-sheet SVG.
|
|
5
|
+
* bundle for one render tile. Layers the engine-injected vars onto the
|
|
6
|
+
* consumer's scope and hands the result to the defs renderer under an
|
|
7
|
+
* id scope unique to the tile, so two tiles using the same source
|
|
8
|
+
* filter don't collide in the sprite-sheet SVG.
|
|
9
9
|
*
|
|
10
10
|
* Returns empty defs and empty bindings when the style declares no
|
|
11
11
|
* filters.
|
|
12
12
|
*/
|
|
13
13
|
export class SvgFilterMaterializer {
|
|
14
|
-
|
|
15
|
-
svgFilterLengthResolver;
|
|
14
|
+
defsRenderer;
|
|
16
15
|
renderHeightPx;
|
|
17
|
-
constructor(
|
|
18
|
-
this.
|
|
19
|
-
this.svgFilterLengthResolver = svgFilterLengthResolver;
|
|
16
|
+
constructor(defsRenderer, renderHeightPx) {
|
|
17
|
+
this.defsRenderer = defsRenderer;
|
|
20
18
|
this.renderHeightPx = renderHeightPx;
|
|
21
19
|
}
|
|
22
20
|
materialize(style, t, engineVars, nextUid) {
|
|
23
21
|
const definitions = style.filters.definitions;
|
|
24
22
|
if (definitions.isEmpty())
|
|
25
|
-
return
|
|
23
|
+
return EMPTY_DEFS;
|
|
26
24
|
const context = { currentTime: t, renderHeightPx: this.renderHeightPx };
|
|
27
25
|
const consumerScope = style.filters.scopeProvider.scopeAt(context);
|
|
28
26
|
const scope = consumerScope.with(SvgFilterScope.fromEntries(Object.entries(engineVars)));
|
|
29
|
-
|
|
30
|
-
const { idByLocal, bindings } = this.svgFilterScoper.scopeIds(definitions.ids, `${style.scopeClass}-${nextUid()}`);
|
|
31
|
-
const defs = definitions.filters
|
|
32
|
-
.map((filter) => {
|
|
33
|
-
const body = this.svgFilterLengthResolver.resolve(filter.materialize(scope), lengthFactors);
|
|
34
|
-
return `<filter id="${idByLocal.get(filter.id)}">${body}</filter>`;
|
|
35
|
-
})
|
|
36
|
-
.join('');
|
|
37
|
-
return { defs, bindings };
|
|
27
|
+
return this.defsRenderer.render(definitions, scope, style.filters.scopeProvider.lengthFactorsAt(context), `${style.scopeClass}-${nextUid()}`);
|
|
38
28
|
}
|
|
39
29
|
}
|
|
40
30
|
//# sourceMappingURL=SvgFilterMaterializer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgFilterMaterializer.js","sourceRoot":"","sources":["../../../../src/modules/rendering/subtitle/SvgFilterMaterializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"SvgFilterMaterializer.js","sourceRoot":"","sources":["../../../../src/modules/rendering/subtitle/SvgFilterMaterializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAIpE,MAAM,UAAU,GAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAEpE;;;;;;;;;GASG;AACH,MAAM,OAAO,qBAAqB;IAGb;IACA;IAFnB,YACmB,YAAmC,EACnC,cAAsB;QADtB,iBAAY,GAAZ,YAAY,CAAuB;QACnC,mBAAc,GAAd,cAAc,CAAQ;IACtC,CAAC;IAEJ,WAAW,CACT,KAAoB,EACpB,CAAS,EACT,UAA0B,EAC1B,OAAqB;QAErB,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAC9C,IAAI,WAAW,CAAC,OAAO,EAAE;YAAE,OAAO,UAAU,CAAC;QAC7C,MAAM,OAAO,GAAG,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;QACxE,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACnE,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAC7B,WAAW,EACX,KAAK,EACL,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,EACpD,GAAG,KAAK,CAAC,UAAU,IAAI,OAAO,EAAE,EAAE,CACnC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoFrameVarsBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/subtitle/VideoFrameVarsBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,2CAA2C,CAAC;AACpG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AACvG,OAAO,KAAK,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACjI,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AACnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"VideoFrameVarsBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/subtitle/VideoFrameVarsBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,2CAA2C,CAAC;AACpG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AACvG,OAAO,KAAK,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACjI,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AACnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAU/E;;;;;;;;;;GAUG;AACH,qBAAa,qBAAqB;IAG9B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBALhB,cAAc,EAAE,yBAAyB,EACzC,mBAAmB,EAAE,0BAA0B,EAC/C,gBAAgB,EAAE,uBAAuB,EACzC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAGtD,KAAK,CACT,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,sBAAsB,EACjC,CAAC,EAAE,MAAM,GACR,OAAO,CAAC,cAAc,CAAC;IAsB1B;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,yBAAyB;IA4CjC,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,uBAAuB;CAShC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CssVariable } from '../../document/CssVariable';
|
|
2
|
+
import { profiler } from '../../profiling/Profiler';
|
|
2
3
|
const NO_EXCLUDED_WORDS = new Set();
|
|
3
4
|
// Safety bleed applied to the painted region for video-frame styles
|
|
4
5
|
// that don't declare a `rendering.padding`. 0.25em ≈ enough to cover
|
|
@@ -33,14 +34,15 @@ export class VideoFrameVarsBuilder {
|
|
|
33
34
|
async build(style, seg, placement, t) {
|
|
34
35
|
if (!style.rendering.videoFrame.required)
|
|
35
36
|
return {};
|
|
36
|
-
const region = this.resolvePaintRegion(style, seg, placement);
|
|
37
|
+
const region = profiler.time('VideoFrameVarsBuilder.paintRegion', () => this.resolvePaintRegion(style, seg, placement));
|
|
38
|
+
const frameUrl = await profiler.time('VideoFrameVarsBuilder.frameUrl', () => this.videoFrameSource.getFrameAt(t, style.rendering.videoFrame.jpegQuality, region));
|
|
37
39
|
// Offset vars assume the consuming element is a direct child of
|
|
38
40
|
// the wrapper: `%` resolves against the wrapper. The region.x/y
|
|
39
41
|
// bias positions the layer so the cropped frame's (0,0) lands on
|
|
40
42
|
// viewport (region.x, region.y); when no crop applies the bias
|
|
41
43
|
// is zero and the layer covers the full viewport.
|
|
42
44
|
return {
|
|
43
|
-
[CssVariable.VIDEO_FRAME]: `url("${
|
|
45
|
+
[CssVariable.VIDEO_FRAME]: `url("${frameUrl}")`,
|
|
44
46
|
[CssVariable.SUBTITLE_REGION_WIDTH]: `${region.width}px`,
|
|
45
47
|
[CssVariable.SUBTITLE_REGION_HEIGHT]: `${region.height}px`,
|
|
46
48
|
[CssVariable.SUBTITLE_REGION_X]: `calc(${placement.hAnchorPct}% - ${placement.xPx - region.x}px)`,
|
|
@@ -62,7 +64,8 @@ export class VideoFrameVarsBuilder {
|
|
|
62
64
|
: this.measureSegmentPaintRegion(style, seg, placement));
|
|
63
65
|
}
|
|
64
66
|
measureSegmentPaintRegion(style, seg, placement) {
|
|
65
|
-
const
|
|
67
|
+
const segmentOverride = style.segmentOverrides.get(seg.id);
|
|
68
|
+
const segmentInlineStylesOverride = segmentOverride?.inlineStyles;
|
|
66
69
|
const baseInlineStyles = segmentInlineStylesOverride
|
|
67
70
|
? { ...style.inlineStyles, ...segmentInlineStylesOverride }
|
|
68
71
|
: style.inlineStyles;
|
|
@@ -72,8 +75,14 @@ export class VideoFrameVarsBuilder {
|
|
|
72
75
|
wordOverrides: style.wordOverrides,
|
|
73
76
|
splitWordsIntoLetters: style.rendering.splitWordsIntoLetters,
|
|
74
77
|
includeVideoFrameLayer: style.rendering.videoFrame.required,
|
|
78
|
+
textDirection: style.rendering.textDirection,
|
|
75
79
|
extraWrapperStyles: {},
|
|
80
|
+
extraSegmentClasses: segmentOverride?.classes ?? [],
|
|
76
81
|
decorationPlacements: style.decorationPlacements,
|
|
82
|
+
// The probe measures geometry, so it has to carry the ids the
|
|
83
|
+
// stylesheet addresses: a rule targeting one element can change
|
|
84
|
+
// its box, and a region measured without it would be wrong.
|
|
85
|
+
addressableElementIds: style.addressableElementIds,
|
|
77
86
|
inlineStyleEmitter: style.inlineStyleEmitter,
|
|
78
87
|
}, seg, seg.time.start, NO_EXCLUDED_WORDS,
|
|
79
88
|
// Paint-region measurement renders the segment in isolation; the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoFrameVarsBuilder.js","sourceRoot":"","sources":["../../../../src/modules/rendering/subtitle/VideoFrameVarsBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"VideoFrameVarsBuilder.js","sourceRoot":"","sources":["../../../../src/modules/rendering/subtitle/VideoFrameVarsBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAQ5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,MAAM,iBAAiB,GAAwB,IAAI,GAAG,EAAE,CAAC;AAEzD,oEAAoE;AACpE,qEAAqE;AACrE,iEAAiE;AACjE,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,OAAO,qBAAqB;IAGb;IACA;IACA;IACA;IACA;IACA;IANnB,YACmB,cAAyC,EACzC,mBAA+C,EAC/C,gBAAyC,EACzC,KAAa,EACb,MAAc,EACd,gBAAyC;QALzC,mBAAc,GAAd,cAAc,CAA2B;QACzC,wBAAmB,GAAnB,mBAAmB,CAA4B;QAC/C,qBAAgB,GAAhB,gBAAgB,CAAyB;QACzC,UAAK,GAAL,KAAK,CAAQ;QACb,WAAM,GAAN,MAAM,CAAQ;QACd,qBAAgB,GAAhB,gBA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E,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
+
import type { HorizontalSide } from '../../bidi/HorizontalSide';
|
|
1
2
|
export type VerticalAlign = 'top' | 'center' | 'bottom';
|
|
2
|
-
|
|
3
|
+
/** Every vertical anchor, for reading one back off something that was stored. */
|
|
4
|
+
export declare const VERTICAL_ALIGNS: ReadonlyArray<VerticalAlign>;
|
|
5
|
+
export type HorizontalAlign = HorizontalSide;
|
|
3
6
|
/**
|
|
4
7
|
* Symmetric box-anchor positioning. `*Offset` is the absolute position of
|
|
5
8
|
* the anchor point as a fraction of the video's dimensions; `*Align`
|
|
6
9
|
* decides which edge of the caption box lands on that point:
|
|
7
|
-
* top/left → 0% of own size
|
|
8
|
-
* center
|
|
9
|
-
* bottom/right → 100%
|
|
10
|
+
* top/left/start → 0% of own size
|
|
11
|
+
* center → 50%
|
|
12
|
+
* bottom/right/end → 100%
|
|
10
13
|
*
|
|
11
14
|
* E.g. `verticalOffset: 1, verticalAlign: 'bottom'` pins the box's bottom
|
|
12
15
|
* edge to the video's bottom edge. `horizontalOffset: 0.5,
|
|
13
16
|
* horizontalAlign: 'center'` centers the box horizontally.
|
|
17
|
+
*
|
|
18
|
+
* `horizontalAlign` decides how the whole horizontal axis is read: with a
|
|
19
|
+
* screen side, `horizontalOffset` counts from the video's left edge; with a
|
|
20
|
+
* reading side, it counts from the edge where reading begins. The two are
|
|
21
|
+
* never mixed, so `start` at `0.06` sits six percent in from the left in
|
|
22
|
+
* left-to-right text and six percent in from the right in right-to-left
|
|
23
|
+
* text, while `left` at `0.06` stays put in both. `center` is treated as a
|
|
24
|
+
* screen side: it names the same place either way, and leaving its offset
|
|
25
|
+
* alone keeps a caption the reader positioned by hand where they put it.
|
|
14
26
|
*/
|
|
15
27
|
export interface AlignmentConfig {
|
|
16
28
|
verticalAlign: VerticalAlign;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlignmentConfig.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/types/AlignmentConfig.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"AlignmentConfig.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/types/AlignmentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExD,iFAAiF;AACjF,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,aAAa,CAA+B,CAAC;AACzF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,aAAa,CAAC;IAE7B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IAEjC,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlignmentConfig.js","sourceRoot":"","sources":["../../../../src/modules/rendering/types/AlignmentConfig.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"AlignmentConfig.js","sourceRoot":"","sources":["../../../../src/modules/rendering/types/AlignmentConfig.ts"],"names":[],"mappings":"AAIA,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAiC,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -11,5 +11,13 @@ export declare class ElementRenderOverrides {
|
|
|
11
11
|
private constructor();
|
|
12
12
|
isEmpty(): boolean;
|
|
13
13
|
get(elementId: string): ScopedRenderOverride | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* A new instance layering `other` over this one: elements present in
|
|
16
|
+
* only one side keep their entry; for elements present in both,
|
|
17
|
+
* `other`'s inline styles merge key-by-key over this one's, and its
|
|
18
|
+
* alignment and classes replace them when present.
|
|
19
|
+
*/
|
|
20
|
+
mergedWith(other: ElementRenderOverrides): ElementRenderOverrides;
|
|
21
|
+
private mergeOverride;
|
|
14
22
|
}
|
|
15
23
|
//# sourceMappingURL=ElementRenderOverrides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementRenderOverrides.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/types/ElementRenderOverrides.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAE1F;;;;GAIG;AACH,qBAAa,sBAAsB;IAY/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,MAAM,CAAC,KAAK,IAAI,sBAAsB;IAItC,MAAM,CAAC,WAAW,CAChB,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,GAC9D,sBAAsB;IAIzB,OAAO;IAIP,OAAO,IAAI,OAAO;IAIlB,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"ElementRenderOverrides.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/types/ElementRenderOverrides.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAE1F;;;;GAIG;AACH,qBAAa,sBAAsB;IAY/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,MAAM,CAAC,KAAK,IAAI,sBAAsB;IAItC,MAAM,CAAC,WAAW,CAChB,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,GAC9D,sBAAsB;IAIzB,OAAO;IAIP,OAAO,IAAI,OAAO;IAIlB,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAIxD;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,sBAAsB,GAAG,sBAAsB;IAWjE,OAAO,CAAC,aAAa;CAUtB"}
|
|
@@ -20,5 +20,33 @@ export class ElementRenderOverrides {
|
|
|
20
20
|
get(elementId) {
|
|
21
21
|
return this.entries.get(elementId);
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* A new instance layering `other` over this one: elements present in
|
|
25
|
+
* only one side keep their entry; for elements present in both,
|
|
26
|
+
* `other`'s inline styles merge key-by-key over this one's, and its
|
|
27
|
+
* alignment and classes replace them when present.
|
|
28
|
+
*/
|
|
29
|
+
mergedWith(other) {
|
|
30
|
+
if (other.isEmpty())
|
|
31
|
+
return this;
|
|
32
|
+
if (this.isEmpty())
|
|
33
|
+
return other;
|
|
34
|
+
const merged = new Map(this.entries);
|
|
35
|
+
for (const [elementId, override] of other.entries) {
|
|
36
|
+
const base = merged.get(elementId);
|
|
37
|
+
merged.set(elementId, base ? this.mergeOverride(base, override) : override);
|
|
38
|
+
}
|
|
39
|
+
return new ElementRenderOverrides(merged);
|
|
40
|
+
}
|
|
41
|
+
mergeOverride(base, layer) {
|
|
42
|
+
const inlineStyles = base.inlineStyles || layer.inlineStyles
|
|
43
|
+
? { ...base.inlineStyles, ...layer.inlineStyles }
|
|
44
|
+
: undefined;
|
|
45
|
+
return {
|
|
46
|
+
...(inlineStyles ? { inlineStyles } : {}),
|
|
47
|
+
...((layer.alignment ?? base.alignment) ? { alignment: layer.alignment ?? base.alignment } : {}),
|
|
48
|
+
...((layer.classes ?? base.classes) ? { classes: layer.classes ?? base.classes } : {}),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
23
51
|
}
|
|
24
52
|
//# sourceMappingURL=ElementRenderOverrides.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementRenderOverrides.js","sourceRoot":"","sources":["../../../../src/modules/rendering/types/ElementRenderOverrides.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IAYd;IAXnB,MAAM,CAAC,KAAK;QACV,OAAO,IAAI,sBAAsB,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,WAAW,CAChB,OAA+D;QAE/D,OAAO,IAAI,sBAAsB,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,YACmB,OAAkD;QAAlD,YAAO,GAAP,OAAO,CAA2C;IAClE,CAAC;IAEJ,OAAO;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,GAAG,CAAC,SAAiB;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"ElementRenderOverrides.js","sourceRoot":"","sources":["../../../../src/modules/rendering/types/ElementRenderOverrides.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IAYd;IAXnB,MAAM,CAAC,KAAK;QACV,OAAO,IAAI,sBAAsB,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,CAAC,WAAW,CAChB,OAA+D;QAE/D,OAAO,IAAI,sBAAsB,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,YACmB,OAAkD;QAAlD,YAAO,GAAP,OAAO,CAA2C;IAClE,CAAC;IAEJ,OAAO;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,GAAG,CAAC,SAAiB;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,KAA6B;QACtC,IAAI,KAAK,CAAC,OAAO,EAAE;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ACvF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BoxEdges } from '../../rendering/types/BoxEdges';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TextDirection } from '../../bidi/TextDirection';
|
|
3
3
|
/**
|
|
4
4
|
* Whether a style consumes the underlying video frame as part of
|
|
5
5
|
* its visuals, and — when it does — at what JPEG quality the frame
|
|
@@ -19,6 +19,11 @@ export interface RenderingConfig {
|
|
|
19
19
|
readonly videoFrame: VideoFrameRequirement;
|
|
20
20
|
/** Extra space around the segment box, per side. `null` when not declared. */
|
|
21
21
|
readonly padding: BoxEdges | null;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Paragraph direction the bidirectional algorithm resolves each line
|
|
24
|
+
* against. It decides where every word lands, so it must describe the
|
|
25
|
+
* language of the text rather than a visual preference.
|
|
26
|
+
*/
|
|
27
|
+
readonly textDirection: TextDirection;
|
|
23
28
|
}
|
|
24
29
|
//# sourceMappingURL=RenderingConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderingConfig.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/types/RenderingConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RenderingConfig.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/types/RenderingConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;IAC3C,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;IAClC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;CACvC"}
|
|
@@ -2,18 +2,23 @@ import type { AlignmentConfig } from '../../rendering/types/AlignmentConfig';
|
|
|
2
2
|
import type { InlineStyleMap } from '../../rendering/types/InlineStyleMap';
|
|
3
3
|
/**
|
|
4
4
|
* Render-time overrides for one element (segment or word), layered on
|
|
5
|
-
* top of the style's root-level defaults.
|
|
6
|
-
* and optional
|
|
7
|
-
* only, or both. An entry where both are absent is equivalent to the
|
|
5
|
+
* top of the style's root-level defaults. The fields are independent
|
|
6
|
+
* and optional; an entry where all are absent is equivalent to the
|
|
8
7
|
* absence of the entry and should be omitted by builders.
|
|
9
8
|
*
|
|
10
9
|
* `inlineStyles` lands on the element's `style="..."` attribute (CSS
|
|
11
10
|
* custom properties and direct properties coexist transparently);
|
|
12
11
|
* `alignment` is partial and merges over the style's root alignment to
|
|
13
|
-
* yield the element's effective anchor point and box-edge selection
|
|
12
|
+
* yield the element's effective anchor point and box-edge selection;
|
|
13
|
+
* `classes` are appended to the element's class list, so stylesheets
|
|
14
|
+
* can select on consumer-driven state. Segment-scope classes apply to
|
|
15
|
+
* the main segment subtree only — positioned sibling subtrees (a word
|
|
16
|
+
* pinned at its own anchor) hold their exact spot and must not pick
|
|
17
|
+
* up state-driven styling.
|
|
14
18
|
*/
|
|
15
19
|
export interface ScopedRenderOverride {
|
|
16
20
|
readonly inlineStyles?: InlineStyleMap;
|
|
17
21
|
readonly alignment?: Partial<AlignmentConfig>;
|
|
22
|
+
readonly classes?: ReadonlyArray<string>;
|
|
18
23
|
}
|
|
19
24
|
//# sourceMappingURL=ScopedRenderOverride.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScopedRenderOverride.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/types/ScopedRenderOverride.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E
|
|
1
|
+
{"version":3,"file":"ScopedRenderOverride.d.ts","sourceRoot":"","sources":["../../../../src/modules/rendering/types/ScopedRenderOverride.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC1C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
2
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
3
|
+
import type { SubtitleGranularity } from '../subtitle-file/SubtitleGranularity';
|
|
4
|
+
/**
|
|
5
|
+
* Writes Advanced SubStation Alpha (`.ass`), the format karaoke, anime
|
|
6
|
+
* and fansub tooling is built around.
|
|
7
|
+
*
|
|
8
|
+
* Word granularity is what this format exists for: a `\k` tag before
|
|
9
|
+
* each word states how long it is held, and a renderer walks the line
|
|
10
|
+
* word by word without the entry ever being split. The file stays the
|
|
11
|
+
* same length as at entry granularity, which no plain-cue format can
|
|
12
|
+
* manage.
|
|
13
|
+
*
|
|
14
|
+
* Styling does not travel. See the note on the default style for why
|
|
15
|
+
* carrying part of it would be worse than carrying none.
|
|
16
|
+
*/
|
|
17
|
+
export declare class AssSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
18
|
+
readonly mediaType = "text/x-ssa";
|
|
19
|
+
readonly fileExtension = "ass";
|
|
20
|
+
protected write(cues: ReadonlyArray<SubtitleCue>, granularity: SubtitleGranularity): string;
|
|
21
|
+
private writeCue;
|
|
22
|
+
private writePlainBody;
|
|
23
|
+
/**
|
|
24
|
+
* A `\k` states how long the syllable before the next one is held, so
|
|
25
|
+
* the tags run back to back and nothing addresses the timeline
|
|
26
|
+
* directly. Silence between two words therefore has to be spent
|
|
27
|
+
* somewhere or every word after it starts early, and the drift adds
|
|
28
|
+
* up across the line.
|
|
29
|
+
*
|
|
30
|
+
* Each word is held until the next one is spoken, which spends the
|
|
31
|
+
* silence on the word already sung and leaves the highlight where the
|
|
32
|
+
* ear left it. Silence before the first word has no word to fall to,
|
|
33
|
+
* so it becomes an empty syllable. The syllables then tile the entry
|
|
34
|
+
* exactly.
|
|
35
|
+
*/
|
|
36
|
+
private writeSungBody;
|
|
37
|
+
/**
|
|
38
|
+
* Where each word starts and where the entry ends, in hundredths from
|
|
39
|
+
* the entry's own start. Rounding positions rather than durations
|
|
40
|
+
* keeps the syllables from drifting out of the entry they belong to.
|
|
41
|
+
*/
|
|
42
|
+
private syllableBoundaries;
|
|
43
|
+
private leadIn;
|
|
44
|
+
/** Braces open and close override blocks, so text has to disclaim them. */
|
|
45
|
+
private escape;
|
|
46
|
+
private centiseconds;
|
|
47
|
+
/**
|
|
48
|
+
* Rounding to hundredths before splitting the position keeps a value
|
|
49
|
+
* a hair under a whole second from printing as a hundredth too many.
|
|
50
|
+
*/
|
|
51
|
+
private timecode;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=AssSubtitleFileSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssSubtitleFileSerializer.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/AssSubtitleFileSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAkDtF;;;;;;;;;;;;GAYG;AACH,qBAAa,yBAA0B,SAAQ,sBAAsB;IACnE,QAAQ,CAAC,SAAS,gBAAgB;IAClC,QAAQ,CAAC,aAAa,SAAS;IAE/B,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,mBAAmB,GAAG,MAAM;IAM3F,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,cAAc;IAItB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,aAAa;IAgBrB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,MAAM;IAId,2EAA2E;IAC3E,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,YAAY;IAIpB;;;OAGG;IACH,OAAO,CAAC,QAAQ;CAKjB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
2
|
+
import { Timecode } from '../subtitle-file/Timecode';
|
|
3
|
+
const NEW_LINE = '\r\n';
|
|
4
|
+
const ROW_BREAK = '\\N';
|
|
5
|
+
/**
|
|
6
|
+
* The reference frame the style's sizes and margins are read against.
|
|
7
|
+
* A renderer scales the whole script from it to whatever the video
|
|
8
|
+
* actually measures, so the numbers stay sensible on any footage.
|
|
9
|
+
*/
|
|
10
|
+
const REFERENCE_WIDTH = 1920;
|
|
11
|
+
const REFERENCE_HEIGHT = 1080;
|
|
12
|
+
/**
|
|
13
|
+
* A deliberately plain style. The design a project carries cannot
|
|
14
|
+
* survive the trip — the format addresses fonts by name and expects
|
|
15
|
+
* them installed on the machine that plays the file, and it has no way
|
|
16
|
+
* to express per-word animation, narration highlighting or any of the
|
|
17
|
+
* effects a template is built from. A partial likeness would read as a
|
|
18
|
+
* broken export rather than as the limit of the format, so the file
|
|
19
|
+
* states plainly that it carries text and timing.
|
|
20
|
+
*
|
|
21
|
+
* Fields, in the order the format declares them: name, font, size, the
|
|
22
|
+
* four colours (ABGR, leading pair is alpha), the four toggles, scale,
|
|
23
|
+
* spacing, angle, border style, outline, shadow, alignment, the three
|
|
24
|
+
* margins, encoding.
|
|
25
|
+
*/
|
|
26
|
+
const DEFAULT_STYLE = 'Style: Default,Arial,48,&H00FFFFFF,&H00A0A0A0,&H00000000,&H00000000,'
|
|
27
|
+
+ '0,0,0,0,100,100,0,0,1,3,0,2,60,60,60,1';
|
|
28
|
+
const HEADER = [
|
|
29
|
+
'[Script Info]',
|
|
30
|
+
'ScriptType: v4.00+',
|
|
31
|
+
'WrapStyle: 0',
|
|
32
|
+
'ScaledBorderAndShadow: yes',
|
|
33
|
+
`PlayResX: ${REFERENCE_WIDTH}`,
|
|
34
|
+
`PlayResY: ${REFERENCE_HEIGHT}`,
|
|
35
|
+
'',
|
|
36
|
+
'[V4+ Styles]',
|
|
37
|
+
'Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour,'
|
|
38
|
+
+ ' Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline,'
|
|
39
|
+
+ ' Shadow, Alignment, MarginL, MarginR, MarginV, Encoding',
|
|
40
|
+
DEFAULT_STYLE,
|
|
41
|
+
'',
|
|
42
|
+
'[Events]',
|
|
43
|
+
'Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text',
|
|
44
|
+
].join(NEW_LINE);
|
|
45
|
+
/**
|
|
46
|
+
* Writes Advanced SubStation Alpha (`.ass`), the format karaoke, anime
|
|
47
|
+
* and fansub tooling is built around.
|
|
48
|
+
*
|
|
49
|
+
* Word granularity is what this format exists for: a `\k` tag before
|
|
50
|
+
* each word states how long it is held, and a renderer walks the line
|
|
51
|
+
* word by word without the entry ever being split. The file stays the
|
|
52
|
+
* same length as at entry granularity, which no plain-cue format can
|
|
53
|
+
* manage.
|
|
54
|
+
*
|
|
55
|
+
* Styling does not travel. See the note on the default style for why
|
|
56
|
+
* carrying part of it would be worse than carrying none.
|
|
57
|
+
*/
|
|
58
|
+
export class AssSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
59
|
+
mediaType = 'text/x-ssa';
|
|
60
|
+
fileExtension = 'ass';
|
|
61
|
+
write(cues, granularity) {
|
|
62
|
+
const events = cues.map((cue) => this.writeCue(cue, granularity)).join(NEW_LINE);
|
|
63
|
+
const separator = events.length > 0 ? NEW_LINE : '';
|
|
64
|
+
return `${HEADER}${separator}${events}${NEW_LINE}`;
|
|
65
|
+
}
|
|
66
|
+
writeCue(cue, granularity) {
|
|
67
|
+
const start = this.timecode(cue.time.start);
|
|
68
|
+
const end = this.timecode(cue.time.end);
|
|
69
|
+
const body = granularity === 'word' ? this.writeSungBody(cue) : this.writePlainBody(cue);
|
|
70
|
+
return `Dialogue: 0,${start},${end},Default,,0,0,0,,${body}`;
|
|
71
|
+
}
|
|
72
|
+
writePlainBody(cue) {
|
|
73
|
+
return cue.rows.map((row) => this.escape(row.text())).join(ROW_BREAK);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A `\k` states how long the syllable before the next one is held, so
|
|
77
|
+
* the tags run back to back and nothing addresses the timeline
|
|
78
|
+
* directly. Silence between two words therefore has to be spent
|
|
79
|
+
* somewhere or every word after it starts early, and the drift adds
|
|
80
|
+
* up across the line.
|
|
81
|
+
*
|
|
82
|
+
* Each word is held until the next one is spoken, which spends the
|
|
83
|
+
* silence on the word already sung and leaves the highlight where the
|
|
84
|
+
* ear left it. Silence before the first word has no word to fall to,
|
|
85
|
+
* so it becomes an empty syllable. The syllables then tile the entry
|
|
86
|
+
* exactly.
|
|
87
|
+
*/
|
|
88
|
+
writeSungBody(cue) {
|
|
89
|
+
const boundaries = this.syllableBoundaries(cue);
|
|
90
|
+
const rows = [];
|
|
91
|
+
let spoken = 0;
|
|
92
|
+
for (const row of cue.rows) {
|
|
93
|
+
const syllables = row.tokens.map((token) => {
|
|
94
|
+
const held = boundaries[spoken + 1] - boundaries[spoken];
|
|
95
|
+
const silence = spoken === 0 ? this.leadIn(boundaries[0]) : '';
|
|
96
|
+
spoken += 1;
|
|
97
|
+
return `${silence}{\\k${held}}${this.escape(token.text)}`;
|
|
98
|
+
});
|
|
99
|
+
rows.push(syllables.join(' '));
|
|
100
|
+
}
|
|
101
|
+
return rows.join(ROW_BREAK);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Where each word starts and where the entry ends, in hundredths from
|
|
105
|
+
* the entry's own start. Rounding positions rather than durations
|
|
106
|
+
* keeps the syllables from drifting out of the entry they belong to.
|
|
107
|
+
*/
|
|
108
|
+
syllableBoundaries(cue) {
|
|
109
|
+
const origin = cue.time.start;
|
|
110
|
+
const starts = cue.tokens().map((token) => this.centiseconds(token.time.start - origin));
|
|
111
|
+
return [...starts, this.centiseconds(cue.time.end - origin)];
|
|
112
|
+
}
|
|
113
|
+
leadIn(firstWordAt) {
|
|
114
|
+
return firstWordAt > 0 ? `{\\k${firstWordAt}}` : '';
|
|
115
|
+
}
|
|
116
|
+
/** Braces open and close override blocks, so text has to disclaim them. */
|
|
117
|
+
escape(text) {
|
|
118
|
+
return text.replace(/\{/g, '\\{').replace(/\}/g, '\\}');
|
|
119
|
+
}
|
|
120
|
+
centiseconds(seconds) {
|
|
121
|
+
return Math.max(0, Math.round(seconds * 100));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Rounding to hundredths before splitting the position keeps a value
|
|
125
|
+
* a hair under a whole second from printing as a hundredth too many.
|
|
126
|
+
*/
|
|
127
|
+
timecode(position) {
|
|
128
|
+
const at = new Timecode(Math.round(position * 100) / 100);
|
|
129
|
+
return `${at.hours}:${at.padded(at.minutes, 2)}:${at.padded(at.seconds, 2)}`
|
|
130
|
+
+ `.${at.padded(at.centiseconds(), 2)}`;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=AssSubtitleFileSerializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssSubtitleFileSerializer.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/AssSubtitleFileSerializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxB,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AACH,MAAM,aAAa,GACjB,sEAAsE;MACpE,wCAAwC,CAAC;AAE7C,MAAM,MAAM,GAAG;IACb,eAAe;IACf,oBAAoB;IACpB,cAAc;IACd,4BAA4B;IAC5B,aAAa,eAAe,EAAE;IAC9B,aAAa,gBAAgB,EAAE;IAC/B,EAAE;IACF,cAAc;IACd,8FAA8F;UAC5F,4FAA4F;UAC5F,yDAAyD;IAC3D,aAAa;IACb,EAAE;IACF,UAAU;IACV,iFAAiF;CAClF,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAEjB;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,yBAA0B,SAAQ,sBAAsB;IAC1D,SAAS,GAAG,YAAY,CAAC;IACzB,aAAa,GAAG,KAAK,CAAC;IAErB,KAAK,CAAC,IAAgC,EAAE,WAAgC;QAChF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAA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AE,KAAK,CAAC,CAAC;IAC1D,CAAC;IAEO,YAAY,CAAC,OAAe;QAClC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC;IAChD,CAAC;IAED;;;OAGG;IACK,QAAQ,CAAC,QAAgB;QAC/B,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QAC1D,OAAO,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;cACxE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
2
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
3
|
+
import type { SubtitleGranularity } from '../subtitle-file/SubtitleGranularity';
|
|
4
|
+
/**
|
|
5
|
+
* Writes SubViewer (`.sbv`), one of the two shapes YouTube hands back
|
|
6
|
+
* when captions are downloaded: a `H:MM:SS.mmm,H:MM:SS.mmm` range on
|
|
7
|
+
* its own line, the rows beneath it, and a blank line between entries.
|
|
8
|
+
* There is no counter and the hour is not padded.
|
|
9
|
+
*
|
|
10
|
+
* Like SubRip, the format cannot time anything below an entry, so word
|
|
11
|
+
* granularity means one entry per word.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SbvSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
14
|
+
readonly mediaType = "text/plain";
|
|
15
|
+
readonly fileExtension = "sbv";
|
|
16
|
+
protected write(cues: ReadonlyArray<SubtitleCue>, granularity: SubtitleGranularity): string;
|
|
17
|
+
private writeCue;
|
|
18
|
+
private timecode;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=SbvSubtitleFileSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SbvSubtitleFileSerializer.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SbvSubtitleFileSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAKtF;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,SAAQ,sBAAsB;IACnE,QAAQ,CAAC,SAAS,gBAAgB;IAClC,QAAQ,CAAC,aAAa,SAAS;IAE/B,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,mBAAmB,GAAG,MAAM;IAK3F,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,QAAQ;CAKjB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
2
|
+
import { Timecode } from '../subtitle-file/Timecode';
|
|
3
|
+
const NEW_LINE = '\n';
|
|
4
|
+
/**
|
|
5
|
+
* Writes SubViewer (`.sbv`), one of the two shapes YouTube hands back
|
|
6
|
+
* when captions are downloaded: a `H:MM:SS.mmm,H:MM:SS.mmm` range on
|
|
7
|
+
* its own line, the rows beneath it, and a blank line between entries.
|
|
8
|
+
* There is no counter and the hour is not padded.
|
|
9
|
+
*
|
|
10
|
+
* Like SubRip, the format cannot time anything below an entry, so word
|
|
11
|
+
* granularity means one entry per word.
|
|
12
|
+
*/
|
|
13
|
+
export class SbvSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
14
|
+
mediaType = 'text/plain';
|
|
15
|
+
fileExtension = 'sbv';
|
|
16
|
+
write(cues, granularity) {
|
|
17
|
+
const entries = granularity === 'word' ? this.perWordCues(cues) : cues;
|
|
18
|
+
return entries.map((cue) => this.writeCue(cue)).join(NEW_LINE);
|
|
19
|
+
}
|
|
20
|
+
writeCue(cue) {
|
|
21
|
+
const range = `${this.timecode(cue.time.start)},${this.timecode(cue.time.end)}`;
|
|
22
|
+
const body = cue.rows.map((row) => row.text()).join(NEW_LINE);
|
|
23
|
+
return `${range}${NEW_LINE}${body}${NEW_LINE}`;
|
|
24
|
+
}
|
|
25
|
+
timecode(position) {
|
|
26
|
+
const at = new Timecode(position);
|
|
27
|
+
return `${at.hours}:${at.padded(at.minutes, 2)}:${at.padded(at.seconds, 2)}`
|
|
28
|
+
+ `.${at.padded(at.milliseconds, 3)}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=SbvSubtitleFileSerializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SbvSubtitleFileSerializer.js","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SbvSubtitleFileSerializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB;;;;;;;;GAQG;AACH,MAAM,OAAO,yBAA0B,SAAQ,sBAAsB;IAC1D,SAAS,GAAG,YAAY,CAAC;IACzB,aAAa,GAAG,KAAK,CAAC;IAErB,KAAK,CAAC,IAAgC,EAAE,WAAgC;QAChF,MAAM,OAAO,GAAG,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IAEO,QAAQ,CAAC,GAAgB;QAC/B,MAAM,KAAK,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAChF,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9D,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;IACjD,CAAC;IAEO,QAAQ,CAAC,QAAgB;QAC/B,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;cACxE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SubtitleCue } from '../subtitle-file/SubtitleCue';
|
|
2
|
+
import { SubtitleFileSerializer } from '../subtitle-file/SubtitleFileSerializer';
|
|
3
|
+
import type { SubtitleGranularity } from '../subtitle-file/SubtitleGranularity';
|
|
4
|
+
/**
|
|
5
|
+
* Writes SubRip (`.srt`): a one-based counter, a
|
|
6
|
+
* `HH:MM:SS,mmm --> HH:MM:SS,mmm` range, and the entry's rows, with a
|
|
7
|
+
* blank line between blocks.
|
|
8
|
+
*
|
|
9
|
+
* The format has no way to time anything below an entry, so word
|
|
10
|
+
* granularity is paid for in entries: one per word, which multiplies
|
|
11
|
+
* the file's length several times over. Every player understands the
|
|
12
|
+
* result, which is the reason to accept the cost.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SrtSubtitleFileSerializer extends SubtitleFileSerializer {
|
|
15
|
+
readonly mediaType = "application/x-subrip";
|
|
16
|
+
readonly fileExtension = "srt";
|
|
17
|
+
protected write(cues: ReadonlyArray<SubtitleCue>, granularity: SubtitleGranularity): string;
|
|
18
|
+
private writeCue;
|
|
19
|
+
private timecode;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=SrtSubtitleFileSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SrtSubtitleFileSerializer.d.ts","sourceRoot":"","sources":["../../../src/modules/subtitle-file/SrtSubtitleFileSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAMtF;;;;;;;;;GASG;AACH,qBAAa,yBAA0B,SAAQ,sBAAsB;IACnE,QAAQ,CAAC,SAAS,0BAA0B;IAC5C,QAAQ,CAAC,aAAa,SAAS;IAE/B,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,mBAAmB,GAAG,MAAM;IAK3F,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,QAAQ;CAKjB"}
|