@slidevideo/cli 0.1.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/CHANGELOG.md +33 -0
- package/IMPRESSUM.md +13 -0
- package/LICENSE-TERMS.md +58 -0
- package/README.md +25 -0
- package/addons/slidevideo/geometry.ts +127 -0
- package/addons/slidevideo/global-top.vue +232 -0
- package/addons/slidevideo/package.json +1 -0
- package/addons/slidevideo/playback-entries.ts +14 -0
- package/addons/slidevideo/preview.ts +157 -0
- package/dist/adapters/browser-runtime.d.ts +37 -0
- package/dist/adapters/browser-runtime.js +1 -0
- package/dist/adapters/edge.d.ts +7 -0
- package/dist/adapters/edge.js +46 -0
- package/dist/adapters/elevenlabs.d.ts +7 -0
- package/dist/adapters/elevenlabs.js +58 -0
- package/dist/adapters/powerpoint-preview.d.ts +2 -0
- package/dist/adapters/powerpoint-preview.js +18 -0
- package/dist/adapters/powerpoint.d.ts +21 -0
- package/dist/adapters/powerpoint.js +434 -0
- package/dist/adapters/registry.d.ts +4 -0
- package/dist/adapters/registry.js +13 -0
- package/dist/adapters/slidev-inputs.d.ts +1 -0
- package/dist/adapters/slidev-inputs.js +86 -0
- package/dist/adapters/slidev-inspection.d.ts +3 -0
- package/dist/adapters/slidev-inspection.js +79 -0
- package/dist/adapters/slidev-server.d.ts +1 -0
- package/dist/adapters/slidev-server.js +48 -0
- package/dist/adapters/slidev.d.ts +30 -0
- package/dist/adapters/slidev.js +251 -0
- package/dist/annotation-paint.d.ts +19 -0
- package/dist/annotation-paint.js +13 -0
- package/dist/annotations.d.ts +27 -0
- package/dist/annotations.js +115 -0
- package/dist/assembly.d.ts +48 -0
- package/dist/assembly.js +138 -0
- package/dist/calibration.d.ts +24 -0
- package/dist/calibration.js +346 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +180 -0
- package/dist/compositor.d.ts +18 -0
- package/dist/compositor.js +155 -0
- package/dist/contracts.d.ts +358 -0
- package/dist/contracts.js +1 -0
- package/dist/errors.d.ts +7 -0
- package/dist/errors.js +15 -0
- package/dist/executables.d.ts +23 -0
- package/dist/executables.js +165 -0
- package/dist/installation.d.ts +6 -0
- package/dist/installation.js +32 -0
- package/dist/license-key.d.ts +12 -0
- package/dist/license-key.js +55 -0
- package/dist/license-status.d.ts +16 -0
- package/dist/license-status.js +12 -0
- package/dist/media.d.ts +12 -0
- package/dist/media.js +57 -0
- package/dist/overlay-assets.d.ts +2 -0
- package/dist/overlay-assets.js +58 -0
- package/dist/pipeline.d.ts +50 -0
- package/dist/pipeline.js +257 -0
- package/dist/preview/contracts.d.ts +34 -0
- package/dist/preview/contracts.js +1 -0
- package/dist/preview/player.d.ts +1 -0
- package/dist/preview/player.js +129 -0
- package/dist/preview/server.d.ts +1 -0
- package/dist/preview/server.js +112 -0
- package/dist/preview/view.d.ts +1 -0
- package/dist/preview/view.js +36 -0
- package/dist/revoked-keys.json +1 -0
- package/dist/run.d.ts +12 -0
- package/dist/run.js +109 -0
- package/dist/setup-install.d.ts +7 -0
- package/dist/setup-install.js +98 -0
- package/dist/setup-license.d.ts +2 -0
- package/dist/setup-license.js +63 -0
- package/dist/setup.d.ts +34 -0
- package/dist/setup.js +218 -0
- package/dist/speech.d.ts +6 -0
- package/dist/speech.js +125 -0
- package/dist/storyboard.d.ts +6 -0
- package/dist/storyboard.js +86 -0
- package/dist/timing.d.ts +6 -0
- package/dist/timing.js +162 -0
- package/package.json +134 -0
- package/schemas/annotation-geometry.v1.json +130 -0
- package/schemas/revoked-keys.schema.json +11 -0
- package/schemas/run-manifest.v1.json +96 -0
- package/schemas/schedule.v1.json +108 -0
- package/schemas/schedule.v2.json +496 -0
- package/schemas/speech.v1.json +173 -0
- package/schemas/storyboard.v1.json +461 -0
- package/schemas/storyboard.v2.json +802 -0
- package/schemas/timing-evidence.v1.json +129 -0
- package/skills/slidevideo/SKILL.md +56 -0
- package/skills/slidevideo/references/production.md +76 -0
- package/skills/slidevideo/references/storyboard.md +272 -0
- package/tools/edge-tts/edge-tts.py +19 -0
- package/tools/edge-tts/requirements.lock +34 -0
- package/tools/powerpoint/Native.cs +277 -0
- package/tools/powerpoint/powerpoint.ps1 +714 -0
- package/tools/powerpoint/preview.ps1 +100 -0
- package/tools/powerpoint/requirements.json +11 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
function Run-Preview {
|
|
2
|
+
$presentation.SlideShowSettings.ShowType = 2
|
|
3
|
+
$presentation.SlideShowSettings.AdvanceMode = 1
|
|
4
|
+
$presentation.SlideShowSettings.ShowWithNarration = 0
|
|
5
|
+
$presentation.SlideShowSettings.StartingSlide = 1
|
|
6
|
+
$presentation.SlideShowSettings.EndingSlide = $presentation.Slides.Count
|
|
7
|
+
$presentation.SlideShowSettings.RangeType = 1
|
|
8
|
+
$editorWindow = [long]$app.HWND
|
|
9
|
+
$script:show = $presentation.SlideShowSettings.Run()
|
|
10
|
+
$deadline = $clock.Elapsed.TotalMilliseconds + 10000
|
|
11
|
+
do {
|
|
12
|
+
Check-Cancel
|
|
13
|
+
$script:window = [SlideVideo.Native]::FindShow($officeProcess, [IO.Path]::GetFileNameWithoutExtension($privateDeck), $editorWindow)
|
|
14
|
+
if ($window -eq 0) { Start-Sleep -Milliseconds 20 }
|
|
15
|
+
} while ($window -eq 0 -and $clock.Elapsed.TotalMilliseconds -lt $deadline)
|
|
16
|
+
if ($window -eq 0) { Fail 'POWERPOINT_WINDOW' 'Cannot identify the slideshow owned by the private preview deck.' }
|
|
17
|
+
$show.View.AcceleratorsEnabled = 0
|
|
18
|
+
$previewWidth = [Math]::Min([int]$job.output.width, 1600)
|
|
19
|
+
$previewHeight = [int][Math]::Round($previewWidth / $deckAspect)
|
|
20
|
+
[SlideVideo.Native]::PlacePreview($window, $previewWidth, $previewHeight)
|
|
21
|
+
$first = $job.operations[0]
|
|
22
|
+
if ($first.type -ne 'slide' -or $first.at_ms -ne 0) { Fail 'POWERPOINT_PROTOCOL' 'The preview schedule must initialize a slide at time zero.' }
|
|
23
|
+
Apply-Operation $first
|
|
24
|
+
$show.View.State = 2
|
|
25
|
+
$deadline = $clock.Elapsed.TotalMilliseconds + 5000
|
|
26
|
+
do {
|
|
27
|
+
Check-Cancel
|
|
28
|
+
try { $script:geometry = [SlideVideo.Native]::PreviewContent($window, $deckAspect) }
|
|
29
|
+
catch { if ($clock.Elapsed.TotalMilliseconds -gt $deadline) { Fail 'POWERPOINT_GEOMETRY' $_.Exception.Message }; Start-Sleep -Milliseconds 20 }
|
|
30
|
+
} while ($null -eq $geometry)
|
|
31
|
+
$previewClock = [Diagnostics.Stopwatch]::new()
|
|
32
|
+
$status = 'paused'
|
|
33
|
+
$nextOperation = 1
|
|
34
|
+
[Console]::InputEncoding = $utf8
|
|
35
|
+
[Console]::OutputEncoding = $utf8
|
|
36
|
+
[SlideVideo.PreviewInput]::Start()
|
|
37
|
+
Write-Json 'prepared.json' @{ version = 1; status = 'ready'; dependencies = (Dependencies) }
|
|
38
|
+
while ($true) {
|
|
39
|
+
Check-Cancel
|
|
40
|
+
$line = [SlideVideo.PreviewInput]::Next()
|
|
41
|
+
$action = ''
|
|
42
|
+
if ($null -ne $line) {
|
|
43
|
+
$command = $line | ConvertFrom-Json
|
|
44
|
+
$action = $command.command
|
|
45
|
+
}
|
|
46
|
+
if ($action -eq 'restart' -or ($action -eq 'play' -and $status -eq 'ended')) {
|
|
47
|
+
foreach ($monitor in $activeMedia) { $monitor.player.Stop() }
|
|
48
|
+
$activeMedia.Clear()
|
|
49
|
+
$show.View.State = 1
|
|
50
|
+
Apply-Operation $first
|
|
51
|
+
$previewClock.Restart()
|
|
52
|
+
$nextOperation = 1
|
|
53
|
+
$status = 'playing'
|
|
54
|
+
} elseif ($action -eq 'play' -and $status -eq 'paused') {
|
|
55
|
+
$show.View.State = 1
|
|
56
|
+
foreach ($monitor in $activeMedia) { $monitor.player.Play() }
|
|
57
|
+
$previewClock.Start()
|
|
58
|
+
$status = 'playing'
|
|
59
|
+
} elseif ($action -eq 'pause' -and $status -eq 'playing') {
|
|
60
|
+
$previewClock.Stop()
|
|
61
|
+
$show.View.State = 2
|
|
62
|
+
foreach ($monitor in $activeMedia) { $monitor.player.Pause() }
|
|
63
|
+
$status = 'paused'
|
|
64
|
+
}
|
|
65
|
+
$position = [Math]::Min($previewClock.Elapsed.TotalMilliseconds, [double]$job.duration_ms)
|
|
66
|
+
foreach ($monitor in @($activeMedia.ToArray())) {
|
|
67
|
+
if ($monitor.operation.end_ms -le $position) { $monitor.player.Pause(); [void]$activeMedia.Remove($monitor) }
|
|
68
|
+
}
|
|
69
|
+
if ($nextOperation -lt $job.operations.Count -and $job.operations[$nextOperation].at_ms -le $position) {
|
|
70
|
+
$show.View.State = 1
|
|
71
|
+
while ($nextOperation -lt $job.operations.Count -and $job.operations[$nextOperation].at_ms -le $position) {
|
|
72
|
+
$operation = $job.operations[$nextOperation]
|
|
73
|
+
$player = Apply-Operation $operation
|
|
74
|
+
if ($operation.type -eq 'play') {
|
|
75
|
+
$activeMedia.Add(@{ operation = $operation; player = $player })
|
|
76
|
+
if ($status -eq 'paused') { $player.Pause() }
|
|
77
|
+
}
|
|
78
|
+
$nextOperation++
|
|
79
|
+
}
|
|
80
|
+
if ($status -eq 'paused') { $show.View.State = 2 }
|
|
81
|
+
}
|
|
82
|
+
if ($status -eq 'playing' -and $position -ge $job.duration_ms) {
|
|
83
|
+
$previewClock.Stop()
|
|
84
|
+
$show.View.State = 2
|
|
85
|
+
$status = 'ended'
|
|
86
|
+
}
|
|
87
|
+
if ($null -eq $line) { Start-Sleep -Milliseconds 10; continue }
|
|
88
|
+
$annotations = @(
|
|
89
|
+
foreach ($annotation in $job.annotations) {
|
|
90
|
+
if ($position -ge $annotation.start_ms -and $position -lt $annotation.end_ms) {
|
|
91
|
+
@{ id = $annotation.id; bounds = (Measure-Annotation $annotation $true) }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
$state = @{ position_ms = $position; status = $status; duration_ms = $job.duration_ms; annotations = $annotations; viewport = @{ width = $previewWidth; height = $previewHeight }; content = @{ x = 0; y = 0; width = $previewWidth; height = $previewHeight } }
|
|
96
|
+
if ($action -eq 'frame') { $state.image = [SlideVideo.Native]::PreviewJpeg($window, $geometry, $previewWidth, $previewHeight) }
|
|
97
|
+
[Console]::WriteLine('SLIDEVIDEO_PREVIEW ' + (ConvertTo-Json -InputObject @{ id = $command.id; state = $state } -Depth 30 -Compress))
|
|
98
|
+
[Console]::Out.Flush()
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"platform": "win32",
|
|
3
|
+
"runtimes": ["Windows PowerShell 5.1", "desktop Microsoft PowerPoint"],
|
|
4
|
+
"assemblies": ["System.Drawing", "System.IO.Compression.FileSystem"],
|
|
5
|
+
"executables": {
|
|
6
|
+
"ffmpeg": ["gdigrab with hwnd capture", "libx264"],
|
|
7
|
+
"ffprobe": []
|
|
8
|
+
},
|
|
9
|
+
"npm_dependencies": [],
|
|
10
|
+
"python_dependencies": []
|
|
11
|
+
}
|