@omnimedia/omnitool 1.1.0-9 → 1.1.0-90

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.
Files changed (448) hide show
  1. package/README.md +358 -73
  2. package/package.json +19 -17
  3. package/s/context.ts +0 -7
  4. package/s/demo/demo.bundle.ts +104 -43
  5. package/s/demo/demo.css +244 -14
  6. package/s/demo/routines/export-test.ts +16 -0
  7. package/s/demo/routines/filmstrip-test.ts +22 -18
  8. package/s/demo/routines/load-video.ts +2 -3
  9. package/s/demo/routines/playback-test.ts +61 -0
  10. package/s/demo/routines/timeline-setup.ts +49 -0
  11. package/s/demo/routines/transcode-test.ts +19 -5
  12. package/s/demo/routines/transitions-test.ts +2 -2
  13. package/s/demo/routines/waveform-test.ts +35 -8
  14. package/s/driver/driver-worker.ts +9 -0
  15. package/s/driver/driver.test.ts +1 -1
  16. package/s/driver/driver.ts +43 -42
  17. package/s/driver/fns/schematic.ts +26 -6
  18. package/s/driver/fns/work.ts +65 -189
  19. package/s/driver/parts/compositor.ts +316 -0
  20. package/s/driver/parts/machina.ts +19 -20
  21. package/s/driver/utils/find-pixi-filter.ts +24 -0
  22. package/s/index.html.ts +103 -25
  23. package/s/index.ts +1 -0
  24. package/s/tests.bundle.ts +11 -0
  25. package/s/tests.html.ts +28 -0
  26. package/s/timeline/index.ts +9 -1
  27. package/s/timeline/parts/animations/make.ts +38 -0
  28. package/s/timeline/parts/animations/presets.ts +138 -0
  29. package/s/timeline/parts/animations/properties.ts +30 -0
  30. package/s/timeline/parts/animations/registry.ts +13 -0
  31. package/s/timeline/parts/animations/types.ts +80 -0
  32. package/s/timeline/parts/filmstrip.ts +43 -16
  33. package/s/timeline/parts/filters.ts +453 -0
  34. package/s/timeline/parts/item.ts +59 -7
  35. package/s/timeline/parts/media.ts +12 -2
  36. package/s/timeline/parts/resource-pool.ts +8 -5
  37. package/s/timeline/parts/resource.ts +3 -0
  38. package/s/timeline/parts/waveform/parts/collect.ts +72 -0
  39. package/s/timeline/parts/waveform/parts/render.ts +45 -0
  40. package/s/timeline/parts/waveform/parts/types.ts +24 -0
  41. package/s/timeline/parts/waveform/waveform.ts +161 -0
  42. package/s/timeline/renderers/export/parts/audio-gain.ts +17 -0
  43. package/s/timeline/renderers/export/parts/audio-mix.ts +133 -0
  44. package/s/timeline/renderers/export/parts/cursor.ts +274 -0
  45. package/s/timeline/renderers/export/parts/produce-audio.ts +64 -0
  46. package/s/timeline/renderers/export/parts/produce-video.ts +49 -0
  47. package/s/timeline/renderers/export/parts/resamplers.ts +48 -0
  48. package/s/timeline/renderers/export/produce.ts +28 -0
  49. package/s/timeline/renderers/parts/handy.ts +418 -0
  50. package/s/timeline/renderers/parts/samplers/audio/parts/find.ts +19 -0
  51. package/s/timeline/renderers/parts/samplers/audio/parts/init.ts +60 -0
  52. package/s/timeline/renderers/parts/samplers/audio/parts/sink.ts +38 -0
  53. package/s/timeline/renderers/parts/samplers/audio/parts/types.ts +16 -0
  54. package/s/timeline/renderers/parts/samplers/audio/sampler.ts +35 -0
  55. package/s/timeline/renderers/parts/samplers/visual/parts/defaults.ts +16 -0
  56. package/s/timeline/renderers/parts/samplers/visual/parts/sample.ts +69 -0
  57. package/s/timeline/renderers/parts/samplers/visual/parts/sequence.ts +111 -0
  58. package/s/timeline/renderers/parts/samplers/visual/parts/sink.ts +38 -0
  59. package/s/timeline/renderers/parts/samplers/visual/parts/transition.ts +28 -0
  60. package/s/timeline/renderers/parts/samplers/visual/parts/types.ts +10 -0
  61. package/s/timeline/renderers/parts/samplers/visual/sampler.ts +28 -0
  62. package/s/timeline/renderers/parts/schedulers.ts +96 -0
  63. package/s/timeline/renderers/player/parts/playback.ts +213 -0
  64. package/s/timeline/renderers/player/player.ts +86 -0
  65. package/s/timeline/renderers/renderers.test.ts +403 -0
  66. package/s/timeline/sugar/helpers.ts +215 -0
  67. package/s/timeline/sugar/o.ts +274 -54
  68. package/s/timeline/sugar/omni.test.ts +210 -0
  69. package/s/timeline/sugar/omni.ts +25 -9
  70. package/s/timeline/types.ts +36 -3
  71. package/s/timeline/utils/anim.ts +63 -0
  72. package/s/timeline/utils/checksum.ts +3 -1
  73. package/s/timeline/utils/datafile.ts +15 -4
  74. package/s/timeline/utils/dummy-data.ts +3 -3
  75. package/s/timeline/utils/matrix.ts +21 -0
  76. package/s/timeline/utils/terps.ts +81 -0
  77. package/s/units/fps.ts +8 -0
  78. package/s/units/ms.ts +8 -0
  79. package/s/units/seconds.ts +8 -0
  80. package/x/WebGLRenderer-4CHIZDHY.js +2 -0
  81. package/x/WebGLRenderer-4CHIZDHY.js.map +7 -0
  82. package/x/WebGPURenderer-O6WXU2QR.js +2 -0
  83. package/x/WebGPURenderer-O6WXU2QR.js.map +7 -0
  84. package/x/browserAll-WNIOTNNP.js +2 -0
  85. package/x/browserAll-WNIOTNNP.js.map +7 -0
  86. package/x/chunk-23FOBGX6.js +2 -0
  87. package/x/chunk-23FOBGX6.js.map +7 -0
  88. package/x/chunk-73XOWA4F.js +393 -0
  89. package/x/chunk-73XOWA4F.js.map +7 -0
  90. package/x/chunk-IAWJKNX5.js +42 -0
  91. package/x/chunk-IAWJKNX5.js.map +7 -0
  92. package/x/chunk-KCMVLWBS.js +157 -0
  93. package/x/chunk-KCMVLWBS.js.map +7 -0
  94. package/x/chunk-MR32SQ27.js +2 -0
  95. package/x/chunk-MR32SQ27.js.map +7 -0
  96. package/x/chunk-VCUJJYRJ.js +327 -0
  97. package/x/chunk-VCUJJYRJ.js.map +7 -0
  98. package/x/chunk-XNIZ4L5W.js +269 -0
  99. package/x/chunk-XNIZ4L5W.js.map +7 -0
  100. package/x/chunk-ZLGNQFUI.js +15 -0
  101. package/x/chunk-ZLGNQFUI.js.map +7 -0
  102. package/x/context.d.ts +1 -4
  103. package/x/context.js +1 -5
  104. package/x/context.js.map +1 -1
  105. package/x/demo/WebGLRenderer-RSJAHIG2.js +2 -0
  106. package/x/demo/WebGLRenderer-RSJAHIG2.js.map +7 -0
  107. package/x/demo/WebGPURenderer-MGFAJCYY.js +2 -0
  108. package/x/demo/WebGPURenderer-MGFAJCYY.js.map +7 -0
  109. package/x/demo/browserAll-PTRBXBRP.js +2 -0
  110. package/x/demo/browserAll-PTRBXBRP.js.map +7 -0
  111. package/x/demo/chunk-CUYOGHWU.js +42 -0
  112. package/x/demo/chunk-CUYOGHWU.js.map +7 -0
  113. package/x/demo/chunk-DGTDNJ7W.js +2 -0
  114. package/x/demo/chunk-DGTDNJ7W.js.map +7 -0
  115. package/x/demo/chunk-FZ5BYF63.js +15 -0
  116. package/x/demo/chunk-FZ5BYF63.js.map +7 -0
  117. package/x/demo/chunk-KWN4NNES.js +269 -0
  118. package/x/demo/chunk-KWN4NNES.js.map +7 -0
  119. package/x/demo/chunk-OJ3FPXW7.js +157 -0
  120. package/x/demo/chunk-OJ3FPXW7.js.map +7 -0
  121. package/x/demo/chunk-PSLUOGTZ.js +393 -0
  122. package/x/demo/chunk-PSLUOGTZ.js.map +7 -0
  123. package/x/demo/chunk-VLCVEIFU.js +327 -0
  124. package/x/demo/chunk-VLCVEIFU.js.map +7 -0
  125. package/x/demo/chunk-ZWCPT5FR.js +2 -0
  126. package/x/demo/chunk-ZWCPT5FR.js.map +7 -0
  127. package/x/demo/demo.bundle.js +94 -40
  128. package/x/demo/demo.bundle.js.map +1 -1
  129. package/x/demo/demo.bundle.min.js +7340 -90
  130. package/x/demo/demo.bundle.min.js.map +4 -4
  131. package/x/demo/demo.css +244 -14
  132. package/x/demo/routines/export-test.d.ts +2 -0
  133. package/x/demo/routines/export-test.js +10 -0
  134. package/x/demo/routines/export-test.js.map +1 -0
  135. package/x/demo/routines/filmstrip-test.d.ts +1 -1
  136. package/x/demo/routines/filmstrip-test.js +20 -17
  137. package/x/demo/routines/filmstrip-test.js.map +1 -1
  138. package/x/demo/routines/load-video.d.ts +1 -1
  139. package/x/demo/routines/load-video.js +1 -2
  140. package/x/demo/routines/load-video.js.map +1 -1
  141. package/x/demo/routines/playback-test.d.ts +2 -0
  142. package/x/demo/routines/playback-test.js +51 -0
  143. package/x/demo/routines/playback-test.js.map +1 -0
  144. package/x/demo/routines/timeline-setup.d.ts +6 -0
  145. package/x/demo/routines/timeline-setup.js +33 -0
  146. package/x/demo/routines/timeline-setup.js.map +1 -0
  147. package/x/demo/routines/transcode-test.js +15 -5
  148. package/x/demo/routines/transcode-test.js.map +1 -1
  149. package/x/demo/routines/transitions-test.js +2 -2
  150. package/x/demo/routines/transitions-test.js.map +1 -1
  151. package/x/demo/routines/waveform-test.d.ts +2 -1
  152. package/x/demo/routines/waveform-test.js +29 -8
  153. package/x/demo/routines/waveform-test.js.map +1 -1
  154. package/x/demo/webworkerAll-JENRT6BT.js +2 -0
  155. package/x/demo/webworkerAll-JENRT6BT.js.map +7 -0
  156. package/x/driver/driver-worker.d.ts +1 -0
  157. package/x/driver/driver-worker.js +6 -0
  158. package/x/driver/driver-worker.js.map +1 -0
  159. package/x/driver/driver.d.ts +25 -8
  160. package/x/driver/driver.js +43 -39
  161. package/x/driver/driver.js.map +1 -1
  162. package/x/driver/driver.test.js +1 -1
  163. package/x/driver/driver.test.js.map +1 -1
  164. package/x/driver/driver.worker.bundle.min.js +117 -3506
  165. package/x/driver/driver.worker.bundle.min.js.map +4 -4
  166. package/x/driver/fns/host.d.ts +3 -2
  167. package/x/driver/fns/schematic.d.ts +25 -4
  168. package/x/driver/fns/work.d.ts +4 -4
  169. package/x/driver/fns/work.js +55 -155
  170. package/x/driver/fns/work.js.map +1 -1
  171. package/x/driver/parts/compositor.d.ts +39 -0
  172. package/x/driver/parts/compositor.js +261 -0
  173. package/x/driver/parts/compositor.js.map +1 -0
  174. package/x/driver/parts/machina.d.ts +0 -20
  175. package/x/driver/parts/machina.js +6 -10
  176. package/x/driver/parts/machina.js.map +1 -1
  177. package/x/driver/utils/find-pixi-filter.d.ts +5 -0
  178. package/x/driver/utils/find-pixi-filter.js +13 -0
  179. package/x/driver/utils/find-pixi-filter.js.map +1 -0
  180. package/x/features/speech/transcribe/parts/prep-audio.d.ts +1 -1
  181. package/x/features/speech/transcribe/worker.bundle.min.js +899 -899
  182. package/x/features/speech/transcribe/worker.bundle.min.js.map +4 -4
  183. package/x/index.d.ts +1 -0
  184. package/x/index.html +347 -38
  185. package/x/index.html.js +103 -24
  186. package/x/index.html.js.map +1 -1
  187. package/x/index.js +1 -0
  188. package/x/index.js.map +1 -1
  189. package/x/tests.bundle.js +8 -0
  190. package/x/tests.bundle.js.map +1 -0
  191. package/x/tests.bundle.min.js +7374 -0
  192. package/x/tests.bundle.min.js.map +7 -0
  193. package/x/tests.html +316 -0
  194. package/x/tests.html.d.ts +2 -0
  195. package/x/tests.html.js +22 -0
  196. package/x/tests.html.js.map +1 -0
  197. package/x/timeline/index.d.ts +8 -0
  198. package/x/timeline/index.js +8 -0
  199. package/x/timeline/index.js.map +1 -1
  200. package/x/timeline/parts/animations/make.d.ts +3 -0
  201. package/x/timeline/parts/animations/make.js +29 -0
  202. package/x/timeline/parts/animations/make.js.map +1 -0
  203. package/x/timeline/parts/animations/presets.d.ts +170 -0
  204. package/x/timeline/parts/animations/presets.js +135 -0
  205. package/x/timeline/parts/animations/presets.js.map +1 -0
  206. package/x/timeline/parts/animations/properties.d.ts +84 -0
  207. package/x/timeline/parts/animations/properties.js +25 -0
  208. package/x/timeline/parts/animations/properties.js.map +1 -0
  209. package/x/timeline/parts/animations/registry.d.ts +218 -0
  210. package/x/timeline/parts/animations/registry.js +11 -0
  211. package/x/timeline/parts/animations/registry.js.map +1 -0
  212. package/x/timeline/parts/animations/types.d.ts +60 -0
  213. package/x/timeline/parts/animations/types.js.map +1 -0
  214. package/x/timeline/parts/filmstrip.d.ts +4 -3
  215. package/x/timeline/parts/filmstrip.js +29 -10
  216. package/x/timeline/parts/filmstrip.js.map +1 -1
  217. package/x/timeline/parts/filters.d.ts +108 -0
  218. package/x/timeline/parts/filters.js +340 -0
  219. package/x/timeline/parts/filters.js.map +1 -0
  220. package/x/timeline/parts/item.d.ts +47 -4
  221. package/x/timeline/parts/item.js +4 -1
  222. package/x/timeline/parts/item.js.map +1 -1
  223. package/x/timeline/parts/media.d.ts +2 -0
  224. package/x/timeline/parts/media.js +11 -2
  225. package/x/timeline/parts/media.js.map +1 -1
  226. package/x/timeline/parts/resource-pool.d.ts +3 -0
  227. package/x/timeline/parts/resource-pool.js +7 -4
  228. package/x/timeline/parts/resource-pool.js.map +1 -1
  229. package/x/timeline/parts/resource.d.ts +3 -0
  230. package/x/timeline/parts/waveform/parts/collect.d.ts +11 -0
  231. package/x/timeline/parts/waveform/parts/collect.js +56 -0
  232. package/x/timeline/parts/waveform/parts/collect.js.map +1 -0
  233. package/x/timeline/parts/waveform/parts/render.d.ts +5 -0
  234. package/x/timeline/parts/waveform/parts/render.js +29 -0
  235. package/x/timeline/parts/waveform/parts/render.js.map +1 -0
  236. package/x/timeline/parts/waveform/parts/types.d.ts +21 -0
  237. package/x/timeline/parts/waveform/parts/types.js +2 -0
  238. package/x/timeline/parts/waveform/parts/types.js.map +1 -0
  239. package/x/timeline/parts/waveform/waveform.d.ts +19 -0
  240. package/x/timeline/parts/waveform/waveform.js +133 -0
  241. package/x/timeline/parts/waveform/waveform.js.map +1 -0
  242. package/x/timeline/renderers/export/parts/audio-gain.d.ts +1 -0
  243. package/x/timeline/renderers/export/parts/audio-gain.js +13 -0
  244. package/x/timeline/renderers/export/parts/audio-gain.js.map +1 -0
  245. package/x/timeline/renderers/export/parts/audio-mix.d.ts +21 -0
  246. package/x/timeline/renderers/export/parts/audio-mix.js +89 -0
  247. package/x/timeline/renderers/export/parts/audio-mix.js.map +1 -0
  248. package/x/timeline/renderers/export/parts/cursor.d.ts +35 -0
  249. package/x/timeline/renderers/export/parts/cursor.js +221 -0
  250. package/x/timeline/renderers/export/parts/cursor.js.map +1 -0
  251. package/x/timeline/renderers/export/parts/produce-audio.d.ts +6 -0
  252. package/x/timeline/renderers/export/parts/produce-audio.js +41 -0
  253. package/x/timeline/renderers/export/parts/produce-audio.js.map +1 -0
  254. package/x/timeline/renderers/export/parts/produce-video.d.ts +10 -0
  255. package/x/timeline/renderers/export/parts/produce-video.js +26 -0
  256. package/x/timeline/renderers/export/parts/produce-video.js.map +1 -0
  257. package/x/timeline/renderers/export/parts/resamplers.d.ts +12 -0
  258. package/x/timeline/renderers/export/parts/resamplers.js +29 -0
  259. package/x/timeline/renderers/export/parts/resamplers.js.map +1 -0
  260. package/x/timeline/renderers/export/produce.d.ts +13 -0
  261. package/x/timeline/renderers/export/produce.js +15 -0
  262. package/x/timeline/renderers/export/produce.js.map +1 -0
  263. package/x/timeline/renderers/parts/handy.d.ts +36 -0
  264. package/x/timeline/renderers/parts/handy.js +254 -0
  265. package/x/timeline/renderers/parts/handy.js.map +1 -0
  266. package/x/timeline/renderers/parts/samplers/audio/parts/find.d.ts +6 -0
  267. package/x/timeline/renderers/parts/samplers/audio/parts/find.js +15 -0
  268. package/x/timeline/renderers/parts/samplers/audio/parts/find.js.map +1 -0
  269. package/x/timeline/renderers/parts/samplers/audio/parts/init.d.ts +5 -0
  270. package/x/timeline/renderers/parts/samplers/audio/parts/init.js +40 -0
  271. package/x/timeline/renderers/parts/samplers/audio/parts/init.js.map +1 -0
  272. package/x/timeline/renderers/parts/samplers/audio/parts/sink.d.ts +8 -0
  273. package/x/timeline/renderers/parts/samplers/audio/parts/sink.js +24 -0
  274. package/x/timeline/renderers/parts/samplers/audio/parts/sink.js.map +1 -0
  275. package/x/timeline/renderers/parts/samplers/audio/parts/types.d.ts +14 -0
  276. package/x/timeline/renderers/parts/samplers/audio/parts/types.js +2 -0
  277. package/x/timeline/renderers/parts/samplers/audio/parts/types.js.map +1 -0
  278. package/x/timeline/renderers/parts/samplers/audio/sampler.d.ts +11 -0
  279. package/x/timeline/renderers/parts/samplers/audio/sampler.js +22 -0
  280. package/x/timeline/renderers/parts/samplers/audio/sampler.js.map +1 -0
  281. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.d.ts +5 -0
  282. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.js +10 -0
  283. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.js.map +1 -0
  284. package/x/timeline/renderers/parts/samplers/visual/parts/sample.d.ts +6 -0
  285. package/x/timeline/renderers/parts/samplers/visual/parts/sample.js +48 -0
  286. package/x/timeline/renderers/parts/samplers/visual/parts/sample.js.map +1 -0
  287. package/x/timeline/renderers/parts/samplers/visual/parts/sequence.d.ts +6 -0
  288. package/x/timeline/renderers/parts/samplers/visual/parts/sequence.js +75 -0
  289. package/x/timeline/renderers/parts/samplers/visual/parts/sequence.js.map +1 -0
  290. package/x/timeline/renderers/parts/samplers/visual/parts/sink.d.ts +8 -0
  291. package/x/timeline/renderers/parts/samplers/visual/parts/sink.js +24 -0
  292. package/x/timeline/renderers/parts/samplers/visual/parts/sink.js.map +1 -0
  293. package/x/timeline/renderers/parts/samplers/visual/parts/transition.d.ts +3 -0
  294. package/x/timeline/renderers/parts/samplers/visual/parts/transition.js +18 -0
  295. package/x/timeline/renderers/parts/samplers/visual/parts/transition.js.map +1 -0
  296. package/x/timeline/renderers/parts/samplers/visual/parts/types.d.ts +8 -0
  297. package/x/timeline/renderers/parts/samplers/visual/parts/types.js +2 -0
  298. package/x/timeline/renderers/parts/samplers/visual/parts/types.js.map +1 -0
  299. package/x/timeline/renderers/parts/samplers/visual/sampler.d.ts +7 -0
  300. package/x/timeline/renderers/parts/samplers/visual/sampler.js +17 -0
  301. package/x/timeline/renderers/parts/samplers/visual/sampler.js.map +1 -0
  302. package/x/timeline/renderers/parts/schedulers.d.ts +17 -0
  303. package/x/timeline/renderers/parts/schedulers.js +64 -0
  304. package/x/timeline/renderers/parts/schedulers.js.map +1 -0
  305. package/x/timeline/renderers/player/parts/playback.d.ts +39 -0
  306. package/x/timeline/renderers/player/parts/playback.js +160 -0
  307. package/x/timeline/renderers/player/parts/playback.js.map +1 -0
  308. package/x/timeline/renderers/player/player.d.ts +27 -0
  309. package/x/timeline/renderers/player/player.js +64 -0
  310. package/x/timeline/renderers/player/player.js.map +1 -0
  311. package/x/timeline/renderers/renderers.test.d.ts +33 -0
  312. package/x/timeline/renderers/renderers.test.js +321 -0
  313. package/x/timeline/renderers/renderers.test.js.map +1 -0
  314. package/x/timeline/sugar/helpers.d.ts +64 -0
  315. package/x/timeline/sugar/helpers.js +114 -0
  316. package/x/timeline/sugar/helpers.js.map +1 -0
  317. package/x/timeline/sugar/o.d.ts +38 -9
  318. package/x/timeline/sugar/o.js +200 -39
  319. package/x/timeline/sugar/o.js.map +1 -1
  320. package/x/timeline/sugar/omni.d.ts +9 -3
  321. package/x/timeline/sugar/omni.js +20 -7
  322. package/x/timeline/sugar/omni.js.map +1 -1
  323. package/x/timeline/sugar/omni.test.d.ts +27 -0
  324. package/x/timeline/sugar/omni.test.js +128 -0
  325. package/x/timeline/sugar/omni.test.js.map +1 -0
  326. package/x/timeline/types.d.ts +15 -2
  327. package/x/timeline/utils/anim.d.ts +3 -0
  328. package/x/timeline/utils/anim.js +40 -0
  329. package/x/timeline/utils/anim.js.map +1 -0
  330. package/x/timeline/utils/checksum.d.ts +3 -2
  331. package/x/timeline/utils/checksum.js.map +1 -1
  332. package/x/timeline/utils/datafile.d.ts +5 -3
  333. package/x/timeline/utils/datafile.js +18 -5
  334. package/x/timeline/utils/datafile.js.map +1 -1
  335. package/x/timeline/utils/dummy-data.d.ts +1 -2
  336. package/x/timeline/utils/dummy-data.js +4 -2
  337. package/x/timeline/utils/dummy-data.js.map +1 -1
  338. package/x/timeline/utils/matrix.d.ts +9 -0
  339. package/x/timeline/utils/matrix.js +10 -0
  340. package/x/timeline/utils/matrix.js.map +1 -1
  341. package/x/timeline/utils/terps.d.ts +11 -0
  342. package/x/timeline/utils/terps.js +57 -0
  343. package/x/timeline/utils/terps.js.map +1 -0
  344. package/x/units/fps.d.ts +6 -0
  345. package/x/units/fps.js +2 -0
  346. package/x/units/fps.js.map +1 -0
  347. package/x/units/ms.d.ts +6 -0
  348. package/x/units/ms.js +2 -0
  349. package/x/units/ms.js.map +1 -0
  350. package/x/units/seconds.d.ts +6 -0
  351. package/x/units/seconds.js +2 -0
  352. package/x/units/seconds.js.map +1 -0
  353. package/x/webworkerAll-RLCTMSDD.js +2 -0
  354. package/x/webworkerAll-RLCTMSDD.js.map +7 -0
  355. package/s/tests.test.ts +0 -8
  356. package/s/timeline/parts/compositor/export.ts +0 -77
  357. package/s/timeline/parts/compositor/parts/html-tree.ts +0 -37
  358. package/s/timeline/parts/compositor/parts/schedulers.ts +0 -85
  359. package/s/timeline/parts/compositor/parts/tree-builder.ts +0 -184
  360. package/s/timeline/parts/compositor/parts/webcodecs-tree.ts +0 -30
  361. package/s/timeline/parts/compositor/playback.ts +0 -81
  362. package/s/timeline/parts/compositor/samplers/html.ts +0 -115
  363. package/s/timeline/parts/compositor/samplers/webcodecs.ts +0 -60
  364. package/s/timeline/parts/waveform.ts +0 -62
  365. package/s/timeline/sugar/builders.ts +0 -102
  366. package/s/timeline/sugar/omni-test.ts +0 -38
  367. package/s/timeline/utils/audio-stream.ts +0 -15
  368. package/s/timeline/utils/video-cursor.ts +0 -40
  369. package/s/tools/common/loader.ts +0 -26
  370. package/s/tools/common/transformer-pipeline.ts +0 -26
  371. package/s/tools/speech-recognition/common/model.ts +0 -26
  372. package/s/tools/speech-recognition/whisper/fns/host.ts +0 -25
  373. package/s/tools/speech-recognition/whisper/fns/schematic.ts +0 -23
  374. package/s/tools/speech-recognition/whisper/fns/work.ts +0 -91
  375. package/s/tools/speech-recognition/whisper/parts/types.ts +0 -38
  376. package/s/tools/speech-recognition/whisper/parts/worker.bundle.ts +0 -7
  377. package/s/tools/speech-recognition/whisper/tool.ts +0 -70
  378. package/x/tests.test.js +0 -6
  379. package/x/tests.test.js.map +0 -1
  380. package/x/timeline/parts/compositor/export.d.ts +0 -9
  381. package/x/timeline/parts/compositor/export.js +0 -64
  382. package/x/timeline/parts/compositor/export.js.map +0 -1
  383. package/x/timeline/parts/compositor/parts/html-tree.d.ts +0 -3
  384. package/x/timeline/parts/compositor/parts/html-tree.js +0 -40
  385. package/x/timeline/parts/compositor/parts/html-tree.js.map +0 -1
  386. package/x/timeline/parts/compositor/parts/schedulers.d.ts +0 -15
  387. package/x/timeline/parts/compositor/parts/schedulers.js +0 -64
  388. package/x/timeline/parts/compositor/parts/schedulers.js.map +0 -1
  389. package/x/timeline/parts/compositor/parts/tree-builder.d.ts +0 -37
  390. package/x/timeline/parts/compositor/parts/tree-builder.js +0 -147
  391. package/x/timeline/parts/compositor/parts/tree-builder.js.map +0 -1
  392. package/x/timeline/parts/compositor/parts/webcodecs-tree.d.ts +0 -3
  393. package/x/timeline/parts/compositor/parts/webcodecs-tree.js +0 -28
  394. package/x/timeline/parts/compositor/parts/webcodecs-tree.js.map +0 -1
  395. package/x/timeline/parts/compositor/playback.d.ts +0 -19
  396. package/x/timeline/parts/compositor/playback.js +0 -71
  397. package/x/timeline/parts/compositor/playback.js.map +0 -1
  398. package/x/timeline/parts/compositor/samplers/html.d.ts +0 -3
  399. package/x/timeline/parts/compositor/samplers/html.js +0 -106
  400. package/x/timeline/parts/compositor/samplers/html.js.map +0 -1
  401. package/x/timeline/parts/compositor/samplers/webcodecs.d.ts +0 -2
  402. package/x/timeline/parts/compositor/samplers/webcodecs.js +0 -55
  403. package/x/timeline/parts/compositor/samplers/webcodecs.js.map +0 -1
  404. package/x/timeline/parts/waveform.d.ts +0 -8
  405. package/x/timeline/parts/waveform.js +0 -51
  406. package/x/timeline/parts/waveform.js.map +0 -1
  407. package/x/timeline/sugar/builders.d.ts +0 -1
  408. package/x/timeline/sugar/builders.js +0 -104
  409. package/x/timeline/sugar/builders.js.map +0 -1
  410. package/x/timeline/sugar/omni-test.d.ts +0 -1
  411. package/x/timeline/sugar/omni-test.js +0 -22
  412. package/x/timeline/sugar/omni-test.js.map +0 -1
  413. package/x/timeline/utils/audio-stream.d.ts +0 -6
  414. package/x/timeline/utils/audio-stream.js +0 -17
  415. package/x/timeline/utils/audio-stream.js.map +0 -1
  416. package/x/timeline/utils/video-cursor.d.ts +0 -10
  417. package/x/timeline/utils/video-cursor.js +0 -36
  418. package/x/timeline/utils/video-cursor.js.map +0 -1
  419. package/x/tools/common/loader.d.ts +0 -19
  420. package/x/tools/common/loader.js +0 -18
  421. package/x/tools/common/loader.js.map +0 -1
  422. package/x/tools/common/transformer-pipeline.d.ts +0 -8
  423. package/x/tools/common/transformer-pipeline.js +0 -24
  424. package/x/tools/common/transformer-pipeline.js.map +0 -1
  425. package/x/tools/speech-recognition/common/model.d.ts +0 -14
  426. package/x/tools/speech-recognition/common/model.js +0 -16
  427. package/x/tools/speech-recognition/common/model.js.map +0 -1
  428. package/x/tools/speech-recognition/whisper/fns/host.d.ts +0 -13
  429. package/x/tools/speech-recognition/whisper/fns/host.js +0 -19
  430. package/x/tools/speech-recognition/whisper/fns/host.js.map +0 -1
  431. package/x/tools/speech-recognition/whisper/fns/schematic.d.ts +0 -19
  432. package/x/tools/speech-recognition/whisper/fns/schematic.js +0 -2
  433. package/x/tools/speech-recognition/whisper/fns/schematic.js.map +0 -1
  434. package/x/tools/speech-recognition/whisper/fns/work.d.ts +0 -12
  435. package/x/tools/speech-recognition/whisper/fns/work.js +0 -74
  436. package/x/tools/speech-recognition/whisper/fns/work.js.map +0 -1
  437. package/x/tools/speech-recognition/whisper/parts/types.d.ts +0 -31
  438. package/x/tools/speech-recognition/whisper/parts/types.js.map +0 -1
  439. package/x/tools/speech-recognition/whisper/parts/worker.bundle.d.ts +0 -1
  440. package/x/tools/speech-recognition/whisper/parts/worker.bundle.js +0 -4
  441. package/x/tools/speech-recognition/whisper/parts/worker.bundle.js.map +0 -1
  442. package/x/tools/speech-recognition/whisper/parts/worker.bundle.min.js +0 -8
  443. package/x/tools/speech-recognition/whisper/parts/worker.bundle.min.js.map +0 -7
  444. package/x/tools/speech-recognition/whisper/tool.d.ts +0 -12
  445. package/x/tools/speech-recognition/whisper/tool.js +0 -63
  446. package/x/tools/speech-recognition/whisper/tool.js.map +0 -1
  447. /package/x/{tests.test.d.ts → tests.bundle.d.ts} +0 -0
  448. /package/x/{tools/speech-recognition/whisper/parts → timeline/parts/animations}/types.js +0 -0
@@ -0,0 +1,453 @@
1
+ import type {
2
+ AlphaFilterOptions,
3
+ BlurFilterOptions,
4
+ ColorMatrix,
5
+ FilterOptions as PixiFilterOptions,
6
+ NoiseFilterOptions,
7
+ Point,
8
+ } from "pixi.js"
9
+ import type * as PixiFilters from "pixi-filters"
10
+ import {FilterableItem, Item} from "./item.js"
11
+
12
+ export type PixelateFilterOptions = {size?: number | number[] | Point}
13
+ export type EmbossFilterOptions = {strength?: number}
14
+
15
+ export type ChoiceOptions = string[] | Record<string, string | number> | number[]
16
+
17
+ export type ChoiceFilterProperty = {
18
+ type: "choice"
19
+ options: ChoiceOptions
20
+ default: string | number
21
+ }
22
+
23
+ export type NumericFilterProperty = {
24
+ type: "number"
25
+ min: number
26
+ max: number
27
+ default: number
28
+ step?: number
29
+ }
30
+
31
+ export type ColorFilterProperty = {
32
+ type: "color"
33
+ default: string
34
+ }
35
+
36
+ export type BooleanFilterProperty = {
37
+ type: "boolean"
38
+ default: boolean
39
+ }
40
+
41
+ export type ObjectFilterProperty = {
42
+ type: "object"
43
+ properties: Record<string, FilterPropertyConfig>
44
+ }
45
+
46
+ export type ArrayFilterProperty = {
47
+ type: "array"
48
+ items: FilterPropertyConfig[]
49
+ }
50
+
51
+ export type FilterPropertyConfig =
52
+ | NumericFilterProperty
53
+ | ColorFilterProperty
54
+ | BooleanFilterProperty
55
+ | ChoiceFilterProperty
56
+ | ObjectFilterProperty
57
+ | ArrayFilterProperty
58
+
59
+ export interface FilterSchema {
60
+ [property: string]: FilterPropertyConfig
61
+ }
62
+
63
+ export type SchemaFromOptions<T> = {
64
+ [K in keyof Required<T>]?: FilterPropertyConfig
65
+ }
66
+
67
+ type FilterDefinition<TType extends string, TParams> = {
68
+ type: TType
69
+ schema: SchemaFromOptions<TParams>
70
+ _params?: TParams
71
+ }
72
+
73
+ const num =(
74
+ min: number,
75
+ max: number,
76
+ defaultValue: number,
77
+ step?: number,
78
+ ): NumericFilterProperty => ({
79
+ type: "number",
80
+ min,
81
+ max,
82
+ default: defaultValue,
83
+ ...(step === undefined ? {} : {step}),
84
+ })
85
+
86
+ const color =(defaultValue: string): ColorFilterProperty => ({
87
+ type: "color",
88
+ default: defaultValue,
89
+ })
90
+
91
+ const bool =(defaultValue: boolean): BooleanFilterProperty => ({
92
+ type: "boolean",
93
+ default: defaultValue,
94
+ })
95
+
96
+ const choice =(
97
+ options: ChoiceOptions,
98
+ defaultValue: string | number,
99
+ ): ChoiceFilterProperty => ({
100
+ type: "choice",
101
+ options,
102
+ default: defaultValue,
103
+ })
104
+
105
+ const object =(properties: Record<string, FilterPropertyConfig>): ObjectFilterProperty => ({
106
+ type: "object",
107
+ properties,
108
+ })
109
+
110
+ const array =(items: FilterPropertyConfig[]): ArrayFilterProperty => ({
111
+ type: "array",
112
+ items,
113
+ })
114
+
115
+ const kernelSizes = [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25]
116
+ const glitchFillModes = {
117
+ TRANSPARENT: 0,
118
+ ORIGINAL: 1,
119
+ LOOP: 2,
120
+ CLAMP: 3,
121
+ MIRROR: 4,
122
+ } as const
123
+
124
+ const defineFilter = <TParams>() =>
125
+ <TType extends string>(
126
+ type: TType,
127
+ schema: SchemaFromOptions<TParams> = {},
128
+ ): FilterDefinition<TType, TParams> => ({type, schema})
129
+
130
+ export const filters = {
131
+ adjustment: defineFilter<PixiFilters.AdjustmentFilterOptions>()("AdjustmentFilter", {
132
+ gamma: num(0, 5, 1),
133
+ saturation: num(0, 5, 1),
134
+ contrast: num(0, 5, 1),
135
+ brightness: num(0, 5, 1),
136
+ red: num(0, 5, 1),
137
+ green: num(0, 5, 1),
138
+ blue: num(0, 5, 1),
139
+ alpha: num(0, 1, 1, 0.01),
140
+ }),
141
+ advancedBloom: defineFilter<PixiFilters.AdvancedBloomFilterOptions>()("AdvancedBloomFilter", {
142
+ threshold: num(0.1, 0.9, 0.5, 0.01),
143
+ bloomScale: num(0.5, 1.5, 1, 0.01),
144
+ brightness: num(0.5, 1.5, 1, 0.01),
145
+ blur: num(0, 20, 8, 0.1),
146
+ quality: num(1, 20, 4, 1),
147
+ }),
148
+ alpha: defineFilter<AlphaFilterOptions>()("AlphaFilter", {
149
+ alpha: num(0, 1, 1, 0.01),
150
+ }),
151
+ ascii: defineFilter<PixiFilters.AsciiFilterOptions>()("AsciiFilter", {
152
+ size: num(2, 20, 8, 1),
153
+ color: color("#ffffff"),
154
+ replaceColor: bool(false),
155
+ }),
156
+ backdropBlur: defineFilter<BlurFilterOptions>()("BackdropBlurFilter", {
157
+ strength: num(0, 100, 8, 0.1),
158
+ quality: num(1, 10, 4, 1),
159
+ }),
160
+ bevel: defineFilter<PixiFilters.BevelFilterOptions>()("BevelFilter", {
161
+ rotation: num(0, 360, 45, 1),
162
+ thickness: num(0, 10, 2, 0.1),
163
+ lightColor: color("#ffffff"),
164
+ lightAlpha: num(0, 1, 0.7, 0.01),
165
+ shadowColor: color("#000000"),
166
+ shadowAlpha: num(0, 1, 0.7, 0.01),
167
+ }),
168
+ bloom: defineFilter<PixiFilters.BloomFilterOptions>()("BloomFilter", {
169
+ strength: object({
170
+ x: num(0, 20, 2, 0.1),
171
+ y: num(0, 20, 2, 0.1),
172
+ }),
173
+ quality: num(1, 20, 4, 1),
174
+ resolution: num(0.25, 4, 1, 0.01),
175
+ kernelSize: choice([5, 7, 9, 11, 13, 15], 5),
176
+ }),
177
+ blur: defineFilter<BlurFilterOptions>()("BlurFilter", {
178
+ strength: num(0, 100, 8, 0.1),
179
+ quality: num(1, 10, 4, 1),
180
+ }),
181
+ bulgePinch: defineFilter<PixiFilters.BulgePinchFilterOptions>()("BulgePinchFilter", {
182
+ radius: num(0, 1000, 100, 1),
183
+ strength: num(-1, 1, 1, 0.01),
184
+ center: object({
185
+ x: num(0, 1, 0.5, 0.01),
186
+ y: num(0, 1, 0.5, 0.01),
187
+ }),
188
+ }),
189
+ colorGradient: defineFilter<PixiFilters.ColorGradientFilterOptions | PixiFilters.ColorGradientFilterCSSOptions>()("ColorGradientFilter"),
190
+ colorMatrix: defineFilter<PixiFilterOptions & {matrix?: ColorMatrix}>()("ColorMatrixFilter"),
191
+ colorOverlay: defineFilter<PixiFilters.ColorOverlayFilterOptions>()("ColorOverlayFilter", {
192
+ color: color("#ff0000"),
193
+ alpha: num(0, 1, 0.5, 0.01),
194
+ }),
195
+ colorReplace: defineFilter<PixiFilters.ColorReplaceFilterOptions>()("ColorReplaceFilter", {
196
+ originalColor: color("#ff0000"),
197
+ targetColor: color("#000000"),
198
+ tolerance: num(0, 1, 0.4, 0.01),
199
+ }),
200
+ convolution: defineFilter<PixiFilters.ConvolutionFilterOptions>()("ConvolutionFilter", {
201
+ width: num(0, 500, 300, 1),
202
+ height: num(0, 500, 300, 1),
203
+ matrix: array([
204
+ num(0, 1, 0),
205
+ num(0, 1, 0.5, 0.01),
206
+ num(0, 1, 0),
207
+ num(0, 1, 0.5, 0.01),
208
+ num(0, 1, 1, 0.01),
209
+ num(0, 1, 0.5, 0.01),
210
+ num(0, 1, 0),
211
+ num(0, 1, 0.5, 0.01),
212
+ num(0, 1, 0),
213
+ ]),
214
+ }),
215
+ crossHatch: defineFilter<{}>()("CrossHatchFilter"),
216
+ crt: defineFilter<PixiFilters.CRTFilterOptions>()("CRTFilter", {
217
+ curvature: num(0, 10, 1, 0.01),
218
+ lineWidth: num(0, 5, 3, 0.01),
219
+ lineContrast: num(0, 1, 0.3, 0.01),
220
+ verticalLine: bool(false),
221
+ noise: num(0, 1, 0.2, 0.01),
222
+ noiseSize: num(1, 10, 1, 0.1),
223
+ vignetting: num(0, 1, 0.3, 0.01),
224
+ vignettingAlpha: num(0, 1, 1, 0.01),
225
+ vignettingBlur: num(0, 1, 0.3, 0.01),
226
+ seed: num(0, 1, 0, 0.01),
227
+ time: num(0.5, 20, 0.5, 0.01),
228
+ }),
229
+ dot: defineFilter<PixiFilters.DotFilterOptions>()("DotFilter", {
230
+ scale: num(0.3, 1, 1, 0.01),
231
+ angle: num(0, 5, 5, 0.01),
232
+ grayscale: bool(true),
233
+ }),
234
+ dropShadow: defineFilter<PixiFilters.DropShadowFilterOptions>()("DropShadowFilter", {
235
+ blur: num(0, 20, 2, 0.1),
236
+ quality: num(1, 20, 3, 1),
237
+ alpha: num(0, 1, 0.5, 0.01),
238
+ offset: object({
239
+ x: num(-50, 50, 4, 1),
240
+ y: num(-50, 50, 4, 1),
241
+ }),
242
+ color: color("#000000"),
243
+ shadowOnly: bool(false),
244
+ }),
245
+ emboss: defineFilter<EmbossFilterOptions>()("EmbossFilter", {
246
+ strength: num(0, 20, 5, 0.1),
247
+ }),
248
+ glitch: defineFilter<PixiFilters.GlitchFilterOptions>()("GlitchFilter", {
249
+ slices: num(0, 64, 5, 1),
250
+ seed: num(0, 1, 0.5, 0.01),
251
+ offset: num(-400, 400, 100, 1),
252
+ direction: num(-180, 180, 0, 1),
253
+ fillMode: choice(glitchFillModes, "LOOP"),
254
+ average: bool(false),
255
+ minSize: num(0, 64, 8, 1),
256
+ sampleSize: num(1, 2048, 512, 1),
257
+ red: object({
258
+ x: num(-50, 50, 2, 1),
259
+ y: num(-50, 50, 2, 1),
260
+ }),
261
+ blue: object({
262
+ x: num(-50, 50, 10, 1),
263
+ y: num(-50, 50, -4, 1),
264
+ }),
265
+ green: object({
266
+ x: num(-50, 50, -10, 1),
267
+ y: num(-50, 50, 4, 1),
268
+ }),
269
+ }),
270
+ glow: defineFilter<PixiFilters.GlowFilterOptions>()("GlowFilter", {
271
+ distance: num(0, 20, 15, 0.1),
272
+ innerStrength: num(0, 20, 0, 0.1),
273
+ outerStrength: num(0, 20, 2, 0.1),
274
+ color: color("#ffffff"),
275
+ quality: num(0, 1, 0.2, 0.01),
276
+ alpha: num(0, 1, 1, 0.01),
277
+ knockout: bool(false),
278
+ }),
279
+ godray: defineFilter<PixiFilters.GodrayFilterOptions>()("GodrayFilter", {
280
+ time: num(0, 1, 0, 0.01),
281
+ gain: num(0, 1, 0.6, 0.01),
282
+ lacunarity: num(0, 5, 2.75, 0.01),
283
+ alpha: num(0, 1, 1, 0.01),
284
+ parallel: bool(true),
285
+ angle: num(-60, 60, 30, 1),
286
+ center: object({
287
+ x: num(-100, 2012, 956, 1),
288
+ y: num(-1000, -100, -100, 1),
289
+ }),
290
+ }),
291
+ grayscale: defineFilter<{}>()("GrayscaleFilter"),
292
+ hslAdjustment: defineFilter<PixiFilters.HslAdjustmentFilterOptions>()("HslAdjustmentFilter", {
293
+ hue: num(-180, 180, 0, 1),
294
+ saturation: num(-1, 1, 0, 0.01),
295
+ lightness: num(-1, 1, 0, 0.01),
296
+ colorize: bool(false),
297
+ alpha: num(0, 1, 1, 0.01),
298
+ }),
299
+ kawaseBlur: defineFilter<PixiFilters.KawaseBlurFilterOptions>()("KawaseBlurFilter", {
300
+ strength: num(0, 20, 4, 0.1),
301
+ quality: num(1, 20, 3, 1),
302
+ pixelSize: object({
303
+ x: num(0, 10, 1, 0.1),
304
+ y: num(0, 10, 1, 0.1),
305
+ }),
306
+ }),
307
+ motionBlur: defineFilter<PixiFilters.MotionBlurFilterOptions>()("MotionBlurFilter", {
308
+ velocity: object({
309
+ x: num(-90, 90, 40, 1),
310
+ y: num(-90, 90, 40, 1),
311
+ }),
312
+ kernelSize: choice(kernelSizes, 15),
313
+ offset: num(-150, 150, 0, 1),
314
+ }),
315
+ multiColorReplace: defineFilter<PixiFilters.MultiColorReplaceFilterOptions>()("MultiColorReplaceFilter"),
316
+ noise: defineFilter<NoiseFilterOptions>()("NoiseFilter", {
317
+ noise: num(0, 1, 0.5, 0.01),
318
+ seed: num(0.01, 10, 0.5, 0.01),
319
+ }),
320
+ oldFilm: defineFilter<PixiFilters.OldFilmFilterOptions>()("OldFilmFilter", {
321
+ sepia: num(0, 1, 0.3, 0.01),
322
+ noise: num(0, 1, 0.3, 0.01),
323
+ noiseSize: num(1, 10, 1, 0.1),
324
+ scratch: num(-1, 1, 0.5, 0.01),
325
+ scratchDensity: num(0, 1, 0.3, 0.01),
326
+ scratchWidth: num(1, 20, 1, 0.1),
327
+ vignetting: num(0, 1, 0.3, 0.01),
328
+ vignettingAlpha: num(0, 1, 1, 0.01),
329
+ vignettingBlur: num(0, 1, 0.3, 0.01),
330
+ }),
331
+ outline: defineFilter<PixiFilters.OutlineFilterOptions>()("OutlineFilter", {
332
+ thickness: num(0, 10, 4, 0.1),
333
+ color: color("#000000"),
334
+ alpha: num(0, 1, 1, 0.01),
335
+ knockout: bool(false),
336
+ }),
337
+ pixelate: defineFilter<PixelateFilterOptions>()("PixelateFilter", {
338
+ size: object({
339
+ x: num(4, 40, 10, 1),
340
+ y: num(4, 40, 10, 1),
341
+ }),
342
+ }),
343
+ radialBlur: defineFilter<PixiFilters.RadialBlurFilterOptions>()("RadialBlurFilter", {
344
+ angle: num(-180, 180, 20, 1),
345
+ radius: num(-1, 1912, 300, 1),
346
+ center: object({
347
+ x: num(0, 1912, 956, 1),
348
+ y: num(0, 920, 460, 1),
349
+ }),
350
+ kernelSize: choice(kernelSizes, 15),
351
+ }),
352
+ reflection: defineFilter<PixiFilters.ReflectionFilterOptions>()("ReflectionFilter", {
353
+ mirror: bool(true),
354
+ boundary: num(0, 1, 0.5, 0.01),
355
+ amplitude: object({
356
+ start: num(0, 50, 0, 0.1),
357
+ end: num(0, 50, 20, 0.1),
358
+ }),
359
+ waveLength: object({
360
+ start: num(10, 200, 30, 1),
361
+ end: num(10, 200, 100, 1),
362
+ }),
363
+ alpha: object({
364
+ start: num(0, 1, 1, 0.01),
365
+ end: num(0, 1, 1, 0.01),
366
+ }),
367
+ time: num(0, 20, 0, 0.01),
368
+ }),
369
+ rgbSplit: defineFilter<PixiFilters.RGBSplitFilterOptions>()("RGBSplitFilter", {
370
+ red: object({
371
+ x: num(-20, 20, -10, 1),
372
+ y: num(-20, 20, 0, 1),
373
+ }),
374
+ blue: object({
375
+ x: num(-20, 20, 0, 1),
376
+ y: num(-20, 20, 0, 1),
377
+ }),
378
+ green: object({
379
+ x: num(-20, 20, 0, 1),
380
+ y: num(-20, 20, 10, 1),
381
+ }),
382
+ }),
383
+ shockwave: defineFilter<PixiFilters.ShockwaveFilterOptions>()("ShockwaveFilter", {
384
+ speed: num(500, 2000, 500, 1),
385
+ amplitude: num(1, 100, 30, 1),
386
+ wavelength: num(2, 400, 160, 1),
387
+ brightness: num(0.2, 2, 1, 0.01),
388
+ radius: num(100, 2000, -1, 1),
389
+ center: object({
390
+ x: num(0, 1912, 956, 1),
391
+ y: num(0, 920, 460, 1),
392
+ }),
393
+ }),
394
+ simplexNoise: defineFilter<PixiFilters.SimplexNoiseFilterOptions>()("SimplexNoiseFilter", {
395
+ strength: num(0, 1, 0.5, 0.01),
396
+ noiseScale: num(0, 50, 10, 0.1),
397
+ offsetX: num(0, 5, 0, 0.01),
398
+ offsetY: num(0, 5, 0, 0.01),
399
+ offsetZ: num(0, 5, 0, 0.01),
400
+ step: num(-1, 1, -1, 0.01),
401
+ }),
402
+ tiltShift: defineFilter<PixiFilters.TiltShiftFilterOptions>()("TiltShiftFilter", {
403
+ blur: num(0, 200, 100, 0.1),
404
+ gradientBlur: num(0, 1000, 600, 1),
405
+ start: object({
406
+ x: num(0, 1912, 0, 1),
407
+ y: num(0, 920, 460, 1),
408
+ }),
409
+ end: object({
410
+ x: num(0, 1912, 1912, 1),
411
+ y: num(0, 920, 460, 1),
412
+ }),
413
+ }),
414
+ twist: defineFilter<Partial<PixiFilters.TwistFilterOptions>>()("TwistFilter", {
415
+ angle: num(-10, 10, 4, 0.01),
416
+ radius: num(0, 1912, 200, 1),
417
+ offset: object({
418
+ x: num(0, 1912, 956, 1),
419
+ y: num(0, 920, 460, 1),
420
+ }),
421
+ }),
422
+ zoomBlur: defineFilter<PixiFilters.ZoomBlurFilterOptions>()("ZoomBlurFilter", {
423
+ strength: num(0.01, 0.5, 0.1, 0.01),
424
+ center: object({
425
+ x: num(0, 1912, 956, 1),
426
+ y: num(0, 920, 460, 1),
427
+ }),
428
+ innerRadius: num(0, 956, 80, 1),
429
+ radius: num(0, 956, -1, 1),
430
+ }),
431
+ } as const
432
+
433
+ type FilterDefinitions = typeof filters
434
+ type FilterDefinitionParams<T> =
435
+ T extends FilterDefinition<string, infer TParams>
436
+ ? TParams
437
+ : never
438
+
439
+ export type FilterOptions = {
440
+ [TName in keyof FilterDefinitions as FilterDefinitions[TName]["type"]]:
441
+ FilterDefinitionParams<FilterDefinitions[TName]>
442
+ }
443
+
444
+ export type FilterType = FilterDefinitions[keyof FilterDefinitions]["type"]
445
+ export type FilterParams<T extends FilterType = FilterType> = FilterOptions[T]
446
+
447
+ export interface FilterAction<TFilter extends FilterType> {
448
+ <T extends FilterableItem>(item: T, params?: FilterParams<TFilter>): T
449
+ make(params?: FilterParams<TFilter>): Item.Filter<TFilter>
450
+ }
451
+ export type FilterActions = {
452
+ [TName in keyof typeof filters]: FilterAction<(typeof filters)[TName]["type"]>
453
+ }
@@ -1,6 +1,12 @@
1
1
 
2
+ import {TextStyleOptions} from "pixi.js"
3
+
2
4
  import {Id, Hash} from "./basics.js"
3
- import {Transform} from "../types.js"
5
+ import {Ms} from "../../units/ms.js"
6
+ import type {FilterParams, FilterType} from "./filters.js"
7
+ import {Transform, VisualAnimations} from "../types.js"
8
+
9
+ export type Crop = [top: number, right: number, bottom: number, left: number]
4
10
 
5
11
  export enum Kind {
6
12
  Sequence,
@@ -10,7 +16,10 @@ export enum Kind {
10
16
  Text,
11
17
  Gap,
12
18
  Spatial,
19
+ Animation,
13
20
  Transition,
21
+ TextStyle,
22
+ Filter
14
23
  }
15
24
 
16
25
  export enum Effect {
@@ -18,11 +27,34 @@ export enum Effect {
18
27
  }
19
28
 
20
29
  export namespace Item {
21
- export type Spatial = {
22
- id: Id
23
- kind: Kind.Spatial
24
- transform: Transform
25
- }
30
+ export type TextStyle = {
31
+ id: Id
32
+ kind: Kind.TextStyle
33
+ style: TextStyleOptions
34
+ }
35
+
36
+ export type Spatial = {
37
+ id: Id
38
+ kind: Kind.Spatial
39
+ transform: Transform
40
+ crop?: Crop
41
+ enabled: boolean
42
+ }
43
+
44
+ export type Animation = {
45
+ id: Id
46
+ kind: Kind.Animation
47
+ anims: VisualAnimations
48
+ enabled: boolean
49
+ }
50
+
51
+ export type Filter<T extends FilterType = FilterType> = {
52
+ id: Id
53
+ kind: Kind.Filter
54
+ type: T
55
+ params?: FilterParams<T>
56
+ enabled: boolean
57
+ }
26
58
 
27
59
  export type Gap = {
28
60
  id: Id
@@ -35,6 +67,7 @@ export namespace Item {
35
67
  kind: Kind.Sequence
36
68
  childrenIds: Id[]
37
69
  spatialId?: Id
70
+ filterIds?: Id[]
38
71
  }
39
72
 
40
73
  export type Stack = {
@@ -42,6 +75,7 @@ export namespace Item {
42
75
  kind: Kind.Stack
43
76
  childrenIds: Id[]
44
77
  spatialId?: Id
78
+ filterIds?: Id[]
45
79
  }
46
80
 
47
81
  export type Video = {
@@ -51,6 +85,8 @@ export namespace Item {
51
85
  start: number
52
86
  duration: number
53
87
  spatialId?: Id
88
+ animationIds?: Id[]
89
+ filterIds?: Id[]
54
90
  }
55
91
 
56
92
  export type Audio = {
@@ -59,14 +95,18 @@ export namespace Item {
59
95
  mediaHash: Hash
60
96
  start: number
61
97
  duration: number
98
+ gain?: number
62
99
  }
63
100
 
64
101
  export type Text = {
65
102
  id: Id
66
103
  kind: Kind.Text
67
104
  content: string
105
+ duration: number
68
106
  spatialId?: Id
69
- color: string
107
+ animationIds?: Id[]
108
+ styleId?: Id
109
+ filterIds?: Id[]
70
110
  }
71
111
 
72
112
  export type Transition = {
@@ -85,6 +125,18 @@ export namespace Item {
85
125
  | Gap
86
126
  | Transition
87
127
  | Spatial
128
+ | Animation
129
+ | TextStyle
130
+ | Filter
88
131
  )
89
132
  }
90
133
 
134
+ export type ContainerItem = Item.Sequence | Item.Stack
135
+ export type NonContainerItem = Exclude<Item.Any, ContainerItem>
136
+ export type FilterableItem = Item.Sequence | Item.Stack | Item.Video | Item.Text
137
+ export type VisualAnimatableItem = Item.Video | Item.Text
138
+
139
+ export type PlayableItem = Item.Any & {
140
+ start: Ms
141
+ duration: Ms
142
+ }
@@ -14,13 +14,23 @@ export class Media {
14
14
 
15
15
  static async analyze(datafile: Datafile) {
16
16
  const media = new this(datafile)
17
- media.duration = 10
18
- const {video, audio} = await this.#has("/assets/temp/gl.mp4")
17
+ const duration = (await this.duration(datafile.url)) * 1000
18
+ media.duration = duration
19
+ const {video, audio} = await this.#has(datafile.url)
19
20
  media.hasAudio = audio
20
21
  media.hasVideo = video
21
22
  return media
22
23
  }
23
24
 
25
+ static async duration(source: DecoderSource) {
26
+ const input = new Input({
27
+ formats: ALL_FORMATS,
28
+ source: await loadDecoderSource(source)
29
+ })
30
+ const duration = await input.computeDuration()
31
+ return Number(duration.toFixed(5)) // fix weird floating points
32
+ }
33
+
24
34
  static async #has(source: DecoderSource) {
25
35
  const input = new Input({
26
36
  formats: ALL_FORMATS,
@@ -1,27 +1,30 @@
1
1
 
2
- import {MapG} from "@e280/stz"
2
+ import {GMap} from "@e280/stz"
3
3
  import {Hash} from "./basics.js"
4
4
  import {Media} from "./media.js"
5
5
  import {Resource} from "./resource.js"
6
6
  import {Datafile} from "../utils/datafile.js"
7
7
 
8
8
  export class ResourcePool {
9
- #map = new MapG<Hash, Resource.Any>
9
+ #map = new GMap<Hash, Resource.Any>
10
10
 
11
11
  /** store a media file (avoids duplicates via hash) */
12
12
  async store(datafile: Datafile) {
13
13
  const media = await Media.analyze(datafile)
14
14
  const {hash} = media.datafile.checksum
15
- const {filename, bytes} = media.datafile
15
+ const {filename, bytes, url, blob} = media.datafile
16
16
 
17
17
  if (this.#map.has(hash)) {
18
18
  const alreadyExists = this.#map.require(hash)
19
19
  alreadyExists.filename = filename
20
20
  }
21
21
  else
22
- this.#map.set(hash, {kind: "media", filename, bytes})
22
+ this.#map.set(hash, {kind: "media", filename, bytes, url, blob, duration: media.duration})
23
23
 
24
24
  return media
25
25
  }
26
- }
27
26
 
27
+ require(hash: Hash) {
28
+ return this.#map.require(hash)
29
+ }
30
+ }
@@ -4,6 +4,9 @@ export namespace Resource {
4
4
  kind: "media"
5
5
  filename: string
6
6
  bytes: Uint8Array
7
+ blob: Blob
8
+ url: string
9
+ duration: number
7
10
  }
8
11
 
9
12
  export type Any = Media