Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

M0.10/M0.11: egui shell — docking workspaces, header/menus, Project, Source/Program monitors, Timeline with all edit tools, Tools, Effects, Effect Controls, Lumetri, meters, mixer, control channel, desktop app with cpal audio

Brandon Thomas235c8a9bbdc6
diff --git a/Cargo.lock b/Cargo.lock
index bb5165575..551f6dcb7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,12 +2,415 @@
# It is not intended for manual editing.
version = 4
+[[package]]
+name = "accesskit"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3b7f7f85a7e5f68090000ed7622545829afd484d210358702ae4cb97dd0c320"
+dependencies = [
+ "uuid",
+]
+
+[[package]]
+name = "accesskit_atspi_common"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e8c61bee90b42a772d39d06a740207dc71a4e780004ace1db8d99fb1baaa954"
+dependencies = [
+ "accesskit",
+ "accesskit_consumer 0.36.0",
+ "atspi-common",
+ "phf",
+ "serde",
+ "zvariant",
+]
+
+[[package]]
+name = "accesskit_consumer"
+version = "0.35.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53cf47daed85312e763fbf85ceca136e0d7abc68e0a7e12abe11f48172bc3b10"
+dependencies = [
+ "accesskit",
+ "hashbrown 0.16.1",
+]
+
+[[package]]
+name = "accesskit_consumer"
+version = "0.36.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "25e0d7e25d06f4dc21d1774d67146e9e80d6789216cbd4d1e88185b0095dba60"
+dependencies = [
+ "accesskit",
+ "hashbrown 0.16.1",
+]
+
+[[package]]
+name = "accesskit_consumer"
+version = "0.38.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d10a236f96f87d70732e44520046785431ef01d5bcd6b041317bfadd2f88245"
+dependencies = [
+ "accesskit",
+ "hashbrown 0.16.1",
+]
+
+[[package]]
+name = "accesskit_macos"
+version = "0.26.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ce02dc63b43f0c9296af9ac946312a2dc8814427d7a64d2d600971dac55b6076"
+dependencies = [
+ "accesskit",
+ "accesskit_consumer 0.38.0",
+ "hashbrown 0.16.1",
+ "objc2 0.5.2",
+ "objc2-app-kit 0.2.2",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "accesskit_unix"
+version = "0.21.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b016ca8db0ea0ea2ceff29a9d6240391492d960716aa471967c00e8cc8cb197c"
+dependencies = [
+ "accesskit",
+ "accesskit_atspi_common",
+ "async-channel",
+ "async-executor",
+ "async-task",
+ "atspi",
+ "futures-lite",
+ "futures-util",
+ "serde",
+ "zbus",
+]
+
+[[package]]
+name = "accesskit_windows"
+version = "0.32.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eff7009f1a532e917d66970a1e80c965140c6cfbbabbdde3d64e5431e6c78e21"
+dependencies = [
+ "accesskit",
+ "accesskit_consumer 0.35.0",
+ "hashbrown 0.16.1",
+ "static_assertions",
+ "windows 0.62.2",
+ "windows-core 0.62.2",
+]
+
+[[package]]
+name = "accesskit_winit"
+version = "0.32.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fe9a94394896352cc4660ca2288bd4ef883d83238853c038b44070c8f134313"
+dependencies = [
+ "accesskit",
+ "accesskit_macos",
+ "accesskit_unix",
+ "accesskit_windows",
+ "raw-window-handle",
+ "winit",
+]
+
[[package]]
name = "adler2"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
+[[package]]
+name = "ahash"
+version = "0.8.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
+dependencies = [
+ "cfg-if",
+ "getrandom 0.3.4",
+ "once_cell",
+ "version_check",
+ "zerocopy",
+]
+
+[[package]]
+name = "allocator-api2"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
+
+[[package]]
+name = "alsa"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43"
+dependencies = [
+ "alsa-sys",
+ "bitflags 2.13.2",
+ "cfg-if",
+ "libc",
+]
+
+[[package]]
+name = "alsa-sys"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527"
+dependencies = [
+ "libc",
+ "pkg-config",
+]
+
+[[package]]
+name = "android-activity"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0f2a1bb052857d5dd49572219344a7332b31b76405648eabac5bc68978251bcd"
+dependencies = [
+ "android-properties",
+ "bitflags 2.13.2",
+ "cc",
+ "jni 0.22.4",
+ "libc",
+ "log",
+ "ndk",
+ "ndk-context",
+ "ndk-sys",
+ "num_enum",
+ "thiserror 2.0.21",
+]
+
+[[package]]
+name = "android-properties"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04"
+
+[[package]]
+name = "android_system_properties"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "arboard"
+version = "3.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf"
+dependencies = [
+ "clipboard-win",
+ "image",
+ "log",
+ "objc2 0.6.4",
+ "objc2-app-kit 0.3.2",
+ "objc2-core-foundation",
+ "objc2-core-graphics",
+ "objc2-foundation 0.3.2",
+ "parking_lot",
+ "percent-encoding",
+ "windows-sys 0.60.2",
+ "x11rb",
+]
+
+[[package]]
+name = "arrayvec"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"
+
+[[package]]
+name = "as-raw-xcb-connection"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b"
+
+[[package]]
+name = "ash"
+version = "0.38.0+1.3.281"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f"
+dependencies = [
+ "libloading",
+]
+
+[[package]]
+name = "async-broadcast"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
+dependencies = [
+ "event-listener",
+ "event-listener-strategy",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-channel"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
+dependencies = [
+ "concurrent-queue",
+ "event-listener-strategy",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-executor"
+version = "1.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a"
+dependencies = [
+ "async-task",
+ "concurrent-queue",
+ "fastrand",
+ "futures-lite",
+ "pin-project-lite",
+ "slab",
+]
+
+[[package]]
+name = "async-io"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
+dependencies = [
+ "autocfg",
+ "cfg-if",
+ "concurrent-queue",
+ "futures-io",
+ "futures-lite",
+ "parking",
+ "polling",
+ "rustix 1.1.5",
+ "slab",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "async-lock"
+version = "3.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
+dependencies = [
+ "event-listener",
+ "event-listener-strategy",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-process"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
+dependencies = [
+ "async-channel",
+ "async-io",
+ "async-lock",
+ "async-signal",
+ "async-task",
+ "blocking",
+ "cfg-if",
+ "event-listener",
+ "futures-lite",
+ "rustix 1.1.5",
+]
+
+[[package]]
+name = "async-recursion"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "async-signal"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
+dependencies = [
+ "async-io",
+ "async-lock",
+ "atomic-waker",
+ "cfg-if",
+ "futures-core",
+ "futures-io",
+ "rustix 1.1.5",
+ "signal-hook-registry",
+ "slab",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "async-task"
+version = "4.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
+
+[[package]]
+name = "async-trait"
+version = "0.1.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
+[[package]]
+name = "atomic-waker"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
+
+[[package]]
+name = "atspi"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c77886257be21c9cd89a4ae7e64860c6f0eefca799bb79127913052bd0eefb3d"
+dependencies = [
+ "atspi-common",
+ "atspi-proxies",
+]
+
+[[package]]
+name = "atspi-common"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20c5617155740c98003016429ad13fe43ce7a77b007479350a9f8bf95a29f63d"
+dependencies = [
+ "enumflags2",
+ "serde",
+ "static_assertions",
+ "zbus",
+ "zbus-lockstep",
+ "zbus-lockstep-macros",
+ "zbus_names",
+ "zvariant",
+]
+
+[[package]]
+name = "atspi-proxies"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2230e48787ed3eb4088996eab66a32ca20c0b67bbd4fd6cdfe79f04f1f04c9fc"
+dependencies = [
+ "atspi-common",
+ "serde",
+ "zbus",
+]
+
[[package]]
name = "autocfg"
version = "1.5.1"
@@ -20,7 +423,16 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
dependencies = [
- "bit-vec",
+ "bit-vec 0.8.0",
+]
+
+[[package]]
+name = "bit-set"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ec2f926cc3060f09db9ebc5b52823d85268d24bb917e472c0c4bea35780a7d"
+dependencies = [
+ "bit-vec 0.9.1",
]
[[package]]
@@ -29,17 +441,80 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
+[[package]]
+name = "bit-vec"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51"
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
[[package]]
name = "bitflags"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
+[[package]]
+name = "block2"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f"
+dependencies = [
+ "objc2 0.5.2",
+]
+
+[[package]]
+name = "block2"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
+dependencies = [
+ "objc2 0.6.4",
+]
+
+[[package]]
+name = "blocking"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa"
+dependencies = [
+ "async-channel",
+ "async-task",
+ "futures-io",
+ "futures-lite",
+ "piper",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.20.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
+
[[package]]
name = "bytemuck"
version = "1.25.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
+dependencies = [
+ "bytemuck_derive",
+]
+
+[[package]]
+name = "bytemuck_derive"
+version = "1.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a1f896587b6f2c069c73d2f0913e2d590c3990285cd2f0b6aa02b786b4c679c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
[[package]]
name = "byteorder-lite"
@@ -48,43 +523,261 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
[[package]]
-name = "cfg-if"
-version = "1.0.5"
+name = "bytes"
+version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
+checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
[[package]]
-name = "color_quant"
-version = "1.1.0"
+name = "calloop"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
+checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec"
+dependencies = [
+ "bitflags 2.13.2",
+ "log",
+ "polling",
+ "rustix 0.38.44",
+ "slab",
+ "thiserror 1.0.69",
+]
[[package]]
-name = "crc32fast"
-version = "1.5.2"
+name = "calloop"
+version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01a7799fd6b852db0e61728dde9a204c423b44d689dbd432522543614b490e78"
+checksum = "4dbf9978365bac10f54d1d4b04f7ce4427e51f71d61f2fe15e3fed5166474df7"
dependencies = [
- "cfg-if",
+ "bitflags 2.13.2",
+ "polling",
+ "rustix 1.1.5",
+ "slab",
+ "tracing",
]
[[package]]
-name = "crossbeam-deque"
-version = "0.8.8"
+name = "calloop-wayland-source"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
+checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
dependencies = [
- "crossbeam-epoch",
- "crossbeam-utils",
+ "calloop 0.13.0",
+ "rustix 0.38.44",
+ "wayland-backend",
+ "wayland-client",
]
[[package]]
-name = "crossbeam-epoch"
-version = "0.9.21"
+name = "calloop-wayland-source"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
+checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
dependencies = [
- "crossbeam-utils",
+ "calloop 0.14.4",
+ "rustix 1.1.5",
+ "wayland-backend",
+ "wayland-client",
+]
+
+[[package]]
+name = "cc"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f360145194ee8e21db5ee7f3fcd4fe52210864c75c985dae33218202c8bbe040"
+dependencies = [
+ "find-msvc-tools",
+ "jobserver",
+ "libc",
+ "shlex",
+]
+
+[[package]]
+name = "cesu8"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
+
+[[package]]
+name = "cfg_aliases"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"
+
+[[package]]
+name = "cgl"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "clipboard-win"
+version = "5.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4"
+dependencies = [
+ "error-code",
+]
+
+[[package]]
+name = "codespan-reporting"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681"
+dependencies = [
+ "serde",
+ "termcolor",
+ "unicode-width",
+]
+
+[[package]]
+name = "color"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ec7c5eb7a16992b1904d76c517d170ab353b0e0b3d5a0c81a8a0cd1037893cf"
+dependencies = [
+ "bytemuck",
+]
+
+[[package]]
+name = "color_quant"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
+
+[[package]]
+name = "combine"
+version = "4.6.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cfc320937d09e6de266b31b9afb480f197d7a861be86be7cb2ea7e5d1bfffc5e"
+dependencies = [
+ "bytes",
+ "memchr",
+]
+
+[[package]]
+name = "concurrent-queue"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "core-foundation"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "core-foundation-sys"
+version = "0.8.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
+
+[[package]]
+name = "core-graphics"
+version = "0.23.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081"
+dependencies = [
+ "bitflags 1.3.2",
+ "core-foundation",
+ "core-graphics-types",
+ "foreign-types",
+ "libc",
+]
+
+[[package]]
+name = "core-graphics-types"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"
+dependencies = [
+ "bitflags 1.3.2",
+ "core-foundation",
+ "libc",
+]
+
+[[package]]
+name = "coreaudio-rs"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1aae284fbaf7d27aa0e292f7677dfbe26503b0d555026f702940805a630eac17"
+dependencies = [
+ "bitflags 1.3.2",
+ "libc",
+ "objc2-audio-toolbox",
+ "objc2-core-audio",
+ "objc2-core-audio-types",
+ "objc2-core-foundation",
+]
+
+[[package]]
+name = "cpal"
+version = "0.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cbd307f43cc2a697e2d1f8bc7a1d824b5269e052209e28883e5bc04d095aaa3f"
+dependencies = [
+ "alsa",
+ "coreaudio-rs",
+ "dasp_sample",
+ "jni 0.21.1",
+ "js-sys",
+ "libc",
+ "mach2",
+ "ndk",
+ "ndk-context",
+ "num-derive",
+ "num-traits",
+ "objc2-audio-toolbox",
+ "objc2-core-audio",
+ "objc2-core-audio-types",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+ "windows 0.54.0",
+]
+
+[[package]]
+name = "crc32fast"
+version = "1.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "01a7799fd6b852db0e61728dde9a204c423b44d689dbd432522543614b490e78"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "crossbeam-deque"
+version = "0.8.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
+dependencies = [
+ "crossbeam-epoch",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-epoch"
+version = "0.9.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
+dependencies = [
+ "crossbeam-utils",
]
[[package]]
@@ -99,687 +792,3746 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
+[[package]]
+name = "cursor-icon"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f"
+
+[[package]]
+name = "dasp_sample"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f"
+
+[[package]]
+name = "dispatch"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"
+
+[[package]]
+name = "dispatch2"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.6.2",
+ "libc",
+ "objc2 0.6.4",
+]
+
+[[package]]
+name = "dlib"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a"
+dependencies = [
+ "libloading",
+]
+
+[[package]]
+name = "document-features"
+version = "0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61"
+dependencies = [
+ "litrs",
+]
+
+[[package]]
+name = "downcast-rs"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
+
+[[package]]
+name = "dpi"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76"
+
+[[package]]
+name = "ecolor"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0656a7530b9e2841ee7a5f983965bdd9840c32f4012f759cfd44b912cced6b34"
+dependencies = [
+ "bytemuck",
+ "emath",
+]
+
+[[package]]
+name = "eframe"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "55ad41fac6e3149abb4866e93df37dbd33baa95db525c3368c944584e95a5dc2"
+dependencies = [
+ "ahash",
+ "bytemuck",
+ "document-features",
+ "egui",
+ "egui-wgpu",
+ "egui-winit",
+ "egui_glow",
+ "glutin",
+ "glutin-winit",
+ "image",
+ "js-sys",
+ "log",
+ "objc2 0.6.4",
+ "objc2-app-kit 0.3.2",
+ "objc2-foundation 0.3.2",
+ "parking_lot",
+ "percent-encoding",
+ "pollster 1.0.1",
+ "profiling",
+ "raw-window-handle",
+ "static_assertions",
+ "wasm-bindgen",
+ "web-sys",
+ "web-time",
+ "wgpu",
+ "windows-sys 0.61.2",
+ "winit",
+]
+
+[[package]]
+name = "egui"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc938cc27cd911415e1e4d151bc56ff9df063d8db081374e87aeb805ea74b2ba"
+dependencies = [
+ "accesskit",
+ "ahash",
+ "bitflags 2.13.2",
+ "emath",
+ "epaint",
+ "itertools",
+ "log",
+ "nohash-hasher",
+ "profiling",
+ "smallvec",
+ "unicode-segmentation",
+ "web-sys",
+]
+
+[[package]]
+name = "egui-wgpu"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5cef1f6d1bba40b09a4d0d62cb822b81030922cfbf65c5373398c3a3caafc5bd"
+dependencies = [
+ "ahash",
+ "bytemuck",
+ "document-features",
+ "egui",
+ "epaint",
+ "log",
+ "profiling",
+ "thiserror 2.0.21",
+ "type-map",
+ "web-time",
+ "wgpu",
+ "winit",
+]
+
+[[package]]
+name = "egui-winit"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "98466000559d66ba4db786a30448b01483946add4188e7f10f522a27b4fb89cc"
+dependencies = [
+ "accesskit_winit",
+ "arboard",
+ "bytemuck",
+ "egui",
+ "log",
+ "objc2 0.6.4",
+ "objc2-foundation 0.3.2",
+ "objc2-ui-kit 0.3.2",
+ "profiling",
+ "raw-window-handle",
+ "smithay-clipboard",
+ "web-time",
+ "winit",
+]
+
+[[package]]
+name = "egui_glow"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "606ed4167daf341e5753d703285c4c1d562324b2c07aa8f405cd7d066fe58f3b"
+dependencies = [
+ "bytemuck",
+ "egui",
+ "glow",
+ "log",
+ "profiling",
+ "winit",
+]
+
[[package]]
name = "either"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
+[[package]]
+name = "emath"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52c8d4141cf0f60fb2f7aefaf352d3ffa5171ef0ab09731c64391801e95e48f1"
+dependencies = [
+ "bytemuck",
+]
+
+[[package]]
+name = "endi"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
+
+[[package]]
+name = "enumflags2"
+version = "0.7.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
+dependencies = [
+ "enumflags2_derive",
+ "serde",
+]
+
+[[package]]
+name = "enumflags2_derive"
+version = "0.7.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "epaint"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a0ec0308dc23130fc1a7d4623a8534c2ed069c6dc84e258ee4f3de99615aa1a3"
+dependencies = [
+ "ahash",
+ "bytemuck",
+ "ecolor",
+ "emath",
+ "epaint_default_fonts",
+ "font-types",
+ "harfrust",
+ "log",
+ "nohash-hasher",
+ "parking_lot",
+ "profiling",
+ "self_cell",
+ "skrifa",
+ "smallvec",
+ "unicode-general-category",
+ "unicode-segmentation",
+ "vello_cpu",
+]
+
+[[package]]
+name = "epaint_default_fonts"
+version = "0.36.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "773fa9c96dd0dbef887e39d0ed6177f141cce4d68e6041df77570aa3702dfa13"
+
+[[package]]
+name = "equivalent"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
+
[[package]]
name = "errno"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
+checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
+dependencies = [
+ "libc",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "error-code"
+version = "3.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b5343afd4a8365a643ac588dab4cf234a190c7f6c88c9f6dd6ffe00837661b7"
+
+[[package]]
+name = "euclid"
+version = "0.22.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "event-listener"
+version = "5.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"
+dependencies = [
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "event-listener-strategy"
+version = "0.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
+dependencies = [
+ "event-listener",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "fastrand"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
+
+[[package]]
+name = "fax"
+version = "0.2.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a"
+
+[[package]]
+name = "fdeflate"
+version = "0.3.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"
+dependencies = [
+ "simd-adler32",
+]
+
+[[package]]
+name = "fearless_simd"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b97b65636e5b9ef369943878ac74335ba1c55c1cb6adbf1e2c293c624248d693"
+
+[[package]]
+name = "filmcraft"
+version = "0.1.0"
+dependencies = [
+ "cpal",
+ "eframe",
+ "egui",
+ "filmcraft-engine",
+ "filmcraft-ui-egui",
+ "log",
+ "rfd",
+ "serde_json",
+]
+
+[[package]]
+name = "filmcraft-bitstream"
+version = "0.1.0"
+dependencies = [
+ "proptest",
+]
+
+[[package]]
+name = "filmcraft-color"
+version = "0.1.0"
+dependencies = [
+ "proptest",
+ "serde",
+]
+
+[[package]]
+name = "filmcraft-edit"
+version = "0.1.0"
+dependencies = [
+ "filmcraft-media",
+ "filmcraft-project",
+ "filmcraft-time",
+ "proptest",
+ "thiserror 2.0.21",
+]
+
+[[package]]
+name = "filmcraft-engine"
+version = "0.1.0"
+dependencies = [
+ "filmcraft-color",
+ "filmcraft-edit",
+ "filmcraft-frame",
+ "filmcraft-geom",
+ "filmcraft-media",
+ "filmcraft-project",
+ "filmcraft-render",
+ "filmcraft-time",
+ "log",
+ "serde",
+ "serde_json",
+ "thiserror 2.0.21",
+]
+
+[[package]]
+name = "filmcraft-frame"
+version = "0.1.0"
+dependencies = [
+ "filmcraft-color",
+ "filmcraft-time",
+ "rayon",
+ "serde",
+]
+
+[[package]]
+name = "filmcraft-geom"
+version = "0.1.0"
+dependencies = [
+ "proptest",
+ "serde",
+]
+
+[[package]]
+name = "filmcraft-isobmff"
+version = "0.1.0"
+dependencies = [
+ "filmcraft-bitstream",
+ "proptest",
+ "serde_json",
+ "thiserror 2.0.21",
+]
+
+[[package]]
+name = "filmcraft-media"
+version = "0.1.0"
+dependencies = [
+ "filmcraft-color",
+ "filmcraft-frame",
+ "filmcraft-time",
+ "image",
+ "rayon",
+ "serde",
+ "thiserror 2.0.21",
+]
+
+[[package]]
+name = "filmcraft-project"
+version = "0.1.0"
+dependencies = [
+ "filmcraft-color",
+ "filmcraft-geom",
+ "filmcraft-media",
+ "filmcraft-time",
+ "proptest",
+ "serde",
+ "serde_json",
+ "thiserror 2.0.21",
+]
+
+[[package]]
+name = "filmcraft-render"
+version = "0.1.0"
+dependencies = [
+ "filmcraft-color",
+ "filmcraft-frame",
+ "filmcraft-geom",
+ "filmcraft-media",
+ "filmcraft-project",
+ "filmcraft-time",
+ "image",
+ "rayon",
+]
+
+[[package]]
+name = "filmcraft-time"
+version = "0.1.0"
+dependencies = [
+ "proptest",
+ "serde",
+]
+
+[[package]]
+name = "filmcraft-ui-egui"
+version = "0.1.0"
+dependencies = [
+ "eframe",
+ "egui",
+ "filmcraft-color",
+ "filmcraft-edit",
+ "filmcraft-engine",
+ "filmcraft-frame",
+ "filmcraft-geom",
+ "filmcraft-media",
+ "filmcraft-project",
+ "filmcraft-render",
+ "filmcraft-time",
+ "log",
+ "rayon",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "find-msvc-tools"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484"
+
+[[package]]
+name = "flate2"
+version = "1.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb"
+dependencies = [
+ "crc32fast",
+ "miniz_oxide 0.9.1",
+ "zlib-rs",
+]
+
+[[package]]
+name = "fnv"
+version = "1.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+
+[[package]]
+name = "foldhash"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
+
+[[package]]
+name = "font-types"
+version = "0.12.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8eb065f3251655b3c90e22e5e363f310fc5332fb3402e37bbc94752283248f6"
+dependencies = [
+ "bytemuck",
+]
+
+[[package]]
+name = "foreign-types"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
+dependencies = [
+ "foreign-types-macros",
+ "foreign-types-shared",
+]
+
+[[package]]
+name = "foreign-types-macros"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
+[[package]]
+name = "foreign-types-shared"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
+
+[[package]]
+name = "futures-core"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
+
+[[package]]
+name = "futures-io"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
+
+[[package]]
+name = "futures-lite"
+version = "2.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
+dependencies = [
+ "fastrand",
+ "futures-core",
+ "futures-io",
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "futures-macro"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
+[[package]]
+name = "futures-task"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
+
+[[package]]
+name = "futures-util"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
+dependencies = [
+ "futures-core",
+ "futures-macro",
+ "futures-task",
+ "pin-project-lite",
+ "slab",
+]
+
+[[package]]
+name = "gethostname"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
+dependencies = [
+ "rustix 1.1.5",
+ "windows-link",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "r-efi 5.3.0",
+ "wasip2",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "r-efi 6.0.0",
+]
+
+[[package]]
+name = "gif"
+version = "0.14.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159"
+dependencies = [
+ "color_quant",
+ "weezl",
+]
+
+[[package]]
+name = "gl_generator"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"
+dependencies = [
+ "khronos_api",
+ "log",
+ "xml-rs",
+]
+
+[[package]]
+name = "glifo"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed4a1bb24121291d27230c1b1b44e07d6a9b28cefdb32fe1581dfb84e14f940a"
+dependencies = [
+ "bytemuck",
+ "foldhash",
+ "hashbrown 0.17.1",
+ "log",
+ "peniko",
+ "skrifa",
+ "smallvec",
+ "vello_common",
+]
+
+[[package]]
+name = "glow"
+version = "0.17.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29038e1c483364cc6bb3cf78feee1816002e127c331a1eec55a4d202b9e1adb5"
+dependencies = [
+ "js-sys",
+ "slotmap",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "glutin"
+version = "0.32.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12124de845cacfebedff80e877bb37b5b75c34c5a4c89e47e1cdd67fb6041325"
+dependencies = [
+ "bitflags 2.13.2",
+ "cfg_aliases",
+ "cgl",
+ "dispatch2",
+ "glutin_egl_sys",
+ "glutin_glx_sys",
+ "glutin_wgl_sys",
+ "libloading",
+ "objc2 0.6.4",
+ "objc2-app-kit 0.3.2",
+ "objc2-core-foundation",
+ "objc2-foundation 0.3.2",
+ "once_cell",
+ "raw-window-handle",
+ "wayland-sys",
+ "windows-sys 0.52.0",
+ "x11-dl",
+]
+
+[[package]]
+name = "glutin-winit"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85edca7075f8fc728f28cb8fbb111a96c3b89e930574369e3e9c27eb75d3788f"
+dependencies = [
+ "cfg_aliases",
+ "glutin",
+ "raw-window-handle",
+ "winit",
+]
+
+[[package]]
+name = "glutin_egl_sys"
+version = "0.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c4680ba6195f424febdc3ba46e7a42a0e58743f2edb115297b86d7f8ecc02d2"
+dependencies = [
+ "gl_generator",
+ "windows-sys 0.52.0",
+]
+
+[[package]]
+name = "glutin_glx_sys"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a7bb2938045a88b612499fbcba375a77198e01306f52272e692f8c1f3751185"
+dependencies = [
+ "gl_generator",
+ "x11-dl",
+]
+
+[[package]]
+name = "glutin_wgl_sys"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e"
+dependencies = [
+ "gl_generator",
+]
+
+[[package]]
+name = "gpu-allocator"
+version = "0.28.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795"
+dependencies = [
+ "ash",
+ "hashbrown 0.16.1",
+ "log",
+ "presser",
+ "thiserror 2.0.21",
+ "windows 0.62.2",
+]
+
+[[package]]
+name = "guillotiere"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b17e70c989c36bad147b27a58d148c0741c51448aa5653436547323e524d0ab"
+dependencies = [
+ "euclid",
+]
+
+[[package]]
+name = "half"
+version = "2.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
+dependencies = [
+ "cfg-if",
+ "crunchy",
+ "num-traits",
+ "zerocopy",
+]
+
+[[package]]
+name = "harfrust"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c03d949a14aa089bbb282f7dd76a498a7f684428e4257202efc119ec010376f9"
+dependencies = [
+ "bitflags 2.13.2",
+ "bytemuck",
+ "read-fonts",
+ "smallvec",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.16.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
+dependencies = [
+ "allocator-api2",
+ "equivalent",
+ "foldhash",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.17.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
+dependencies = [
+ "foldhash",
+]
+
+[[package]]
+name = "hermit-abi"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"
+
+[[package]]
+name = "hex"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
+
+[[package]]
+name = "image"
+version = "0.25.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
+dependencies = [
+ "bytemuck",
+ "byteorder-lite",
+ "color_quant",
+ "gif",
+ "image-webp",
+ "moxcms",
+ "num-traits",
+ "png",
+ "tiff",
+ "zune-core",
+ "zune-jpeg",
+]
+
+[[package]]
+name = "image-webp"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"
+dependencies = [
+ "byteorder-lite",
+ "quick-error 2.0.1",
+]
+
+[[package]]
+name = "indexmap"
+version = "2.14.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
+dependencies = [
+ "equivalent",
+ "hashbrown 0.17.1",
+]
+
+[[package]]
+name = "itertools"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
+
+[[package]]
+name = "jni"
+version = "0.21.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
+dependencies = [
+ "cesu8",
+ "cfg-if",
+ "combine",
+ "jni-sys 0.3.1",
+ "log",
+ "thiserror 1.0.69",
+ "walkdir",
+ "windows-sys 0.45.0",
+]
+
+[[package]]
+name = "jni"
+version = "0.22.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498"
+dependencies = [
+ "cfg-if",
+ "combine",
+ "jni-macros",
+ "jni-sys 0.4.1",
+ "log",
+ "simd_cesu8",
+ "thiserror 2.0.21",
+ "walkdir",
+ "windows-link",
+]
+
+[[package]]
+name = "jni-macros"
+version = "0.22.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "rustc_version",
+ "simd_cesu8",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "jni-sys"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258"
+dependencies = [
+ "jni-sys 0.4.1",
+]
+
+[[package]]
+name = "jni-sys"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2"
+dependencies = [
+ "jni-sys-macros",
+]
+
+[[package]]
+name = "jni-sys-macros"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264"
+dependencies = [
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "jobserver"
+version = "0.1.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
+dependencies = [
+ "getrandom 0.4.3",
+ "libc",
+]
+
+[[package]]
+name = "js-sys"
+version = "0.3.106"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5"
+dependencies = [
+ "cfg-if",
+ "futures-util",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "khronos-egl"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76"
+dependencies = [
+ "libc",
+ "libloading",
+ "pkg-config",
+]
+
+[[package]]
+name = "khronos_api"
+version = "3.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
+
+[[package]]
+name = "kurbo"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4b60dfc32f652b926df6192e55525b16d186c69d47876c3ead4da5cc9f8450e2"
+dependencies = [
+ "arrayvec",
+ "euclid",
+ "polycool",
+ "smallvec",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.189"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
+
+[[package]]
+name = "libloading"
+version = "0.8.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
+dependencies = [
+ "cfg-if",
+ "windows-link",
+]
+
+[[package]]
+name = "libm"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
+
+[[package]]
+name = "libredox"
+version = "0.1.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61ff90caf6077a803a240f62fdbe88645a890bbca49ef8174c3cb0404362171d"
+dependencies = [
+ "bitflags 2.13.2",
+ "libc",
+ "plain",
+ "redox_syscall 0.9.4",
+]
+
+[[package]]
+name = "linebender_resource_handle"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.4.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
+
+[[package]]
+name = "litrs"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"
+
+[[package]]
+name = "lock_api"
+version = "0.4.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
+dependencies = [
+ "scopeguard",
+]
+
+[[package]]
+name = "log"
+version = "0.4.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
+
+[[package]]
+name = "mach2"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "memchr"
+version = "2.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
+
+[[package]]
+name = "memmap2"
+version = "0.9.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "memoffset"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "miniz_oxide"
+version = "0.8.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
+dependencies = [
+ "adler2",
+ "simd-adler32",
+]
+
+[[package]]
+name = "miniz_oxide"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"
+dependencies = [
+ "adler2",
+ "simd-adler32",
+]
+
+[[package]]
+name = "moxcms"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
+dependencies = [
+ "num-traits",
+ "pxfm",
+]
+
+[[package]]
+name = "naga"
+version = "30.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a616d2fb8c89516ac2723a581f69d6c18576046bed761bd6b305e5618e6ae130"
+dependencies = [
+ "arrayvec",
+ "bit-set 0.10.0",
+ "bitflags 2.13.2",
+ "cfg-if",
+ "cfg_aliases",
+ "codespan-reporting",
+ "half",
+ "hashbrown 0.17.1",
+ "indexmap",
+ "libm",
+ "log",
+ "naga-types",
+ "num-traits",
+ "once_cell",
+ "rustc-hash 1.1.0",
+ "spirv",
+ "thiserror 2.0.21",
+ "unicode-ident",
+]
+
+[[package]]
+name = "naga-types"
+version = "30.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "590afbf58a6f4f62873cd5cff4468061844bafa1cdf399cc954537c22d768d49"
+dependencies = [
+ "hashbrown 0.17.1",
+ "indexmap",
+ "rustc-hash 1.1.0",
+ "thiserror 2.0.21",
+]
+
+[[package]]
+name = "ndk"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4"
+dependencies = [
+ "bitflags 2.13.2",
+ "jni-sys 0.3.1",
+ "log",
+ "ndk-sys",
+ "num_enum",
+ "raw-window-handle",
+ "thiserror 1.0.69",
+]
+
+[[package]]
+name = "ndk-context"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
+
+[[package]]
+name = "ndk-sys"
+version = "0.6.0+11769913"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873"
+dependencies = [
+ "jni-sys 0.3.1",
+]
+
+[[package]]
+name = "nohash-hasher"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
+
+[[package]]
+name = "num-derive"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
+dependencies = [
+ "autocfg",
+ "libm",
+]
+
+[[package]]
+name = "num_enum"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26"
+dependencies = [
+ "num_enum_derive",
+ "rustversion",
+]
+
+[[package]]
+name = "num_enum_derive"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8"
+dependencies = [
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "objc-sys"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310"
+
+[[package]]
+name = "objc2"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804"
+dependencies = [
+ "objc-sys",
+ "objc2-encode",
+]
+
+[[package]]
+name = "objc2"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f"
+dependencies = [
+ "objc2-encode",
+]
+
+[[package]]
+name = "objc2-app-kit"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "libc",
+ "objc2 0.5.2",
+ "objc2-core-data",
+ "objc2-core-image",
+ "objc2-foundation 0.2.2",
+ "objc2-quartz-core 0.2.2",
+]
+
+[[package]]
+name = "objc2-app-kit"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.6.2",
+ "objc2 0.6.4",
+ "objc2-core-foundation",
+ "objc2-core-graphics",
+ "objc2-foundation 0.3.2",
+]
+
+[[package]]
+name = "objc2-audio-toolbox"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6948501a91121d6399b79abaa33a8aa4ea7857fe019f341b8c23ad6e81b79b08"
+dependencies = [
+ "bitflags 2.13.2",
+ "libc",
+ "objc2 0.6.4",
+ "objc2-core-audio",
+ "objc2-core-audio-types",
+ "objc2-core-foundation",
+ "objc2-foundation 0.3.2",
+]
+
+[[package]]
+name = "objc2-cloud-kit"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-core-location",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "objc2-contacts"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889"
+dependencies = [
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "objc2-core-audio"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1eebcea8b0dbff5f7c8504f3107c68fc061a3eb44932051c8cf8a68d969c3b2"
+dependencies = [
+ "dispatch2",
+ "objc2 0.6.4",
+ "objc2-core-audio-types",
+ "objc2-core-foundation",
+]
+
+[[package]]
+name = "objc2-core-audio-types"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a89f2ec274a0cf4a32642b2991e8b351a404d290da87bb6a9a9d8632490bd1c"
+dependencies = [
+ "bitflags 2.13.2",
+ "objc2 0.6.4",
+]
+
+[[package]]
+name = "objc2-core-data"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "objc2-core-foundation"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
+dependencies = [
+ "bitflags 2.13.2",
+ "dispatch2",
+ "objc2 0.6.4",
+]
+
+[[package]]
+name = "objc2-core-graphics"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"
+dependencies = [
+ "bitflags 2.13.2",
+ "dispatch2",
+ "objc2 0.6.4",
+ "objc2-core-foundation",
+ "objc2-io-surface",
+]
+
+[[package]]
+name = "objc2-core-image"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80"
+dependencies = [
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-foundation 0.2.2",
+ "objc2-metal 0.2.2",
+]
+
+[[package]]
+name = "objc2-core-location"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781"
+dependencies = [
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-contacts",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "objc2-encode"
+version = "4.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
+
+[[package]]
+name = "objc2-foundation"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "dispatch",
+ "libc",
+ "objc2 0.5.2",
+]
+
+[[package]]
+name = "objc2-foundation"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.6.2",
+ "objc2 0.6.4",
+ "objc2-core-foundation",
+]
+
+[[package]]
+name = "objc2-io-surface"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
+dependencies = [
+ "bitflags 2.13.2",
+ "objc2 0.6.4",
+ "objc2-core-foundation",
+]
+
+[[package]]
+name = "objc2-link-presentation"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398"
+dependencies = [
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-app-kit 0.2.2",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "objc2-metal"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "objc2-metal"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.6.2",
+ "objc2 0.6.4",
+ "objc2-foundation 0.3.2",
+]
+
+[[package]]
+name = "objc2-quartz-core"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-foundation 0.2.2",
+ "objc2-metal 0.2.2",
+]
+
+[[package]]
+name = "objc2-quartz-core"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"
+dependencies = [
+ "bitflags 2.13.2",
+ "objc2 0.6.4",
+ "objc2-core-foundation",
+ "objc2-core-graphics",
+ "objc2-foundation 0.3.2",
+ "objc2-metal 0.3.2",
+]
+
+[[package]]
+name = "objc2-symbols"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc"
+dependencies = [
+ "objc2 0.5.2",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "objc2-ui-kit"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-cloud-kit",
+ "objc2-core-data",
+ "objc2-core-image",
+ "objc2-core-location",
+ "objc2-foundation 0.2.2",
+ "objc2-link-presentation",
+ "objc2-quartz-core 0.2.2",
+ "objc2-symbols",
+ "objc2-uniform-type-identifiers",
+ "objc2-user-notifications",
+]
+
+[[package]]
+name = "objc2-ui-kit"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22"
+dependencies = [
+ "bitflags 2.13.2",
+ "objc2 0.6.4",
+ "objc2-core-foundation",
+ "objc2-foundation 0.3.2",
+]
+
+[[package]]
+name = "objc2-uniform-type-identifiers"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe"
+dependencies = [
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "objc2-user-notifications"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3"
+dependencies = [
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "objc2 0.5.2",
+ "objc2-core-location",
+ "objc2-foundation 0.2.2",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.21.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
+
+[[package]]
+name = "orbclient"
+version = "0.3.55"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5df339f526ea9a60e371768d50efc2f2508c7203290731565d1f7a6f71d21747"
+dependencies = [
+ "libc",
+ "libredox",
+]
+
+[[package]]
+name = "ordered-float"
+version = "5.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c7c9e0d9b23589f26070720bac724174bfec1083e82f7854cdd0267518343c0"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "ordered-stream"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
+dependencies = [
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "parking"
+version = "2.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
+
+[[package]]
+name = "parking_lot"
+version = "0.12.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall 0.5.18",
+ "smallvec",
+ "windows-link",
+]
+
+[[package]]
+name = "peniko"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "839c8299360d2e998bdb106dc0a6cd71dcc5f4df51df1b620361bf50e283cca6"
+dependencies = [
+ "bytemuck",
+ "color",
+ "kurbo",
+ "linebender_resource_handle",
+ "smallvec",
+]
+
+[[package]]
+name = "percent-encoding"
+version = "2.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
+
+[[package]]
+name = "phf"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
+dependencies = [
+ "phf_macros",
+ "phf_shared",
+ "serde",
+]
+
+[[package]]
+name = "phf_generator"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
+dependencies = [
+ "fastrand",
+ "phf_shared",
+]
+
+[[package]]
+name = "phf_macros"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef"
+dependencies = [
+ "phf_generator",
+ "phf_shared",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "phf_shared"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
+dependencies = [
+ "siphasher",
+]
+
+[[package]]
+name = "pin-project"
+version = "1.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924"
+dependencies = [
+ "pin-project-internal",
+]
+
+[[package]]
+name = "pin-project-internal"
+version = "1.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
+
+[[package]]
+name = "piper"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
+dependencies = [
+ "atomic-waker",
+ "fastrand",
+ "futures-io",
+]
+
+[[package]]
+name = "pkg-config"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
+
+[[package]]
+name = "plain"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
+
+[[package]]
+name = "png"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
+dependencies = [
+ "bitflags 2.13.2",
+ "crc32fast",
+ "fdeflate",
+ "flate2",
+ "miniz_oxide 0.8.9",
+]
+
+[[package]]
+name = "polling"
+version = "3.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
+dependencies = [
+ "cfg-if",
+ "concurrent-queue",
+ "hermit-abi",
+ "pin-project-lite",
+ "rustix 1.1.5",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "pollster"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
+
+[[package]]
+name = "pollster"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc6355899e1c9462875b6757c79f3caa011a1fdae12bbb1a2e72dd1f234f8336"
+
+[[package]]
+name = "polycool"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50596ddc09eb5ad5f75cacd40209568e66df71baf86e1499a0e99c4cff12a5a6"
+dependencies = [
+ "arrayvec",
+]
+
+[[package]]
+name = "portable-atomic"
+version = "1.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
+
+[[package]]
+name = "portable-atomic-util"
+version = "0.2.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"
+dependencies = [
+ "portable-atomic",
+]
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
+dependencies = [
+ "zerocopy",
+]
+
+[[package]]
+name = "presser"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"
+
+[[package]]
+name = "proc-macro-crate"
+version = "3.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
+dependencies = [
+ "toml_edit",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.107"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "profiling"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5"
+
+[[package]]
+name = "proptest"
+version = "1.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
+dependencies = [
+ "bit-set 0.8.0",
+ "bit-vec 0.8.0",
+ "bitflags 2.13.2",
+ "num-traits",
+ "rand",
+ "rand_chacha",
+ "rand_xorshift",
+ "regex-syntax",
+ "rusty-fork",
+ "tempfile",
+ "unarray",
+]
+
+[[package]]
+name = "pxfm"
+version = "0.1.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
+
+[[package]]
+name = "quick-error"
+version = "1.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
+
+[[package]]
+name = "quick-error"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
+
+[[package]]
+name = "quick-xml"
+version = "0.41.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.47"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "r-efi"
+version = "5.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
+
+[[package]]
+name = "r-efi"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
+
+[[package]]
+name = "rand"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
+dependencies = [
+ "rand_chacha",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
+dependencies = [
+ "getrandom 0.3.4",
+]
+
+[[package]]
+name = "rand_xorshift"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "range-alloc"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08"
+
+[[package]]
+name = "raw-window-handle"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539"
+
+[[package]]
+name = "raw-window-metal"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135"
+dependencies = [
+ "objc2 0.6.4",
+ "objc2-core-foundation",
+ "objc2-foundation 0.3.2",
+ "objc2-quartz-core 0.3.2",
+]
+
+[[package]]
+name = "rayon"
+version = "1.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
+dependencies = [
+ "either",
+ "rayon-core",
+]
+
+[[package]]
+name = "rayon-core"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
+dependencies = [
+ "crossbeam-deque",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "read-fonts"
+version = "0.41.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "046a7d674daf459825b32f5062056d6882db0d2f5a479fbd76ccfc870ac18709"
+dependencies = [
+ "bytemuck",
+ "font-types",
+ "once_cell",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
+dependencies = [
+ "bitflags 1.3.2",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.5.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
+dependencies = [
+ "bitflags 2.13.2",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "737970939a87c6fa31e7acad13307bccbb017a073b695b6089a2c484f929e20e"
+dependencies = [
+ "bitflags 2.13.2",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
+
+[[package]]
+name = "renderdoc-sys"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
+
+[[package]]
+name = "rfd"
+version = "0.17.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20dafead71c16a34e1ff357ddefc8afc11e7d51d6d2b9fbd07eaa48e3e540220"
+dependencies = [
+ "block2 0.6.2",
+ "dispatch2",
+ "js-sys",
+ "libc",
+ "log",
+ "objc2 0.6.4",
+ "objc2-app-kit 0.3.2",
+ "objc2-core-foundation",
+ "objc2-foundation 0.3.2",
+ "percent-encoding",
+ "pollster 0.4.0",
+ "raw-window-handle",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "web-sys",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "rustc-hash"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
+
+[[package]]
+name = "rustc-hash"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
+
+[[package]]
+name = "rustc_version"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
+dependencies = [
+ "semver",
+]
+
+[[package]]
+name = "rustix"
+version = "0.38.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
+dependencies = [
+ "bitflags 2.13.2",
+ "errno",
+ "libc",
+ "linux-raw-sys 0.4.15",
+ "windows-sys 0.59.0",
+]
+
+[[package]]
+name = "rustix"
+version = "1.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "891efababe418670775f199f0d233d84843c227a0949a883ce15b37c78d6629d"
+dependencies = [
+ "bitflags 2.13.2",
+ "errno",
+ "libc",
+ "linux-raw-sys 0.12.1",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
+
+[[package]]
+name = "rusty-fork"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2"
+dependencies = [
+ "fnv",
+ "quick-error 1.2.3",
+ "tempfile",
+ "wait-timeout",
+]
+
+[[package]]
+name = "same-file"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "scoped-tls"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
+
+[[package]]
+name = "scopeguard"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+
+[[package]]
+name = "self_cell"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813"
+
+[[package]]
+name = "semver"
+version = "1.0.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
+
+[[package]]
+name = "serde"
+version = "1.0.229"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
+dependencies = [
+ "serde_core",
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_core"
+version = "1.0.229"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.229"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.151"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
+dependencies = [
+ "itoa",
+ "memchr",
+ "serde",
+ "serde_core",
+ "zmij",
+]
+
+[[package]]
+name = "serde_repr"
+version = "0.1.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
+[[package]]
+name = "shlex"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
+
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
+dependencies = [
+ "errno",
+ "libc",
+]
+
+[[package]]
+name = "simd-adler32"
+version = "0.3.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
+
+[[package]]
+name = "simd_cesu8"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520"
+dependencies = [
+ "rustc_version",
+ "simdutf8",
+]
+
+[[package]]
+name = "simdutf8"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
+
+[[package]]
+name = "siphasher"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"
+
+[[package]]
+name = "skrifa"
+version = "0.44.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "819ab7d62b1d3e72d9d9dea5650bac30424f9111364bb94928dbf5ecad1baa68"
+dependencies = [
+ "bytemuck",
+ "read-fonts",
+]
+
+[[package]]
+name = "slab"
+version = "0.4.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
+
+[[package]]
+name = "slotmap"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038"
+dependencies = [
+ "version_check",
+]
+
+[[package]]
+name = "smallvec"
+version = "1.16.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e"
+
+[[package]]
+name = "smithay-client-toolkit"
+version = "0.19.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
+dependencies = [
+ "bitflags 2.13.2",
+ "calloop 0.13.0",
+ "calloop-wayland-source 0.3.0",
+ "cursor-icon",
+ "libc",
+ "log",
+ "memmap2",
+ "rustix 0.38.44",
+ "thiserror 1.0.69",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-csd-frame",
+ "wayland-cursor",
+ "wayland-protocols",
+ "wayland-protocols-wlr",
+ "wayland-scanner",
+ "xkeysym",
+]
+
+[[package]]
+name = "smithay-client-toolkit"
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0"
+dependencies = [
+ "bitflags 2.13.2",
+ "calloop 0.14.4",
+ "calloop-wayland-source 0.4.1",
+ "cursor-icon",
+ "libc",
+ "log",
+ "memmap2",
+ "rustix 1.1.5",
+ "thiserror 2.0.21",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-csd-frame",
+ "wayland-cursor",
+ "wayland-protocols",
+ "wayland-protocols-experimental",
+ "wayland-protocols-misc",
+ "wayland-protocols-wlr",
+ "wayland-scanner",
+ "xkeysym",
+]
+
+[[package]]
+name = "smithay-clipboard"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71704c03f739f7745053bde45fa203a46c58d25bc5c4efba1d9a60e9dba81226"
+dependencies = [
+ "libc",
+ "smithay-client-toolkit 0.20.0",
+ "wayland-backend",
+]
+
+[[package]]
+name = "smol_str"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "spirv"
+version = "0.4.0+sdk-1.4.341.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9571ea910ebd84c86af4b3ed27f9dbdc6ad06f17c5f96146b2b671e2976744f"
+dependencies = [
+ "bitflags 2.13.2",
+]
+
+[[package]]
+name = "static_assertions"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
+
+[[package]]
+name = "syn"
+version = "2.0.119"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "3.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "tempfile"
+version = "3.27.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
+dependencies = [
+ "fastrand",
+ "getrandom 0.4.3",
+ "once_cell",
+ "rustix 1.1.5",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "thiserror"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
+dependencies = [
+ "thiserror-impl 1.0.69",
+]
+
+[[package]]
+name = "thiserror"
+version = "2.0.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
+dependencies = [
+ "thiserror-impl 2.0.21",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "2.0.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
+[[package]]
+name = "tiff"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"
+dependencies = [
+ "fax",
+ "flate2",
+ "half",
+ "quick-error 2.0.1",
+ "weezl",
+ "zune-jpeg",
+]
+
+[[package]]
+name = "tokio"
+version = "1.53.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
+dependencies = [
+ "pin-project-lite",
+]
+
+[[package]]
+name = "toml_datetime"
+version = "1.1.1+spec-1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
+dependencies = [
+ "serde_core",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.25.15+spec-1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1340ea94a5856333492c9064b02c778b191dd2c853778d9609debdcdfea3a614"
+dependencies = [
+ "indexmap",
+ "toml_datetime",
+ "toml_parser",
+ "winnow",
+]
+
+[[package]]
+name = "toml_parser"
+version = "1.1.3+spec-1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56"
+dependencies = [
+ "winnow",
+]
+
+[[package]]
+name = "tracing"
+version = "0.1.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
+dependencies = [
+ "log",
+ "pin-project-lite",
+ "tracing-attributes",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-attributes"
+version = "0.1.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.36"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
+dependencies = [
+ "once_cell",
+]
+
+[[package]]
+name = "type-map"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb30dbbd9036155e74adad6812e9898d03ec374946234fbcebd5dfc7b9187b90"
+dependencies = [
+ "rustc-hash 2.1.3",
+]
+
+[[package]]
+name = "uds_windows"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
+dependencies = [
+ "memoffset",
+ "tempfile",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "unarray"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"
+
+[[package]]
+name = "unicode-general-category"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
+
+[[package]]
+name = "unicode-segmentation"
+version = "1.13.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
+
+[[package]]
+name = "unicode-width"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
+
+[[package]]
+name = "uuid"
+version = "1.26.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce"
+dependencies = [
+ "js-sys",
+ "serde_core",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "vello_common"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2e9aed918117e8152c9eddfd8362d73c465c23f26c44786aa331707b8a64fa2"
+dependencies = [
+ "bytemuck",
+ "fearless_simd",
+ "guillotiere",
+ "log",
+ "peniko",
+ "smallvec",
+ "thiserror 2.0.21",
+]
+
+[[package]]
+name = "vello_cpu"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac7349e1f55f6b801c7c277958df4ea53e7f20f21e8014910ad888b2ecda93ea"
+dependencies = [
+ "bytemuck",
+ "glifo",
+ "hashbrown 0.17.1",
+ "vello_common",
+]
+
+[[package]]
+name = "version_check"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
+
+[[package]]
+name = "wait-timeout"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "walkdir"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
+dependencies = [
+ "same-file",
+ "winapi-util",
+]
+
+[[package]]
+name = "wasip2"
+version = "1.0.4+wasi-0.2.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"
+dependencies = [
+ "wit-bindgen",
+]
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.129"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+ "rustversion",
+ "wasm-bindgen-macro",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-futures"
+version = "0.4.79"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e"
+dependencies = [
+ "js-sys",
+ "tokio",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.129"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.129"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7"
+dependencies = [
+ "bumpalo",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.129"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "wayland-backend"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38a91b4eaddff87b1cd1074985e3713da4af2c49742d1b356b2c01670a67a078"
+dependencies = [
+ "cc",
+ "downcast-rs",
+ "rustix 1.1.5",
+ "scoped-tls",
+ "smallvec",
+ "wayland-sys",
+]
+
+[[package]]
+name = "wayland-client"
+version = "0.31.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3c36a0f861ad76d0901f2800b46321410d9f73f2ea88aac0650d86c32688073"
+dependencies = [
+ "bitflags 2.13.2",
+ "rustix 1.1.5",
+ "wayland-backend",
+ "wayland-scanner",
+]
+
+[[package]]
+name = "wayland-csd-frame"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
+dependencies = [
+ "bitflags 2.13.2",
+ "cursor-icon",
+ "wayland-backend",
+]
+
+[[package]]
+name = "wayland-cursor"
+version = "0.31.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a52d18780be9b1314328a3de5f930b73d2200112e3849ca6cb11822793fb34d"
+dependencies = [
+ "rustix 1.1.5",
+ "wayland-client",
+ "xcursor",
+]
+
+[[package]]
+name = "wayland-protocols"
+version = "0.32.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23d0c813de3daa2ed6520af85a3bd49b0e722a3078506899aa9686fea58dc4b6"
+dependencies = [
+ "bitflags 2.13.2",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-scanner",
+]
+
+[[package]]
+name = "wayland-protocols-experimental"
+version = "20250721.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1"
+dependencies = [
+ "bitflags 2.13.2",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-scanner",
+]
+
+[[package]]
+name = "wayland-protocols-misc"
+version = "0.3.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6e9567599ef23e09b8dad6e429e5738d4509dfc46b3b21f32841a304d16b29c8"
+dependencies = [
+ "bitflags 2.13.2",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-scanner",
+]
+
+[[package]]
+name = "wayland-protocols-plasma"
+version = "0.3.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b6d8cf1eb2c1c31ed1f5643c88a6e53538129d4af80030c8cabd1f9fa884d91"
+dependencies = [
+ "bitflags 2.13.2",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-scanner",
+]
+
+[[package]]
+name = "wayland-protocols-wlr"
+version = "0.3.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eb04e52f7836d7c7976c78ca0250d61e33873c34156a2a1fc9474828ec268234"
+dependencies = [
+ "bitflags 2.13.2",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-scanner",
+]
+
+[[package]]
+name = "wayland-scanner"
+version = "0.31.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "338e30461b3a2b67d70eb30a6d89f8e0c93a833e07d2ae89085cd070c4a00ac0"
+dependencies = [
+ "proc-macro2",
+ "quick-xml",
+ "quote",
+]
+
+[[package]]
+name = "wayland-sys"
+version = "0.31.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be"
+dependencies = [
+ "dlib",
+ "log",
+ "once_cell",
+ "pkg-config",
+]
+
+[[package]]
+name = "web-sys"
+version = "0.3.106"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88261b9deccee56594c11a3460c462c41f58d148598fe70ad77070126a68aba4"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "web-time"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "weezl"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
+
+[[package]]
+name = "wgpu"
+version = "30.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "527ccdf43dd5b2e8676eed9984ce00e2bbb0a1b85b70c1969dcb6cd2eb55ab9e"
+dependencies = [
+ "arrayvec",
+ "bitflags 2.13.2",
+ "bytemuck",
+ "cfg-if",
+ "cfg_aliases",
+ "document-features",
+ "hashbrown 0.17.1",
+ "js-sys",
+ "log",
+ "naga",
+ "parking_lot",
+ "portable-atomic",
+ "profiling",
+ "raw-window-handle",
+ "smallvec",
+ "static_assertions",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+ "wgpu-core",
+ "wgpu-hal",
+ "wgpu-types",
+]
+
+[[package]]
+name = "wgpu-core"
+version = "30.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14c018fce9b6270aa203c2fdd56f3cce996713534bd757e4ea58c8560b121f14"
dependencies = [
- "libc",
- "windows-sys",
+ "arrayvec",
+ "bit-set 0.10.0",
+ "bit-vec 0.9.1",
+ "bitflags 2.13.2",
+ "bytemuck",
+ "cfg_aliases",
+ "document-features",
+ "hashbrown 0.17.1",
+ "indexmap",
+ "log",
+ "naga",
+ "naga-types",
+ "once_cell",
+ "parking_lot",
+ "portable-atomic",
+ "profiling",
+ "raw-window-handle",
+ "rustc-hash 1.1.0",
+ "smallvec",
+ "thiserror 2.0.21",
+ "wgpu-core-deps-apple",
+ "wgpu-core-deps-emscripten",
+ "wgpu-core-deps-wasm",
+ "wgpu-core-deps-windows-linux-android",
+ "wgpu-hal",
+ "wgpu-naga-bridge",
+ "wgpu-types",
]
[[package]]
-name = "fastrand"
-version = "2.5.0"
+name = "wgpu-core-deps-apple"
+version = "30.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
+checksum = "061f3d319a40d39d00b1ecc2c33b89fe21d4e6fe01859df3500a3a8ecccd6b68"
+dependencies = [
+ "wgpu-hal",
+]
[[package]]
-name = "fax"
-version = "0.2.7"
+name = "wgpu-core-deps-emscripten"
+version = "30.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a"
+checksum = "d98b86cf4abf524a902dd35f18ca6a3f08fc2ae9847c8f10b48e30491b1f0b86"
+dependencies = [
+ "wgpu-hal",
+]
[[package]]
-name = "fdeflate"
-version = "0.3.7"
+name = "wgpu-core-deps-wasm"
+version = "30.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"
+checksum = "d260ca2ca8adc654f513a869bf3cac0b47f5b8d3f87803d6942015f8de597aae"
dependencies = [
- "simd-adler32",
+ "wgpu-hal",
]
[[package]]
-name = "filmcraft-bitstream"
-version = "0.1.0"
+name = "wgpu-core-deps-windows-linux-android"
+version = "30.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7586165fd5f6d881cb9ce4bb71f40d6caab2c0f1837e3fc1d9788a197fb6004f"
dependencies = [
- "proptest",
+ "wgpu-hal",
]
[[package]]
-name = "filmcraft-color"
-version = "0.1.0"
+name = "wgpu-hal"
+version = "30.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6b7fb58561a792bc237628ba0792e332de418fefe145f13b5ed8201e6d52f58"
dependencies = [
- "proptest",
- "serde",
+ "android_system_properties",
+ "arrayvec",
+ "ash",
+ "bit-set 0.10.0",
+ "bitflags 2.13.2",
+ "block2 0.6.2",
+ "bytemuck",
+ "cfg-if",
+ "cfg_aliases",
+ "glow",
+ "glutin_wgl_sys",
+ "gpu-allocator",
+ "hashbrown 0.17.1",
+ "js-sys",
+ "khronos-egl",
+ "libc",
+ "libloading",
+ "log",
+ "naga",
+ "naga-types",
+ "ndk-sys",
+ "objc2 0.6.4",
+ "objc2-core-foundation",
+ "objc2-core-graphics",
+ "objc2-foundation 0.3.2",
+ "objc2-metal 0.3.2",
+ "objc2-quartz-core 0.3.2",
+ "once_cell",
+ "ordered-float",
+ "parking_lot",
+ "portable-atomic",
+ "portable-atomic-util",
+ "profiling",
+ "range-alloc",
+ "raw-window-handle",
+ "raw-window-metal",
+ "renderdoc-sys",
+ "smallvec",
+ "static_assertions",
+ "thiserror 2.0.21",
+ "wasm-bindgen",
+ "wayland-sys",
+ "web-sys",
+ "wgpu-naga-bridge",
+ "wgpu-types",
+ "windows 0.62.2",
+ "windows-core 0.62.2",
+ "windows-result 0.4.1",
]
[[package]]
-name = "filmcraft-edit"
-version = "0.1.0"
+name = "wgpu-naga-bridge"
+version = "30.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2f62e73117bb7a62bfd9c5a5841438a823f6566c6442a808ee269d2d055c081"
dependencies = [
- "filmcraft-media",
- "filmcraft-project",
- "filmcraft-time",
- "proptest",
- "thiserror",
+ "naga",
+ "wgpu-types",
]
[[package]]
-name = "filmcraft-engine"
-version = "0.1.0"
+name = "wgpu-types"
+version = "30.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "99dad6f1fbdbbdb4c278a6508b059d44688f5cebddf78d005a46a31340269286"
dependencies = [
- "filmcraft-color",
- "filmcraft-edit",
- "filmcraft-frame",
- "filmcraft-geom",
- "filmcraft-media",
- "filmcraft-project",
- "filmcraft-render",
- "filmcraft-time",
+ "bitflags 2.13.2",
+ "bytemuck",
+ "js-sys",
"log",
- "serde",
- "serde_json",
- "thiserror",
+ "naga-types",
+ "raw-window-handle",
+ "static_assertions",
+ "web-sys",
]
[[package]]
-name = "filmcraft-frame"
-version = "0.1.0"
+name = "winapi-util"
+version = "0.1.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
- "filmcraft-color",
- "filmcraft-time",
- "rayon",
- "serde",
+ "windows-sys 0.61.2",
]
[[package]]
-name = "filmcraft-geom"
-version = "0.1.0"
+name = "windows"
+version = "0.54.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49"
dependencies = [
- "proptest",
- "serde",
+ "windows-core 0.54.0",
+ "windows-targets 0.52.6",
]
[[package]]
-name = "filmcraft-isobmff"
-version = "0.1.0"
+name = "windows"
+version = "0.62.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
dependencies = [
- "filmcraft-bitstream",
- "proptest",
- "serde_json",
- "thiserror",
+ "windows-collections",
+ "windows-core 0.62.2",
+ "windows-future",
+ "windows-numerics",
]
[[package]]
-name = "filmcraft-media"
-version = "0.1.0"
+name = "windows-collections"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
dependencies = [
- "filmcraft-color",
- "filmcraft-frame",
- "filmcraft-time",
- "image",
- "rayon",
- "serde",
- "thiserror",
+ "windows-core 0.62.2",
]
[[package]]
-name = "filmcraft-project"
-version = "0.1.0"
+name = "windows-core"
+version = "0.54.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65"
dependencies = [
- "filmcraft-color",
- "filmcraft-geom",
- "filmcraft-media",
- "filmcraft-time",
- "proptest",
- "serde",
- "serde_json",
- "thiserror",
+ "windows-result 0.1.2",
+ "windows-targets 0.52.6",
]
[[package]]
-name = "filmcraft-render"
-version = "0.1.0"
+name = "windows-core"
+version = "0.62.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
dependencies = [
- "filmcraft-color",
- "filmcraft-frame",
- "filmcraft-geom",
- "filmcraft-media",
- "filmcraft-project",
- "filmcraft-time",
- "image",
- "rayon",
+ "windows-implement",
+ "windows-interface",
+ "windows-link",
+ "windows-result 0.4.1",
+ "windows-strings",
]
[[package]]
-name = "filmcraft-time"
-version = "0.1.0"
+name = "windows-future"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
dependencies = [
- "proptest",
- "serde",
+ "windows-core 0.62.2",
+ "windows-link",
+ "windows-threading",
]
[[package]]
-name = "flate2"
-version = "1.1.10"
+name = "windows-implement"
+version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb"
+checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
dependencies = [
- "crc32fast",
- "miniz_oxide 0.9.1",
- "zlib-rs",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
]
[[package]]
-name = "fnv"
-version = "1.0.7"
+name = "windows-interface"
+version = "0.59.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
[[package]]
-name = "getrandom"
-version = "0.3.4"
+name = "windows-link"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
-dependencies = [
- "cfg-if",
- "libc",
- "r-efi 5.3.0",
- "wasip2",
-]
+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
-name = "getrandom"
-version = "0.4.3"
+name = "windows-numerics"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
+checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
dependencies = [
- "cfg-if",
- "libc",
- "r-efi 6.0.0",
+ "windows-core 0.62.2",
+ "windows-link",
]
[[package]]
-name = "gif"
-version = "0.14.2"
+name = "windows-result"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159"
+checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
dependencies = [
- "color_quant",
- "weezl",
+ "windows-targets 0.52.6",
]
[[package]]
-name = "half"
-version = "2.7.1"
+name = "windows-result"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
+checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
dependencies = [
- "cfg-if",
- "crunchy",
- "zerocopy",
+ "windows-link",
]
[[package]]
-name = "image"
-version = "0.25.10"
+name = "windows-strings"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
+checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
dependencies = [
- "bytemuck",
- "byteorder-lite",
- "color_quant",
- "gif",
- "image-webp",
- "moxcms",
- "num-traits",
- "png",
- "tiff",
- "zune-core",
- "zune-jpeg",
+ "windows-link",
]
[[package]]
-name = "image-webp"
-version = "0.2.4"
+name = "windows-sys"
+version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"
+checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
dependencies = [
- "byteorder-lite",
- "quick-error 2.0.1",
+ "windows-targets 0.42.2",
]
[[package]]
-name = "itoa"
-version = "1.0.18"
+name = "windows-sys"
+version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
+dependencies = [
+ "windows-targets 0.52.6",
+]
[[package]]
-name = "libc"
-version = "0.2.189"
+name = "windows-sys"
+version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets 0.52.6",
+]
[[package]]
-name = "linux-raw-sys"
-version = "0.12.1"
+name = "windows-sys"
+version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
+checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
+dependencies = [
+ "windows-targets 0.53.5",
+]
[[package]]
-name = "log"
-version = "0.4.34"
+name = "windows-sys"
+version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
+checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
+dependencies = [
+ "windows-link",
+]
[[package]]
-name = "memchr"
-version = "2.8.3"
+name = "windows-targets"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
+checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
+dependencies = [
+ "windows_aarch64_gnullvm 0.42.2",
+ "windows_aarch64_msvc 0.42.2",
+ "windows_i686_gnu 0.42.2",
+ "windows_i686_msvc 0.42.2",
+ "windows_x86_64_gnu 0.42.2",
+ "windows_x86_64_gnullvm 0.42.2",
+ "windows_x86_64_msvc 0.42.2",
+]
[[package]]
-name = "miniz_oxide"
-version = "0.8.9"
+name = "windows-targets"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
- "adler2",
- "simd-adler32",
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
+ "windows_i686_gnullvm 0.52.6",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
]
[[package]]
-name = "miniz_oxide"
-version = "0.9.1"
+name = "windows-targets"
+version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c"
+checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
- "adler2",
- "simd-adler32",
+ "windows-link",
+ "windows_aarch64_gnullvm 0.53.1",
+ "windows_aarch64_msvc 0.53.1",
+ "windows_i686_gnu 0.53.1",
+ "windows_i686_gnullvm 0.53.1",
+ "windows_i686_msvc 0.53.1",
+ "windows_x86_64_gnu 0.53.1",
+ "windows_x86_64_gnullvm 0.53.1",
+ "windows_x86_64_msvc 0.53.1",
]
[[package]]
-name = "moxcms"
-version = "0.8.1"
+name = "windows-threading"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
+checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"
dependencies = [
- "num-traits",
- "pxfm",
+ "windows-link",
]
[[package]]
-name = "num-traits"
-version = "0.2.19"
+name = "windows_aarch64_gnullvm"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
-dependencies = [
- "autocfg",
-]
+checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]]
-name = "once_cell"
-version = "1.21.4"
+name = "windows_aarch64_gnullvm"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
-name = "png"
-version = "0.18.1"
+name = "windows_aarch64_gnullvm"
+version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
-dependencies = [
- "bitflags",
- "crc32fast",
- "fdeflate",
- "flate2",
- "miniz_oxide 0.8.9",
-]
+checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
[[package]]
-name = "ppv-lite86"
-version = "0.2.21"
+name = "windows_aarch64_msvc"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
-dependencies = [
- "zerocopy",
-]
+checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]]
-name = "proc-macro2"
-version = "1.0.107"
+name = "windows_aarch64_msvc"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
-dependencies = [
- "unicode-ident",
-]
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
-name = "proptest"
-version = "1.11.0"
+name = "windows_aarch64_msvc"
+version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
-dependencies = [
- "bit-set",
- "bit-vec",
- "bitflags",
- "num-traits",
- "rand",
- "rand_chacha",
- "rand_xorshift",
- "regex-syntax",
- "rusty-fork",
- "tempfile",
- "unarray",
-]
+checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
[[package]]
-name = "pxfm"
-version = "0.1.30"
+name = "windows_i686_gnu"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea"
+checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]]
-name = "quick-error"
-version = "1.2.3"
+name = "windows_i686_gnu"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
-name = "quick-error"
-version = "2.0.1"
+name = "windows_i686_gnu"
+version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
+checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
[[package]]
-name = "quote"
-version = "1.0.47"
+name = "windows_i686_gnullvm"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
-dependencies = [
- "proc-macro2",
-]
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
-name = "r-efi"
-version = "5.3.0"
+name = "windows_i686_gnullvm"
+version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
+checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
[[package]]
-name = "r-efi"
-version = "6.0.0"
+name = "windows_i686_msvc"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
+checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]]
-name = "rand"
-version = "0.9.5"
+name = "windows_i686_msvc"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
-dependencies = [
- "rand_chacha",
- "rand_core",
-]
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
-name = "rand_chacha"
-version = "0.9.0"
+name = "windows_i686_msvc"
+version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
-dependencies = [
- "ppv-lite86",
- "rand_core",
-]
+checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
[[package]]
-name = "rand_core"
-version = "0.9.5"
+name = "windows_x86_64_gnu"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
-dependencies = [
- "getrandom 0.3.4",
-]
+checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]]
-name = "rand_xorshift"
-version = "0.4.0"
+name = "windows_x86_64_gnu"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a"
-dependencies = [
- "rand_core",
-]
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
-name = "rayon"
-version = "1.12.0"
+name = "windows_x86_64_gnu"
+version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
-dependencies = [
- "either",
- "rayon-core",
-]
+checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
[[package]]
-name = "rayon-core"
-version = "1.13.0"
+name = "windows_x86_64_gnullvm"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
-dependencies = [
- "crossbeam-deque",
- "crossbeam-utils",
-]
+checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]]
-name = "regex-syntax"
-version = "0.8.11"
+name = "windows_x86_64_gnullvm"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
-name = "rustix"
-version = "1.1.5"
+name = "windows_x86_64_gnullvm"
+version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "891efababe418670775f199f0d233d84843c227a0949a883ce15b37c78d6629d"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys",
-]
+checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
[[package]]
-name = "rusty-fork"
-version = "0.3.1"
+name = "windows_x86_64_msvc"
+version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2"
-dependencies = [
- "fnv",
- "quick-error 1.2.3",
- "tempfile",
- "wait-timeout",
-]
+checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
-name = "serde"
-version = "1.0.229"
+name = "windows_x86_64_msvc"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
-dependencies = [
- "serde_core",
- "serde_derive",
-]
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
-name = "serde_core"
-version = "1.0.229"
+name = "windows_x86_64_msvc"
+version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
-dependencies = [
- "serde_derive",
-]
+checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
[[package]]
-name = "serde_derive"
-version = "1.0.229"
+name = "winit"
+version = "0.30.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
+checksum = "a6755fa58a9f8350bd1e472d4c3fcc25f824ec358933bba33306d0b63df5978d"
dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.6",
+ "ahash",
+ "android-activity",
+ "atomic-waker",
+ "bitflags 2.13.2",
+ "block2 0.5.1",
+ "bytemuck",
+ "calloop 0.13.0",
+ "cfg_aliases",
+ "concurrent-queue",
+ "core-foundation",
+ "core-graphics",
+ "cursor-icon",
+ "dpi",
+ "js-sys",
+ "libc",
+ "memmap2",
+ "ndk",
+ "objc2 0.5.2",
+ "objc2-app-kit 0.2.2",
+ "objc2-foundation 0.2.2",
+ "objc2-ui-kit 0.2.2",
+ "orbclient",
+ "percent-encoding",
+ "pin-project",
+ "raw-window-handle",
+ "redox_syscall 0.4.1",
+ "rustix 0.38.44",
+ "smithay-client-toolkit 0.19.2",
+ "smol_str",
+ "tracing",
+ "unicode-segmentation",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "wayland-backend",
+ "wayland-client",
+ "wayland-protocols",
+ "wayland-protocols-plasma",
+ "web-sys",
+ "web-time",
+ "windows-sys 0.52.0",
+ "x11-dl",
+ "x11rb",
+ "xkbcommon-dl",
]
[[package]]
-name = "serde_json"
-version = "1.0.151"
+name = "winnow"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
+checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
dependencies = [
- "itoa",
"memchr",
- "serde",
- "serde_core",
- "zmij",
]
[[package]]
-name = "simd-adler32"
-version = "0.3.10"
+name = "wit-bindgen"
+version = "0.57.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
+checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
[[package]]
-name = "syn"
-version = "2.0.119"
+name = "x11-dl"
+version = "2.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
+checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f"
dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
+ "libc",
+ "once_cell",
+ "pkg-config",
]
[[package]]
-name = "syn"
-version = "3.0.6"
+name = "x11rb"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
+checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414"
dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
+ "as-raw-xcb-connection",
+ "gethostname",
+ "libc",
+ "libloading",
+ "once_cell",
+ "rustix 1.1.5",
+ "x11rb-protocol",
]
[[package]]
-name = "tempfile"
-version = "3.27.0"
+name = "x11rb-protocol"
+version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
-dependencies = [
- "fastrand",
- "getrandom 0.4.3",
- "once_cell",
- "rustix",
- "windows-sys",
-]
+checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd"
[[package]]
-name = "thiserror"
-version = "2.0.21"
+name = "xcursor"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
-dependencies = [
- "thiserror-impl",
-]
+checksum = "163b33ed8786455e2fa5d72f554057ce3f3182425434f756cd39c99839d88e23"
[[package]]
-name = "thiserror-impl"
-version = "2.0.21"
+name = "xkbcommon-dl"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
+checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5"
dependencies = [
- "proc-macro2",
- "quote",
- "syn 3.0.6",
+ "bitflags 2.13.2",
+ "dlib",
+ "log",
+ "once_cell",
+ "xkeysym",
]
[[package]]
-name = "tiff"
-version = "0.11.3"
+name = "xkeysym"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"
-dependencies = [
- "fax",
- "flate2",
- "half",
- "quick-error 2.0.1",
- "weezl",
- "zune-jpeg",
-]
+checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56"
[[package]]
-name = "unarray"
-version = "0.1.4"
+name = "xml-rs"
+version = "0.8.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"
+checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7"
[[package]]
-name = "unicode-ident"
-version = "1.0.26"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
+name = "xtask"
+version = "0.1.0"
+dependencies = [
+ "serde_json",
+]
[[package]]
-name = "wait-timeout"
-version = "0.2.1"
+name = "zbus"
+version = "5.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"
+checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907"
dependencies = [
+ "async-broadcast",
+ "async-executor",
+ "async-io",
+ "async-lock",
+ "async-process",
+ "async-recursion",
+ "async-task",
+ "async-trait",
+ "blocking",
+ "enumflags2",
+ "event-listener",
+ "futures-core",
+ "futures-lite",
+ "hex",
"libc",
+ "ordered-stream",
+ "rustix 1.1.5",
+ "serde",
+ "serde_repr",
+ "tracing",
+ "uds_windows",
+ "uuid",
+ "windows-sys 0.61.2",
+ "winnow",
+ "zbus_macros",
+ "zbus_names",
+ "zvariant",
]
[[package]]
-name = "wasip2"
-version = "1.0.4+wasi-0.2.12"
+name = "zbus-lockstep"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"
+checksum = "6998de05217a084b7578728a9443d04ea4cd80f2a0839b8d78770b76ccd45863"
dependencies = [
- "wit-bindgen",
+ "zbus_xml",
+ "zvariant",
]
[[package]]
-name = "weezl"
-version = "0.1.12"
+name = "zbus-lockstep-macros"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
+checksum = "10da05367f3a7b7553c8cdf8fa91aee6b64afebe32b51c95177957efc47ca3a0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+ "zbus-lockstep",
+ "zbus_xml",
+ "zvariant",
+]
[[package]]
-name = "windows-link"
-version = "0.2.1"
+name = "zbus_macros"
+version = "5.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
+checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40"
+dependencies = [
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+ "zbus_names",
+ "zvariant",
+ "zvariant_utils",
+]
[[package]]
-name = "windows-sys"
-version = "0.61.2"
+name = "zbus_names"
+version = "4.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
+checksum = "d8bf88b4a3ff53e883001e0e0115b297a9d53c31b9c1edd2bfdd853e3428624e"
dependencies = [
- "windows-link",
+ "serde",
+ "winnow",
+ "zvariant",
]
[[package]]
-name = "wit-bindgen"
-version = "0.57.1"
+name = "zbus_xml"
+version = "5.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
+checksum = "d1586c021a01ca0a9216dcd874e546382e156a5cbab5fab6cb5f10087e22682a"
+dependencies = [
+ "serde",
+ "winnow",
+ "zbus_names",
+ "zvariant",
+]
[[package]]
-name = "xtask"
-version = "0.1.0"
+name = "zcheapstr"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473"
dependencies = [
- "serde_json",
+ "serde",
]
[[package]]
@@ -828,3 +4580,44 @@ checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
dependencies = [
"zune-core",
]
+
+[[package]]
+name = "zvariant"
+version = "5.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1d34c27cc6cdd1f458427519dd6b8612f7b7e3f7b9a0b2355d041dda9869147"
+dependencies = [
+ "endi",
+ "enumflags2",
+ "serde",
+ "winnow",
+ "zcheapstr",
+ "zvariant_derive",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zvariant_derive"
+version = "5.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "864155e69b4352db0c7f374917bf45d1e0c8d17659c8b3dbf9795f3673f8c497"
+dependencies = [
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zvariant_utils"
+version = "4.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde",
+ "syn 3.0.6",
+ "winnow",
+]
diff --git a/Cargo.toml b/Cargo.toml
index ffbb35251..8534bc619 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[workspace]
resolver = "3"
-members = ["crates/*", "xtask"]
-default-members = ["crates/*", "xtask"]
+members = ["crates/*", "apps/*", "xtask"]
+default-members = ["crates/*", "apps/*", "xtask"]
[workspace.package]
version = "0.1.0"
diff --git a/apps/filmcraft/Cargo.toml b/apps/filmcraft/Cargo.toml
new file mode 100644
index 000000000..f20909310
--- /dev/null
+++ b/apps/filmcraft/Cargo.toml
@@ -0,0 +1,20 @@
+[package]
+name = "filmcraft"
+description = "FilmCraft desktop app"
+version.workspace = true
+edition.workspace = true
+license.workspace = true
+default-run = "filmcraft"
+
+[lints]
+workspace = true
+
+[dependencies]
+filmcraft-engine = { workspace = true }
+filmcraft-ui-egui = { workspace = true }
+egui = { workspace = true }
+eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "wayland", "x11"] }
+serde_json = { workspace = true }
+log = { workspace = true }
+rfd = { workspace = true }
+cpal = "0.16"
diff --git a/apps/filmcraft/src/audio.rs b/apps/filmcraft/src/audio.rs
new file mode 100644
index 000000000..a83a625c4
--- /dev/null
+++ b/apps/filmcraft/src/audio.rs
@@ -0,0 +1,61 @@
+//! cpal audio output: the playback master clock.
+
+use std::sync::Arc;
+use std::sync::atomic::{AtomicU64, Ordering};
+
+use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
+use filmcraft_ui_egui::AudioOut;
+
+pub struct CpalOut {
+ stream: Option<cpal::Stream>,
+ played: Arc<AtomicU64>,
+ rate: u32,
+}
+
+impl CpalOut {
+ pub fn new() -> Option<Self> {
+ let host = cpal::default_host();
+ let dev = host.default_output_device()?;
+ let cfg = dev.default_output_config().ok()?;
+ Some(Self { stream: None, played: Arc::new(AtomicU64::new(0)), rate: cfg.sample_rate().0 })
+ }
+}
+
+impl AudioOut for CpalOut {
+ fn start(&mut self, mut fill: Box<dyn FnMut(&mut [f32], usize) + Send>) -> Result<u32, String> {
+ self.stop();
+ let host = cpal::default_host();
+ let dev = host.default_output_device().ok_or("no output device")?;
+ let cfg = dev.default_output_config().map_err(|e| e.to_string())?;
+ let channels = cfg.channels() as usize;
+ let config: cpal::StreamConfig = cfg.clone().into();
+ self.played.store(0, Ordering::SeqCst);
+ let played = self.played.clone();
+ let err = |e| eprintln!("filmcraft: audio stream error: {e}");
+ let stream = match cfg.sample_format() {
+ cpal::SampleFormat::F32 => dev.build_output_stream(
+ &config,
+ move |buf: &mut [f32], _| {
+ fill(buf, channels);
+ played.fetch_add((buf.len() / channels) as u64, Ordering::SeqCst);
+ },
+ err,
+ None,
+ ),
+ other => return Err(format!("unsupported sample format {other:?}")),
+ }
+ .map_err(|e| e.to_string())?;
+ stream.play().map_err(|e| e.to_string())?;
+ self.stream = Some(stream);
+ Ok(self.rate)
+ }
+ fn stop(&mut self) {
+ self.stream = None;
+ }
+ fn sample_rate(&self) -> u32 {
+ self.rate
+ }
+ fn played_frames(&self) -> Option<u64> {
+ self.stream.as_ref().map(|_| self.played.load(Ordering::SeqCst))
+ }
+}
diff --git a/apps/filmcraft/src/control_server.rs b/apps/filmcraft/src/control_server.rs
new file mode 100644
index 000000000..7516c836b
--- /dev/null
+++ b/apps/filmcraft/src/control_server.rs
@@ -0,0 +1,61 @@
+//! Localhost JSON-lines control server (one request per line, one reply per line). Loopback only.
+
+use std::io::{BufRead, BufReader, Write};
+use std::net::{TcpListener, TcpStream};
+use std::sync::mpsc::{Receiver, Sender, channel};
+use std::time::Duration;
+
+use filmcraft_ui_egui::ControlRequest;
+use serde_json::{Value, json};
+
+pub fn start(port: u16, ctx: egui::Context) -> Receiver<ControlRequest> {
+ let (tx, rx) = channel::<ControlRequest>();
+ let listener = match TcpListener::bind(("127.0.0.1", port)) {
+ Ok(l) => l,
+ Err(e) => {
+ eprintln!("filmcraft: control server failed to bind 127.0.0.1:{port}: {e}");
+ return rx;
+ }
+ };
+ eprintln!("filmcraft: control server listening on 127.0.0.1:{port}");
+ std::thread::spawn(move || {
+ for stream in listener.incoming().flatten() {
+ let tx = tx.clone();
+ let ctx = ctx.clone();
+ std::thread::spawn(move || serve(stream, tx, ctx));
+ }
+ });
+ rx
+}
+
+fn serve(stream: TcpStream, tx: Sender<ControlRequest>, ctx: egui::Context) {
+ let Ok(read) = stream.try_clone() else { return };
+ let mut out = stream;
+ for line in BufReader::new(read).lines() {
+ let Ok(line) = line else { break };
+ if line.trim().is_empty() {
+ continue;
+ }
+ let reply = match serde_json::from_str::<Value>(&line) {
+ Ok(msg) => {
+ let id = msg.get("id").cloned().unwrap_or(Value::Null);
+ let method = msg.get("method").and_then(Value::as_str).unwrap_or("").to_string();
+ let params = msg.get("params").cloned().unwrap_or(json!({}));
+ let (req, rrx) = ControlRequest::new(method, params);
+ if tx.send(req).is_err() {
+ break;
+ }
+ ctx.request_repaint();
+ let mut r = rrx.recv_timeout(Duration::from_secs(60)).unwrap_or_else(|_| json!({"ok": false, "error": "timeout"}));
+ if let Some(o) = r.as_object_mut() {
+ o.insert("id".into(), id);
+ }
+ r
+ }
+ Err(e) => json!({"ok": false, "error": format!("bad JSON: {e}")}),
+ };
+ if writeln!(out, "{reply}").is_err() {
+ break;
+ }
+ }
+}
diff --git a/apps/filmcraft/src/main.rs b/apps/filmcraft/src/main.rs
new file mode 100644
index 000000000..7b287b0cb
--- /dev/null
+++ b/apps/filmcraft/src/main.rs
@@ -0,0 +1,80 @@
+//! FilmCraft desktop app.
+//!
+//! Usage: `filmcraft [--control <port>] [--demo] [project.fcproj | media files…]`
+//!
+//! `--control <port>` (or `FILMCRAFT_CONTROL_PORT`) starts a localhost JSON-lines control server;
+//! see `filmcraft_ui_egui::control` for the methods.
+
+mod audio;
+mod control_server;
+
+use filmcraft_engine::Session;
+use filmcraft_ui_egui::FilmcraftApp;
+use serde_json::json;
+
+fn main() -> eframe::Result {
+ let mut control_port: Option<u16> = std::env::var("FILMCRAFT_CONTROL_PORT").ok().and_then(|p| p.parse().ok());
+ let mut files = Vec::new();
+ let mut demo = true;
+ let mut args = std::env::args().skip(1);
+ while let Some(a) = args.next() {
+ match a.as_str() {
+ "--control" => control_port = args.next().and_then(|p| p.parse().ok()),
+ "--demo" => demo = true,
+ "--empty" => demo = false,
+ "--version" => {
+ println!("filmcraft {}", env!("CARGO_PKG_VERSION"));
+ return Ok(());
+ }
+ _ => files.push(a),
+ }
+ }
+ let options = eframe::NativeOptions {
+ viewport: egui::ViewportBuilder::default()
+ .with_title("FilmCraft")
+ .with_inner_size([1600.0, 980.0])
+ .with_min_inner_size([900.0, 560.0])
+ .with_drag_and_drop(true)
+ .with_fullsize_content_view(true)
+ .with_titlebar_shown(false)
+ .with_title_shown(false),
+ ..Default::default()
+ };
+ eframe::run_native(
+ "FilmCraft",
+ options,
+ Box::new(move |cc| {
+ let mut session = Session::default();
+ let project = files.iter().find(|f| f.ends_with(".fcproj")).cloned();
+ if let Some(p) = project {
+ if let Err(e) = session.execute("file.open", json!({"path": p})) {
+ eprintln!("filmcraft: {e}");
+ }
+ } else if demo {
+ let _ = session.execute("file.openDemoProject", json!({}));
+ }
+ let media: Vec<String> = files.iter().filter(|f| !f.ends_with(".fcproj")).cloned().collect();
+ if !media.is_empty() {
+ let _ = session.execute("file.import", json!({"paths": media}));
+ }
+ let mut app = FilmcraftApp::new(session);
+ app.integrated_titlebar = cfg!(target_os = "macos");
+ if let Some(out) = audio::CpalOut::new() {
+ app.audio = Some(Box::new(out));
+ }
+ app.hooks.pick_files = Some(Box::new(|exts: &[&str]| {
+ rfd::FileDialog::new().add_filter("Media", exts).pick_files().unwrap_or_default().into_iter().map(|p| p.to_string_lossy().to_string()).collect()
+ }));
+ app.hooks.pick_save = Some(Box::new(|name: &str| {
+ rfd::FileDialog::new().add_filter("FilmCraft Project", &["fcproj"]).set_file_name(name).save_file().map(|p| p.to_string_lossy().to_string())
+ }));
+ app.hooks.pick_open_project =
+ Some(Box::new(|| rfd::FileDialog::new().add_filter("FilmCraft Project", &["fcproj"]).pick_file().map(|p| p.to_string_lossy().to_string())));
+ if let Some(port) = control_port {
+ let rx = control_server::start(port, cc.egui_ctx.clone());
+ app = app.with_control(rx);
+ }
+ Ok(Box::new(app))
+ }),
+ )
+}
diff --git a/assets/README.md b/assets/README.md
new file mode 100644
index 000000000..b7984e038
--- /dev/null
+++ b/assets/README.md
@@ -0,0 +1,8 @@
+# Third-party assets
+
+| File | Licence | Source |
+|---|---|---|
+| `fonts/Inter-*.ttf` | SIL OFL 1.1 (`fonts/OFL-Inter.txt`) | https://rsms.me/inter |
+| `fonts/JetBrainsMono-Regular.ttf` | SIL OFL 1.1 (`fonts/OFL-JetBrainsMono.txt`) | https://www.jetbrains.com/lp/mono/ |
+
+All icons are drawn in code (`crates/ui-egui/src/icons.rs`); no Adobe artwork is used.
diff --git a/assets/fonts/Inter-Medium.ttf b/assets/fonts/Inter-Medium.ttf
new file mode 100644
index 000000000..458cd0601
Binary files /dev/null and b/assets/fonts/Inter-Medium.ttf differ
diff --git a/assets/fonts/Inter-Regular.ttf b/assets/fonts/Inter-Regular.ttf
new file mode 100644
index 000000000..b7aaca8de
Binary files /dev/null and b/assets/fonts/Inter-Regular.ttf differ
diff --git a/assets/fonts/Inter-SemiBold.ttf b/assets/fonts/Inter-SemiBold.ttf
new file mode 100644
index 000000000..47f8ab1d6
Binary files /dev/null and b/assets/fonts/Inter-SemiBold.ttf differ
diff --git a/assets/fonts/JetBrainsMono-Regular.ttf b/assets/fonts/JetBrainsMono-Regular.ttf
new file mode 100644
index 000000000..711830ede
Binary files /dev/null and b/assets/fonts/JetBrainsMono-Regular.ttf differ
diff --git a/assets/fonts/OFL-Inter.txt b/assets/fonts/OFL-Inter.txt
new file mode 100644
index 000000000..9b2ca37b3
--- /dev/null
+++ b/assets/fonts/OFL-Inter.txt
@@ -0,0 +1,92 @@
+Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION AND CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/assets/fonts/OFL-JetBrainsMono.txt b/assets/fonts/OFL-JetBrainsMono.txt
new file mode 100644
index 000000000..5ceee0025
--- /dev/null
+++ b/assets/fonts/OFL-JetBrainsMono.txt
@@ -0,0 +1,93 @@
+Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/crates/engine/src/demo.rs b/crates/engine/src/demo.rs
index 715cbb8ed..2161b4df3 100644
--- a/crates/engine/src/demo.rs
+++ b/crates/engine/src/demo.rs
@@ -1,3 +1,4 @@
+#![allow(clippy::option_map_unit_fn)]
//! A ready-made demo project (synthetic footage, a cut sequence with transitions, titles-free
//! effects, markers and music) so the editor shows a realistic workspace with no files at all.
diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml
new file mode 100644
index 000000000..88f70b7f4
--- /dev/null
+++ b/crates/ui-egui/Cargo.toml
@@ -0,0 +1,27 @@
+[package]
+name = "filmcraft-ui-egui"
+description = "The FilmCraft egui frontend (swappable): panels, docking, timeline, monitors, control channel"
+version.workspace = true
+edition.workspace = true
+license.workspace = true
+rust-version.workspace = true
+
+[lints]
+workspace = true
+
+[dependencies]
+filmcraft-time = { workspace = true }
+filmcraft-geom = { workspace = true }
+filmcraft-color = { workspace = true }
+filmcraft-frame = { workspace = true }
+filmcraft-media = { workspace = true }
+filmcraft-project = { workspace = true }
+filmcraft-edit = { workspace = true }
+filmcraft-render = { workspace = true }
+filmcraft-engine = { workspace = true }
+egui = { workspace = true }
+eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] }
+serde = { workspace = true }
+serde_json = { workspace = true }
+log = { workspace = true }
+rayon = { workspace = true }
diff --git a/crates/ui-egui/src/automation.rs b/crates/ui-egui/src/automation.rs
new file mode 100644
index 000000000..9b9ae3bb9
--- /dev/null
+++ b/crates/ui-egui/src/automation.rs
@@ -0,0 +1,36 @@
+//! Automation registry: every interactive element registers a stable id and its screen rect each
+//! frame, so agents can click/drag by id (`ui.click {id:"timeline.track.V1.lock"}`) and
+//! `ui.inspect` can report the full on-screen widget tree.
+
+use egui::Rect;
+use serde::Serialize;
+
+#[derive(Clone, Debug, Serialize)]
+pub struct Element {
+ pub id: String,
+ pub label: String,
+ pub rect: [f32; 4],
+}
+
+#[derive(Default)]
+pub struct Registry {
+ pub elements: Vec<Element>,
+ /// Last frame's elements (for lookups from control handlers between frames).
+ pub previous: Vec<Element>,
+}
+
+impl Registry {
+ pub fn add(&mut self, id: &str, rect: Rect, label: &str) {
+ self.elements.push(Element { id: id.to_string(), label: label.to_string(), rect: [rect.min.x, rect.min.y, rect.width(), rect.height()] });
+ }
+ pub fn begin_frame(&mut self) {
+ self.previous = std::mem::take(&mut self.elements);
+ }
+ pub fn find(&self, id: &str) -> Option<&Element> {
+ self.previous.iter().chain(self.elements.iter()).find(|e| e.id == id)
+ }
+ /// Elements whose id starts with a prefix.
+ pub fn query(&self, prefix: &str) -> Vec<&Element> {
+ self.previous.iter().filter(|e| e.id.starts_with(prefix)).collect()
+ }
+}
diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs
new file mode 100644
index 000000000..adf0b6c6a
--- /dev/null
+++ b/crates/ui-egui/src/control.rs
@@ -0,0 +1,383 @@
+//! Programmatic control of the running app (agents, tests, MCP bridge).
+//!
+//! Transport-agnostic: a transport thread (TCP in the desktop app) sends [`ControlRequest`]s; the
+//! UI thread handles them between frames and replies with `{"ok":…, "result"|"error":…}`.
+//!
+//! Methods:
+//! - `engine.execute {command, params}` / `ui.menu.invoke {id}`: run any engine or UI command
+//! - `engine.commands`: list engine commands; `ui.menu.list`: menu tree with enablement
+//! - `ui.inspect`: UI state + every registered widget (`elements`: id, label, rect)
+//! - `ui.elements {prefix?}`: registered widgets (optionally filtered by id prefix)
+//! - `ui.set {tool?, workspace?, mode?, theme?, focused?, playbackRes?, timeline?:{pps,scroll}}`
+//! - `ui.panel.show {panel}` / `ui.panel.close {panel}`
+//! - `ui.click {id | x,y, button?, count?, modifiers?}` / `ui.move {x,y}` / `ui.scroll {x,y,dx,dy}`
+//! - `ui.drag {from:{id|x,y}, to:{id|x,y}, steps?, modifiers?}`: synthetic press-move-release
+//! - `ui.key {key, command?, shift?, alt?, ctrl?}` / `ui.type {text}`
+//! - `ui.timeline.hit {x, y}`: what the timeline shows at a point (track, clip, edge, time)
+//! - `ui.timeline.locate {clip, edge?}`: screen point of a clip body/edge (for drags)
+//! - `ui.playback {action: play|stop|toggle, speed?}`
+//! - `ui.screenshot {path?, panel?}`: PNG of the window (or one panel)
+//! - `ui.resize {width, height}` / `ui.focus` / `app.quit`
+
+use std::sync::mpsc::Sender;
+
+use serde_json::{Value, json};
+
+use crate::FilmcraftApp;
+use crate::dock::PanelKind;
+use crate::state::{Mode, PlaybackRes, Tool};
+
+pub struct ControlRequest {
+ pub method: String,
+ pub params: Value,
+ pub reply: Sender<Value>,
+}
+
+impl ControlRequest {
+ pub fn new(method: impl Into<String>, params: Value) -> (Self, std::sync::mpsc::Receiver<Value>) {
+ let (tx, rx) = std::sync::mpsc::channel();
+ (Self { method: method.into(), params, reply: tx }, rx)
+ }
+}
+
+pub enum Outcome {
+ Done(Value),
+ /// Reply once queued synthetic input has been processed.
+ AfterInput,
+ Screenshot {
+ path: Option<String>,
+ crop: Option<[f32; 4]>,
+ },
+}
+
+fn ok(v: Value) -> Outcome {
+ Outcome::Done(json!({"ok": true, "result": v}))
+}
+fn err(e: impl std::fmt::Display) -> Outcome {
+ Outcome::Done(json!({"ok": false, "error": e.to_string()}))
+}
+
+fn modifiers(p: &Value) -> egui::Modifiers {
+ let m = p.get("modifiers").unwrap_or(p);
+ let b = |k: &str| m.get(k).and_then(Value::as_bool).unwrap_or(false);
+ egui::Modifiers { alt: b("alt"), ctrl: b("ctrl"), shift: b("shift"), mac_cmd: cfg!(target_os = "macos") && b("command"), command: b("command") }
+}
+
+/// Resolve a point from `{id}` (element centre) or `{x, y}`.
+fn point(app: &FilmcraftApp, p: &Value) -> Result<egui::Pos2, String> {
+ if let Some(id) = p.get("id").and_then(Value::as_str) {
+ let e = app.auto.find(id).ok_or_else(|| format!("no element `{id}` (see ui.elements)"))?;
+ let fx = p.get("fx").and_then(Value::as_f64).unwrap_or(0.5) as f32;
+ let fy = p.get("fy").and_then(Value::as_f64).unwrap_or(0.5) as f32;
+ return Ok(egui::pos2(e.rect[0] + e.rect[2] * fx, e.rect[1] + e.rect[3] * fy));
+ }
+ let x = p.get("x").and_then(Value::as_f64).ok_or("need `id` or `x`,`y`")?;
+ let y = p.get("y").and_then(Value::as_f64).ok_or("need `y`")?;
+ Ok(egui::pos2(x as f32, y as f32))
+}
+
+pub fn handle(app: &mut FilmcraftApp, ctx: &egui::Context, req: &ControlRequest) -> Outcome {
+ let p = &req.params;
+ let s = |k: &str| p.get(k).and_then(Value::as_str);
+ match req.method.as_str() {
+ "engine.execute" | "ui.menu.invoke" => {
+ let Some(id) = s("command").or(s("id")) else { return err("missing `command`") };
+ let params = p.get("params").cloned().unwrap_or(json!({}));
+ match crate::menus::invoke(app, ctx, id, params) {
+ Ok(v) => ok(v),
+ Err(e) => err(e),
+ }
+ }
+ "engine.commands" => match app.session.execute("command.list", json!({})) {
+ Ok(v) => ok(v),
+ Err(e) => err(e),
+ },
+ "ui.menu.list" => ok(serde_json::to_value(crate::menus::menu_items(app)).unwrap_or_default()),
+ "ui.inspect" => ok(inspect(app, ctx)),
+ "ui.elements" => {
+ let prefix = s("prefix").unwrap_or("");
+ ok(serde_json::to_value(app.auto.query(prefix)).unwrap_or_default())
+ }
+ "ui.set" => {
+ if let Some(t) = s("tool") {
+ match Tool::from_name(t) {
+ Some(t) => app.ui.tool = t,
+ None => return err(format!("unknown tool `{t}`")),
+ }
+ }
+ if let Some(w) = s("workspace") {
+ match crate::dock::WORKSPACES.iter().find(|x| x.eq_ignore_ascii_case(w)) {
+ Some(w) => app.set_workspace(w),
+ None => return err(format!("unknown workspace `{w}`")),
+ }
+ }
+ if let Some(m) = s("mode") {
+ app.ui.mode = match m.to_ascii_lowercase().as_str() {
+ "import" => Mode::Import,
+ "export" => Mode::Export,
+ _ => Mode::Edit,
+ };
+ }
+ if let Some(th) = s("theme") {
+ match crate::theme::ThemeKind::from_name(th) {
+ Some(k) => app.set_theme(ctx, k),
+ None => return err("unknown theme (dark, medium, light)"),
+ }
+ }
+ if let Some(f) = s("focused").and_then(PanelKind::from_name) {
+ app.ui.focused = f;
+ }
+ if let Some(r) = s("playbackRes") {
+ app.ui.program.res = PlaybackRes::ALL
+ .into_iter()
+ .find(|x| x.label().eq_ignore_ascii_case(r) || format!("{x:?}").eq_ignore_ascii_case(r))
+ .unwrap_or(app.ui.program.res);
+ }
+ if let Some(tl) = p.get("timeline") {
+ if let Some(v) = tl.get("pps").and_then(Value::as_f64) {
+ app.ui.timeline.target_pps = v;
+ }
+ if let Some(v) = tl.get("scroll").and_then(Value::as_f64) {
+ app.ui.timeline.target_scroll = v;
+ }
+ if tl.get("fit").and_then(Value::as_bool) == Some(true) {
+ app.ui.timeline.fit_pending = true;
+ }
+ if let Some(v) = tl.get("videoTrackHeight").and_then(Value::as_f64) {
+ app.ui.timeline.video_track_h = v as f32;
+ }
+ if let Some(v) = tl.get("audioTrackHeight").and_then(Value::as_f64) {
+ app.ui.timeline.audio_track_h = v as f32;
+ }
+ }
+ if let Some(v) = p.get("safeMargins").and_then(Value::as_bool) {
+ app.ui.program.safe_margins = v;
+ }
+ ok(Value::Null)
+ }
+ "ui.panel.show" | "ui.panel.close" => {
+ let Some(panel) = s("panel").and_then(PanelKind::from_name) else { return err("unknown `panel`") };
+ if req.method == "ui.panel.show" {
+ app.show_panel(panel);
+ } else {
+ app.ui.dock.close(panel);
+ }
+ ok(Value::Null)
+ }
+ "ui.click" | "ui.move" => {
+ let pos = match point(app, p) {
+ Ok(p) => p,
+ Err(e) => return err(e),
+ };
+ let m = modifiers(p);
+ app.synthetic.push(egui::Event::PointerMoved(pos));
+ if req.method == "ui.click" {
+ let button = match s("button") {
+ Some("right") => egui::PointerButton::Secondary,
+ Some("middle") => egui::PointerButton::Middle,
+ _ => egui::PointerButton::Primary,
+ };
+ let count = p.get("count").and_then(Value::as_u64).unwrap_or(1);
+ for _ in 0..count {
+ app.synthetic.push(egui::Event::PointerButton { pos, button, pressed: true, modifiers: m });
+ app.synthetic.push(egui::Event::PointerButton { pos, button, pressed: false, modifiers: m });
+ }
+ }
+ Outcome::AfterInput
+ }
+ "ui.drag" => {
+ let (Some(from), Some(to)) = (p.get("from"), p.get("to")) else { return err("need `from` and `to`") };
+ let (a, b) = match (point(app, from), point(app, to)) {
+ (Ok(a), Ok(b)) => (a, b),
+ (Err(e), _) | (_, Err(e)) => return err(e),
+ };
+ let steps = p.get("steps").and_then(Value::as_u64).unwrap_or(12).max(2);
+ let m = modifiers(p);
+ app.synthetic.push(egui::Event::PointerMoved(a));
+ app.synthetic.push(egui::Event::PointerButton { pos: a, button: egui::PointerButton::Primary, pressed: true, modifiers: m });
+ for i in 1..=steps {
+ let f = i as f32 / steps as f32;
+ app.synthetic.push(egui::Event::PointerMoved(a + (b - a) * f));
+ }
+ app.synthetic.push(egui::Event::PointerButton { pos: b, button: egui::PointerButton::Primary, pressed: false, modifiers: m });
+ Outcome::AfterInput
+ }
+ "ui.scroll" => {
+ let pos = match point(app, p) {
+ Ok(p) => p,
+ Err(e) => return err(e),
+ };
+ let dx = p.get("dx").and_then(Value::as_f64).unwrap_or(0.0) as f32;
+ let dy = p.get("dy").and_then(Value::as_f64).unwrap_or(0.0) as f32;
+ app.synthetic.push(egui::Event::PointerMoved(pos));
+ app.synthetic.push(egui::Event::MouseWheel {
+ unit: egui::MouseWheelUnit::Point,
+ delta: egui::vec2(dx, dy),
+ modifiers: modifiers(p),
+ phase: egui::TouchPhase::Move,
+ });
+ app.synthetic.push(egui::Event::PointerButton {
+ pos: egui::pos2(-100.0, -100.0),
+ button: egui::PointerButton::Extra1,
+ pressed: false,
+ modifiers: Default::default(),
+ });
+ Outcome::AfterInput
+ }
+ "ui.key" => {
+ let Some(name) = s("key") else { return err("missing `key`") };
+ let Some((mut m, key)) = crate::menus::parse_shortcut(name) else { return err(format!("unknown key `{name}`")) };
+ let extra = modifiers(p);
+ m = m | extra;
+ app.synthetic.push(egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers: m });
+ app.synthetic.push(egui::Event::Key { key, physical_key: None, pressed: false, repeat: false, modifiers: m });
+ Outcome::AfterInput
+ }
+ "ui.type" => {
+ let Some(text) = s("text") else { return err("missing `text`") };
+ app.synthetic.push(egui::Event::Text(text.to_string()));
+ app.synthetic.push(egui::Event::Key { key: egui::Key::F35, physical_key: None, pressed: false, repeat: false, modifiers: Default::default() });
+ Outcome::AfterInput
+ }
+ "ui.timeline.hit" => {
+ let pos = match point(app, p) {
+ Ok(p) => p,
+ Err(e) => return err(e),
+ };
+ ok(crate::panels::timeline::hit_json(app, pos))
+ }
+ "ui.timeline.locate" => {
+ let Some(c) = p.get("clip").and_then(Value::as_u64) else { return err("need `clip`") };
+ match crate::panels::timeline::locate(app, c, s("edge")) {
+ Some((x, y)) => ok(json!({"x": x, "y": y})),
+ None => err("clip not visible in the timeline"),
+ }
+ }
+ "ui.playback" => {
+ match s("action").unwrap_or("toggle") {
+ "play" => app.play(p.get("speed").and_then(Value::as_f64).unwrap_or(1.0)),
+ "stop" => app.stop(),
+ _ => app.toggle_play(1.0),
+ }
+ ok(json!({"playing": app.playback.playing, "playhead": app.session.playhead().0}))
+ }
+ "ui.screenshot" => {
+ let crop = s("panel").and_then(PanelKind::from_name).and_then(|pk| app.auto.find(&format!("panel.{}", pk.id())).map(|e| e.rect));
+ let crop = crop.or_else(|| s("id").and_then(|id| app.auto.find(id).map(|e| e.rect)));
+ ctx.send_viewport_cmd(egui::ViewportCommand::Focus);
+ ctx.request_repaint();
+ Outcome::Screenshot { path: s("path").map(str::to_string), crop }
+ }
+ "ui.resize" => {
+ let w = p.get("width").and_then(Value::as_f64).unwrap_or(1600.0) as f32;
+ let h = p.get("height").and_then(Value::as_f64).unwrap_or(1000.0) as f32;
+ ctx.send_viewport_cmd(egui::ViewportCommand::InnerSize(egui::vec2(w, h)));
+ ok(Value::Null)
+ }
+ "ui.focus" => {
+ ctx.send_viewport_cmd(egui::ViewportCommand::Focus);
+ ok(Value::Null)
+ }
+ "app.quit" => {
+ ctx.send_viewport_cmd(egui::ViewportCommand::Close);
+ ok(Value::Null)
+ }
+ m => err(format!("unknown method `{m}`")),
+ }
+}
+
+pub fn inspect(app: &FilmcraftApp, ctx: &egui::Context) -> Value {
+ let size = ctx.content_rect().size();
+ json!({
+ "window": [size.x, size.y],
+ "pixelsPerPoint": ctx.pixels_per_point(),
+ "fps": app.fps,
+ "ui": app.ui,
+ "playback": {"playing": app.playback.playing, "speed": app.playback.speed, "loop": app.playback.looping, "audioClock": app.playback.audio_clock},
+ "playhead": app.session.playhead().0,
+ "activeSequence": app.session.state.active_sequence.map(|i| i.0),
+ "selection": app.session.state.selection.iter().map(|c| c.0).collect::<Vec<_>>(),
+ "elements": app.auto.previous.len(),
+ "dialog": app.dialog.map(|d| format!("{d:?}")),
+ })
+}
+
+/// Save a screenshot (optionally cropped to a rect in points) as PNG; returns the reply JSON.
+pub fn save_screenshot(ctx: &egui::Context, image: &egui::ColorImage, path: Option<&str>, crop: Option<[f32; 4]>) -> Value {
+ let ppp = ctx.pixels_per_point();
+ let [w, h] = image.size;
+ let (x0, y0, cw, ch) = match crop {
+ Some([x, y, cw, ch]) => {
+ let x0 = ((x * ppp) as usize).min(w);
+ let y0 = ((y * ppp) as usize).min(h);
+ (x0, y0, ((cw * ppp) as usize).min(w - x0), ((ch * ppp) as usize).min(h - y0))
+ }
+ None => (0, 0, w, h),
+ };
+ let mut rgba = Vec::with_capacity(cw * ch * 4);
+ for y in y0..y0 + ch {
+ for x in x0..x0 + cw {
+ let c = image.pixels[y * w + x];
+ rgba.extend_from_slice(&[c.r(), c.g(), c.b(), 255]);
+ }
+ }
+ let path = path.map(str::to_string).unwrap_or_else(|| std::env::temp_dir().join("filmcraft-screenshot.png").to_string_lossy().to_string());
+ match encode_png(&rgba, cw as u32, ch as u32) {
+ Ok(png) => match std::fs::write(&path, png) {
+ Ok(()) => json!({"ok": true, "result": {"path": path, "width": cw, "height": ch}}),
+ Err(e) => json!({"ok": false, "error": e.to_string()}),
+ },
+ Err(e) => json!({"ok": false, "error": e}),
+ }
+}
+
+/// Minimal PNG encoder (stored deflate blocks, no compression dependency).
+pub fn encode_png(rgba: &[u8], w: u32, h: u32) -> Result<Vec<u8>, String> {
+ fn chunk(out: &mut Vec<u8>, ty: &[u8], data: &[u8]) {
+ out.extend_from_slice(&(data.len() as u32).to_be_bytes());
+ let mut c = Vec::with_capacity(4 + data.len());
+ c.extend_from_slice(ty);
+ c.extend_from_slice(data);
+ out.extend_from_slice(&c);
+ out.extend_from_slice(&crc(&c).to_be_bytes());
+ }
+ fn crc(d: &[u8]) -> u32 {
+ let mut c = 0xFFFF_FFFFu32;
+ for &b in d {
+ c ^= b as u32;
+ for _ in 0..8 {
+ c = if c & 1 != 0 { (c >> 1) ^ 0xEDB8_8320 } else { c >> 1 };
+ }
+ }
+ !c
+ }
+ let mut raw = Vec::with_capacity((w as usize * 4 + 1) * h as usize);
+ for y in 0..h as usize {
+ raw.push(0);
+ raw.extend_from_slice(&rgba[y * w as usize * 4..(y + 1) * w as usize * 4]);
+ }
+ // zlib stream with stored blocks
+ let mut z = vec![0x78, 0x01];
+ for (i, block) in raw.chunks(65535).enumerate() {
+ let last = (i + 1) * 65535 >= raw.len();
+ z.push(last as u8);
+ z.extend_from_slice(&(block.len() as u16).to_le_bytes());
+ z.extend_from_slice(&(!(block.len() as u16)).to_le_bytes());
+ z.extend_from_slice(block);
+ }
+ let (mut a, mut b) = (1u32, 0u32);
+ for &x in &raw {
+ a = (a + x as u32) % 65521;
+ b = (b + a) % 65521;
+ }
+ z.extend_from_slice(&((b << 16) | a).to_be_bytes());
+ let mut out = vec![0x89, b'P', b'N', b'G', 0x0D, 0x0A, 0x1A, 0x0A];
+ let mut ihdr = Vec::new();
+ ihdr.extend_from_slice(&w.to_be_bytes());
+ ihdr.extend_from_slice(&h.to_be_bytes());
+ ihdr.extend_from_slice(&[8, 6, 0, 0, 0]);
+ chunk(&mut out, b"IHDR", &ihdr);
+ chunk(&mut out, b"IDAT", &z);
+ chunk(&mut out, b"IEND", &[]);
+ Ok(out)
+}
diff --git a/crates/ui-egui/src/dock.rs b/crates/ui-egui/src/dock.rs
new file mode 100644
index 000000000..e4ef2fcd1
--- /dev/null
+++ b/crates/ui-egui/src/dock.rs
@@ -0,0 +1,477 @@
+//! Premiere-style docking: a tree of splits and tab groups. Panels are rounded frames separated by
+//! thin gutters; each group has a tab strip (active tab bright, with a panel menu "≡"); the focused
+//! panel gets a blue outline. Gutters drag to resize; workspaces are serialized trees.
+
+use egui::{Align2, Color32, Rect, Sense, Stroke, StrokeKind, pos2, vec2};
+use serde::{Deserialize, Serialize};
+
+use crate::icons::{self, Icon};
+use crate::theme::Tokens;
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
+pub enum PanelKind {
+ Project,
+ MediaBrowser,
+ Libraries,
+ Info,
+ Effects,
+ Markers,
+ History,
+ Source,
+ EffectControls,
+ AudioClipMixer,
+ Metadata,
+ Program,
+ Timeline,
+ Tools,
+ AudioMeters,
+ AudioTrackMixer,
+ LumetriColor,
+ LumetriScopes,
+ EssentialGraphics,
+ EssentialSound,
+ Properties,
+ Text,
+}
+
+impl PanelKind {
+ pub const ALL: [PanelKind; 22] = [
+ PanelKind::Project,
+ PanelKind::MediaBrowser,
+ PanelKind::Libraries,
+ PanelKind::Info,
+ PanelKind::Effects,
+ PanelKind::Markers,
+ PanelKind::History,
+ PanelKind::Source,
+ PanelKind::EffectControls,
+ PanelKind::AudioClipMixer,
+ PanelKind::Metadata,
+ PanelKind::Program,
+ PanelKind::Timeline,
+ PanelKind::Tools,
+ PanelKind::AudioMeters,
+ PanelKind::AudioTrackMixer,
+ PanelKind::LumetriColor,
+ PanelKind::LumetriScopes,
+ PanelKind::EssentialGraphics,
+ PanelKind::EssentialSound,
+ PanelKind::Properties,
+ PanelKind::Text,
+ ];
+ pub fn title(self) -> &'static str {
+ match self {
+ PanelKind::Project => "Project",
+ PanelKind::MediaBrowser => "Media Browser",
+ PanelKind::Libraries => "Libraries",
+ PanelKind::Info => "Info",
+ PanelKind::Effects => "Effects",
+ PanelKind::Markers => "Markers",
+ PanelKind::History => "History",
+ PanelKind::Source => "Source",
+ PanelKind::EffectControls => "Effect Controls",
+ PanelKind::AudioClipMixer => "Audio Clip Mixer",
+ PanelKind::Metadata => "Metadata",
+ PanelKind::Program => "Program",
+ PanelKind::Timeline => "Timeline",
+ PanelKind::Tools => "Tools",
+ PanelKind::AudioMeters => "Audio Meters",
+ PanelKind::AudioTrackMixer => "Audio Track Mixer",
+ PanelKind::LumetriColor => "Lumetri Color",
+ PanelKind::LumetriScopes => "Lumetri Scopes",
+ PanelKind::EssentialGraphics => "Essential Graphics",
+ PanelKind::EssentialSound => "Essential Sound",
+ PanelKind::Properties => "Properties",
+ PanelKind::Text => "Text",
+ }
+ }
+ pub fn id(self) -> String {
+ format!("{self:?}")
+ }
+ pub fn from_name(s: &str) -> Option<PanelKind> {
+ let n = s.to_ascii_lowercase().replace([' ', '_', '-'], "");
+ Self::ALL.iter().copied().find(|p| format!("{p:?}").to_ascii_lowercase() == n || p.title().to_ascii_lowercase().replace(' ', "") == n)
+ }
+ /// Window-menu shortcut (Premiere: Shift+1..9).
+ pub fn window_shortcut(self) -> Option<&'static str> {
+ match self {
+ PanelKind::Project => Some("Shift+1"),
+ PanelKind::Source => Some("Shift+2"),
+ PanelKind::Timeline => Some("Shift+3"),
+ PanelKind::Program => Some("Shift+4"),
+ PanelKind::EffectControls => Some("Shift+5"),
+ PanelKind::AudioClipMixer => Some("Shift+6"),
+ PanelKind::Effects => Some("Shift+7"),
+ PanelKind::MediaBrowser => Some("Shift+8"),
+ PanelKind::AudioTrackMixer => Some("Shift+9"),
+ _ => None,
+ }
+ }
+ /// Narrow chrome-less panels (no tab strip; a slim grip instead).
+ pub fn compact(self) -> bool {
+ matches!(self, PanelKind::Tools | PanelKind::AudioMeters)
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
+pub enum SplitSize {
+ Ratio(f32),
+ /// First child has a fixed size in points.
+ FixedA(f32),
+ /// Second child has a fixed size in points.
+ FixedB(f32),
+}
+
+#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
+pub enum DockNode {
+ /// `vertical`: children stacked top/bottom; else side by side.
+ Split {
+ vertical: bool,
+ size: SplitSize,
+ a: Box<DockNode>,
+ b: Box<DockNode>,
+ },
+ Tabs {
+ panels: Vec<PanelKind>,
+ active: usize,
+ },
+}
+
+fn tabs(p: &[PanelKind], active: usize) -> DockNode {
+ DockNode::Tabs { panels: p.to_vec(), active }
+}
+fn hsplit(size: SplitSize, a: DockNode, b: DockNode) -> DockNode {
+ DockNode::Split { vertical: false, size, a: Box::new(a), b: Box::new(b) }
+}
+fn vsplit(size: SplitSize, a: DockNode, b: DockNode) -> DockNode {
+ DockNode::Split { vertical: true, size, a: Box::new(a), b: Box::new(b) }
+}
+
+pub const WORKSPACES: [&str; 9] = ["Editing", "Assembly", "Color", "Effects", "Audio", "Captions and Graphics", "Learning", "Review", "All Panels"];
+
+/// The default layout of a named workspace.
+pub fn workspace(name: &str) -> DockNode {
+ use PanelKind::*;
+ use SplitSize::*;
+ let bottom_editing = || hsplit(FixedA(38.0), tabs(&[Tools], 0), hsplit(FixedB(58.0), tabs(&[Timeline], 0), tabs(&[AudioMeters], 0)));
+ match name {
+ "Assembly" => vsplit(
+ Ratio(0.52),
+ hsplit(
+ Ratio(0.46),
+ tabs(&[Project, MediaBrowser, Libraries, Info, Effects, Markers, History], 0),
+ hsplit(Ratio(0.5), tabs(&[Source, EffectControls, AudioClipMixer, Metadata], 0), tabs(&[Program], 0)),
+ ),
+ bottom_editing(),
+ ),
+ "Color" => vsplit(
+ Ratio(0.58),
+ hsplit(
+ FixedB(330.0),
+ hsplit(Ratio(0.42), tabs(&[LumetriScopes, Source, EffectControls], 0), tabs(&[Program], 0)),
+ tabs(&[LumetriColor, Effects], 0),
+ ),
+ hsplit(FixedB(330.0), hsplit(Ratio(0.3), tabs(&[Project, Info, Markers, History], 0), bottom_editing()), tabs(&[LumetriColor], 0)),
+ ),
+ "Effects" => hsplit(
+ FixedB(320.0),
+ vsplit(
+ Ratio(0.5),
+ hsplit(Ratio(0.5), tabs(&[Source, EffectControls, AudioClipMixer], 1), tabs(&[Program], 0)),
+ hsplit(Ratio(0.3), tabs(&[Project, MediaBrowser, Info, Markers, History], 0), bottom_editing()),
+ ),
+ vsplit(Ratio(0.5), tabs(&[Effects], 0), tabs(&[EffectControls, EssentialGraphics], 1)),
+ ),
+ "Audio" => hsplit(
+ FixedB(320.0),
+ vsplit(
+ Ratio(0.5),
+ hsplit(Ratio(0.5), tabs(&[AudioTrackMixer, Source, AudioClipMixer, EffectControls], 0), tabs(&[Program], 0)),
+ hsplit(Ratio(0.3), tabs(&[Project, MediaBrowser, Effects, Markers, History], 0), bottom_editing()),
+ ),
+ tabs(&[EssentialSound], 0),
+ ),
+ "Captions and Graphics" => hsplit(
+ FixedB(330.0),
+ vsplit(
+ Ratio(0.5),
+ hsplit(Ratio(0.4), tabs(&[Text, Source, EffectControls], 0), tabs(&[Program], 0)),
+ hsplit(Ratio(0.3), tabs(&[Project, MediaBrowser, Libraries], 0), bottom_editing()),
+ ),
+ tabs(&[EssentialGraphics, Properties], 0),
+ ),
+ "All Panels" => vsplit(
+ Ratio(0.5),
+ hsplit(
+ Ratio(0.5),
+ tabs(&[Source, EffectControls, AudioClipMixer, Metadata, LumetriScopes, Text], 0),
+ hsplit(Ratio(0.6), tabs(&[Program], 0), tabs(&[LumetriColor, EssentialGraphics, EssentialSound, Properties, AudioTrackMixer], 0)),
+ ),
+ hsplit(Ratio(0.26), tabs(&[Project, MediaBrowser, Libraries, Info, Effects, Markers, History], 0), bottom_editing()),
+ ),
+ // Editing (default), Learning, Review
+ _ => vsplit(
+ Ratio(0.5),
+ hsplit(Ratio(0.5), tabs(&[Source, EffectControls, AudioClipMixer, Metadata], 0), tabs(&[Program], 0)),
+ hsplit(Ratio(0.27), tabs(&[Project, MediaBrowser, Libraries, Info, Effects, Markers, History], 0), bottom_editing()),
+ ),
+ }
+}
+
+impl DockNode {
+ /// Every panel in the tree.
+ pub fn panels(&self, out: &mut Vec<PanelKind>) {
+ match self {
+ DockNode::Split { a, b, .. } => {
+ a.panels(out);
+ b.panels(out);
+ }
+ DockNode::Tabs { panels, .. } => out.extend(panels.iter().copied()),
+ }
+ }
+ pub fn contains(&self, p: PanelKind) -> bool {
+ let mut v = Vec::new();
+ self.panels(&mut v);
+ v.contains(&p)
+ }
+ /// Make `p` the active tab of its group. Returns false if not present.
+ pub fn activate(&mut self, p: PanelKind) -> bool {
+ match self {
+ DockNode::Split { a, b, .. } => a.activate(p) || b.activate(p),
+ DockNode::Tabs { panels, active } => {
+ if let Some(i) = panels.iter().position(|x| *x == p) {
+ *active = i;
+ true
+ } else {
+ false
+ }
+ }
+ }
+ }
+ pub fn is_visible(&self, p: PanelKind) -> bool {
+ match self {
+ DockNode::Split { a, b, .. } => a.is_visible(p) || b.is_visible(p),
+ DockNode::Tabs { panels, active } => panels.get(*active) == Some(&p),
+ }
+ }
+ /// Close a panel (remove its tab; empty groups collapse their split).
+ pub fn close(&mut self, p: PanelKind) {
+ if let DockNode::Split { a, b, .. } = self {
+ a.close(p);
+ b.close(p);
+ let empty = |n: &DockNode| matches!(n, DockNode::Tabs { panels, .. } if panels.is_empty());
+ if empty(a) {
+ *self = (**b).clone();
+ } else if empty(b) {
+ *self = (**a).clone();
+ }
+ } else if let DockNode::Tabs { panels, active } = self {
+ panels.retain(|x| *x != p);
+ *active = (*active).min(panels.len().saturating_sub(1));
+ }
+ }
+ /// Add a panel as a tab next to `near` (or into the first group).
+ pub fn open_near(&mut self, p: PanelKind, near: PanelKind) {
+ if self.contains(p) {
+ self.activate(p);
+ return;
+ }
+ fn add(n: &mut DockNode, p: PanelKind, near: PanelKind) -> bool {
+ match n {
+ DockNode::Split { a, b, .. } => add(a, p, near) || add(b, p, near),
+ DockNode::Tabs { panels, active } => {
+ if panels.contains(&near) {
+ panels.push(p);
+ *active = panels.len() - 1;
+ true
+ } else {
+ false
+ }
+ }
+ }
+ }
+ if !add(self, p, near) && !add(self, p, PanelKind::Project) {
+ add(self, p, PanelKind::Program);
+ }
+ }
+}
+
+/// One laid-out tab group.
+pub struct Group {
+ pub path: String,
+ pub rect: Rect,
+ pub content: Rect,
+ pub panels: Vec<PanelKind>,
+ pub active: usize,
+}
+
+/// Actions produced by interacting with the dock chrome.
+#[derive(Debug, Clone, PartialEq)]
+pub enum DockAction {
+ Activate(PanelKind),
+ Focus(PanelKind),
+ Close(PanelKind),
+ PanelMenu(PanelKind, egui::Pos2),
+}
+
+/// Lay out the tree into group rects (with `gap` gutters) and handle gutter dragging.
+pub fn layout(ui: &mut egui::Ui, node: &mut DockNode, rect: Rect, t: &Tokens, path: &str, out: &mut Vec<Group>, reg: &mut crate::automation::Registry) {
+ match node {
+ DockNode::Tabs { panels, active } => {
+ let tab_h = if panels.len() == 1 && panels[0].compact() { 8.0 } else { t.tab_h };
+ let content = Rect::from_min_max(pos2(rect.min.x, rect.min.y + tab_h), rect.max);
+ out.push(Group { path: path.to_string(), rect, content, panels: panels.clone(), active: *active });
+ }
+ DockNode::Split { vertical, size, a, b } => {
+ let g = t.gap;
+ let total = if *vertical { rect.height() } else { rect.width() };
+ let avail = (total - g).max(0.0);
+ let first = match *size {
+ SplitSize::Ratio(r) => avail * r,
+ SplitSize::FixedA(px) => px.min(avail - 20.0),
+ SplitSize::FixedB(px) => avail - px.min(avail - 20.0),
+ }
+ .clamp(20.0_f32.min(avail), (avail - 20.0).max(0.0));
+ let (ra, gutter, rb) = if *vertical {
+ (
+ Rect::from_min_max(rect.min, pos2(rect.max.x, rect.min.y + first)),
+ Rect::from_min_max(pos2(rect.min.x, rect.min.y + first), pos2(rect.max.x, rect.min.y + first + g)),
+ Rect::from_min_max(pos2(rect.min.x, rect.min.y + first + g), rect.max),
+ )
+ } else {
+ (
+ Rect::from_min_max(rect.min, pos2(rect.min.x + first, rect.max.y)),
+ Rect::from_min_max(pos2(rect.min.x + first, rect.min.y), pos2(rect.min.x + first + g, rect.max.y)),
+ Rect::from_min_max(pos2(rect.min.x + first + g, rect.min.y), rect.max),
+ )
+ };
+ // gutter drag (a slightly larger hit area than the visible gap)
+ let hit = gutter.expand2(if *vertical { vec2(0.0, 3.0) } else { vec2(3.0, 0.0) });
+ let id = egui::Id::new(("dock-gutter", path.to_string()));
+ let resp = ui.interact(hit, id, Sense::drag());
+ reg.add(&format!("dock.gutter.{path}"), hit, "gutter");
+ if resp.hovered() || resp.dragged() {
+ ui.ctx().set_cursor_icon(if *vertical { egui::CursorIcon::ResizeVertical } else { egui::CursorIcon::ResizeHorizontal });
+ }
+ if resp.dragged() {
+ let d = if *vertical { resp.drag_delta().y } else { resp.drag_delta().x };
+ let nf = (first + d).clamp(40.0, (avail - 40.0).max(40.0));
+ *size = match *size {
+ SplitSize::Ratio(_) => SplitSize::Ratio(nf / avail.max(1.0)),
+ SplitSize::FixedA(_) => SplitSize::FixedA(nf),
+ SplitSize::FixedB(_) => SplitSize::FixedB(avail - nf),
+ };
+ }
+ if resp.dragged() || resp.hovered() {
+ ui.painter().rect_filled(gutter, 0.0, t.focus.gamma_multiply(if resp.dragged() { 0.9 } else { 0.4 }));
+ }
+ layout(ui, a, ra, t, &format!("{path}a"), out, reg);
+ layout(ui, b, rb, t, &format!("{path}b"), out, reg);
+ }
+ }
+}
+
+/// Draw a group's frame + tab strip. Returns actions (tab clicks, panel menu, focus).
+pub fn draw_group_chrome(ui: &mut egui::Ui, g: &Group, focused: PanelKind, t: &Tokens, reg: &mut crate::automation::Registry) -> Vec<DockAction> {
+ let mut actions = Vec::new();
+ let painter = ui.painter().clone();
+ painter.rect_filled(g.rect, t.radius, t.panel_bg);
+ let active_panel = g.panels.get(g.active).copied();
+ let compact = g.panels.len() == 1 && g.panels[0].compact();
+ if compact {
+ // grip dots
+ let c = pos2(g.rect.center().x, g.rect.min.y + 4.0);
+ for dx in [-4.0, 0.0, 4.0] {
+ painter.circle_filled(c + vec2(dx, 0.0), 1.0, t.text_faint);
+ }
+ } else {
+ let strip = Rect::from_min_size(g.rect.min, vec2(g.rect.width(), t.tab_h));
+ let mut x = strip.min.x + 10.0;
+ for (i, p) in g.panels.iter().enumerate() {
+ let is_active = i == g.active;
+ let font = if is_active { Tokens::semibold(12.0) } else { Tokens::ui(12.0) };
+ let galley = painter.layout_no_wrap(p.title().to_string(), font, if is_active { t.tab_text_active } else { t.tab_text });
+ let menu_w = if is_active { 18.0 } else { 0.0 };
+ let w = galley.size().x + 16.0 + menu_w;
+ if x + w > strip.max.x - 20.0 && i > g.active {
+ // overflow chevron
+ let r = Rect::from_min_size(pos2(strip.max.x - 22.0, strip.min.y + 4.0), vec2(18.0, t.tab_h - 8.0));
+ let resp = ui.interact(r, egui::Id::new(("tab-overflow", g.path.clone())), Sense::click());
+ icons::paint(&painter, r.shrink(3.0), Icon::ChevronRight, t.tab_text);
+ icons::paint(&painter, r.shrink(3.0).translate(vec2(4.0, 0.0)), Icon::ChevronRight, t.tab_text);
+ if resp.clicked() {
+ let next = g.panels[(g.active + 1) % g.panels.len()];
+ actions.push(DockAction::Activate(next));
+ }
+ break;
+ }
+ let tab = Rect::from_min_size(pos2(x, strip.min.y), vec2(w, t.tab_h));
+ let resp = ui.interact(tab, egui::Id::new(("tab", g.path.clone(), i)), Sense::click());
+ reg.add(&format!("panel.tab.{}", p.id()), tab, p.title());
+ if resp.hovered() && !is_active {
+ painter.rect_filled(tab.shrink2(vec2(2.0, 4.0)), t.radius_sm, t.hover);
+ }
+ painter.galley(pos2(tab.min.x + 8.0, tab.center().y - galley.size().y / 2.0), galley, Color32::WHITE);
+ if is_active {
+ let mr = Rect::from_center_size(pos2(tab.max.x - 8.0 - menu_w / 2.0 + 4.0, tab.center().y), vec2(14.0, 14.0));
+ let mresp = ui.interact(mr, egui::Id::new(("tab-menu", g.path.clone())), Sense::click());
+ reg.add(&format!("panel.menu.{}", p.id()), mr, "panel menu");
+ icons::paint(&painter, mr, Icon::Hamburger, if mresp.hovered() { t.tab_text_active } else { t.tab_text });
+ if mresp.clicked() {
+ actions.push(DockAction::PanelMenu(*p, mr.left_bottom()));
+ }
+ }
+ if resp.clicked() {
+ actions.push(DockAction::Activate(*p));
+ actions.push(DockAction::Focus(*p));
+ }
+ if resp.middle_clicked() {
+ actions.push(DockAction::Close(*p));
+ }
+ x += w + 2.0;
+ }
+ }
+ // focus outline
+ if active_panel == Some(focused) {
+ painter.rect_stroke(g.rect.shrink(0.5), t.radius, Stroke::new(1.5, t.focus), StrokeKind::Inside);
+ }
+ // clicking anywhere in the panel focuses it
+ if let Some(p) = active_panel
+ && ui.rect_contains_pointer(g.rect)
+ && ui.input(|i| i.pointer.any_pressed())
+ {
+ actions.push(DockAction::Focus(p));
+ }
+ actions
+}
+
+/// Placeholder body for panels that are not implemented yet.
+pub fn placeholder(ui: &mut egui::Ui, rect: Rect, t: &Tokens, text: &str) {
+ ui.painter().text(rect.center(), Align2::CENTER_CENTER, text, Tokens::ui(12.0), t.text_faint);
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn workspaces_contain_core_panels() {
+ for w in WORKSPACES {
+ let d = workspace(w);
+ assert!(d.contains(PanelKind::Timeline), "{w}");
+ assert!(d.contains(PanelKind::Program), "{w}");
+ }
+ }
+
+ #[test]
+ fn close_and_open() {
+ let mut d = workspace("Editing");
+ d.close(PanelKind::Metadata);
+ assert!(!d.contains(PanelKind::Metadata));
+ d.open_near(PanelKind::LumetriColor, PanelKind::Program);
+ assert!(d.is_visible(PanelKind::LumetriColor));
+ let s = serde_json::to_string(&d).unwrap();
+ let back: DockNode = serde_json::from_str(&s).unwrap();
+ assert_eq!(back, d);
+ }
+}
diff --git a/crates/ui-egui/src/frames.rs b/crates/ui-egui/src/frames.rs
new file mode 100644
index 000000000..b56c7afa2
--- /dev/null
+++ b/crates/ui-egui/src/frames.rs
@@ -0,0 +1,217 @@
+//! Background frame rendering for monitors, thumbnails and playback prefetch.
+//!
+//! A small pool of worker threads pulls prioritised jobs (the frame on screen first, then the
+//! frames playback will need next, then thumbnails). Results land in a byte-budgeted cache keyed
+//! by (target, frame, scale, revision); the UI shows the exact frame when ready and otherwise holds
+//! the nearest frame it already has, so scrubbing never flashes black and never blocks the UI.
+
+use std::collections::{HashMap, VecDeque};
+use std::sync::{Arc, Condvar, Mutex};
+
+use filmcraft_engine::{MediaPool, Services};
+use filmcraft_project::{ItemId, Project};
+use filmcraft_time::Tick;
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
+pub enum Target {
+ /// Composite of a sequence at a timeline time.
+ Sequence(ItemId),
+ /// A single project item at a media time (Source monitor, thumbnails).
+ Item(ItemId),
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
+pub struct FrameKey {
+ pub target: Target,
+ pub frame: i64,
+ /// Output width in pixels (thumbnails) or scale ×1000 (monitors).
+ pub size: u32,
+ pub revision: u64,
+}
+
+pub struct Rgba {
+ pub w: usize,
+ pub h: usize,
+ pub px: Vec<u8>,
+}
+
+struct Job {
+ key: FrameKey,
+ time: Tick,
+ /// Output scale relative to the target's frame size.
+ scale: f32,
+ project: Arc<Project>,
+ prio: u32,
+}
+
+struct Shared {
+ queue: Mutex<VecDeque<Job>>,
+ cv: Condvar,
+ done: Mutex<Cache>,
+ in_flight: Mutex<Vec<FrameKey>>,
+}
+
+struct Cache {
+ map: HashMap<FrameKey, (Arc<Rgba>, u64)>,
+ bytes: usize,
+ budget: usize,
+ clock: u64,
+}
+
+impl Cache {
+ fn insert(&mut self, k: FrameKey, v: Arc<Rgba>) {
+ self.clock += 1;
+ self.bytes += v.px.len();
+ if let Some((old, _)) = self.map.insert(k, (v, self.clock)) {
+ self.bytes -= old.px.len();
+ }
+ if self.bytes > self.budget {
+ let mut all: Vec<(u64, FrameKey, usize)> = self.map.iter().map(|(k, (v, s))| (*s, *k, v.px.len())).collect();
+ all.sort_unstable_by_key(|x| x.0);
+ for (_, k, b) in all {
+ if self.bytes <= self.budget * 8 / 10 {
+ break;
+ }
+ self.map.remove(&k);
+ self.bytes -= b;
+ }
+ }
+ }
+}
+
+pub struct FrameServer {
+ shared: Arc<Shared>,
+ pub pool: Arc<MediaPool>,
+ pub services: Arc<dyn Services>,
+ repaint: Arc<Mutex<Option<egui::Context>>>,
+}
+
+impl FrameServer {
+ pub fn new(pool: Arc<MediaPool>, services: Arc<dyn Services>, workers: usize) -> Self {
+ let shared = Arc::new(Shared {
+ queue: Mutex::new(VecDeque::new()),
+ cv: Condvar::new(),
+ done: Mutex::new(Cache { map: HashMap::new(), bytes: 0, budget: 768 << 20, clock: 0 }),
+ in_flight: Mutex::new(Vec::new()),
+ });
+ let repaint: Arc<Mutex<Option<egui::Context>>> = Arc::new(Mutex::new(None));
+ #[cfg(not(target_arch = "wasm32"))]
+ for i in 0..workers.max(1) {
+ let sh = shared.clone();
+ let pool = pool.clone();
+ let services = services.clone();
+ let rp = repaint.clone();
+ std::thread::Builder::new().name(format!("filmcraft-frames-{i}")).spawn(move || worker(sh, pool, services, rp)).ok();
+ }
+ #[cfg(target_arch = "wasm32")]
+ let _ = workers;
+ Self { shared, pool, services, repaint }
+ }
+
+ pub fn set_context(&self, ctx: &egui::Context) {
+ let mut g = self.repaint.lock().unwrap_or_else(|e| e.into_inner());
+ if g.is_none() {
+ *g = Some(ctx.clone());
+ }
+ }
+
+ pub fn get(&self, k: &FrameKey) -> Option<Arc<Rgba>> {
+ let mut c = self.shared.done.lock().unwrap_or_else(|e| e.into_inner());
+ c.clock += 1;
+ let clock = c.clock;
+ c.map.get_mut(k).map(|(v, s)| {
+ *s = clock;
+ v.clone()
+ })
+ }
+
+ /// Queue a job unless it is cached, queued or in flight.
+ pub fn request(&self, key: FrameKey, time: Tick, scale: f32, project: &Arc<Project>, prio: u32) {
+ if self.shared.done.lock().unwrap_or_else(|e| e.into_inner()).map.contains_key(&key) {
+ return;
+ }
+ if self.shared.in_flight.lock().unwrap_or_else(|e| e.into_inner()).contains(&key) {
+ return;
+ }
+ let mut q = self.shared.queue.lock().unwrap_or_else(|e| e.into_inner());
+ if let Some(j) = q.iter_mut().find(|j| j.key == key) {
+ j.prio = j.prio.min(prio);
+ return;
+ }
+ q.push_back(Job { key, time, scale, project: project.clone(), prio });
+ drop(q);
+ self.shared.cv.notify_one();
+ #[cfg(target_arch = "wasm32")]
+ self.run_one_sync();
+ }
+
+ /// Drop queued jobs that fail `keep` (e.g. stale revisions or frames far from the playhead).
+ pub fn retain_queue(&self, keep: impl Fn(&FrameKey) -> bool) {
+ self.shared.queue.lock().unwrap_or_else(|e| e.into_inner()).retain(|j| keep(&j.key));
+ }
+
+ pub fn queue_len(&self) -> usize {
+ self.shared.queue.lock().unwrap_or_else(|e| e.into_inner()).len()
+ }
+
+ /// The most recent cached frame for `target` at or before `frame` within `max_back` frames.
+ pub fn nearest(&self, target: Target, frame: i64, size: u32, revision: u64, max_back: i64) -> Option<Arc<Rgba>> {
+ for d in 0..=max_back {
+ if let Some(v) = self.get(&FrameKey { target, frame: frame - d, size, revision }) {
+ return Some(v);
+ }
+ }
+ None
+ }
+
+ #[cfg(target_arch = "wasm32")]
+ fn run_one_sync(&self) {
+ let job = { self.shared.queue.lock().unwrap_or_else(|e| e.into_inner()).pop_front() };
+ if let Some(job) = job {
+ let img = render_job(&job, &self.pool, &self.services);
+ self.shared.done.lock().unwrap_or_else(|e| e.into_inner()).insert(job.key, Arc::new(img));
+ }
+ }
+}
+
+#[cfg(not(target_arch = "wasm32"))]
+fn worker(sh: Arc<Shared>, pool: Arc<MediaPool>, services: Arc<dyn Services>, repaint: Arc<Mutex<Option<egui::Context>>>) {
+ loop {
+ let job = {
+ let mut q = sh.queue.lock().unwrap_or_else(|e| e.into_inner());
+ loop {
+ if !q.is_empty() {
+ // highest priority (lowest number) first; FIFO among equals
+ let best = q.iter().enumerate().min_by_key(|(i, j)| (j.prio, *i)).map(|(i, _)| i).unwrap_or(0);
+ break q.remove(best).expect("index valid");
+ }
+ q = sh.cv.wait(q).unwrap_or_else(|e| e.into_inner());
+ }
+ };
+ sh.in_flight.lock().unwrap_or_else(|e| e.into_inner()).push(job.key);
+ let img = render_job(&job, &pool, &services);
+ sh.done.lock().unwrap_or_else(|e| e.into_inner()).insert(job.key, Arc::new(img));
+ sh.in_flight.lock().unwrap_or_else(|e| e.into_inner()).retain(|k| *k != job.key);
+ if let Some(ctx) = repaint.lock().unwrap_or_else(|e| e.into_inner()).as_ref() {
+ ctx.request_repaint();
+ }
+ }
+}
+
+fn render_job(job: &Job, pool: &Arc<MediaPool>, services: &Arc<dyn Services>) -> Rgba {
+ let provider = pool.provider(job.project.clone(), services.clone());
+ let img = match job.key.target {
+ Target::Sequence(seq) => Some(filmcraft_render::render_sequence(
+ &job.project,
+ seq,
+ job.time,
+ filmcraft_render::RenderOptions { scale: job.scale, ..Default::default() },
+ &provider,
+ )),
+ Target::Item(item) => filmcraft_render::render_item(&job.project, item, job.time, job.scale, &provider),
+ };
+ match img {
+ Some(img) => Rgba { w: img.w, h: img.h, px: img.over_black_rgba8() },
+ None => Rgba { w: 1, h: 1, px: vec![0, 0, 0, 255] },
+ }
+}
diff --git a/crates/ui-egui/src/header.rs b/crates/ui-egui/src/header.rs
new file mode 100644
index 000000000..64f2749be
--- /dev/null
+++ b/crates/ui-egui/src/header.rs
@@ -0,0 +1,130 @@
+//! The header bar: app mark + menus on the left, Import / Edit / Export mode tabs in the centre,
+//! project title, workspace switcher and quick actions on the right.
+
+use egui::{Align2, Color32, Rect, Sense, Stroke, pos2, vec2};
+
+use crate::FilmcraftApp;
+use crate::icons::{self, Icon};
+use crate::state::Mode;
+use crate::theme::Tokens;
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let p = ui.painter().clone();
+ p.rect_filled(rect, 0.0, t.header_bg);
+ p.line_segment([rect.left_bottom(), rect.right_bottom()], Stroke::new(1.0, Color32::from_rgb(0, 0, 0)));
+ // Window drag area (integrated title bar on macOS).
+ let drag = ui.interact(rect, egui::Id::new("header-drag"), Sense::click_and_drag());
+ if drag.drag_started() {
+ ui.ctx().send_viewport_cmd(egui::ViewportCommand::StartDrag);
+ }
+ if drag.double_clicked() {
+ let max = ui.ctx().input(|i| i.viewport().maximized.unwrap_or(false));
+ ui.ctx().send_viewport_cmd(egui::ViewportCommand::Maximized(!max));
+ }
+ let mut x = rect.min.x + if app.integrated_titlebar { 78.0 } else { 10.0 };
+ // App mark: a small film-frame glyph in the accent colour.
+ let mark = Rect::from_center_size(pos2(x + 11.0, rect.center().y), vec2(22.0, 22.0));
+ p.rect_filled(mark, 5.0, Color32::from_rgb(38, 28, 90));
+ p.rect_stroke(mark, 5.0, Stroke::new(1.0, Color32::from_rgb(120, 104, 255)), egui::StrokeKind::Inside);
+ p.text(mark.center(), Align2::CENTER_CENTER, "Fc", Tokens::semibold(11.0), Color32::from_rgb(200, 190, 255));
+ app.auto.add("header.home", mark, "Home");
+ x = mark.max.x + 8.0;
+ // Menu bar
+ let menu_rect = Rect::from_min_max(pos2(x, rect.min.y + 6.0), pos2(x + 560.0, rect.max.y - 6.0));
+ let mut mu = ui.new_child(egui::UiBuilder::new().max_rect(menu_rect).layout(egui::Layout::left_to_right(egui::Align::Center)));
+ mu.style_mut().visuals.widgets.inactive.weak_bg_fill = Color32::TRANSPARENT;
+ mu.style_mut().visuals.widgets.inactive.bg_stroke = Stroke::NONE;
+ crate::menus::menu_bar(app, &mut mu);
+ // Mode tabs centred
+ let modes = [(Mode::Import, "Import"), (Mode::Edit, "Edit"), (Mode::Export, "Export")];
+ let tab_w = 74.0;
+ let total = tab_w * 3.0;
+ let mut tx = rect.center().x - total / 2.0;
+ for (m, label) in modes {
+ let r = Rect::from_min_size(pos2(tx, rect.min.y + 6.0), vec2(tab_w, rect.height() - 12.0));
+ let resp = ui.interact(r, egui::Id::new(("mode", label)), Sense::click());
+ app.auto.add(&format!("header.mode.{}", label.to_ascii_lowercase()), r, label);
+ let active = app.ui.mode == m;
+ if resp.hovered() && !active {
+ p.rect_filled(r, 5.0, t.hover);
+ }
+ p.text(
+ r.center() - vec2(0.0, 1.0),
+ Align2::CENTER_CENTER,
+ label,
+ if active { Tokens::semibold(13.0) } else { Tokens::ui(13.0) },
+ if active { t.tab_text_active } else { t.tab_text },
+ );
+ if active {
+ let u = Rect::from_center_size(pos2(r.center().x, r.max.y - 1.0), vec2(label.len() as f32 * 7.5, 2.0));
+ p.rect_filled(u, 1.0, t.tab_text_active);
+ }
+ if resp.clicked() {
+ app.ui.mode = m;
+ }
+ tx += tab_w;
+ }
+ // Right side: title, workspaces, quick export, fullscreen
+ let mut rx = rect.max.x - 12.0;
+ let btn = |ui: &mut egui::Ui, rx: &mut f32, icon: Icon, id: &str, tip: &str, app: &mut FilmcraftApp| -> bool {
+ let r = Rect::from_center_size(pos2(*rx - 14.0, rect.center().y), vec2(28.0, 28.0));
+ *rx -= 32.0;
+ let resp = ui.interact(r, egui::Id::new(("hdr", id)), Sense::click()).on_hover_text(tip);
+ app.auto.add(&format!("header.{id}"), r, tip);
+ if resp.hovered() {
+ ui.painter().rect_filled(r, 5.0, t.hover);
+ }
+ icons::paint(ui.painter(), r.shrink(7.0), icon, t.icon);
+ resp.clicked()
+ };
+ if btn(ui, &mut rx, Icon::Fullscreen, "fullscreen", "Full screen", app) {
+ let fs = ui.ctx().input(|i| i.viewport().fullscreen.unwrap_or(false));
+ ui.ctx().send_viewport_cmd(egui::ViewportCommand::Fullscreen(!fs));
+ }
+ if btn(ui, &mut rx, Icon::Bell, "notifications", "Progress & notifications", app) {
+ app.ui.status = "No background jobs running".into();
+ }
+ if btn(ui, &mut rx, Icon::Export, "quickExport", "Quick Export", app) {
+ app.ui.mode = Mode::Export;
+ }
+ let ws_clicked = btn(ui, &mut rx, Icon::Workspaces, "workspaces", "Workspaces", app);
+ let ws_rect = Rect::from_center_size(pos2(rx + 18.0, rect.center().y), vec2(28.0, 28.0));
+ let popup_id = egui::Id::new("workspaces-popup");
+ if ws_clicked {
+ ui.ctx().data_mut(|d| d.insert_temp(popup_id, true));
+ }
+ let open = ui.ctx().data(|d| d.get_temp::<bool>(popup_id).unwrap_or(false));
+ if open {
+ let area = egui::Area::new(popup_id.with("area")).order(egui::Order::Foreground).fixed_pos(pos2(ws_rect.max.x - 200.0, ws_rect.max.y + 4.0)).show(
+ ui.ctx(),
+ |ui| {
+ egui::Frame::popup(ui.style()).show(ui, |ui| {
+ ui.set_min_width(200.0);
+ ui.label(egui::RichText::new("Workspaces").strong());
+ ui.separator();
+ for w in crate::dock::WORKSPACES {
+ let sel = app.ui.workspace == w;
+ if ui.selectable_label(sel, w).clicked() {
+ app.set_workspace(w);
+ ui.ctx().data_mut(|d| d.insert_temp(popup_id, false));
+ }
+ }
+ ui.separator();
+ if ui.button("Reset to Saved Layout").clicked() {
+ let n = app.ui.workspace.clone();
+ app.set_workspace(&n);
+ ui.ctx().data_mut(|d| d.insert_temp(popup_id, false));
+ }
+ });
+ },
+ );
+ if area.response.clicked_elsewhere() && !ws_clicked {
+ ui.ctx().data_mut(|d| d.insert_temp(popup_id, false));
+ }
+ }
+ // Project title (with unsaved dot)
+ let title = format!("{}{}", app.session.project.name, if app.session.is_dirty() { " •" } else { "" });
+ let right_start = rx - 8.0;
+ p.text(pos2(right_start, rect.center().y), Align2::RIGHT_CENTER, title, Tokens::ui(12.5), t.text_dim);
+}
diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs
new file mode 100644
index 000000000..796d6b4aa
--- /dev/null
+++ b/crates/ui-egui/src/icons.rs
@@ -0,0 +1,518 @@
+//! Vector icons drawn in code on a 16×16 design grid (crisp at any DPI, recolourable, no
+//! third-party or Adobe artwork). Shapes follow NLE conventions (ripple brackets, razor blade…).
+
+use egui::epaint::{PathShape, PathStroke};
+use egui::{Color32, Painter, Pos2, Rect, Stroke, pos2, vec2};
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
+pub enum Icon {
+ Selection,
+ TrackSelectFwd,
+ TrackSelectBack,
+ Ripple,
+ Rolling,
+ RateStretch,
+ Razor,
+ Slip,
+ Slide,
+ Pen,
+ Rectangle,
+ Ellipse,
+ Hand,
+ Zoom,
+ Type,
+ Play,
+ Pause,
+ StepBack,
+ StepFwd,
+ GoToIn,
+ GoToOut,
+ MarkIn,
+ MarkOut,
+ Marker,
+ Insert,
+ Overwrite,
+ Lift,
+ Extract,
+ Camera,
+ Loop,
+ Wrench,
+ Plus,
+ Eye,
+ EyeOff,
+ Speaker,
+ Mute,
+ Lock,
+ Unlock,
+ SyncLock,
+ Mic,
+ Folder,
+ Film,
+ Sequence,
+ Audio,
+ Image,
+ Search,
+ ListView,
+ IconView,
+ Freeform,
+ NewItem,
+ Trash,
+ Home,
+ Workspaces,
+ Hamburger,
+ ChevronDown,
+ ChevronRight,
+ Magnet,
+ Link,
+ Keyframe,
+ Stopwatch,
+ Fx,
+ Reset,
+ Close,
+ Fullscreen,
+ Export,
+ Gear,
+ Info,
+ Captions,
+ Adjust,
+ Nest,
+ Undo,
+ Redo,
+ Bell,
+ Sparkle,
+ Grid,
+ Square,
+}
+
+pub struct Pen16<'a> {
+ painter: &'a Painter,
+ rect: Rect,
+ color: Color32,
+ width: f32,
+}
+
+impl Pen16<'_> {
+ fn p(&self, x: f32, y: f32) -> Pos2 {
+ let s = self.rect.width().min(self.rect.height()) / 16.0;
+ let o = self.rect.center() - vec2(8.0 * s, 8.0 * s);
+ pos2(o.x + x * s, o.y + y * s)
+ }
+ fn s(&self) -> f32 {
+ self.rect.width().min(self.rect.height()) / 16.0
+ }
+ fn line(&self, pts: &[(f32, f32)]) {
+ let v: Vec<Pos2> = pts.iter().map(|(x, y)| self.p(*x, *y)).collect();
+ self.painter.add(PathShape::line(v, PathStroke::new(self.width * self.s(), self.color)));
+ }
+ fn closed(&self, pts: &[(f32, f32)]) {
+ let v: Vec<Pos2> = pts.iter().map(|(x, y)| self.p(*x, *y)).collect();
+ self.painter.add(PathShape::closed_line(v, PathStroke::new(self.width * self.s(), self.color)));
+ }
+ fn fill(&self, pts: &[(f32, f32)]) {
+ let v: Vec<Pos2> = pts.iter().map(|(x, y)| self.p(*x, *y)).collect();
+ self.painter.add(PathShape::convex_polygon(v, self.color, Stroke::NONE));
+ }
+ fn circle(&self, x: f32, y: f32, r: f32) {
+ self.painter.circle_stroke(self.p(x, y), r * self.s(), Stroke::new(self.width * self.s(), self.color));
+ }
+ fn dot(&self, x: f32, y: f32, r: f32) {
+ self.painter.circle_filled(self.p(x, y), r * self.s(), self.color);
+ }
+ fn rect(&self, x0: f32, y0: f32, x1: f32, y1: f32) {
+ let r = Rect::from_min_max(self.p(x0, y0), self.p(x1, y1));
+ self.painter.rect_stroke(r, 1.0 * self.s(), Stroke::new(self.width * self.s(), self.color), egui::StrokeKind::Middle);
+ }
+ fn rect_fill(&self, x0: f32, y0: f32, x1: f32, y1: f32) {
+ let r = Rect::from_min_max(self.p(x0, y0), self.p(x1, y1));
+ self.painter.rect_filled(r, 0.8 * self.s(), self.color);
+ }
+ fn arc(&self, cx: f32, cy: f32, r: f32, a0: f32, a1: f32) {
+ let n = 20;
+ let pts: Vec<(f32, f32)> = (0..=n)
+ .map(|i| {
+ let a = (a0 + (a1 - a0) * i as f32 / n as f32).to_radians();
+ (cx + r * a.cos(), cy + r * a.sin())
+ })
+ .collect();
+ self.line(&pts);
+ }
+}
+
+/// Paint `icon` centred in `rect`.
+pub fn paint(painter: &Painter, rect: Rect, icon: Icon, color: Color32) {
+ let pen = Pen16 { painter, rect, color, width: 1.25 };
+ use Icon::*;
+ match icon {
+ Selection => pen.fill(&[(4.0, 2.0), (4.0, 13.0), (6.8, 10.4), (8.8, 14.6), (10.4, 13.9), (8.5, 9.8), (12.2, 9.6)]),
+ TrackSelectFwd => {
+ pen.fill(&[(2.0, 3.0), (2.0, 11.0), (4.0, 9.2), (5.4, 12.2), (6.6, 11.6), (5.3, 8.7), (7.8, 8.5)]);
+ pen.fill(&[(8.5, 4.5), (11.0, 7.0), (8.5, 9.5)]);
+ pen.fill(&[(11.5, 4.5), (14.0, 7.0), (11.5, 9.5)]);
+ }
+ TrackSelectBack => {
+ pen.fill(&[(14.0, 3.0), (14.0, 11.0), (12.0, 9.2), (10.6, 12.2), (9.4, 11.6), (10.7, 8.7), (8.2, 8.5)]);
+ pen.fill(&[(7.5, 4.5), (5.0, 7.0), (7.5, 9.5)]);
+ pen.fill(&[(4.5, 4.5), (2.0, 7.0), (4.5, 9.5)]);
+ }
+ Ripple => {
+ pen.line(&[(9.0, 2.5), (6.5, 2.5), (6.5, 13.5), (9.0, 13.5)]);
+ pen.fill(&[(10.0, 5.0), (13.5, 8.0), (10.0, 11.0)]);
+ pen.line(&[(2.0, 8.0), (6.5, 8.0)]);
+ }
+ Rolling => {
+ pen.line(&[(6.0, 2.5), (8.0, 2.5), (8.0, 13.5), (6.0, 13.5)]);
+ pen.line(&[(10.0, 2.5), (8.0, 2.5)]);
+ pen.line(&[(10.0, 13.5), (8.0, 13.5)]);
+ pen.fill(&[(5.0, 5.5), (2.0, 8.0), (5.0, 10.5)]);
+ pen.fill(&[(11.0, 5.5), (14.0, 8.0), (11.0, 10.5)]);
+ }
+ RateStretch => {
+ pen.line(&[(2.5, 3.0), (2.5, 13.0)]);
+ pen.line(&[(13.5, 3.0), (13.5, 13.0)]);
+ pen.line(&[(4.5, 8.0), (11.5, 8.0)]);
+ pen.fill(&[(4.0, 8.0), (6.5, 6.0), (6.5, 10.0)]);
+ pen.fill(&[(12.0, 8.0), (9.5, 6.0), (9.5, 10.0)]);
+ pen.circle(8.0, 4.0, 1.4);
+ pen.circle(8.0, 12.0, 1.4);
+ }
+ Razor => {
+ pen.closed(&[(2.5, 5.0), (13.5, 5.0), (13.5, 11.0), (2.5, 11.0)]);
+ pen.circle(8.0, 8.0, 1.3);
+ pen.line(&[(5.0, 8.0), (6.5, 8.0)]);
+ pen.line(&[(9.5, 8.0), (11.0, 8.0)]);
+ }
+ Slip => {
+ pen.line(&[(2.5, 4.0), (2.5, 12.0)]);
+ pen.line(&[(13.5, 4.0), (13.5, 12.0)]);
+ pen.fill(&[(4.5, 8.0), (7.0, 6.0), (7.0, 10.0)]);
+ pen.fill(&[(11.5, 8.0), (9.0, 6.0), (9.0, 10.0)]);
+ pen.line(&[(5.5, 3.0), (10.5, 3.0)]);
+ pen.line(&[(5.5, 13.0), (10.5, 13.0)]);
+ }
+ Slide => {
+ pen.line(&[(5.5, 3.0), (5.5, 13.0)]);
+ pen.line(&[(10.5, 3.0), (10.5, 13.0)]);
+ pen.fill(&[(1.5, 8.0), (4.0, 6.0), (4.0, 10.0)]);
+ pen.fill(&[(14.5, 8.0), (12.0, 6.0), (12.0, 10.0)]);
+ }
+ Pen => {
+ pen.closed(&[(8.0, 2.0), (12.0, 9.0), (9.5, 13.5), (6.5, 13.5), (4.0, 9.0)]);
+ pen.line(&[(8.0, 2.0), (8.0, 8.0)]);
+ pen.dot(8.0, 9.0, 1.0);
+ }
+ Rectangle => pen.rect(2.5, 4.0, 13.5, 12.0),
+ Ellipse => pen.circle(8.0, 8.0, 5.5),
+ Hand => {
+ pen.line(&[(5.0, 8.5), (5.0, 4.0), (6.5, 3.2), (7.3, 4.0), (7.3, 7.5)]);
+ pen.line(&[(7.3, 4.0), (7.3, 2.8), (8.8, 2.2), (9.6, 3.0), (9.6, 7.5)]);
+ pen.line(&[(9.6, 3.6), (11.0, 3.2), (11.9, 4.0), (11.9, 8.0)]);
+ pen.line(&[(11.9, 5.5), (13.0, 5.3), (13.6, 6.0), (13.6, 10.0), (11.5, 14.0), (6.5, 14.0), (3.0, 10.0), (2.5, 8.5), (3.5, 7.8), (5.0, 8.5)]);
+ }
+ Zoom => {
+ pen.circle(6.8, 6.8, 4.3);
+ pen.line(&[(10.0, 10.0), (14.0, 14.0)]);
+ pen.line(&[(4.8, 6.8), (8.8, 6.8)]);
+ pen.line(&[(6.8, 4.8), (6.8, 8.8)]);
+ }
+ Type => {
+ pen.line(&[(3.0, 4.5), (3.0, 2.8), (13.0, 2.8), (13.0, 4.5)]);
+ pen.line(&[(8.0, 2.8), (8.0, 13.5)]);
+ pen.line(&[(6.0, 13.5), (10.0, 13.5)]);
+ }
+ Play => pen.fill(&[(4.5, 2.8), (13.0, 8.0), (4.5, 13.2)]),
+ Pause => {
+ pen.rect_fill(4.0, 3.0, 6.8, 13.0);
+ pen.rect_fill(9.2, 3.0, 12.0, 13.0);
+ }
+ StepBack => {
+ pen.rect_fill(3.5, 3.5, 5.0, 12.5);
+ pen.fill(&[(12.5, 3.5), (6.0, 8.0), (12.5, 12.5)]);
+ }
+ StepFwd => {
+ pen.rect_fill(11.0, 3.5, 12.5, 12.5);
+ pen.fill(&[(3.5, 3.5), (10.0, 8.0), (3.5, 12.5)]);
+ }
+ GoToIn => {
+ pen.line(&[(5.0, 3.0), (3.0, 3.0), (3.0, 13.0), (5.0, 13.0)]);
+ pen.fill(&[(13.0, 3.5), (6.0, 8.0), (13.0, 12.5)]);
+ }
+ GoToOut => {
+ pen.line(&[(11.0, 3.0), (13.0, 3.0), (13.0, 13.0), (11.0, 13.0)]);
+ pen.fill(&[(3.0, 3.5), (10.0, 8.0), (3.0, 12.5)]);
+ }
+ MarkIn => pen.line(&[(10.5, 2.5), (5.5, 2.5), (5.5, 13.5), (10.5, 13.5)]),
+ MarkOut => pen.line(&[(5.5, 2.5), (10.5, 2.5), (10.5, 13.5), (5.5, 13.5)]),
+ Marker => pen.fill(&[(4.0, 2.5), (12.0, 2.5), (12.0, 9.5), (8.0, 13.5), (4.0, 9.5)]),
+ Insert => {
+ pen.rect(2.0, 5.0, 14.0, 13.0);
+ pen.fill(&[(5.5, 1.5), (10.5, 1.5), (8.0, 5.5)]);
+ pen.line(&[(8.0, 5.0), (8.0, 13.0)]);
+ }
+ Overwrite => {
+ pen.rect(2.0, 7.0, 14.0, 13.0);
+ pen.rect_fill(5.0, 8.5, 11.0, 11.5);
+ pen.fill(&[(5.5, 1.5), (10.5, 1.5), (8.0, 5.5)]);
+ }
+ Lift => {
+ pen.rect(2.0, 8.0, 14.0, 13.5);
+ pen.line(&[(8.0, 11.0), (8.0, 2.5)]);
+ pen.line(&[(5.0, 5.5), (8.0, 2.5), (11.0, 5.5)]);
+ }
+ Extract => {
+ pen.rect(2.0, 8.0, 14.0, 13.5);
+ pen.line(&[(8.0, 11.0), (8.0, 2.5)]);
+ pen.line(&[(5.0, 5.5), (8.0, 2.5), (11.0, 5.5)]);
+ pen.line(&[(5.5, 10.75), (6.5, 10.75)]);
+ pen.line(&[(9.5, 10.75), (10.5, 10.75)]);
+ }
+ Camera => {
+ pen.closed(&[(2.0, 5.0), (5.0, 5.0), (6.0, 3.5), (10.0, 3.5), (11.0, 5.0), (14.0, 5.0), (14.0, 12.5), (2.0, 12.5)]);
+ pen.circle(8.0, 8.7, 2.3);
+ }
+ Loop => {
+ pen.arc(8.0, 8.0, 5.0, 200.0, 520.0);
+ pen.fill(&[(1.8, 5.5), (5.2, 5.5), (3.2, 8.5)]);
+ }
+ Wrench => {
+ pen.line(&[(3.0, 13.0), (9.0, 7.0)]);
+ pen.arc(10.5, 5.5, 3.0, 110.0, 400.0);
+ }
+ Plus => {
+ pen.line(&[(8.0, 3.0), (8.0, 13.0)]);
+ pen.line(&[(3.0, 8.0), (13.0, 8.0)]);
+ }
+ Eye | EyeOff => {
+ pen.line(&[(1.5, 8.0), (4.0, 5.0), (8.0, 3.8), (12.0, 5.0), (14.5, 8.0), (12.0, 11.0), (8.0, 12.2), (4.0, 11.0), (1.5, 8.0)]);
+ pen.circle(8.0, 8.0, 2.0);
+ if icon == EyeOff {
+ pen.line(&[(2.5, 13.5), (13.5, 2.5)]);
+ }
+ }
+ Speaker | Mute => {
+ pen.fill(&[(2.0, 6.0), (5.0, 6.0), (9.0, 2.5), (9.0, 13.5), (5.0, 10.0), (2.0, 10.0)]);
+ if icon == Mute {
+ pen.line(&[(10.5, 6.0), (14.0, 10.0)]);
+ pen.line(&[(14.0, 6.0), (10.5, 10.0)]);
+ } else {
+ pen.arc(9.0, 8.0, 3.0, -50.0, 50.0);
+ pen.arc(9.0, 8.0, 5.5, -50.0, 50.0);
+ }
+ }
+ Lock | Unlock => {
+ pen.rect(3.5, 7.0, 12.5, 14.0);
+ if icon == Lock {
+ pen.arc(8.0, 7.0, 3.0, 180.0, 360.0);
+ } else {
+ pen.arc(8.0, 5.0, 3.0, 180.0, 330.0);
+ }
+ pen.dot(8.0, 10.5, 1.0);
+ }
+ SyncLock => {
+ pen.rect(3.0, 7.0, 13.0, 14.0);
+ pen.arc(8.0, 7.0, 3.0, 180.0, 360.0);
+ pen.line(&[(5.5, 10.5), (7.0, 12.0), (10.5, 9.0)]);
+ }
+ Mic => {
+ pen.rect(6.0, 2.0, 10.0, 10.0);
+ pen.arc(8.0, 8.0, 4.5, 0.0, 180.0);
+ pen.line(&[(8.0, 12.5), (8.0, 14.5)]);
+ }
+ Folder => pen.closed(&[(1.5, 4.0), (6.0, 4.0), (7.5, 5.5), (14.5, 5.5), (14.5, 13.0), (1.5, 13.0)]),
+ Film => {
+ pen.rect(2.0, 3.0, 14.0, 13.0);
+ for y in [5.0, 8.0, 11.0] {
+ pen.dot(3.8, y, 0.6);
+ pen.dot(12.2, y, 0.6);
+ }
+ pen.line(&[(5.5, 3.0), (5.5, 13.0)]);
+ pen.line(&[(10.5, 3.0), (10.5, 13.0)]);
+ }
+ Sequence => {
+ pen.rect(1.5, 3.5, 14.5, 12.5);
+ pen.rect_fill(3.0, 5.5, 9.0, 7.5);
+ pen.rect_fill(6.0, 9.0, 13.0, 11.0);
+ }
+ Audio => {
+ for (i, h) in [3.0, 6.0, 9.0, 5.0, 7.0, 3.0].iter().enumerate() {
+ let x = 2.5 + i as f32 * 2.2;
+ pen.line(&[(x, 8.0 - h / 2.0), (x, 8.0 + h / 2.0)]);
+ }
+ }
+ Image => {
+ pen.rect(2.0, 3.0, 14.0, 13.0);
+ pen.line(&[(2.5, 12.0), (6.0, 8.0), (9.0, 11.0), (11.0, 9.0), (13.5, 12.0)]);
+ pen.dot(10.5, 6.0, 1.1);
+ }
+ Search => {
+ pen.circle(6.8, 6.8, 4.3);
+ pen.line(&[(10.0, 10.0), (14.0, 14.0)]);
+ }
+ ListView => {
+ for y in [4.0, 8.0, 12.0] {
+ pen.dot(3.0, y, 0.8);
+ pen.line(&[(5.5, y), (14.0, y)]);
+ }
+ }
+ IconView => {
+ pen.rect(2.5, 2.5, 7.0, 7.0);
+ pen.rect(9.0, 2.5, 13.5, 7.0);
+ pen.rect(2.5, 9.0, 7.0, 13.5);
+ pen.rect(9.0, 9.0, 13.5, 13.5);
+ }
+ Freeform => {
+ pen.rect(2.0, 3.0, 8.0, 8.0);
+ pen.rect(7.0, 9.0, 14.0, 13.5);
+ pen.rect(10.0, 2.0, 14.0, 6.0);
+ }
+ NewItem => {
+ pen.closed(&[(3.0, 2.0), (10.0, 2.0), (13.0, 5.0), (13.0, 14.0), (3.0, 14.0)]);
+ pen.line(&[(8.0, 6.0), (8.0, 11.0)]);
+ pen.line(&[(5.5, 8.5), (10.5, 8.5)]);
+ }
+ Trash => {
+ pen.line(&[(2.5, 4.0), (13.5, 4.0)]);
+ pen.line(&[(6.0, 4.0), (6.5, 2.5), (9.5, 2.5), (10.0, 4.0)]);
+ pen.closed(&[(3.8, 4.0), (12.2, 4.0), (11.4, 14.0), (4.6, 14.0)]);
+ }
+ Home => {
+ pen.line(&[(1.5, 8.0), (8.0, 2.0), (14.5, 8.0)]);
+ pen.line(&[(3.5, 6.5), (3.5, 14.0), (12.5, 14.0), (12.5, 6.5)]);
+ pen.line(&[(6.5, 14.0), (6.5, 10.0), (9.5, 10.0), (9.5, 14.0)]);
+ }
+ Workspaces => {
+ pen.rect(1.5, 2.5, 14.5, 13.5);
+ pen.line(&[(6.0, 2.5), (6.0, 13.5)]);
+ pen.line(&[(6.0, 8.0), (14.5, 8.0)]);
+ }
+ Hamburger => {
+ for y in [4.5, 8.0, 11.5] {
+ pen.line(&[(3.0, y), (13.0, y)]);
+ }
+ }
+ ChevronDown => pen.line(&[(4.0, 6.0), (8.0, 10.0), (12.0, 6.0)]),
+ ChevronRight => pen.line(&[(6.0, 4.0), (10.0, 8.0), (6.0, 12.0)]),
+ Magnet => {
+ pen.arc(8.0, 8.0, 4.5, 0.0, 180.0);
+ pen.line(&[(3.5, 8.0), (3.5, 2.5)]);
+ pen.line(&[(12.5, 8.0), (12.5, 2.5)]);
+ pen.rect_fill(2.5, 2.5, 4.8, 4.8);
+ pen.rect_fill(11.2, 2.5, 13.5, 4.8);
+ }
+ Link => {
+ pen.closed(&[(2.0, 6.0), (8.0, 6.0), (8.0, 10.0), (2.0, 10.0)]);
+ pen.closed(&[(8.0, 6.0), (14.0, 6.0), (14.0, 10.0), (8.0, 10.0)]);
+ }
+ Keyframe => pen.fill(&[(8.0, 3.0), (13.0, 8.0), (8.0, 13.0), (3.0, 8.0)]),
+ Stopwatch => {
+ pen.circle(8.0, 9.0, 5.0);
+ pen.line(&[(8.0, 9.0), (8.0, 6.0)]);
+ pen.line(&[(6.5, 2.0), (9.5, 2.0)]);
+ pen.line(&[(8.0, 2.0), (8.0, 4.0)]);
+ }
+ Fx => {
+ pen.line(&[(7.5, 2.5), (6.0, 2.5), (5.0, 4.0), (4.0, 13.5)]);
+ pen.line(&[(2.5, 6.5), (7.0, 6.5)]);
+ pen.line(&[(8.5, 7.0), (13.5, 13.5)]);
+ pen.line(&[(13.5, 7.0), (8.5, 13.5)]);
+ }
+ Reset => {
+ pen.arc(8.0, 8.5, 5.0, 200.0, 500.0);
+ pen.fill(&[(1.5, 6.0), (5.5, 5.5), (3.0, 9.0)]);
+ }
+ Close => {
+ pen.line(&[(4.0, 4.0), (12.0, 12.0)]);
+ pen.line(&[(12.0, 4.0), (4.0, 12.0)]);
+ }
+ Fullscreen => {
+ pen.line(&[(2.5, 6.0), (2.5, 2.5), (6.0, 2.5)]);
+ pen.line(&[(10.0, 2.5), (13.5, 2.5), (13.5, 6.0)]);
+ pen.line(&[(13.5, 10.0), (13.5, 13.5), (10.0, 13.5)]);
+ pen.line(&[(6.0, 13.5), (2.5, 13.5), (2.5, 10.0)]);
+ }
+ Export => {
+ pen.line(&[(8.0, 10.0), (8.0, 2.0)]);
+ pen.line(&[(5.0, 5.0), (8.0, 2.0), (11.0, 5.0)]);
+ pen.line(&[(3.0, 8.0), (3.0, 14.0), (13.0, 14.0), (13.0, 8.0)]);
+ }
+ Gear => {
+ pen.circle(8.0, 8.0, 2.2);
+ for i in 0..8 {
+ let a = (i as f32 * 45.0).to_radians();
+ pen.line(&[(8.0 + 4.0 * a.cos(), 8.0 + 4.0 * a.sin()), (8.0 + 6.0 * a.cos(), 8.0 + 6.0 * a.sin())]);
+ }
+ pen.circle(8.0, 8.0, 4.2);
+ }
+ Info => {
+ pen.circle(8.0, 8.0, 6.0);
+ pen.line(&[(8.0, 7.0), (8.0, 11.5)]);
+ pen.dot(8.0, 4.8, 0.9);
+ }
+ Captions => {
+ pen.rect(1.5, 3.0, 14.5, 13.0);
+ pen.line(&[(4.0, 9.0), (7.0, 9.0)]);
+ pen.line(&[(9.0, 9.0), (12.0, 9.0)]);
+ pen.line(&[(4.0, 11.0), (12.0, 11.0)]);
+ }
+ Adjust => {
+ for (y, x) in [(4.0, 10.0), (8.0, 5.0), (12.0, 9.0)] {
+ pen.line(&[(2.0, y), (14.0, y)]);
+ pen.dot(x, y, 1.5);
+ }
+ }
+ Nest => {
+ pen.rect(1.5, 2.5, 14.5, 13.5);
+ pen.rect(4.5, 5.5, 11.5, 10.5);
+ }
+ Undo => {
+ pen.arc(9.0, 9.0, 4.5, 180.0, 450.0);
+ pen.fill(&[(2.0, 9.0), (4.5, 6.0), (7.0, 9.0)]);
+ }
+ Redo => {
+ pen.arc(7.0, 9.0, 4.5, 90.0, 360.0);
+ pen.fill(&[(14.0, 9.0), (11.5, 6.0), (9.0, 9.0)]);
+ }
+ Bell => {
+ pen.line(&[(3.0, 12.0), (13.0, 12.0)]);
+ pen.line(&[(4.5, 12.0), (4.5, 7.0)]);
+ pen.line(&[(11.5, 12.0), (11.5, 7.0)]);
+ pen.arc(8.0, 7.0, 3.5, 180.0, 360.0);
+ pen.dot(8.0, 13.8, 1.0);
+ }
+ Sparkle => {
+ pen.fill(&[(8.0, 1.5), (9.5, 6.5), (14.5, 8.0), (9.5, 9.5), (8.0, 14.5), (6.5, 9.5), (1.5, 8.0), (6.5, 6.5)]);
+ }
+ Grid => {
+ pen.rect(2.0, 2.0, 14.0, 14.0);
+ pen.line(&[(6.0, 2.0), (6.0, 14.0)]);
+ pen.line(&[(10.0, 2.0), (10.0, 14.0)]);
+ pen.line(&[(2.0, 6.0), (14.0, 6.0)]);
+ pen.line(&[(2.0, 10.0), (14.0, 10.0)]);
+ }
+ Square => pen.rect(3.0, 3.0, 13.0, 13.0),
+ }
+}
+
+/// An icon button: returns the response; `active` draws the selected state.
+pub fn button(ui: &mut egui::Ui, icon: Icon, size: f32, active: bool, t: &crate::theme::Tokens, tooltip: &str) -> egui::Response {
+ let (rect, resp) = ui.allocate_exact_size(vec2(size, size), egui::Sense::click());
+ let bg = if resp.is_pointer_button_down_on() {
+ Some(t.pressed)
+ } else if resp.hovered() {
+ Some(t.hover)
+ } else {
+ None
+ };
+ if let Some(bg) = bg {
+ ui.painter().rect_filled(rect, t.radius_sm, bg);
+ }
+ let col = if active {
+ t.icon_active
+ } else if resp.hovered() {
+ t.tab_text_active
+ } else {
+ t.icon
+ };
+ paint(ui.painter(), rect.shrink(size * 0.2), icon, col);
+ if tooltip.is_empty() { resp } else { resp.on_hover_text(tooltip) }
+}
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
new file mode 100644
index 000000000..6fe40f10f
--- /dev/null
+++ b/crates/ui-egui/src/lib.rs
@@ -0,0 +1,647 @@
+//! The FilmCraft egui frontend.
+//!
+//! Thin by design: all project changes go through `filmcraft_engine::Session::execute`; this crate
+//! owns only presentation state ([`state::UiState`]), GPU textures, the playback clock and the
+//! control-channel handlers. Swap it for another toolkit without touching the engine.
+
+pub mod automation;
+pub mod control;
+pub mod dock;
+pub mod frames;
+pub mod header;
+pub mod icons;
+pub mod menus;
+pub mod panels;
+pub mod state;
+pub mod theme;
+pub mod widgets;
+
+use std::collections::HashMap;
+use std::sync::Arc;
+use std::sync::mpsc::{Receiver, Sender};
+
+use egui::{Color32, TextureHandle, TextureOptions};
+use filmcraft_engine::{Services, Session};
+use filmcraft_time::Tick;
+use serde_json::{Value, json};
+
+pub use control::ControlRequest;
+use dock::PanelKind;
+use frames::{FrameKey, FrameServer, Target};
+use state::UiState;
+use theme::{ThemeKind, Tokens};
+
+/// Audio output provided by the platform layer (cpal on desktop, WebAudio on web).
+pub trait AudioOut {
+ /// Start output; `fill(buffer, channels)` is called on the audio thread with interleaved f32.
+ fn start(&mut self, fill: Box<dyn FnMut(&mut [f32], usize) + Send>) -> Result<u32, String>;
+ fn stop(&mut self);
+ /// Device sample rate.
+ fn sample_rate(&self) -> u32;
+ /// Frames played since `start` (the playback master clock), if the device reports it.
+ fn played_frames(&self) -> Option<u64>;
+}
+
+/// Host hooks for native file dialogs etc.
+#[derive(Default)]
+pub struct HostHooks {
+ pub pick_files: Option<Box<dyn FnMut(&[&str]) -> Vec<String>>>,
+ pub pick_save: Option<Box<dyn FnMut(&str) -> Option<String>>>,
+ pub pick_open_project: Option<Box<dyn FnMut() -> Option<String>>>,
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub enum Dialog {
+ About,
+ Shortcuts,
+ NewSequence,
+}
+
+#[derive(Default)]
+pub struct Playback {
+ pub playing: bool,
+ pub speed: f64,
+ pub looping: bool,
+ /// Wall-clock (egui time, s) and timeline tick when playback (re)started.
+ anchor_time: f64,
+ anchor_tick: Tick,
+ /// Audio frames played at anchor (when the audio clock drives).
+ pub audio_clock: bool,
+ pub dropped: u64,
+ pub shown: u64,
+ last_frame: i64,
+}
+
+pub struct FilmcraftApp {
+ pub session: Session,
+ pub ui: UiState,
+ pub tokens: Tokens,
+ pub frames: Arc<FrameServer>,
+ pub playback: Playback,
+ pub audio: Option<Box<dyn AudioOut>>,
+ pub hooks: HostHooks,
+ pub dialog: Option<Dialog>,
+ pub auto: automation::Registry,
+ /// Named textures (monitors, thumbnails) with the key they show.
+ textures: HashMap<String, (FrameKey, TextureHandle)>,
+ control_rx: Option<Receiver<ControlRequest>>,
+ pub(crate) synthetic: Vec<egui::Event>,
+ pending_screenshots: Vec<(u64, Option<String>, Option<[f32; 4]>, Sender<Value>)>,
+ queued_screenshots: Vec<(u64, f64, u32)>,
+ input_waiters: Vec<Sender<Value>>,
+ next_token: u64,
+ styled: bool,
+ fonts_ready: bool,
+ pub integrated_titlebar: bool,
+ pub last_timeline_width: f32,
+ pub fps: f32,
+ last_time: f64,
+ bindings: Vec<(egui::Modifiers, egui::Key, String)>,
+ pub toast: Option<(String, f64)>,
+ pub tl: panels::timeline::TlState,
+}
+
+impl FilmcraftApp {
+ pub fn new(session: Session) -> Self {
+ let frames = Arc::new(FrameServer::new(
+ session.media.clone(),
+ session.services.clone(),
+ std::thread::available_parallelism().map(|n| n.get().clamp(2, 6)).unwrap_or(3),
+ ));
+ Self {
+ session,
+ ui: UiState::default(),
+ tokens: Tokens::for_kind(ThemeKind::Dark),
+ frames,
+ playback: Playback { speed: 1.0, ..Default::default() },
+ audio: None,
+ hooks: HostHooks::default(),
+ dialog: None,
+ auto: Default::default(),
+ textures: HashMap::new(),
+ control_rx: None,
+ synthetic: Vec::new(),
+ pending_screenshots: Vec::new(),
+ queued_screenshots: Vec::new(),
+ input_waiters: Vec::new(),
+ next_token: 1,
+ styled: false,
+ fonts_ready: false,
+ integrated_titlebar: false,
+ last_timeline_width: 1000.0,
+ fps: 60.0,
+ last_time: 0.0,
+ bindings: menus::bindings(),
+ toast: None,
+ tl: Default::default(),
+ }
+ }
+
+ pub fn with_control(mut self, rx: Receiver<ControlRequest>) -> Self {
+ self.control_rx = Some(rx);
+ self
+ }
+
+ pub fn services(&self) -> Arc<dyn Services> {
+ self.session.services.clone()
+ }
+
+ /// Rebuild the frame server if the session's media pool was replaced (e.g. project opened).
+ fn sync_pool(&mut self) {
+ if !Arc::ptr_eq(&self.frames.pool, &self.session.media) {
+ self.frames = Arc::new(FrameServer::new(
+ self.session.media.clone(),
+ self.session.services.clone(),
+ std::thread::available_parallelism().map(|n| n.get().clamp(2, 6)).unwrap_or(3),
+ ));
+ self.textures.clear();
+ }
+ }
+
+ pub fn set_theme(&mut self, ctx: &egui::Context, k: ThemeKind) {
+ self.tokens = Tokens::for_kind(k);
+ theme::apply_visuals(ctx, &self.tokens);
+ self.ui.dark = k != ThemeKind::Light;
+ }
+
+ pub fn set_workspace(&mut self, name: &str) {
+ self.ui.workspace = name.to_string();
+ self.ui.dock = dock::workspace(name);
+ if name == "Color" {
+ self.ui.show_scopes = false;
+ }
+ }
+
+ pub fn show_panel(&mut self, p: PanelKind) {
+ if !self.ui.dock.contains(p) {
+ let near = match p {
+ PanelKind::LumetriColor | PanelKind::EssentialGraphics | PanelKind::EssentialSound | PanelKind::Properties => PanelKind::Program,
+ PanelKind::Source
+ | PanelKind::EffectControls
+ | PanelKind::AudioClipMixer
+ | PanelKind::Metadata
+ | PanelKind::LumetriScopes
+ | PanelKind::AudioTrackMixer
+ | PanelKind::Text => PanelKind::Source,
+ _ => PanelKind::Project,
+ };
+ self.ui.dock.open_near(p, near);
+ }
+ self.ui.dock.activate(p);
+ self.ui.focused = p;
+ }
+
+ pub fn status(&mut self, s: impl Into<String>) {
+ self.ui.status = s.into();
+ }
+
+ // ---------------------------------------------------------------- playback
+
+ pub fn toggle_play(&mut self, speed: f64) {
+ if self.playback.playing {
+ self.stop();
+ } else {
+ self.play(speed);
+ }
+ }
+
+ pub fn play(&mut self, speed: f64) {
+ if self.session.active_sequence().is_none() {
+ return;
+ }
+ // restart from the end → from the start
+ let dur = self.session.active_sequence().map(|q| q.duration()).unwrap_or_default();
+ if speed > 0.0 && self.session.playhead() >= dur - self.session.sequence_rate().frame_duration() {
+ self.session.set_playhead(Tick::ZERO);
+ }
+ self.playback.playing = true;
+ self.playback.speed = speed;
+ self.playback.anchor_tick = self.session.playhead();
+ self.playback.anchor_time = -1.0; // set on next frame
+ self.playback.dropped = 0;
+ self.playback.shown = 0;
+ self.start_audio();
+ }
+
+ pub fn stop(&mut self) {
+ self.playback.playing = false;
+ if let Some(a) = self.audio.as_mut() {
+ a.stop();
+ }
+ self.playback.audio_clock = false;
+ }
+
+ fn start_audio(&mut self) {
+ let speed = self.playback.speed;
+ if (speed - 1.0).abs() > 1e-9 {
+ if let Some(a) = self.audio.as_mut() {
+ a.stop();
+ }
+ return;
+ }
+ let Some(seq_id) = self.session.state.active_sequence else { return };
+ let project = self.session.project.clone();
+ let provider = self.session.media.provider(project.clone(), self.session.services.clone());
+ let start_tick = self.session.playhead();
+ let Some(a) = self.audio.as_mut() else { return };
+ let sr = a.sample_rate();
+ let mut cursor = start_tick.to_units_floor(sr as i64);
+ let fill = Box::new(move |buf: &mut [f32], ch: usize| {
+ let Some(seq) = project.sequence(seq_id) else { return };
+ let n = buf.len() / ch.max(1);
+ // Mix at the sequence rate; convert when the device rate differs (nearest sample).
+ let seq_sr = seq.settings.sample_rate;
+ let mix = if seq_sr == sr {
+ filmcraft_render::audio::mix_sequence(&project, seq, cursor, n, &provider)
+ } else {
+ let s0 = (cursor as i128 * seq_sr as i128 / sr as i128) as i64;
+ let m = n * seq_sr as usize / sr as usize + 2;
+ let b = filmcraft_render::audio::mix_sequence(&project, seq, s0, m, &provider);
+ let mut out = filmcraft_frame::AudioBuffer::silence(sr, 2, n);
+ for c in 0..2 {
+ for i in 0..n {
+ let j = (i * seq_sr as usize / sr as usize).min(m - 1);
+ out.channels[c][i] = b.channels[c][j];
+ }
+ }
+ out
+ };
+ for i in 0..n {
+ for c in 0..ch {
+ buf[i * ch + c] = mix.channels[c.min(1)][i].clamp(-1.0, 1.0);
+ }
+ }
+ cursor += n as i64;
+ });
+ match a.start(fill) {
+ Ok(_) => self.playback.audio_clock = true,
+ Err(e) => {
+ log::warn!("audio output unavailable: {e}");
+ self.playback.audio_clock = false;
+ }
+ }
+ }
+
+ fn advance_playback(&mut self, ctx: &egui::Context) {
+ if !self.playback.playing {
+ return;
+ }
+ let now = ctx.input(|i| i.time);
+ if self.playback.anchor_time < 0.0 {
+ self.playback.anchor_time = now;
+ }
+ let rate = self.session.sequence_rate();
+ let elapsed = if self.playback.audio_clock {
+ match self.audio.as_ref().and_then(|a| a.played_frames().map(|f| (f, a.sample_rate()))) {
+ Some((f, sr)) => f as f64 / sr as f64,
+ None => now - self.playback.anchor_time,
+ }
+ } else {
+ now - self.playback.anchor_time
+ };
+ let t = self.playback.anchor_tick + Tick::from_seconds_f64(elapsed * self.playback.speed);
+ let seq = self.session.active_sequence();
+ let dur = seq.map(|q| q.duration()).unwrap_or_default();
+ let (lo, hi) = if self.playback.looping {
+ (seq.and_then(|q| q.mark_in).unwrap_or(Tick::ZERO), seq.and_then(|q| q.mark_out).map(|o| o + rate.frame_duration()).unwrap_or(dur))
+ } else {
+ (Tick::ZERO, dur)
+ };
+ if t >= hi && self.playback.speed > 0.0 {
+ if self.playback.looping {
+ self.session.set_playhead(lo);
+ self.play(self.playback.speed);
+ } else {
+ self.session.set_playhead(hi - rate.frame_duration());
+ self.stop();
+ }
+ } else if t <= Tick::ZERO && self.playback.speed < 0.0 {
+ self.session.set_playhead(Tick::ZERO);
+ self.stop();
+ } else {
+ self.session.set_playhead(t);
+ }
+ ctx.request_repaint();
+ }
+
+ // ---------------------------------------------------------------- textures
+
+ /// Upload a rendered frame into a named texture (only when the key changed).
+ pub fn texture_for(&mut self, ctx: &egui::Context, name: &str, key: FrameKey, img: &frames::Rgba) -> egui::TextureId {
+ if let Some((k, tex)) = self.textures.get_mut(name) {
+ if *k != key {
+ tex.set(egui::ColorImage::from_rgba_unmultiplied([img.w, img.h], &img.px), TextureOptions::LINEAR);
+ *k = key;
+ }
+ return tex.id();
+ }
+ let tex = ctx.load_texture(name, egui::ColorImage::from_rgba_unmultiplied([img.w, img.h], &img.px), TextureOptions::LINEAR);
+ let id = tex.id();
+ self.textures.insert(name.to_string(), (key, tex));
+ id
+ }
+
+ pub fn texture_existing(&self, name: &str) -> Option<(egui::TextureId, egui::Vec2)> {
+ self.textures.get(name).map(|(_, t)| (t.id(), t.size_vec2()))
+ }
+
+ /// Get a thumbnail texture for an item at a media time (requested at low priority).
+ pub fn thumbnail(&mut self, ctx: &egui::Context, item: filmcraft_project::ItemId, t: Tick, width: u32) -> Option<(egui::TextureId, egui::Vec2)> {
+ let pi = self.session.project.item(item)?;
+ let src_w = match &pi.kind {
+ filmcraft_project::ItemKind::Media(m) => m.info.video.as_ref()?.width,
+ filmcraft_project::ItemKind::Sequence(s) => s.settings.width,
+ _ => return None,
+ };
+ let rate = pi.frame_rate();
+ let frame = rate.frame_at(t);
+ // Thumbnails ignore project revision (media content doesn't change); sequences use it.
+ let rev = if matches!(pi.kind, filmcraft_project::ItemKind::Sequence(_)) { self.session.revision } else { 0 };
+ let key = FrameKey { target: Target::Item(item), frame, size: width, revision: rev };
+ let name = format!("thumb-{}-{}-{}", item.0, frame, width);
+ if let Some(img) = self.frames.get(&key) {
+ let id = self.texture_for(ctx, &name, key, &img);
+ return Some((id, egui::vec2(img.w as f32, img.h as f32)));
+ }
+ let scale = width as f32 / src_w.max(1) as f32;
+ let project = self.session.project.clone();
+ self.frames.request(key, rate.tick_of(frame), scale, &project, 50);
+ self.texture_existing(&name)
+ }
+
+ // ---------------------------------------------------------------- files
+
+ pub fn file_dialog(&mut self, id: &str) -> Result<Value, String> {
+ match id {
+ "file.import" => {
+ let exts: Vec<&str> = filmcraft_media::VIDEO_EXTENSIONS
+ .iter()
+ .chain(filmcraft_media::AUDIO_EXTENSIONS)
+ .chain(filmcraft_media::STILL_EXTENSIONS)
+ .copied()
+ .collect();
+ let paths = self.hooks.pick_files.as_mut().map(|f| f(&exts)).unwrap_or_default();
+ if paths.is_empty() {
+ return Ok(Value::Null);
+ }
+ let r = self.session.execute("file.import", json!({"paths": paths})).map_err(|e| e.to_string());
+ if let Ok(v) = &r
+ && let Some(errs) = v.get("errors").and_then(Value::as_array)
+ && !errs.is_empty()
+ {
+ self.ui.status = errs.iter().filter_map(Value::as_str).collect::<Vec<_>>().join("; ");
+ }
+ r
+ }
+ "file.saveAs" | "file.save" => {
+ let suggested = format!("{}.fcproj", self.session.project.name);
+ let Some(path) = self.hooks.pick_save.as_mut().and_then(|f| f(&suggested)) else { return Ok(Value::Null) };
+ self.session.execute("file.saveAs", json!({"path": path})).map_err(|e| e.to_string())
+ }
+ "file.open" => {
+ let Some(path) = self.hooks.pick_open_project.as_mut().and_then(|f| f()) else { return Ok(Value::Null) };
+ self.session.execute("file.open", json!({"path": path})).map_err(|e| e.to_string())
+ }
+ _ => Err(format!("no dialog for {id}")),
+ }
+ }
+
+ /// Import dropped files.
+ fn handle_drops(&mut self, ctx: &egui::Context) {
+ let dropped = ctx.input(|i| i.raw.dropped_files.clone());
+ let mut paths = Vec::new();
+ for f in dropped {
+ let p = f.path();
+ if p.exists() {
+ paths.push(p.to_string_lossy().to_string());
+ }
+ }
+ if !paths.is_empty() {
+ let _ = self.session.execute("file.import", json!({"paths": paths}));
+ }
+ }
+
+ // ---------------------------------------------------------------- input
+
+ fn handle_shortcuts(&mut self, ctx: &egui::Context) {
+ if ctx.egui_wants_keyboard_input() {
+ return;
+ }
+ let mut fire = Vec::new();
+ ctx.input_mut(|i| {
+ for (m, k, id) in &self.bindings {
+ if i.consume_key(*m, *k) {
+ fire.push(id.clone());
+ }
+ }
+ });
+ for id in fire {
+ // Mark In/Out in the Source monitor when it has focus.
+ let params = if self.ui.focused == PanelKind::Source && matches!(id.as_str(), "markers.markIn" | "markers.markOut") {
+ json!({"target": "source"})
+ } else {
+ json!({})
+ };
+ if let Err(e) = menus::invoke(self, ctx, &id, params) {
+ self.ui.status = e;
+ }
+ }
+ }
+
+ // ---------------------------------------------------------------- control channel
+
+ fn drain_control(&mut self, ctx: &egui::Context) {
+ let Some(rx) = self.control_rx.take() else { return };
+ while let Ok(req) = rx.try_recv() {
+ let reply = req.reply.clone();
+ match control::handle(self, ctx, &req) {
+ control::Outcome::Done(v) => {
+ let _ = reply.send(v);
+ }
+ control::Outcome::AfterInput => self.input_waiters.push(reply),
+ control::Outcome::Screenshot { path, crop } => {
+ let token = self.next_token;
+ self.next_token += 1;
+ let settle = ctx.input(|i| i.time) + 0.25;
+ self.queued_screenshots.push((token, settle, 0));
+ self.pending_screenshots.push((token, path, crop, reply));
+ }
+ }
+ }
+ self.control_rx = Some(rx);
+ }
+
+ fn issue_screenshots(&mut self, ctx: &egui::Context) {
+ let now = ctx.input(|i| i.time);
+ let mut any = false;
+ self.queued_screenshots.retain_mut(|(token, at, frames)| {
+ *frames += 1;
+ any = true;
+ if now >= *at && *frames >= 3 {
+ ctx.send_viewport_cmd(egui::ViewportCommand::Screenshot(egui::UserData::new(*token)));
+ false
+ } else {
+ true
+ }
+ });
+ if any || !self.pending_screenshots.is_empty() {
+ ctx.request_repaint();
+ }
+ }
+
+ fn collect_screenshots(&mut self, ctx: &egui::Context) {
+ if self.pending_screenshots.is_empty() {
+ return;
+ }
+ let events: Vec<_> = ctx.input(|i| {
+ i.raw
+ .events
+ .iter()
+ .filter_map(|e| match e {
+ egui::Event::Screenshot { user_data, image, .. } => {
+ let token = user_data.data.as_ref().and_then(|d| d.downcast_ref::<u64>()).copied()?;
+ Some((token, image.clone()))
+ }
+ _ => None,
+ })
+ .collect()
+ });
+ for (token, image) in events {
+ if let Some(i) = self.pending_screenshots.iter().position(|(t, ..)| *t == token) {
+ let (_, path, crop, reply) = self.pending_screenshots.remove(i);
+ let r = control::save_screenshot(ctx, &image, path.as_deref(), crop);
+ let _ = reply.send(r);
+ }
+ }
+ }
+
+ // ---------------------------------------------------------------- frame
+
+ fn frame(&mut self, ui: &mut egui::Ui) {
+ let ctx = ui.ctx().clone();
+ self.auto.begin_frame();
+ self.frames.set_context(&ctx);
+ self.sync_pool();
+ for ev in self.session.drain_events() {
+ match ev {
+ filmcraft_engine::Event::OpenSequence(_) => {
+ self.ui.timeline.fit_pending = true;
+ self.ui.dock.activate(PanelKind::Timeline);
+ }
+ filmcraft_engine::Event::OpenSource(_) => {
+ self.ui.dock.activate(PanelKind::Source);
+ }
+ filmcraft_engine::Event::Toast { message, .. } => self.toast = Some((message, ctx.input(|i| i.time))),
+ filmcraft_engine::Event::ProjectChanged { .. } => {}
+ }
+ }
+ self.handle_drops(&ctx);
+ self.handle_shortcuts(&ctx);
+ self.advance_playback(&ctx);
+ let t = self.tokens;
+ let full = ui.max_rect();
+ ui.painter().rect_filled(full, 0.0, t.app_bg);
+ let header_h = 40.0;
+ let header = egui::Rect::from_min_size(full.min, egui::vec2(full.width(), header_h));
+ header::show(self, ui, header);
+ let body = egui::Rect::from_min_max(egui::pos2(full.min.x + 4.0, header.max.y + 1.0), egui::pos2(full.max.x - 4.0, full.max.y - 4.0));
+ match self.ui.mode {
+ state::Mode::Edit => self.dock_area(ui, body),
+ state::Mode::Import => panels::import_mode::show(self, ui, body),
+ state::Mode::Export => panels::export_mode::show(self, ui, body),
+ }
+ panels::dialogs::show(self, &ctx);
+ if !self.ui.status.is_empty() {
+ let r = egui::Rect::from_min_size(egui::pos2(full.center().x - 260.0, full.max.y - 34.0), egui::vec2(520.0, 26.0));
+ ui.painter().rect_filled(r, 13.0, Color32::from_black_alpha(210));
+ ui.painter().text(r.center(), egui::Align2::CENTER_CENTER, &self.ui.status, Tokens::ui(12.0), t.text);
+ let resp = ui.interact(r, egui::Id::new("status-toast"), egui::Sense::click());
+ if resp.clicked() {
+ self.ui.status.clear();
+ }
+ }
+ }
+
+ fn dock_area(&mut self, ui: &mut egui::Ui, body: egui::Rect) {
+ let t = self.tokens;
+ let mut dock = std::mem::replace(&mut self.ui.dock, dock::DockNode::Tabs { panels: vec![], active: 0 });
+ let mut groups = Vec::new();
+ dock::layout(ui, &mut dock, body, &t, "", &mut groups, &mut self.auto);
+ let mut actions = Vec::new();
+ for g in &groups {
+ actions.extend(dock::draw_group_chrome(ui, g, self.ui.focused, &t, &mut self.auto));
+ }
+ self.ui.dock = dock;
+ for g in &groups {
+ let Some(p) = g.panels.get(g.active).copied() else { continue };
+ self.auto.add(&format!("panel.{}", p.id()), g.content, p.title());
+ let mut child = ui.new_child(egui::UiBuilder::new().max_rect(g.content).id_salt(("panel", p.id())));
+ child.set_clip_rect(g.content);
+ panels::show(self, &mut child, p, g.content);
+ }
+ for a in actions {
+ match a {
+ dock::DockAction::Activate(p) => {
+ self.ui.dock.activate(p);
+ }
+ dock::DockAction::Focus(p) => self.ui.focused = p,
+ dock::DockAction::Close(p) => self.ui.dock.close(p),
+ dock::DockAction::PanelMenu(p, pos) => {
+ ui.ctx().data_mut(|d| d.insert_temp(egui::Id::new("panel-menu"), (p, pos)));
+ }
+ }
+ }
+ panels::panel_menu_popup(self, ui);
+ }
+}
+
+impl eframe::App for FilmcraftApp {
+ fn raw_input_hook(&mut self, _ctx: &egui::Context, raw_input: &mut egui::RawInput) {
+ if !self.synthetic.is_empty() {
+ let n = self
+ .synthetic
+ .iter()
+ .position(|e| matches!(e, egui::Event::PointerButton { pressed: false, .. } | egui::Event::Key { pressed: false, .. }))
+ .map_or(self.synthetic.len(), |i| i + 1);
+ raw_input.events.extend(self.synthetic.drain(..n));
+ }
+ }
+
+ fn logic(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
+ if !self.styled {
+ theme::install(ctx, &self.tokens);
+ self.styled = true;
+ ctx.request_repaint();
+ } else {
+ self.fonts_ready = true;
+ }
+ let now = ctx.input(|i| i.time);
+ let dt = (now - self.last_time) as f32;
+ if dt > 0.0 {
+ self.fps = self.fps * 0.9 + (1.0 / dt).min(480.0) * 0.1;
+ }
+ self.last_time = now;
+ self.drain_control(ctx);
+ self.issue_screenshots(ctx);
+ self.collect_screenshots(ctx);
+ }
+
+ fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
+ if !self.fonts_ready {
+ ui.ctx().request_repaint();
+ return;
+ }
+ self.frame(ui);
+ let ctx = ui.ctx().clone();
+ if !self.synthetic.is_empty() {
+ ctx.request_repaint();
+ } else if !self.input_waiters.is_empty() {
+ for w in self.input_waiters.drain(..) {
+ let _ = w.send(json!({"ok": true, "result": null}));
+ }
+ }
+ if self.frames.queue_len() > 0 {
+ ctx.request_repaint_after(std::time::Duration::from_millis(16));
+ }
+ }
+}
diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs
new file mode 100644
index 000000000..f00620d8b
--- /dev/null
+++ b/crates/ui-egui/src/menus.rs
@@ -0,0 +1,359 @@
+//! Menus and UI-level commands. The menu bar is generated from the engine registry plus the UI
+//! command table below (commands that only affect the frontend: tools, playback, zoom, panels).
+//! `invoke` is the single entry point used by menus, shortcuts and the control channel.
+
+use serde_json::{Value, json};
+
+use crate::FilmcraftApp;
+use crate::dock::PanelKind;
+use crate::state::{Mode, PlaybackRes, Tool};
+
+pub struct UiCommand {
+ pub id: &'static str,
+ pub label: &'static str,
+ pub menu: &'static [&'static str],
+ pub shortcut: Option<&'static str>,
+}
+
+macro_rules! uic {
+ ($id:literal, $label:literal, [$($m:literal),*], $sc:expr) => {
+ UiCommand { id: $id, label: $label, menu: &[$($m),*], shortcut: $sc }
+ };
+}
+
+pub const UI_COMMANDS: &[UiCommand] = &[
+ uic!("playback.toggle", "Play/Stop", [], Some("Space")),
+ uic!("playback.forward", "Shuttle Right", [], Some("L")),
+ uic!("playback.stop", "Shuttle Stop", [], Some("K")),
+ uic!("playback.reverse", "Shuttle Left", [], Some("J")),
+ uic!("playback.inToOut", "Play In to Out", [], Some("Shift+Space")),
+ uic!("playback.loop", "Loop", [], None),
+ uic!("view.zoomIn", "Zoom In", ["View"], Some("=")),
+ uic!("view.zoomOut", "Zoom Out", ["View"], Some("-")),
+ uic!("view.zoomToSequence", "Zoom to Sequence", ["View"], Some("\\")),
+ uic!("view.playbackRes.full", "Full", ["View", "Playback Resolution"], None),
+ uic!("view.playbackRes.half", "1/2", ["View", "Playback Resolution"], None),
+ uic!("view.playbackRes.quarter", "1/4", ["View", "Playback Resolution"], None),
+ uic!("view.playbackRes.eighth", "1/8", ["View", "Playback Resolution"], None),
+ uic!("view.safeMargins", "Safe Margins", ["View"], None),
+ uic!("view.theme.dark", "Darkest", ["View", "Appearance"], None),
+ uic!("view.theme.medium", "Medium", ["View", "Appearance"], None),
+ uic!("view.theme.light", "Light", ["View", "Appearance"], None),
+ uic!("window.workspace.editing", "Editing", ["Window", "Workspaces"], Some("Alt+Shift+1")),
+ uic!("window.workspace.assembly", "Assembly", ["Window", "Workspaces"], Some("Alt+Shift+2")),
+ uic!("window.workspace.color", "Color", ["Window", "Workspaces"], Some("Alt+Shift+3")),
+ uic!("window.workspace.effects", "Effects", ["Window", "Workspaces"], Some("Alt+Shift+4")),
+ uic!("window.workspace.audio", "Audio", ["Window", "Workspaces"], Some("Alt+Shift+5")),
+ uic!("window.workspace.captionsandgraphics", "Captions and Graphics", ["Window", "Workspaces"], Some("Alt+Shift+6")),
+ uic!("window.workspace.allpanels", "All Panels", ["Window", "Workspaces"], None),
+ uic!("window.workspace.reset", "Reset to Saved Layout", ["Window", "Workspaces"], Some("Alt+Shift+0")),
+ uic!("tool.selection", "Selection Tool", [], Some("V")),
+ uic!("tool.trackSelectForward", "Track Select Forward Tool", [], Some("A")),
+ uic!("tool.trackSelectBackward", "Track Select Backward Tool", [], Some("Shift+A")),
+ uic!("tool.ripple", "Ripple Edit Tool", [], Some("B")),
+ uic!("tool.rolling", "Rolling Edit Tool", [], Some("N")),
+ uic!("tool.rateStretch", "Rate Stretch Tool", [], Some("R")),
+ uic!("tool.razor", "Razor Tool", [], Some("C")),
+ uic!("tool.slip", "Slip Tool", [], Some("Y")),
+ uic!("tool.slide", "Slide Tool", [], Some("U")),
+ uic!("tool.pen", "Pen Tool", [], Some("P")),
+ uic!("tool.hand", "Hand Tool", [], Some("H")),
+ uic!("tool.zoom", "Zoom Tool", [], Some("Z")),
+ uic!("tool.type", "Type Tool", [], Some("T")),
+ uic!("mode.import", "Import", [], None),
+ uic!("mode.edit", "Edit", [], None),
+ uic!("mode.export", "Export", ["File", "Export"], Some("Cmd+M")),
+ uic!("app.about", "About FilmCraft", ["Help"], None),
+ uic!("help.shortcuts", "Keyboard Shortcuts", ["Help"], None),
+];
+
+pub fn panel_command_id(p: PanelKind) -> String {
+ format!("window.panel.{}", p.id())
+}
+
+/// Execute a UI or engine command by id.
+pub fn invoke(app: &mut FilmcraftApp, ctx: &egui::Context, id: &str, params: Value) -> Result<Value, String> {
+ if let Some(rest) = id.strip_prefix("window.panel.") {
+ let p = PanelKind::from_name(rest).ok_or_else(|| format!("unknown panel `{rest}`"))?;
+ app.show_panel(p);
+ return Ok(Value::Null);
+ }
+ if let Some(ws) = id.strip_prefix("window.workspace.") {
+ if ws == "reset" {
+ let name = app.ui.workspace.clone();
+ app.set_workspace(&name);
+ return Ok(Value::Null);
+ }
+ let name = crate::dock::WORKSPACES.iter().find(|w| w.to_ascii_lowercase().replace(' ', "") == ws).ok_or_else(|| format!("unknown workspace `{ws}`"))?;
+ app.set_workspace(name);
+ return Ok(json!({"workspace": name}));
+ }
+ if let Some(t) = id.strip_prefix("tool.") {
+ let tool = Tool::from_name(t).ok_or_else(|| format!("unknown tool `{t}`"))?;
+ app.ui.tool = tool;
+ return Ok(json!({"tool": tool}));
+ }
+ match id {
+ "playback.toggle" => {
+ app.toggle_play(1.0);
+ return Ok(json!({"playing": app.playback.playing}));
+ }
+ "playback.forward" => {
+ let s = if app.playback.playing && app.playback.speed > 0.0 { (app.playback.speed * 2.0).min(8.0) } else { 1.0 };
+ app.play(s);
+ return Ok(json!({"speed": app.playback.speed}));
+ }
+ "playback.reverse" => {
+ let s = if app.playback.playing && app.playback.speed < 0.0 { (app.playback.speed * 2.0).max(-8.0) } else { -1.0 };
+ app.play(s);
+ return Ok(json!({"speed": app.playback.speed}));
+ }
+ "playback.stop" => {
+ app.stop();
+ return Ok(Value::Null);
+ }
+ "playback.inToOut" => {
+ if let Some(i) = app.session.active_sequence().and_then(|q| q.mark_in) {
+ app.session.set_playhead(i);
+ }
+ app.play(1.0);
+ return Ok(Value::Null);
+ }
+ "playback.loop" => {
+ app.playback.looping = !app.playback.looping;
+ return Ok(json!({"loop": app.playback.looping}));
+ }
+ "view.zoomIn" | "view.zoomOut" => {
+ let f = if id == "view.zoomIn" { 1.6 } else { 1.0 / 1.6 };
+ let ph = app.session.playhead().seconds();
+ crate::panels::timeline::zoom_about(&mut app.ui.timeline, f, ph, app.last_timeline_width);
+ return Ok(Value::Null);
+ }
+ "view.zoomToSequence" => {
+ app.ui.timeline.fit_pending = true;
+ return Ok(Value::Null);
+ }
+ "view.safeMargins" => {
+ app.ui.program.safe_margins = !app.ui.program.safe_margins;
+ return Ok(Value::Null);
+ }
+ "mode.import" => {
+ app.ui.mode = Mode::Import;
+ return Ok(Value::Null);
+ }
+ "mode.edit" => {
+ app.ui.mode = Mode::Edit;
+ return Ok(Value::Null);
+ }
+ "mode.export" => {
+ app.ui.mode = Mode::Export;
+ return Ok(Value::Null);
+ }
+ "app.about" => {
+ app.dialog = Some(crate::Dialog::About);
+ return Ok(Value::Null);
+ }
+ "help.shortcuts" => {
+ app.dialog = Some(crate::Dialog::Shortcuts);
+ return Ok(Value::Null);
+ }
+ _ => {}
+ }
+ if let Some(r) = id.strip_prefix("view.playbackRes.") {
+ let res = match r {
+ "full" => PlaybackRes::Full,
+ "half" => PlaybackRes::Half,
+ "quarter" => PlaybackRes::Quarter,
+ "eighth" => PlaybackRes::Eighth,
+ _ => PlaybackRes::Sixteenth,
+ };
+ app.ui.program.res = res;
+ return Ok(Value::Null);
+ }
+ if let Some(th) = id.strip_prefix("view.theme.") {
+ let k = crate::theme::ThemeKind::from_name(th).ok_or("unknown theme")?;
+ app.set_theme(ctx, k);
+ return Ok(Value::Null);
+ }
+ // File dialogs for commands that need a path.
+ if (id == "file.import" && params.get("paths").is_none() && params.get("path").is_none())
+ || (id == "file.saveAs" && params.get("path").is_none())
+ || (id == "file.open" && params.get("path").is_none())
+ || (id == "file.save" && params.get("path").is_none() && app.session.path.is_none())
+ {
+ return app.file_dialog(id);
+ }
+ let r = app.session.execute(id, params).map_err(|e| e.to_string());
+ if let Err(e) = &r {
+ app.ui.status = e.clone();
+ }
+ r
+}
+
+/// A menu tree entry for display / `ui.menu.list`.
+#[derive(Clone, Debug, serde::Serialize)]
+pub struct MenuItem {
+ pub id: String,
+ pub label: String,
+ pub path: Vec<String>,
+ pub shortcut: Option<String>,
+ pub enabled: bool,
+}
+
+pub const MENUS: [&str; 9] = ["File", "Edit", "Clip", "Sequence", "Markers", "Graphics and Titles", "View", "Window", "Help"];
+
+pub fn menu_items(app: &FilmcraftApp) -> Vec<MenuItem> {
+ let mut out = Vec::new();
+ for c in filmcraft_engine::command_specs() {
+ if c.menu.is_empty() {
+ continue;
+ }
+ out.push(MenuItem {
+ id: c.id.into(),
+ label: c.label.into(),
+ path: c.menu.iter().map(|s| s.to_string()).collect(),
+ shortcut: c.shortcut.map(Into::into),
+ enabled: app.session.is_enabled(c.id),
+ });
+ }
+ for c in UI_COMMANDS {
+ if c.menu.is_empty() {
+ continue;
+ }
+ out.push(MenuItem {
+ id: c.id.into(),
+ label: c.label.into(),
+ path: c.menu.iter().map(|s| s.to_string()).collect(),
+ shortcut: c.shortcut.map(Into::into),
+ enabled: true,
+ });
+ }
+ for p in PanelKind::ALL {
+ out.push(MenuItem {
+ id: panel_command_id(p),
+ label: p.title().into(),
+ path: vec!["Window".into()],
+ shortcut: p.window_shortcut().map(Into::into),
+ enabled: true,
+ });
+ }
+ out
+}
+
+/// Pretty shortcut text for menus (macOS glyphs).
+pub fn shortcut_text(s: &str) -> String {
+ if cfg!(target_os = "macos") {
+ s.replace("Cmd+", "⌘")
+ .replace("Shift+", "⇧")
+ .replace("Alt+", "⌥")
+ .replace("Ctrl+", "⌃")
+ .replace("Backspace", "⌫")
+ .replace("Delete", "⌦")
+ .replace("Space", "Space")
+ } else {
+ s.replace("Cmd+", "Ctrl+")
+ }
+}
+
+/// Parse "Cmd+Shift+K" into modifiers + key.
+pub fn parse_shortcut(s: &str) -> Option<(egui::Modifiers, egui::Key)> {
+ let mut m = egui::Modifiers::NONE;
+ let mut key = None;
+ let parts: Vec<&str> = if s == "+" { vec!["+"] } else { s.split('+').collect() };
+ for p in parts {
+ match p {
+ "Cmd" => m.command = true,
+ "Shift" => m.shift = true,
+ "Alt" => m.alt = true,
+ "Ctrl" => m.ctrl = true,
+ k => {
+ key = match k {
+ ";" => Some(egui::Key::Semicolon),
+ "'" => Some(egui::Key::Quote),
+ "," => Some(egui::Key::Comma),
+ "." => Some(egui::Key::Period),
+ "/" => Some(egui::Key::Slash),
+ "\\" => Some(egui::Key::Backslash),
+ "=" => Some(egui::Key::Equals),
+ "-" => Some(egui::Key::Minus),
+ "`" => Some(egui::Key::Backtick),
+ _ => egui::Key::from_name(k),
+ }
+ }
+ }
+ }
+ key.map(|k| (m, k))
+}
+
+/// All shortcut bindings: (modifiers, key, command id).
+pub fn bindings() -> Vec<(egui::Modifiers, egui::Key, String)> {
+ let mut v = Vec::new();
+ for c in UI_COMMANDS {
+ if let Some((m, k)) = c.shortcut.and_then(parse_shortcut) {
+ v.push((m, k, c.id.to_string()));
+ }
+ }
+ for c in filmcraft_engine::command_specs() {
+ if let Some((m, k)) = c.shortcut.and_then(parse_shortcut) {
+ v.push((m, k, c.id.to_string()));
+ }
+ }
+ for p in PanelKind::ALL {
+ if let Some((m, k)) = p.window_shortcut().and_then(parse_shortcut) {
+ v.push((m, k, panel_command_id(p)));
+ }
+ }
+ // Most specific (more modifiers) first so Shift+I doesn't also fire I.
+ v.sort_by_key(|(m, _, _)| std::cmp::Reverse(m.command as u8 + m.shift as u8 + m.alt as u8 + m.ctrl as u8));
+ v
+}
+
+/// Draw the in-window menu bar.
+pub fn menu_bar(app: &mut FilmcraftApp, ui: &mut egui::Ui) {
+ let items = menu_items(app);
+ let ctx = ui.ctx().clone();
+ let mut clicked: Option<String> = None;
+ egui::MenuBar::new().ui(ui, |ui| {
+ for top in MENUS {
+ let mine: Vec<&MenuItem> = items.iter().filter(|i| i.path.first().map(String::as_str) == Some(top)).collect();
+ ui.menu_button(top, |ui| {
+ ui.set_min_width(260.0);
+ if mine.is_empty() {
+ ui.add_enabled(false, egui::Button::new("(empty)"));
+ }
+ let mut subs: Vec<&str> = Vec::new();
+ for it in &mine {
+ if it.path.len() > 1 {
+ let sub = it.path[1].as_str();
+ if !subs.contains(&sub) {
+ subs.push(sub);
+ ui.menu_button(sub, |ui| {
+ ui.set_min_width(220.0);
+ for s in mine.iter().filter(|x| x.path.get(1).map(String::as_str) == Some(sub)) {
+ if menu_entry(ui, s) {
+ clicked = Some(s.id.clone());
+ ui.close();
+ }
+ }
+ });
+ }
+ } else if menu_entry(ui, it) {
+ clicked = Some(it.id.clone());
+ ui.close();
+ }
+ }
+ });
+ }
+ });
+ if let Some(id) = clicked {
+ let _ = invoke(app, &ctx, &id, json!({}));
+ }
+}
+
+fn menu_entry(ui: &mut egui::Ui, it: &MenuItem) -> bool {
+ let mut b = egui::Button::new(&it.label);
+ if let Some(s) = &it.shortcut {
+ b = b.shortcut_text(shortcut_text(s));
+ }
+ ui.add_enabled(it.enabled, b).clicked()
+}
diff --git a/crates/ui-egui/src/panels/dialogs.rs b/crates/ui-egui/src/panels/dialogs.rs
new file mode 100644
index 000000000..4284cd79c
--- /dev/null
+++ b/crates/ui-egui/src/panels/dialogs.rs
@@ -0,0 +1,40 @@
+//! Modal dialogs (About, Keyboard Shortcuts).
+
+use crate::{Dialog, FilmcraftApp};
+
+pub fn show(app: &mut FilmcraftApp, ctx: &egui::Context) {
+ let Some(d) = app.dialog else { return };
+ let mut open = true;
+ match d {
+ Dialog::About => {
+ egui::Window::new("About FilmCraft").open(&mut open).collapsible(false).resizable(false).show(ctx, |ui| {
+ ui.heading("FilmCraft");
+ ui.label(format!("Version {}", env!("CARGO_PKG_VERSION")));
+ ui.label("A clean-room, pure-Rust non-linear video editor.");
+ ui.label("Fonts: Inter and JetBrains Mono (SIL OFL 1.1).");
+ });
+ }
+ Dialog::Shortcuts => {
+ egui::Window::new("Keyboard Shortcuts").open(&mut open).default_size([520.0, 520.0]).show(ctx, |ui| {
+ egui::ScrollArea::vertical().show(ui, |ui| {
+ egui::Grid::new("shortcuts").striped(true).show(ui, |ui| {
+ for c in filmcraft_engine::command_specs().iter().filter(|c| c.shortcut.is_some()) {
+ ui.label(c.label);
+ ui.monospace(crate::menus::shortcut_text(c.shortcut.unwrap_or("")));
+ ui.end_row();
+ }
+ for c in crate::menus::UI_COMMANDS.iter().filter(|c| c.shortcut.is_some()) {
+ ui.label(c.label);
+ ui.monospace(crate::menus::shortcut_text(c.shortcut.unwrap_or("")));
+ ui.end_row();
+ }
+ });
+ });
+ });
+ }
+ Dialog::NewSequence => {}
+ }
+ if !open {
+ app.dialog = None;
+ }
+}
diff --git a/crates/ui-egui/src/panels/effect_controls.rs b/crates/ui-egui/src/panels/effect_controls.rs
new file mode 100644
index 000000000..af6524f1e
--- /dev/null
+++ b/crates/ui-egui/src/panels/effect_controls.rs
@@ -0,0 +1,311 @@
+//! Effect Controls: the selected clip's effects (fixed Motion/Opacity/Time Remapping first, as in
+//! Premiere, then standard effects), generated from parameter schemas, with stopwatches and a
+//! keyframe lane on the right. Also hosts the Lumetri Color panel body (same editor, grouped).
+
+use egui::{Align2, Color32, Rect, Sense, Stroke, pos2, vec2};
+use filmcraft_project::{ClipId, EffectInstance, ParamKind, ParamValue, TrackItem};
+use filmcraft_time::Tick;
+use serde_json::{Value, json};
+
+use crate::FilmcraftApp;
+use crate::icons::{self, Icon};
+use crate::theme::Tokens;
+
+const ROW_H: f32 = 22.0;
+
+fn selected_clip(app: &FilmcraftApp) -> Option<(ClipId, TrackItem, filmcraft_project::TrackKind)> {
+ let seq = app.session.active_sequence()?;
+ let mut best = None;
+ for c in &app.session.state.selection {
+ if let Some((tid, it)) = seq.find_item(*c) {
+ let kind = seq.track(tid)?.kind;
+ if kind == filmcraft_project::TrackKind::Video {
+ return Some((*c, it.clone(), kind));
+ }
+ best.get_or_insert((*c, it.clone(), kind));
+ }
+ }
+ best
+}
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let Some((clip, it, kind)) = selected_clip(app) else {
+ crate::dock::placeholder(ui, rect, &t, "(no clip selected)");
+ return;
+ };
+ let seq = app.session.active_sequence().expect("seq").clone();
+ let split = rect.min.x + (rect.width() * 0.58).max(260.0).min(rect.width() - 60.0);
+ let head = Rect::from_min_size(rect.min + vec2(8.0, 2.0), vec2(split - rect.min.x - 8.0, 24.0));
+ ui.painter().text(pos2(head.min.x, head.center().y), Align2::LEFT_CENTER, format!("Source · {}", it.name), Tokens::ui(11.5), t.text_dim);
+ ui.painter().text(pos2(split - 6.0, head.center().y), Align2::RIGHT_CENTER, format!("{} · {}", seq_name(app), it.name), Tokens::ui(11.5), t.text);
+ // keyframe lane header: mini ruler over the clip's duration
+ let lane = Rect::from_min_max(pos2(split + 4.0, rect.min.y + 4.0), pos2(rect.max.x - 6.0, rect.max.y - 26.0));
+ ui.painter().rect_filled(lane, 0.0, t.tl_bg);
+ let ph = app.session.playhead();
+ let dur = it.duration.0.max(1) as f64;
+ let lx = |tk: Tick| -> f32 { lane.min.x + (((tk - it.start).0 as f64 / dur) as f32).clamp(0.0, 1.0) * lane.width() };
+ ui.painter().rect_filled(Rect::from_min_max(pos2(lane.min.x, lane.min.y + 2.0), pos2(lane.max.x, lane.min.y + 16.0)), 2.0, Color32::from_rgb(58, 58, 70));
+ ui.painter().text(pos2(lane.min.x + 4.0, lane.min.y + 9.0), Align2::LEFT_CENTER, &it.name, Tokens::ui(10.0), t.text);
+ let body = Rect::from_min_max(pos2(rect.min.x, head.max.y + 4.0), pos2(split, rect.max.y - 26.0));
+ let mut actions: Vec<(String, Value)> = Vec::new();
+ let mut bui = ui.new_child(egui::UiBuilder::new().max_rect(body).id_salt("ec-body"));
+ bui.set_clip_rect(Rect::from_min_max(body.min, pos2(rect.max.x, body.max.y)));
+ let mt_now = it.source_time_at(ph.clamp(it.start, it.end() - Tick(1)));
+ let heading = if kind == filmcraft_project::TrackKind::Video { "Video" } else { "Audio" };
+ bui.painter().text(pos2(body.min.x + 8.0, body.min.y + 8.0), Align2::LEFT_CENTER, heading, Tokens::semibold(11.5), t.text_dim);
+ bui.add_space(18.0);
+ for (idx, e) in it.effects.iter().enumerate() {
+ let Some(def) = e.def() else { continue };
+ let key = format!("{}:{}", clip.0, idx);
+ let open = !app.ui.collapsed_fx.contains(&key);
+ let (r, resp) = bui.allocate_exact_size(vec2(body.width(), ROW_H), Sense::click());
+ if resp.hovered() {
+ bui.painter().rect_filled(r, 0.0, t.hover);
+ }
+ icons::paint(
+ bui.painter(),
+ Rect::from_center_size(pos2(r.min.x + 10.0, r.center().y), vec2(10.0, 10.0)),
+ if open { Icon::ChevronDown } else { Icon::ChevronRight },
+ t.text_dim,
+ );
+ // fx enable toggle
+ let fxr = Rect::from_center_size(pos2(r.min.x + 28.0, r.center().y), vec2(18.0, 14.0));
+ let fxresp = bui.interact(fxr, egui::Id::new(("fxen", clip.0, idx)), Sense::click());
+ bui.painter().text(fxr.center(), Align2::CENTER_CENTER, "fx", Tokens::semibold(10.5), if e.enabled { t.text } else { t.text_faint });
+ if !e.enabled {
+ bui.painter().line_segment([fxr.left_bottom(), fxr.right_top()], Stroke::new(1.0, t.text_faint));
+ }
+ if fxresp.clicked() {
+ actions.push(("effects.toggleEnabled".into(), json!({"clip": clip.0, "index": idx})));
+ }
+ bui.painter().text(pos2(r.min.x + 42.0, r.center().y), Align2::LEFT_CENTER, def.name, Tokens::ui(12.0), t.text);
+ // reset button
+ let rr = Rect::from_center_size(pos2(r.max.x - 14.0, r.center().y), vec2(16.0, 16.0));
+ let rresp = bui.interact(rr, egui::Id::new(("fxreset", clip.0, idx)), Sense::click()).on_hover_text("Reset Effect");
+ icons::paint(bui.painter(), rr.shrink(2.0), Icon::Reset, if rresp.hovered() { t.text } else { t.text_dim });
+ if rresp.clicked() {
+ actions.push(("effects.reset".into(), json!({"clip": clip.0, "index": idx})));
+ }
+ app.auto.add(&format!("effectControls.effect.{}", e.effect), r, def.name);
+ if resp.clicked() && !fxresp.clicked() && !rresp.clicked() {
+ if open {
+ app.ui.collapsed_fx.push(key.clone());
+ } else {
+ app.ui.collapsed_fx.retain(|k| *k != key);
+ }
+ }
+ resp.context_menu(|ui| {
+ if !def.intrinsic && ui.button("Clear").clicked() {
+ actions.push(("effects.remove".into(), json!({"clip": clip.0, "index": idx})));
+ ui.close();
+ }
+ });
+ if !open {
+ continue;
+ }
+ for pd in &def.params {
+ param_row(app, &mut bui, body, clip, idx, e, pd, mt_now, &mut actions, &lane, &lx, &it);
+ }
+ }
+ // playhead in lane
+ let px = lx(ph);
+ ui.painter().line_segment([pos2(px, lane.min.y), pos2(px, lane.max.y)], Stroke::new(1.0, t.playhead));
+ // footer timecode
+ let tc = filmcraft_time::format_time(ph, seq.settings.frame_rate, seq.settings.drop_frame, filmcraft_time::TimeDisplay::Timecode, 48000);
+ ui.painter().text(pos2(rect.min.x + 10.0, rect.max.y - 13.0), Align2::LEFT_CENTER, tc, Tokens::mono(13.0), t.timecode);
+ for (cmd, p) in actions {
+ if let Err(e) = app.session.execute(&cmd, p) {
+ app.ui.status = e.to_string();
+ }
+ }
+}
+
+fn seq_name(app: &FilmcraftApp) -> String {
+ app.session.state.active_sequence.and_then(|s| app.session.project.item(s)).map(|i| i.name.clone()).unwrap_or_default()
+}
+
+#[allow(clippy::too_many_arguments)]
+fn param_row(
+ app: &mut FilmcraftApp,
+ ui: &mut egui::Ui,
+ body: Rect,
+ clip: ClipId,
+ idx: usize,
+ e: &EffectInstance,
+ pd: &filmcraft_project::ParamDef,
+ mt: Tick,
+ actions: &mut Vec<(String, Value)>,
+ lane: &Rect,
+ lx: &dyn Fn(Tick) -> f32,
+ it: &TrackItem,
+) {
+ let _ = lx;
+ let t = app.tokens;
+ let Some(param) = e.params.get(pd.id) else { return };
+ let (r, _) = ui.allocate_exact_size(vec2(body.width(), ROW_H), Sense::hover());
+ let mut x = r.min.x + 26.0;
+ if pd.animatable {
+ let sw = Rect::from_center_size(pos2(x, r.center().y), vec2(14.0, 14.0));
+ let resp = ui.interact(sw, egui::Id::new(("sw", clip.0, idx, pd.id)), Sense::click()).on_hover_text("Toggle animation");
+ icons::paint(ui.painter(), sw, Icon::Stopwatch, if param.is_animated() { t.accent } else { t.text_dim });
+ if resp.clicked() {
+ actions.push(("effects.toggleAnimation".into(), json!({"clip": clip.0, "effect": idx, "param": pd.id})));
+ }
+ app.auto.add(&format!("effectControls.{}.{}.stopwatch", e.effect, pd.id), sw, "Toggle animation");
+ }
+ x += 14.0;
+ ui.painter().text(pos2(x, r.center().y), Align2::LEFT_CENTER, pd.label, Tokens::ui(12.0), t.text);
+ let vx = r.min.x + (r.width() * 0.5).max(150.0);
+ let value = param.value_at(mt);
+ let mut vui = ui.new_child(
+ egui::UiBuilder::new()
+ .max_rect(Rect::from_min_max(pos2(vx, r.min.y + 1.0), pos2(r.max.x - 26.0, r.max.y - 1.0)))
+ .layout(egui::Layout::left_to_right(egui::Align::Center)),
+ );
+ let id = egui::Id::new(("pv", clip.0, idx, pd.id));
+ let mut set: Option<Value> = None;
+ match (&pd.kind, &value) {
+ (ParamKind::Float { min, max, soft_min, soft_max, unit, decimals }, ParamValue::Float(v)) => {
+ let speed = ((soft_max - soft_min) / 400.0).max(0.01);
+ let (_, nv) = crate::widgets::hot_number(&mut vui, id, *v, speed, (*min, *max), *decimals as usize, unit, &t);
+ if let Some(nv) = nv {
+ set = Some(json!(nv));
+ }
+ }
+ (ParamKind::Angle, ParamValue::Float(v)) => {
+ let (_, nv) = crate::widgets::hot_number(&mut vui, id, *v, 0.5, (-36000.0, 36000.0), 1, "°", &t);
+ if let Some(nv) = nv {
+ set = Some(json!(nv));
+ }
+ }
+ (ParamKind::Point, ParamValue::Vec2(p)) => {
+ let (_, nx) = crate::widgets::hot_number(&mut vui, id.with("x"), p.x, 1.0, (-100_000.0, 100_000.0), 1, "", &t);
+ let (_, ny) = crate::widgets::hot_number(&mut vui, id.with("y"), p.y, 1.0, (-100_000.0, 100_000.0), 1, "", &t);
+ if nx.is_some() || ny.is_some() {
+ set = Some(json!([nx.unwrap_or(p.x), ny.unwrap_or(p.y)]));
+ }
+ }
+ (ParamKind::Bool, ParamValue::Bool(b)) => {
+ let mut v = *b;
+ if vui.checkbox(&mut v, "").changed() {
+ set = Some(json!(v));
+ }
+ }
+ (ParamKind::Choice(opts), ParamValue::Choice(c)) => {
+ let mut sel = *c as usize;
+ egui::ComboBox::from_id_salt(id).selected_text(opts.get(sel).copied().unwrap_or("")).width(130.0).show_ui(&mut vui, |ui| {
+ for (i, o) in opts.iter().enumerate() {
+ if ui.selectable_value(&mut sel, i, *o).changed() {
+ set = Some(json!(i));
+ }
+ }
+ });
+ }
+ (ParamKind::Color, ParamValue::Color(c)) => {
+ let mut rgba = egui::Rgba::from_rgba_unmultiplied(c[0], c[1], c[2], c[3]);
+ if egui::color_picker::color_edit_button_rgba(&mut vui, &mut rgba, egui::color_picker::Alpha::Opaque).changed() {
+ set = Some(json!([rgba.r(), rgba.g(), rgba.b(), rgba.a()]));
+ }
+ }
+ _ => {
+ vui.label(format!("{value:?}"));
+ }
+ }
+ if let Some(v) = set {
+ actions.push(("effects.setParam".into(), json!({"clip": clip.0, "effect": idx, "param": pd.id, "value": v})));
+ }
+ // keyframes in the lane
+ if param.is_animated() {
+ let y = r.center().y;
+ for k in &param.keyframes {
+ // media time → timeline
+ let tl = it.start + Tick(((k.time - it.source_in).0 as f64 / it.speed.abs().max(1e-6)) as i64);
+ let f = ((tl - it.start).0 as f64 / it.duration.0.max(1) as f64) as f32;
+ if (0.0..=1.0).contains(&f) {
+ let kx = lane.min.x + f * lane.width();
+ icons::paint(ui.painter(), Rect::from_center_size(pos2(kx, y), vec2(10.0, 10.0)), Icon::Keyframe, Color32::from_rgb(200, 200, 200));
+ }
+ }
+ }
+}
+
+/// Lumetri Color panel: edits (or adds) the Lumetri effect on the selected clip, grouped by section.
+pub fn lumetri_panel(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let Some((clip, it, _)) = selected_clip(app) else {
+ crate::dock::placeholder(ui, rect, &t, "Select a clip to grade");
+ return;
+ };
+ let idx = it.effects.iter().position(|e| e.effect == "lumetri");
+ let mut bui = ui.new_child(egui::UiBuilder::new().max_rect(rect.shrink(6.0)).id_salt("lumetri"));
+ bui.label(egui::RichText::new(format!("Master · {}", it.name)).color(t.text_dim));
+ let Some(idx) = idx else {
+ if bui.button("Add Lumetri Color to clip").clicked() {
+ let _ = app.session.execute("effects.apply", json!({"clips": [clip.0], "effect": "lumetri"}));
+ }
+ return;
+ };
+ let e = it.effects[idx].clone();
+ let def = e.def().expect("lumetri def");
+ let ph = app.session.playhead();
+ let mt = it.source_time_at(ph.clamp(it.start, it.end() - Tick(1)));
+ let mut actions = Vec::new();
+ egui::ScrollArea::vertical().auto_shrink([false, false]).show(&mut bui, |ui| {
+ let mut groups: Vec<&str> = Vec::new();
+ for p in &def.params {
+ if let Some(g) = p.group
+ && !groups.contains(&g)
+ {
+ groups.push(g);
+ }
+ }
+ for g in groups {
+ let key = format!("lumetri:{g}");
+ let open = !app.ui.collapsed_fx.contains(&key);
+ let (resp, now_open) = crate::widgets::section_header(ui, egui::Id::new(&key), g, open, &t, true);
+ app.auto.add(&format!("lumetri.section.{g}"), resp.rect, g);
+ if now_open != open {
+ if now_open {
+ app.ui.collapsed_fx.retain(|k| *k != key);
+ } else {
+ app.ui.collapsed_fx.push(key.clone());
+ }
+ }
+ if !now_open {
+ continue;
+ }
+ for pd in def.params.iter().filter(|p| p.group == Some(g)) {
+ let v = e.params.get(pd.id).map(|p| p.value_at(mt)).unwrap_or(pd.default.clone());
+ ui.horizontal(|ui| {
+ ui.add_space(18.0);
+ ui.add_sized(vec2(110.0, 18.0), egui::Label::new(egui::RichText::new(pd.label).size(12.0)));
+ if let (ParamKind::Float { min, max, soft_min, soft_max, .. }, ParamValue::Float(x)) = (&pd.kind, &v) {
+ let mut val = *x;
+ let s = ui.add(egui::Slider::new(&mut val, *soft_min..=*soft_max).show_value(false));
+ let (_, nv) =
+ crate::widgets::hot_number(ui, egui::Id::new(("lum", pd.id)), val, (soft_max - soft_min) / 300.0, (*min, *max), 1, "", &t);
+ if s.changed() {
+ actions.push(json!({"clip": clip.0, "effect": idx, "param": pd.id, "value": val}));
+ } else if let Some(nv) = nv {
+ actions.push(json!({"clip": clip.0, "effect": idx, "param": pd.id, "value": nv}));
+ }
+ if s.double_clicked() {
+ actions.push(json!({"clip": clip.0, "effect": idx, "param": pd.id, "value": pd.default.as_f64().unwrap_or(0.0)}));
+ }
+ } else if let ParamValue::Color(c) = v {
+ let mut rgba = egui::Rgba::from_rgba_unmultiplied(c[0], c[1], c[2], c[3]);
+ if egui::color_picker::color_edit_button_rgba(ui, &mut rgba, egui::color_picker::Alpha::Opaque).changed() {
+ actions.push(json!({"clip": clip.0, "effect": idx, "param": pd.id, "value": [rgba.r(), rgba.g(), rgba.b(), 1.0]}));
+ }
+ }
+ });
+ }
+ }
+ });
+ for a in actions {
+ if let Err(e) = app.session.execute("effects.setParam", a) {
+ app.ui.status = e.to_string();
+ }
+ }
+}
diff --git a/crates/ui-egui/src/panels/effects.rs b/crates/ui-egui/src/panels/effects.rs
new file mode 100644
index 000000000..c9a3a6ce4
--- /dev/null
+++ b/crates/ui-egui/src/panels/effects.rs
@@ -0,0 +1,122 @@
+//! Effects panel: searchable folder tree of presets, audio/video effects and transitions (from the
+//! effect definitions). Drag onto a clip or edit point; double-click applies to the selection.
+
+use egui::{Align2, Color32, Rect, Sense, pos2, vec2};
+use serde_json::json;
+
+use crate::FilmcraftApp;
+use crate::icons::{self, Icon};
+use crate::theme::Tokens;
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let sr = Rect::from_min_size(rect.min + vec2(8.0, 6.0), vec2(rect.width() - 16.0, 22.0));
+ let mut child = ui.new_child(egui::UiBuilder::new().max_rect(sr));
+ let mut q = app.ui.effects_search.clone();
+ crate::widgets::search_field(&mut child, &mut q, "Search effects", sr.width(), &t);
+ app.ui.effects_search = q.clone();
+ let body = Rect::from_min_max(pos2(rect.min.x, sr.max.y + 6.0), rect.max);
+ let mut bui = ui.new_child(egui::UiBuilder::new().max_rect(body).id_salt("fx-body"));
+ bui.set_clip_rect(body);
+ let filter = q.to_ascii_lowercase();
+ let defs = filmcraft_project::effect_defs();
+ // folder tree: top-level categories in Premiere's order
+ let tops = ["Presets", "Lumetri Presets", "Audio Effects", "Audio Transitions", "Video Effects", "Video Transitions"];
+ let mut apply: Option<String> = None;
+ egui::ScrollArea::vertical().id_salt("fx-scroll").auto_shrink([false, false]).show(&mut bui, |ui| {
+ for top in tops {
+ let items: Vec<_> = defs
+ .iter()
+ .filter(|d| d.category.first() == Some(&top))
+ .filter(|d| filter.is_empty() || d.name.to_ascii_lowercase().contains(&filter))
+ .collect();
+ if !filter.is_empty() && items.is_empty() {
+ continue;
+ }
+ let open = folder_row(app, ui, top, 0, &filter);
+ if !open {
+ continue;
+ }
+ let mut subs: Vec<&str> = items.iter().filter_map(|d| d.category.get(1).copied()).collect();
+ subs.dedup();
+ let mut seen = Vec::new();
+ for s in subs {
+ if seen.contains(&s) {
+ continue;
+ }
+ seen.push(s);
+ let key = format!("{top}/{s}");
+ if !folder_row(app, ui, &key, 1, &filter) {
+ continue;
+ }
+ for d in items.iter().filter(|d| d.category.get(1) == Some(&s)) {
+ let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), 20.0), Sense::click_and_drag());
+ if resp.hovered() {
+ ui.painter().rect_filled(r, 0.0, t.hover);
+ }
+ let x = r.min.x + 46.0;
+ let icon_r = Rect::from_center_size(pos2(x - 10.0, r.center().y), vec2(13.0, 13.0));
+ let is_tr = matches!(d.kind, filmcraft_project::EffectKind::VideoTransition | filmcraft_project::EffectKind::AudioTransition);
+ ui.painter().rect_stroke(icon_r, 2.0, egui::Stroke::new(1.0, t.text_dim), egui::StrokeKind::Inside);
+ if is_tr {
+ ui.painter().line_segment([icon_r.left_bottom(), icon_r.right_top()], egui::Stroke::new(1.0, t.text_dim));
+ } else {
+ ui.painter().text(icon_r.center(), Align2::CENTER_CENTER, "fx", Tokens::ui(8.0), t.text_dim);
+ }
+ ui.painter().text(pos2(x, r.center().y), Align2::LEFT_CENTER, d.name, Tokens::ui(12.0), t.text);
+ // badges: accelerated / 32-bit / YUV
+ let mut bx = r.max.x - 8.0;
+ for (on, label) in [(d.yuv, "YUV"), (d.float32, "32"), (d.accelerated, "⚡")] {
+ if on && !is_tr || (is_tr && label == "⚡") {
+ let br = Rect::from_min_size(pos2(bx - 22.0, r.min.y + 3.0), vec2(20.0, 14.0));
+ ui.painter().rect_filled(br, 2.0, Color32::from_rgb(48, 48, 48));
+ ui.painter().text(br.center(), Align2::CENTER_CENTER, label, Tokens::ui(8.5), t.text_dim);
+ bx -= 24.0;
+ }
+ }
+ app.auto.add(&format!("effects.item.{}", d.id), r, d.name);
+ if resp.drag_started() {
+ crate::panels::start_drag_effect(ui, d.id);
+ }
+ if resp.double_clicked() {
+ apply = Some(d.id.to_string());
+ }
+ }
+ }
+ }
+ });
+ if let Some(id) = apply {
+ let r = app.session.execute("effects.apply", json!({"effect": id}));
+ if let Err(e) = r {
+ app.ui.status = e.to_string();
+ }
+ }
+}
+
+fn folder_row(app: &mut FilmcraftApp, ui: &mut egui::Ui, key: &str, depth: usize, filter: &str) -> bool {
+ let t = app.tokens;
+ let open = !filter.is_empty() || app.ui.expanded_fx.iter().any(|k| k == key);
+ let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), 20.0), Sense::click());
+ if resp.hovered() {
+ ui.painter().rect_filled(r, 0.0, t.hover);
+ }
+ let x = r.min.x + 8.0 + depth as f32 * 16.0;
+ icons::paint(
+ ui.painter(),
+ Rect::from_center_size(pos2(x + 4.0, r.center().y), vec2(10.0, 10.0)),
+ if open { Icon::ChevronDown } else { Icon::ChevronRight },
+ t.text_dim,
+ );
+ icons::paint(ui.painter(), Rect::from_center_size(pos2(x + 18.0, r.center().y), vec2(13.0, 13.0)), Icon::Folder, t.text_dim);
+ let name = key.rsplit('/').next().unwrap_or(key);
+ ui.painter().text(pos2(x + 30.0, r.center().y), Align2::LEFT_CENTER, name, Tokens::ui(12.0), t.text);
+ app.auto.add(&format!("effects.folder.{key}"), r, name);
+ if resp.clicked() {
+ if open {
+ app.ui.expanded_fx.retain(|k| k != key);
+ } else {
+ app.ui.expanded_fx.push(key.to_string());
+ }
+ }
+ open
+}
diff --git a/crates/ui-egui/src/panels/export_mode.rs b/crates/ui-egui/src/panels/export_mode.rs
new file mode 100644
index 000000000..254dc872f
--- /dev/null
+++ b/crates/ui-egui/src/panels/export_mode.rs
@@ -0,0 +1,65 @@
+//! Export mode (header "Export"): destination list, settings and a live preview. The encode
+//! pipeline lands in M6; the page already shows the sequence preview and settings summary.
+
+use egui::{Align2, Color32, Rect, pos2, vec2};
+
+use crate::FilmcraftApp;
+use crate::frames::{FrameKey, Target};
+use crate::theme::Tokens;
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let left = Rect::from_min_size(rect.min, vec2(220.0, rect.height()));
+ let right = Rect::from_min_max(pos2(rect.max.x - 360.0, rect.min.y), rect.max);
+ let mid = Rect::from_min_max(pos2(left.max.x + 4.0, rect.min.y), pos2(right.min.x - 4.0, rect.max.y));
+ for r in [left, mid, right] {
+ ui.painter().rect_filled(r, t.radius, t.panel_bg);
+ }
+ ui.painter().text(left.min + vec2(14.0, 20.0), Align2::LEFT_CENTER, "Destinations", Tokens::semibold(13.0), t.text);
+ for (i, d) in ["Media File", "YouTube", "Vimeo", "TikTok", "Instagram", "FTP"].iter().enumerate() {
+ let r = Rect::from_min_size(left.min + vec2(8.0, 40.0 + i as f32 * 30.0), vec2(left.width() - 16.0, 26.0));
+ if i == 0 {
+ ui.painter().rect_filled(r, 4.0, t.row_selected);
+ }
+ ui.painter().text(pos2(r.min.x + 10.0, r.center().y), Align2::LEFT_CENTER, *d, Tokens::ui(12.5), t.text);
+ }
+ // preview
+ if let Some(seq_id) = app.session.state.active_sequence {
+ let q = app.session.active_sequence().expect("seq").clone();
+ let rate = q.settings.frame_rate;
+ let frame = rate.frame_at(app.session.playhead());
+ let key = FrameKey { target: Target::Sequence(seq_id), frame, size: 500, revision: app.session.revision };
+ let project = app.session.project.clone();
+ app.frames.request(key, rate.tick_of(frame), 0.5, &project, 0);
+ let pic = crate::panels::monitor::fit(mid.shrink(24.0), q.settings.width as f32, q.settings.height as f32);
+ ui.painter().rect_filled(pic, 0.0, Color32::BLACK);
+ if let Some(img) = app.frames.get(&key) {
+ let ctx = ui.ctx().clone();
+ let tex = app.texture_for(&ctx, "export-preview", key, &img);
+ ui.painter().image(tex, pic, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);
+ }
+ // settings summary
+ let lines = [
+ ("File name", format!("{}.mp4", app.session.project.item(seq_id).map(|i| i.name.clone()).unwrap_or_default())),
+ ("Preset", "Match Source - Adaptive High Bitrate".into()),
+ ("Format", "H.264".into()),
+ ("Video", format!("{}x{} · {} fps · VBR 1 pass, target 20 Mbps", q.settings.width, q.settings.height, q.settings.frame_rate.label())),
+ ("Audio", format!("AAC · {} Hz · Stereo · 320 kbps", q.settings.sample_rate)),
+ ("Range", "Entire Source".into()),
+ ];
+ let mut y = right.min.y + 22.0;
+ ui.painter().text(pos2(right.min.x + 16.0, y), Align2::LEFT_CENTER, "Settings", Tokens::semibold(13.0), t.text);
+ y += 28.0;
+ for (k, v) in lines {
+ ui.painter().text(pos2(right.min.x + 16.0, y), Align2::LEFT_CENTER, k, Tokens::ui(11.5), t.text_dim);
+ ui.painter().text(pos2(right.min.x + 16.0, y + 16.0), Align2::LEFT_CENTER, v, Tokens::ui(12.5), t.text);
+ y += 42.0;
+ }
+ let b = Rect::from_min_size(pos2(right.max.x - 120.0, right.max.y - 44.0), vec2(104.0, 30.0));
+ ui.painter().rect_filled(b, 15.0, t.accent);
+ ui.painter().text(b.center(), Align2::CENTER_CENTER, "Export", Tokens::semibold(13.0), Color32::WHITE);
+ app.auto.add("export.button", b, "Export");
+ } else {
+ crate::dock::placeholder(ui, mid, &t, "Open a sequence to export");
+ }
+}
diff --git a/crates/ui-egui/src/panels/import_mode.rs b/crates/ui-egui/src/panels/import_mode.rs
new file mode 100644
index 000000000..fa2bf0c64
--- /dev/null
+++ b/crates/ui-egui/src/panels/import_mode.rs
@@ -0,0 +1,47 @@
+//! Import mode (header "Import"): large browser cards for importing media and demo footage.
+
+use egui::{Align2, Color32, Rect, Sense, pos2, vec2};
+use serde_json::json;
+
+use crate::FilmcraftApp;
+use crate::theme::Tokens;
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ ui.painter().rect_filled(rect, t.radius, t.panel_bg);
+ ui.painter().text(rect.min + vec2(24.0, 30.0), Align2::LEFT_CENTER, "Import", Tokens::semibold(22.0), t.text);
+ ui.painter().text(
+ rect.min + vec2(24.0, 58.0),
+ Align2::LEFT_CENTER,
+ "Add media to your project. Drop files anywhere in the window, or choose a source below.",
+ Tokens::ui(13.0),
+ t.text_dim,
+ );
+ let ctx = ui.ctx().clone();
+ let cards = [
+ ("Browse files…", "file.import", "Movies, audio and stills from disk"),
+ ("Demo footage", "file.importDemoFootage", "Six procedural 1080p clips with sound"),
+ ("Demo project", "file.openDemoProject", "A cut sequence with transitions, effects and music"),
+ ("Bars and Tone", "file.newBarsAndTone", "SMPTE HD bars with 1 kHz reference tone"),
+ ];
+ let cw = 260.0;
+ for (i, (title, cmd, sub)) in cards.iter().enumerate() {
+ let r = Rect::from_min_size(rect.min + vec2(24.0 + i as f32 * (cw + 16.0), 90.0), vec2(cw, 150.0));
+ let resp = ui.interact(r, egui::Id::new(("imp", *cmd)), Sense::click());
+ app.auto.add(&format!("import.{cmd}"), r, title);
+ ui.painter().rect_filled(r, 8.0, if resp.hovered() { t.hover } else { t.tl_header_bg });
+ ui.painter().text(r.min + vec2(16.0, 110.0), Align2::LEFT_CENTER, *title, Tokens::semibold(14.0), t.text);
+ ui.painter().text(r.min + vec2(16.0, 132.0), Align2::LEFT_CENTER, *sub, Tokens::ui(11.5), t.text_dim);
+ crate::icons::paint(
+ ui.painter(),
+ Rect::from_min_size(r.min + vec2(16.0, 18.0), vec2(56.0, 56.0)),
+ [crate::icons::Icon::Folder, crate::icons::Icon::Film, crate::icons::Icon::Sequence, crate::icons::Icon::Grid][i],
+ Color32::from_rgb(140, 150, 255),
+ );
+ if resp.clicked() {
+ let _ = crate::menus::invoke(app, &ctx, cmd, json!({}));
+ app.ui.mode = crate::state::Mode::Edit;
+ }
+ }
+ let _ = pos2(0.0, 0.0);
+}
diff --git a/crates/ui-egui/src/panels/meters.rs b/crates/ui-egui/src/panels/meters.rs
new file mode 100644
index 000000000..b96afc7ff
--- /dev/null
+++ b/crates/ui-egui/src/panels/meters.rs
@@ -0,0 +1,100 @@
+//! Audio Meters (stereo peak meters with dB scale and peak hold) and a basic Audio Track Mixer.
+//! Levels are measured from the mixed sequence audio around the playhead.
+
+use egui::{Align2, Rect, Sense, pos2, vec2};
+use serde_json::json;
+
+use crate::FilmcraftApp;
+use crate::theme::Tokens;
+
+fn levels(app: &FilmcraftApp) -> [f32; 2] {
+ let Some(seq) = app.session.active_sequence() else { return [-90.0; 2] };
+ if !app.playback.playing {
+ return [-90.0; 2];
+ }
+ let sr = seq.settings.sample_rate as i64;
+ let s0 = app.session.playhead().to_units_floor(sr);
+ let provider = app.session.media.provider(app.session.project.clone(), app.session.services.clone());
+ let buf = filmcraft_render::audio::mix_sequence(&app.session.project, seq, s0, 1024, &provider);
+ let p = buf.peaks();
+ [20.0 * p.first().copied().unwrap_or(0.0).max(1e-6).log10(), 20.0 * p.get(1).copied().unwrap_or(0.0).max(1e-6).log10()]
+}
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let lv = levels(app);
+ let id = egui::Id::new("meter-state");
+ let now = ui.input(|i| i.time);
+ let mut st: [f32; 4] = ui.data(|d| d.get_temp(id)).unwrap_or([-90.0; 4]);
+ for c in 0..2 {
+ // fast attack, 20 dB/s release; peak hold decays after 1.5 s
+ st[c] = if lv[c] > st[c] { lv[c] } else { (st[c] - 20.0 * ui.input(|i| i.stable_dt)).max(-90.0) };
+ st[c + 2] = if lv[c] > st[c + 2] { lv[c] } else { st[c + 2] - 6.0 * ui.input(|i| i.stable_dt) };
+ }
+ ui.data_mut(|d| d.insert_temp(id, st));
+ let _ = now;
+ let area = Rect::from_min_max(pos2(rect.min.x + 6.0, rect.min.y + 6.0), pos2(rect.max.x - 22.0, rect.max.y - 24.0));
+ let w = ((area.width() - 3.0) / 2.0).max(3.0);
+ for c in 0..2 {
+ let r = Rect::from_min_size(pos2(area.min.x + c as f32 * (w + 3.0), area.min.y), vec2(w, area.height()));
+ crate::widgets::meter_bar(ui.painter(), r, st[c], st[c + 2], &t);
+ }
+ // dB scale
+ for db in [0, -6, -12, -18, -24, -30, -36, -42, -48, -54] {
+ let y = area.max.y - area.height() * ((db as f32 + 60.0) / 60.0);
+ ui.painter().text(pos2(rect.max.x - 4.0, y), Align2::RIGHT_CENTER, format!("{db}"), Tokens::ui(8.5), t.text_faint);
+ }
+ // S S solo buttons at the bottom (Premiere has solo toggles per channel)
+ for c in 0..2 {
+ let r = Rect::from_min_size(pos2(area.min.x + c as f32 * (w + 3.0), rect.max.y - 20.0), vec2(w.max(12.0), 14.0));
+ ui.painter().rect_stroke(r, 7.0, egui::Stroke::new(1.0, t.separator), egui::StrokeKind::Inside);
+ ui.painter().text(r.center(), Align2::CENTER_CENTER, "S", Tokens::ui(8.5), t.text_dim);
+ }
+ if app.playback.playing {
+ ui.ctx().request_repaint();
+ }
+ app.auto.add("audioMeters", area, "Audio Meters");
+}
+
+pub fn track_mixer(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let Some(seq) = app.session.active_sequence().cloned() else {
+ crate::dock::placeholder(ui, rect, &t, "(no sequence)");
+ return;
+ };
+ let strip_w = 86.0;
+ let mut actions = Vec::new();
+ for (i, tr) in seq.audio_tracks.iter().enumerate().chain(std::iter::empty()) {
+ let x = rect.min.x + 8.0 + i as f32 * (strip_w + 4.0);
+ if x + strip_w > rect.max.x {
+ break;
+ }
+ let strip = Rect::from_min_max(pos2(x, rect.min.y + 6.0), pos2(x + strip_w, rect.max.y - 6.0));
+ ui.painter().rect_filled(strip, 4.0, t.tl_header_bg);
+ ui.painter().text(pos2(strip.center().x, strip.min.y + 12.0), Align2::CENTER_CENTER, format!("A{}", i + 1), Tokens::semibold(11.0), t.text);
+ // pan knob as hot number
+ let mut pan_ui = ui.new_child(egui::UiBuilder::new().max_rect(Rect::from_min_size(pos2(strip.min.x + 20.0, strip.min.y + 26.0), vec2(60.0, 18.0))));
+ let (_, np) = crate::widgets::hot_number(&mut pan_ui, egui::Id::new(("pan", tr.id.0)), tr.pan, 1.0, (-100.0, 100.0), 0, "", &t);
+ if let Some(np) = np {
+ actions.push(json!({"track": tr.id.0, "pan": np}));
+ }
+ // fader
+ let fader = Rect::from_min_max(pos2(strip.center().x - 3.0, strip.min.y + 54.0), pos2(strip.center().x + 3.0, strip.max.y - 40.0));
+ ui.painter().rect_filled(fader, 3.0, t.field_bg);
+ let norm = ((tr.volume_db + 60.0) / 66.0).clamp(0.0, 1.0) as f32;
+ let ky = fader.max.y - norm * fader.height();
+ let knob = Rect::from_center_size(pos2(fader.center().x, ky), vec2(26.0, 10.0));
+ let resp = ui.interact(knob.expand(4.0), egui::Id::new(("fader", tr.id.0)), Sense::drag());
+ ui.painter().rect_filled(knob, 2.0, if resp.dragged() { t.accent } else { egui::Color32::from_rgb(160, 160, 160) });
+ if resp.dragged() {
+ let nn = (norm - resp.drag_delta().y / fader.height()).clamp(0.0, 1.0);
+ actions.push(json!({"track": tr.id.0, "volumeDb": nn as f64 * 66.0 - 60.0}));
+ }
+ app.auto.add(&format!("mixer.A{}.fader", i + 1), knob, "volume");
+ ui.painter().text(pos2(strip.center().x, strip.max.y - 26.0), Align2::CENTER_CENTER, format!("{:.1}", tr.volume_db), Tokens::ui(11.0), t.hot_text);
+ ui.painter().text(pos2(strip.center().x, strip.max.y - 10.0), Align2::CENTER_CENTER, &tr.name, Tokens::ui(10.0), t.text_dim);
+ }
+ for a in actions {
+ let _ = app.session.execute("timeline.setTrack", a);
+ }
+}
diff --git a/crates/ui-egui/src/panels/misc.rs b/crates/ui-egui/src/panels/misc.rs
new file mode 100644
index 000000000..2c1b070d1
--- /dev/null
+++ b/crates/ui-egui/src/panels/misc.rs
@@ -0,0 +1,245 @@
+//! Smaller panels: History, Markers, Info, Media Browser, Lumetri Scopes.
+
+use egui::{Align2, Color32, Rect, Sense, pos2, vec2};
+use filmcraft_time::{TimeDisplay, format_time};
+use serde_json::json;
+
+use crate::FilmcraftApp;
+use crate::frames::{FrameKey, Target};
+use crate::theme::Tokens;
+
+pub fn history(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect.shrink(6.0)));
+ let undo: Vec<String> = app.session.history.undo.iter().map(|h| h.0.clone()).collect();
+ let redo: Vec<String> = app.session.history.redo.iter().rev().map(|h| h.0.clone()).collect();
+ let mut target: Option<i64> = None;
+ egui::ScrollArea::vertical().auto_shrink([false, false]).show(&mut child, |ui| {
+ let row = |ui: &mut egui::Ui, label: &str, current: bool, dim: bool| -> bool {
+ let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), 20.0), Sense::click());
+ if current {
+ ui.painter().rect_filled(r, 0.0, t.row_selected);
+ } else if resp.hovered() {
+ ui.painter().rect_filled(r, 0.0, t.hover);
+ }
+ ui.painter().text(pos2(r.min.x + 8.0, r.center().y), Align2::LEFT_CENTER, label, Tokens::ui(12.0), if dim { t.text_faint } else { t.text });
+ resp.clicked()
+ };
+ if row(ui, "Open", undo.is_empty(), false) {
+ target = Some(-(undo.len() as i64));
+ }
+ for (i, l) in undo.iter().enumerate() {
+ if row(ui, l, i + 1 == undo.len(), false) {
+ target = Some(i as i64 + 1 - undo.len() as i64);
+ }
+ }
+ for (i, l) in redo.iter().enumerate() {
+ if row(ui, l, false, true) {
+ target = Some(i as i64 + 1);
+ }
+ }
+ });
+ if let Some(n) = target {
+ if n < 0 {
+ for _ in 0..-n {
+ app.session.undo();
+ }
+ } else {
+ for _ in 0..n {
+ app.session.redo();
+ }
+ }
+ }
+}
+
+pub fn markers(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let Some(seq) = app.session.active_sequence().cloned() else {
+ crate::dock::placeholder(ui, rect, &t, "(no sequence)");
+ return;
+ };
+ let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect.shrink(6.0)));
+ let mut go = None;
+ egui::ScrollArea::vertical().auto_shrink([false, false]).show(&mut child, |ui| {
+ for m in &seq.markers {
+ let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), 38.0), Sense::click());
+ if resp.hovered() {
+ ui.painter().rect_filled(r, 3.0, t.hover);
+ }
+ let c = m.color.rgb();
+ ui.painter().rect_filled(Rect::from_min_size(r.min + vec2(4.0, 6.0), vec2(4.0, 26.0)), 2.0, Color32::from_rgb(c[0], c[1], c[2]));
+ ui.painter().text(
+ pos2(r.min.x + 16.0, r.min.y + 12.0),
+ Align2::LEFT_CENTER,
+ if m.name.is_empty() { "Marker" } else { &m.name },
+ Tokens::ui(12.0),
+ t.text,
+ );
+ let tc = format_time(m.start, seq.settings.frame_rate, seq.settings.drop_frame, TimeDisplay::Timecode, 48000);
+ ui.painter().text(pos2(r.min.x + 16.0, r.min.y + 27.0), Align2::LEFT_CENTER, tc, Tokens::mono(11.0), t.hot_text);
+ if resp.clicked() {
+ go = Some(m.start);
+ }
+ }
+ if seq.markers.is_empty() {
+ ui.label(egui::RichText::new("No markers. Press M to add one.").color(t.text_faint));
+ }
+ });
+ if let Some(g) = go {
+ app.session.set_playhead(g);
+ }
+}
+
+pub fn info(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect.shrink(8.0)));
+ let ui = &mut child;
+ let line = |ui: &mut egui::Ui, k: &str, v: String| {
+ ui.horizontal(|ui| {
+ ui.add_sized(vec2(90.0, 16.0), egui::Label::new(egui::RichText::new(k).color(t.text_dim)));
+ ui.label(v);
+ });
+ };
+ if let Some(item) = app.session.state.project_selection.first().and_then(|i| app.session.project.item(*i)).cloned() {
+ ui.label(egui::RichText::new(&item.name).strong());
+ line(ui, "Type:", item.type_label().to_string());
+ if let Some(m) = item.as_media() {
+ if let Some(v) = &m.info.video {
+ line(ui, "Video:", format!("{} fps, {} x {} ({:.4})", v.frame_rate.label(), v.width, v.height, v.par.0 as f32 / v.par.1 as f32));
+ line(ui, "Codec:", v.codec.clone());
+ }
+ if let Some(a) = &m.info.audio {
+ line(ui, "Audio:", format!("{} Hz - {} ch - {}", a.sample_rate, a.channels, a.codec));
+ }
+ }
+ line(ui, "Duration:", format_time(item.duration(), item.frame_rate(), false, TimeDisplay::Timecode, 48000));
+ ui.separator();
+ }
+ if let Some(seq) = app.session.active_sequence() {
+ let name = app.session.state.active_sequence.and_then(|s| app.session.project.item(s)).map(|i| i.name.clone()).unwrap_or_default();
+ ui.label(egui::RichText::new(name).strong());
+ line(
+ ui,
+ "Settings:",
+ format!("{}x{} · {} fps · {} Hz", seq.settings.width, seq.settings.height, seq.settings.frame_rate.label(), seq.settings.sample_rate),
+ );
+ line(ui, "Playhead:", format_time(app.session.playhead(), seq.settings.frame_rate, seq.settings.drop_frame, TimeDisplay::Timecode, 48000));
+ for (i, tr) in seq.video_tracks.iter().enumerate().rev() {
+ let at = tr.item_at(app.session.playhead()).map(|x| x.name.clone()).unwrap_or_default();
+ line(ui, &format!("Video {}:", i + 1), at);
+ }
+ for (i, tr) in seq.audio_tracks.iter().enumerate() {
+ let at = tr.item_at(app.session.playhead()).map(|x| x.name.clone()).unwrap_or_default();
+ line(ui, &format!("Audio {}:", i + 1), at);
+ }
+ }
+ ui.separator();
+ line(ui, "UI:", format!("{:.0} fps · {} frames queued", app.fps, app.frames.queue_len()));
+}
+
+pub fn media_browser(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect.shrink(8.0)));
+ let ui = &mut child;
+ let dir_id = egui::Id::new("media-browser-dir");
+ #[cfg(not(target_arch = "wasm32"))]
+ {
+ let mut dir: String =
+ ui.data(|d| d.get_temp(dir_id)).unwrap_or_else(|| std::env::var("HOME").map(|h| format!("{h}/Movies")).unwrap_or_else(|_| "/".into()));
+ ui.horizontal(|ui| {
+ if ui.button("⬆").clicked()
+ && let Some(p) = std::path::Path::new(&dir).parent()
+ {
+ dir = p.to_string_lossy().to_string();
+ }
+ ui.add(egui::TextEdit::singleline(&mut dir).desired_width(ui.available_width()));
+ });
+ let mut entries: Vec<(bool, String)> = std::fs::read_dir(&dir)
+ .map(|rd| {
+ rd.flatten()
+ .filter(|e| !e.file_name().to_string_lossy().starts_with('.'))
+ .map(|e| (e.path().is_dir(), e.file_name().to_string_lossy().to_string()))
+ .collect()
+ })
+ .unwrap_or_default();
+ entries.sort_by(|a, b| b.0.cmp(&a.0).then(a.1.to_lowercase().cmp(&b.1.to_lowercase())));
+ let mut import = Vec::new();
+ egui::ScrollArea::vertical().auto_shrink([false, false]).show(ui, |ui| {
+ for (is_dir, name) in &entries {
+ let path = format!("{dir}/{name}");
+ let ok = *is_dir || filmcraft_media::is_importable(std::path::Path::new(&path));
+ if !ok {
+ continue;
+ }
+ let resp = ui.selectable_label(false, format!("{} {name}", if *is_dir { "📁" } else { "🎞" }));
+ if resp.double_clicked() {
+ if *is_dir {
+ dir = path.clone();
+ } else {
+ import.push(path.clone());
+ }
+ }
+ }
+ });
+ ui.data_mut(|d| d.insert_temp(dir_id, dir));
+ if !import.is_empty() {
+ let r = app.session.execute("file.import", json!({"paths": import}));
+ if let Err(e) = r {
+ app.ui.status = e.to_string();
+ }
+ }
+ }
+ #[cfg(target_arch = "wasm32")]
+ {
+ let _ = dir_id;
+ ui.label(egui::RichText::new("Use File ▸ Import to pick files.").color(t.text_dim));
+ }
+ let _ = t;
+}
+
+/// Lumetri Scopes: luma waveform + vectorscope of the program frame.
+pub fn scopes(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let Some(seq_id) = app.session.state.active_sequence else { return };
+ let rate = app.session.sequence_rate();
+ let frame = rate.frame_at(app.session.playhead());
+ let key = FrameKey { target: Target::Sequence(seq_id), frame, size: 250, revision: app.session.revision };
+ let project = app.session.project.clone();
+ app.frames.request(key, rate.tick_of(frame), 0.25, &project, 2);
+ let Some(img) = app.frames.get(&key) else {
+ crate::dock::placeholder(ui, rect, &t, "…");
+ return;
+ };
+ let half = rect.width() / 2.0;
+ let wf = Rect::from_min_size(rect.min + vec2(8.0, 8.0), vec2(half - 12.0, rect.height() - 16.0));
+ let vs_size = (rect.height() - 16.0).min(half - 12.0);
+ let vs = Rect::from_center_size(pos2(rect.min.x + half + half / 2.0, rect.center().y), vec2(vs_size, vs_size));
+ ui.painter().rect_filled(wf, 0.0, Color32::BLACK);
+ ui.painter().rect_filled(vs, vs_size / 2.0, Color32::BLACK);
+ // waveform: plot luma per column
+ let mut mesh = egui::Mesh::default();
+ let (w, h) = (img.w, img.h);
+ let step_y = (h / 90).max(1);
+ for x in (0..w).step_by((w / wf.width().max(1.0) as usize).max(1)) {
+ for y in (0..h).step_by(step_y) {
+ let i = (y * w + x) * 4;
+ let l = 0.2126 * img.px[i] as f32 + 0.7152 * img.px[i + 1] as f32 + 0.0722 * img.px[i + 2] as f32;
+ let px = wf.min.x + x as f32 / w as f32 * wf.width();
+ let py = wf.max.y - l / 255.0 * wf.height();
+ mesh.add_colored_rect(Rect::from_min_size(pos2(px, py), vec2(1.0, 1.0)), Color32::from_rgba_unmultiplied(120, 255, 140, 60));
+ // vectorscope
+ let (r, g, b) = (img.px[i] as f32 / 255.0, img.px[i + 1] as f32 / 255.0, img.px[i + 2] as f32 / 255.0);
+ let ycc = filmcraft_color::rgb_to_ycbcr(r, g, b, filmcraft_color::Matrix::Bt709);
+ let vx = vs.center().x + ycc[1] * vs_size;
+ let vy = vs.center().y - ycc[2] * vs_size;
+ mesh.add_colored_rect(Rect::from_min_size(pos2(vx, vy), vec2(1.0, 1.0)), Color32::from_rgba_unmultiplied(200, 255, 200, 50));
+ }
+ }
+ ui.painter().add(mesh);
+ for v in [0, 25, 50, 75, 100] {
+ let y = wf.max.y - v as f32 / 100.0 * wf.height();
+ ui.painter().line_segment([pos2(wf.min.x, y), pos2(wf.max.x, y)], egui::Stroke::new(0.5, Color32::from_white_alpha(30)));
+ ui.painter().text(pos2(wf.min.x + 2.0, y - 6.0), Align2::LEFT_CENTER, v.to_string(), Tokens::ui(8.0), t.text_faint);
+ }
+ ui.painter().circle_stroke(vs.center(), vs_size / 2.0, egui::Stroke::new(1.0, Color32::from_white_alpha(40)));
+}
diff --git a/crates/ui-egui/src/panels/mod.rs b/crates/ui-egui/src/panels/mod.rs
new file mode 100644
index 000000000..50e41fe59
--- /dev/null
+++ b/crates/ui-egui/src/panels/mod.rs
@@ -0,0 +1,147 @@
+//! Panel bodies. `show` dispatches on [`PanelKind`]; drag-and-drop between panels (project items,
+//! effects) is carried in egui temp data so the timeline/monitors can accept drops.
+
+pub mod dialogs;
+pub mod effect_controls;
+pub mod effects;
+pub mod export_mode;
+pub mod import_mode;
+pub mod meters;
+pub mod misc;
+pub mod monitor;
+pub mod project;
+pub mod timeline;
+pub mod tools;
+
+use egui::{Align2, Color32, Rect};
+use filmcraft_project::ItemId;
+
+use crate::FilmcraftApp;
+use crate::dock::PanelKind;
+use crate::theme::Tokens;
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, p: PanelKind, rect: Rect) {
+ match p {
+ PanelKind::Program => monitor::show(app, ui, rect, monitor::Which::Program),
+ PanelKind::Source => monitor::show(app, ui, rect, monitor::Which::Source),
+ PanelKind::Timeline => timeline::show(app, ui, rect),
+ PanelKind::Project => project::show(app, ui, rect),
+ PanelKind::Tools => tools::show(app, ui, rect),
+ PanelKind::Effects => effects::show(app, ui, rect),
+ PanelKind::EffectControls => effect_controls::show(app, ui, rect),
+ PanelKind::AudioMeters => meters::show(app, ui, rect),
+ PanelKind::LumetriColor => effect_controls::lumetri_panel(app, ui, rect),
+ PanelKind::History => misc::history(app, ui, rect),
+ PanelKind::Markers => misc::markers(app, ui, rect),
+ PanelKind::Info => misc::info(app, ui, rect),
+ PanelKind::MediaBrowser => misc::media_browser(app, ui, rect),
+ PanelKind::AudioTrackMixer => meters::track_mixer(app, ui, rect),
+ PanelKind::LumetriScopes => misc::scopes(app, ui, rect),
+ other => crate::dock::placeholder(ui, rect, &app.tokens, &format!("{} — coming in a later milestone", other.title())),
+ }
+}
+
+#[derive(Clone, Debug)]
+enum DragPayload {
+ Item(ItemId),
+ Effect(String),
+}
+
+fn payload_id() -> egui::Id {
+ egui::Id::new("filmcraft-drag-payload")
+}
+
+pub fn start_drag_item(ui: &egui::Ui, item: ItemId) {
+ ui.ctx().data_mut(|d| d.insert_temp(payload_id(), Some(DragPayloadBox(DragPayload::Item(item)))));
+}
+pub fn start_drag_effect(ui: &egui::Ui, id: &str) {
+ ui.ctx().data_mut(|d| d.insert_temp(payload_id(), Some(DragPayloadBox(DragPayload::Effect(id.to_string())))));
+}
+#[derive(Clone, Debug)]
+struct DragPayloadBox(DragPayload);
+
+fn payload(ui: &egui::Ui) -> Option<DragPayload> {
+ ui.ctx().data(|d| d.get_temp::<Option<DragPayloadBox>>(payload_id())).flatten().map(|b| b.0)
+}
+pub fn dragged_project_item(ui: &egui::Ui) -> Option<ItemId> {
+ match payload(ui) {
+ Some(DragPayload::Item(i)) => Some(i),
+ _ => None,
+ }
+}
+pub fn dragged_effect(ui: &egui::Ui) -> Option<String> {
+ match payload(ui) {
+ Some(DragPayload::Effect(e)) => Some(e),
+ _ => None,
+ }
+}
+pub fn clear_drag(ui: &egui::Ui) {
+ ui.ctx().data_mut(|d| d.insert_temp::<Option<DragPayloadBox>>(payload_id(), None));
+}
+
+/// Draw the drag ghost near the pointer and clear the payload after release.
+pub fn drag_ghost(app: &FilmcraftApp, ui: &egui::Ui) {
+ let Some(pl) = payload(ui) else { return };
+ let ctx = ui.ctx();
+ if let Some(p) = ctx.pointer_hover_pos() {
+ let label = match &pl {
+ DragPayload::Item(i) => app.session.project.item(*i).map(|x| x.name.clone()).unwrap_or_default(),
+ DragPayload::Effect(e) => filmcraft_project::find_effect(e).map(|d| d.name.to_string()).unwrap_or_default(),
+ };
+ let painter = ctx.layer_painter(egui::LayerId::new(egui::Order::Tooltip, egui::Id::new("drag-ghost")));
+ let r = Rect::from_min_size(p + egui::vec2(12.0, 8.0), egui::vec2(label.len() as f32 * 7.0 + 16.0, 20.0));
+ painter.rect_filled(r, 4.0, Color32::from_black_alpha(200));
+ painter.text(r.center(), Align2::CENTER_CENTER, label, Tokens::ui(11.5), Color32::WHITE);
+ }
+ if ctx.input(|i| i.pointer.any_released()) {
+ // cleared next frame so drop targets see the release this frame
+ let f = ctx.cumulative_frame_nr();
+ let k = egui::Id::new("drag-release-frame");
+ match ctx.data(|d| d.get_temp::<u64>(k)) {
+ Some(prev) if prev < f => {
+ clear_drag(ui);
+ ctx.data_mut(|d| d.remove::<u64>(k));
+ }
+ None => {
+ ctx.data_mut(|d| d.insert_temp(k, f));
+ }
+ Some(_) => {}
+ }
+ } else if !ctx.input(|i| i.pointer.any_down()) {
+ clear_drag(ui);
+ }
+}
+
+/// The panel "≡" menu.
+pub fn panel_menu_popup(app: &mut FilmcraftApp, ui: &mut egui::Ui) {
+ drag_ghost(app, ui);
+ let id = egui::Id::new("panel-menu");
+ let Some((p, pos)) = ui.ctx().data(|d| d.get_temp::<(PanelKind, egui::Pos2)>(id)) else { return };
+ let mut close = false;
+ let area = egui::Area::new(id.with("area")).order(egui::Order::Foreground).fixed_pos(pos).show(ui.ctx(), |ui| {
+ egui::Frame::popup(ui.style()).show(ui, |ui| {
+ ui.set_min_width(190.0);
+ if ui.button("Close Panel").clicked() {
+ app.ui.dock.close(p);
+ close = true;
+ }
+ if ui.button("Maximize Frame").clicked() {
+ app.ui.dock = crate::dock::DockNode::Tabs { panels: vec![p], active: 0 };
+ close = true;
+ }
+ if ui.button("Restore Workspace").clicked() {
+ let w = app.ui.workspace.clone();
+ app.set_workspace(&w);
+ close = true;
+ }
+ if p == PanelKind::Timeline {
+ ui.separator();
+ ui.checkbox(&mut app.ui.timeline.show_thumbnails, "Video Thumbnails");
+ ui.checkbox(&mut app.ui.timeline.show_waveforms, "Audio Waveforms");
+ }
+ });
+ });
+ if close || (area.response.clicked_elsewhere() && ui.input(|i| i.pointer.any_pressed())) {
+ ui.ctx().data_mut(|d| d.remove::<(PanelKind, egui::Pos2)>(id));
+ }
+}
diff --git a/crates/ui-egui/src/panels/monitor.rs b/crates/ui-egui/src/panels/monitor.rs
new file mode 100644
index 000000000..96d5c7795
--- /dev/null
+++ b/crates/ui-egui/src/panels/monitor.rs
@@ -0,0 +1,382 @@
+//! Source and Program monitors.
+//!
+//! Frames come from the background [`FrameServer`](crate::frames::FrameServer) at the *smaller* of
+//! the playback resolution and the on-screen resolution (so a small monitor never pays for 4K).
+//! While playing we prefetch the next frames in priority order; while scrubbing the exact frame is
+//! requested first and the nearest cached frame is shown until it arrives (no black flashes).
+
+use egui::{Align2, Color32, Rect, Sense, Stroke, StrokeKind, pos2, vec2};
+use filmcraft_project::ItemKind;
+use filmcraft_time::{Tick, TimeDisplay, format_time};
+use serde_json::json;
+
+use crate::FilmcraftApp;
+use crate::frames::{FrameKey, Target};
+use crate::icons::{self, Icon};
+use crate::state::PlaybackRes;
+use crate::theme::Tokens;
+
+#[derive(Clone, Copy, PartialEq)]
+pub enum Which {
+ Source,
+ Program,
+}
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect, which: Which) {
+ let t = app.tokens;
+ let ctx = ui.ctx().clone();
+ let controls_h = 26.0 + 18.0 + 34.0;
+ let video_area = Rect::from_min_max(rect.min + vec2(4.0, 4.0), pos2(rect.max.x - 4.0, rect.max.y - controls_h));
+ let (target, frame_size, rate, time, duration, drop_frame, mark_in, mark_out, name) = match which {
+ Which::Program => {
+ let Some(seq_id) = app.session.state.active_sequence else {
+ crate::dock::placeholder(ui, rect, &t, "(no sequences)");
+ return;
+ };
+ let q = app.session.active_sequence().expect("active");
+ (
+ Target::Sequence(seq_id),
+ (q.settings.width, q.settings.height),
+ q.settings.frame_rate,
+ app.session.playhead(),
+ q.duration(),
+ q.settings.drop_frame,
+ q.mark_in,
+ q.mark_out,
+ app.session.project.item(seq_id).map(|i| i.name.clone()).unwrap_or_default(),
+ )
+ }
+ Which::Source => {
+ let Some(item) = app.session.state.source_item else {
+ crate::dock::placeholder(ui, rect, &t, "(no clips)");
+ return;
+ };
+ let Some(pi) = app.session.project.item(item) else { return };
+ let size = match &pi.kind {
+ ItemKind::Media(m) => m.info.video.as_ref().map(|v| (v.width, v.height)).unwrap_or((0, 0)),
+ ItemKind::Sequence(s) => (s.settings.width, s.settings.height),
+ _ => (1920, 1080),
+ };
+ let (mi, mo) = match &pi.kind {
+ ItemKind::Media(m) => (m.mark_in, m.mark_out),
+ ItemKind::Sequence(s) => (s.mark_in, s.mark_out),
+ _ => (None, None),
+ };
+ (Target::Item(item), size, pi.frame_rate(), app.session.state.source_playhead, pi.duration(), false, mi, mo, pi.name.clone())
+ }
+ };
+ let prefix = if which == Which::Program { "program" } else { "source" };
+ ui.painter().rect_filled(video_area, 0.0, t.panel_bg);
+ // ---- picture
+ let has_video = frame_size.0 > 0;
+ let pic = if has_video { fit(video_area, frame_size.0 as f32, frame_size.1 as f32) } else { video_area };
+ ui.painter().rect_filled(pic, 0.0, t.monitor_bg);
+ let res = if which == Which::Program { app.ui.program.res } else { app.ui.source.res };
+ if has_video {
+ let ppp = ctx.pixels_per_point();
+ let screen_scale = (pic.width() * ppp / frame_size.0 as f32).min(1.0);
+ let scale = quantize_scale(res.scale().min(screen_scale.max(1.0 / 32.0)));
+ let frame = rate.frame_at(time);
+ let rev = if matches!(target, Target::Item(_))
+ && app
+ .session
+ .project
+ .item(match target {
+ Target::Item(i) => i,
+ Target::Sequence(s) => s,
+ })
+ .is_some_and(|i| !matches!(i.kind, ItemKind::Sequence(_)))
+ {
+ 0
+ } else {
+ app.session.revision
+ };
+ let size_key = (scale * 1000.0) as u32;
+ let key = FrameKey { target, frame, size: size_key, revision: rev };
+ let project = app.session.project.clone();
+ let playing = which == Which::Program && app.playback.playing;
+ app.frames.request(key, rate.tick_of(frame), scale, &project, 0);
+ if playing {
+ let dir = if app.playback.speed < 0.0 { -1 } else { 1 };
+ let ahead = if app.playback.speed.abs() > 1.5 { 24 } else { 14 };
+ for i in 1..=ahead {
+ let f = frame + i * dir * (app.playback.speed.abs().max(1.0) as i64);
+ if f >= 0 {
+ app.frames.request(FrameKey { frame: f, ..key }, rate.tick_of(f), scale, &project, i as u32);
+ }
+ }
+ // drop stale prefetch jobs
+ let cur = frame;
+ app.frames.retain_queue(|k| k.target != target || (k.revision == rev && (k.frame - cur) * dir >= 0 && (k.frame - cur).abs() < 40));
+ }
+ let tex_name = format!("monitor-{prefix}");
+ let shown = if let Some(img) = app.frames.get(&key) {
+ if playing {
+ app.playback.shown += 1;
+ }
+ Some(app.texture_for(&ctx, &tex_name, key, &img))
+ } else {
+ if playing && app.playback.last_frame_shown() != frame {
+ app.playback.dropped += 1;
+ }
+ match app.frames.nearest(target, frame, size_key, rev, 6) {
+ Some(img) => Some(app.texture_for(&ctx, &tex_name, FrameKey { frame: frame - 1, ..key }, &img)),
+ None => app.texture_existing(&tex_name).map(|(id, _)| id),
+ }
+ };
+ app.playback.set_last_frame(frame);
+ if let Some(tex) = shown {
+ ui.painter().image(tex, pic, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);
+ }
+ let mv = if which == Which::Program { &app.ui.program } else { &app.ui.source };
+ if mv.safe_margins {
+ for (f, c) in [(0.9, Color32::from_white_alpha(120)), (0.8, Color32::from_white_alpha(90))] {
+ let r = Rect::from_center_size(pic.center(), pic.size() * f);
+ ui.painter().rect_stroke(r, 0.0, Stroke::new(1.0, c), StrokeKind::Middle);
+ }
+ let c = pic.center();
+ ui.painter().line_segment([c - vec2(8.0, 0.0), c + vec2(8.0, 0.0)], Stroke::new(1.0, Color32::from_white_alpha(120)));
+ ui.painter().line_segment([c - vec2(0.0, 8.0), c + vec2(0.0, 8.0)], Stroke::new(1.0, Color32::from_white_alpha(120)));
+ }
+ } else if which == Which::Source {
+ // audio-only source: draw a waveform placeholder
+ ui.painter().text(pic.center(), Align2::CENTER_CENTER, format!("♪ {name}"), Tokens::ui(14.0), t.text_dim);
+ }
+ // Dropped-frame indicator (Program only)
+ if which == Which::Program && app.playback.playing {
+ let c = if app.playback.dropped > 0 { t.render_yellow } else { t.render_green };
+ ui.painter().circle_filled(pos2(video_area.min.x + 10.0, video_area.min.y + 10.0), 4.0, c);
+ }
+ // Click/drag in the picture: the Hand tool pans, otherwise focus.
+ let pic_resp = ui.interact(pic, egui::Id::new((prefix, "pic")), Sense::click());
+ app.auto.add(&format!("{prefix}.picture"), pic, "picture");
+ if pic_resp.double_clicked() && which == Which::Source {
+ // (Premiere opens the clip's settings; we show info)
+ app.ui.status = name.clone();
+ }
+
+ // ---- controls row: timecode | zoom | res | wrench | duration
+ let row1 = Rect::from_min_size(pos2(rect.min.x + 8.0, video_area.max.y + 2.0), vec2(rect.width() - 16.0, 24.0));
+ let tc = format_time(time, rate, drop_frame, TimeDisplay::Timecode, 48000);
+ ui.painter().text(pos2(row1.min.x, row1.center().y), Align2::LEFT_CENTER, &tc, Tokens::mono(15.0), t.timecode);
+ app.auto.add(&format!("{prefix}.timecode"), Rect::from_min_size(row1.min, vec2(110.0, row1.height())), &tc);
+ let dur_tc = format_time(
+ mark_out.map(|o| o + rate.frame_duration()).unwrap_or(duration) - mark_in.unwrap_or(Tick::ZERO),
+ rate,
+ drop_frame,
+ TimeDisplay::Timecode,
+ 48000,
+ );
+ ui.painter().text(pos2(row1.max.x, row1.center().y), Align2::RIGHT_CENTER, &dur_tc, Tokens::mono(15.0), t.text);
+ // zoom + resolution dropdowns centred-ish
+ let zr = Rect::from_min_size(pos2(row1.center().x - 70.0, row1.min.y + 2.0), vec2(56.0, 20.0));
+ let zoom_label = match if which == Which::Program { app.ui.program.zoom } else { app.ui.source.zoom } {
+ None => "Fit".to_string(),
+ Some(z) => format!("{}%", (z * 100.0) as i32),
+ };
+ crate::widgets::dropdown_text(ui, zr, &zoom_label, &t, egui::Id::new((prefix, "zoom")));
+ let rr = Rect::from_min_size(pos2(zr.max.x + 6.0, row1.min.y + 2.0), vec2(56.0, 20.0));
+ let rresp = crate::widgets::dropdown_text(ui, rr, res.label(), &t, egui::Id::new((prefix, "res")));
+ app.auto.add(&format!("{prefix}.resolution"), rr, "Select Playback Resolution");
+ egui::Popup::menu(&rresp).show(|ui| {
+ for r in PlaybackRes::ALL {
+ if ui.selectable_label(r == res, r.label()).clicked() {
+ if which == Which::Program {
+ app.ui.program.res = r;
+ } else {
+ app.ui.source.res = r;
+ }
+ }
+ }
+ });
+ let wr = Rect::from_min_size(pos2(rr.max.x + 6.0, row1.min.y + 1.0), vec2(22.0, 22.0));
+ let wresp = ui.interact(wr, egui::Id::new((prefix, "wrench")), Sense::click());
+ icons::paint(ui.painter(), wr.shrink(4.0), Icon::Wrench, if wresp.hovered() { t.tab_text_active } else { t.icon });
+ app.auto.add(&format!("{prefix}.settings"), wr, "Settings");
+ egui::Popup::menu(&wresp).show(|ui| {
+ let mv = if which == Which::Program { &mut app.ui.program } else { &mut app.ui.source };
+ ui.checkbox(&mut mv.safe_margins, "Safe Margins");
+ ui.checkbox(&mut mv.show_transport, "Show Transport Controls");
+ if which == Which::Program {
+ ui.separator();
+ ui.checkbox(&mut app.ui.show_scopes, "Lumetri Scopes");
+ ui.checkbox(&mut app.playback.looping, "Loop");
+ }
+ });
+
+ // ---- mini timeline / scrub bar
+ let bar = Rect::from_min_size(pos2(rect.min.x + 8.0, row1.max.y + 1.0), vec2(rect.width() - 16.0, 16.0));
+ mini_timeline(app, ui, bar, which, time, duration, rate, mark_in, mark_out);
+
+ // ---- transport buttons
+ let row3 = Rect::from_min_size(pos2(rect.min.x, bar.max.y + 2.0), vec2(rect.width(), 30.0));
+ transport(app, ui, row3, which);
+}
+
+fn quantize_scale(s: f32) -> f32 {
+ // Buckets keep the cache effective while resizing the panel.
+ let buckets = [1.0 / 32.0, 1.0 / 16.0, 1.0 / 8.0, 0.1875, 0.25, 0.375, 0.5, 0.75, 1.0];
+ *buckets.iter().find(|b| **b >= s - 1e-4).unwrap_or(&1.0)
+}
+
+pub fn fit(area: Rect, w: f32, h: f32) -> Rect {
+ let s = (area.width() / w).min(area.height() / h);
+ Rect::from_center_size(area.center(), vec2(w * s, h * s))
+}
+
+#[allow(clippy::too_many_arguments)]
+fn mini_timeline(
+ app: &mut FilmcraftApp,
+ ui: &mut egui::Ui,
+ bar: Rect,
+ which: Which,
+ time: Tick,
+ duration: Tick,
+ rate: filmcraft_time::FrameRate,
+ mark_in: Option<Tick>,
+ mark_out: Option<Tick>,
+) {
+ let t = app.tokens;
+ let p = ui.painter();
+ let track = Rect::from_min_max(pos2(bar.min.x, bar.center().y - 1.0), pos2(bar.max.x, bar.center().y + 1.0));
+ p.rect_filled(track, 1.0, t.separator);
+ let dur = duration.0.max(1) as f64;
+ let xof = |tk: Tick| bar.min.x + ((tk.0 as f64 / dur) as f32).clamp(0.0, 1.0) * bar.width();
+ if mark_in.is_some() || mark_out.is_some() {
+ let a = xof(mark_in.unwrap_or(Tick::ZERO));
+ let b = xof(mark_out.map(|o| o + rate.frame_duration()).unwrap_or(duration));
+ p.rect_filled(Rect::from_min_max(pos2(a, bar.min.y + 3.0), pos2(b, bar.max.y - 3.0)), 2.0, Color32::from_white_alpha(46));
+ }
+ // markers (program)
+ if which == Which::Program
+ && let Some(q) = app.session.active_sequence()
+ {
+ for m in &q.markers {
+ let x = xof(m.start);
+ let c = Color32::from_rgb(m.color.rgb()[0], m.color.rgb()[1], m.color.rgb()[2]);
+ p.rect_filled(Rect::from_min_size(pos2(x - 2.0, bar.min.y), vec2(4.0, 5.0)), 1.0, c);
+ }
+ }
+ let x = xof(time);
+ // playhead: blue triangle over a line
+ p.add(egui::Shape::convex_polygon(vec![pos2(x - 5.0, bar.min.y), pos2(x + 5.0, bar.min.y), pos2(x, bar.min.y + 6.0)], t.playhead, Stroke::NONE));
+ p.line_segment([pos2(x, bar.min.y + 4.0), pos2(x, bar.max.y)], Stroke::new(1.5, t.playhead));
+ let resp = ui.interact(bar, egui::Id::new((which as u8, "scrub")), Sense::click_and_drag());
+ app.auto.add(if which == Which::Program { "program.scrubBar" } else { "source.scrubBar" }, bar, "scrub bar");
+ if (resp.dragged() || resp.clicked())
+ && let Some(pos) = resp.interact_pointer_pos()
+ {
+ let f = ((pos.x - bar.min.x) / bar.width()).clamp(0.0, 1.0) as f64;
+ let tk = rate.snap(Tick((f * dur) as i64));
+ match which {
+ Which::Program => {
+ app.stop();
+ app.session.set_playhead(tk);
+ }
+ Which::Source => {
+ let _ = app.session.execute("source.setPlayhead", json!({"time": tk.0}));
+ }
+ }
+ }
+}
+
+fn transport(app: &mut FilmcraftApp, ui: &mut egui::Ui, row: Rect, which: Which) {
+ let t = app.tokens;
+ let src = which == Which::Source;
+ let buttons: Vec<(Icon, &str, &str)> = if src {
+ vec![
+ (Icon::Marker, "markers.add", "Add Marker (M)"),
+ (Icon::MarkIn, "src.markIn", "Mark In (I)"),
+ (Icon::MarkOut, "src.markOut", "Mark Out (O)"),
+ (Icon::GoToIn, "src.goIn", "Go to In (Shift+I)"),
+ (Icon::StepBack, "src.stepBack", "Step Back 1 Frame (Left)"),
+ (Icon::Play, "src.play", "Play-Stop Toggle (Space)"),
+ (Icon::StepFwd, "src.stepFwd", "Step Forward 1 Frame (Right)"),
+ (Icon::GoToOut, "src.goOut", "Go to Out (Shift+O)"),
+ (Icon::Insert, "source.insert", "Insert (,)"),
+ (Icon::Overwrite, "source.overwrite", "Overwrite (.)"),
+ (Icon::Camera, "exportFrame", "Export Frame (Shift+E)"),
+ ]
+ } else {
+ vec![
+ (Icon::Marker, "markers.add", "Add Marker (M)"),
+ (Icon::MarkIn, "markers.markIn", "Mark In (I)"),
+ (Icon::MarkOut, "markers.markOut", "Mark Out (O)"),
+ (Icon::GoToIn, "markers.goToIn", "Go to In (Shift+I)"),
+ (Icon::StepBack, "playhead.stepBack", "Step Back 1 Frame (Left)"),
+ (if app.playback.playing { Icon::Pause } else { Icon::Play }, "playback.toggle", "Play-Stop Toggle (Space)"),
+ (Icon::StepFwd, "playhead.stepForward", "Step Forward 1 Frame (Right)"),
+ (Icon::GoToOut, "markers.goToOut", "Go to Out (Shift+O)"),
+ (Icon::Lift, "sequence.lift", "Lift (;)"),
+ (Icon::Extract, "sequence.extract", "Extract (')"),
+ (Icon::Camera, "exportFrame", "Export Frame (Shift+E)"),
+ ]
+ };
+ let bw = 30.0;
+ let total = buttons.len() as f32 * bw;
+ let mut x = row.center().x - total / 2.0;
+ let ctx = ui.ctx().clone();
+ let prefix = if src { "source" } else { "program" };
+ for (icon, cmd, tip) in buttons {
+ let r = Rect::from_min_size(pos2(x, row.min.y + 2.0), vec2(bw - 2.0, 26.0));
+ let resp = ui.interact(r, egui::Id::new((prefix, cmd)), Sense::click()).on_hover_text(tip);
+ app.auto.add(&format!("{prefix}.transport.{cmd}"), r, tip);
+ let is_play = cmd.ends_with("play") || cmd == "playback.toggle";
+ if resp.hovered() {
+ ui.painter().rect_filled(r, 4.0, t.hover);
+ }
+ let sz = if is_play { 16.0 } else { 14.0 };
+ icons::paint(ui.painter(), Rect::from_center_size(r.center(), vec2(sz, sz)), icon, if resp.hovered() { t.tab_text_active } else { t.icon });
+ if resp.clicked() {
+ let r = match cmd {
+ "src.markIn" => app.session.execute("markers.markIn", json!({"target": "source"})).map_err(|e| e.to_string()),
+ "src.markOut" => app.session.execute("markers.markOut", json!({"target": "source"})).map_err(|e| e.to_string()),
+ "src.goIn" | "src.goOut" | "src.stepBack" | "src.stepFwd" => {
+ source_nav(app, cmd);
+ Ok(serde_json::Value::Null)
+ }
+ "src.play" => Ok(serde_json::Value::Null),
+ "exportFrame" => {
+ app.ui.status = "Export Frame: use Export mode (M6)".into();
+ Ok(serde_json::Value::Null)
+ }
+ c => crate::menus::invoke(app, &ctx, c, json!({})),
+ };
+ if let Err(e) = r {
+ app.ui.status = e;
+ }
+ }
+ x += bw;
+ }
+ // button editor "+"
+ let r = Rect::from_min_size(pos2(row.max.x - 30.0, row.min.y + 4.0), vec2(22.0, 22.0));
+ let resp = ui.interact(r, egui::Id::new((prefix, "btn-editor")), Sense::click()).on_hover_text("Button Editor");
+ icons::paint(ui.painter(), r.shrink(5.0), Icon::Plus, if resp.hovered() { t.tab_text_active } else { t.text_dim });
+}
+
+fn source_nav(app: &mut FilmcraftApp, cmd: &str) {
+ let Some(item) = app.session.state.source_item else { return };
+ let Some(pi) = app.session.project.item(item) else { return };
+ let rate = pi.frame_rate();
+ let (mi, mo) = match &pi.kind {
+ ItemKind::Media(m) => (m.mark_in, m.mark_out),
+ _ => (None, None),
+ };
+ let cur = app.session.state.source_playhead;
+ let t = match cmd {
+ "src.goIn" => mi.unwrap_or(Tick::ZERO),
+ "src.goOut" => mo.unwrap_or(pi.duration() - rate.frame_duration()),
+ "src.stepBack" => cur - rate.frame_duration(),
+ _ => cur + rate.frame_duration(),
+ };
+ let _ = app.session.execute("source.setPlayhead", json!({"time": t.0}));
+}
+
+impl crate::Playback {
+ pub fn last_frame_shown(&self) -> i64 {
+ self.last_frame
+ }
+ pub fn set_last_frame(&mut self, f: i64) {
+ self.last_frame = f;
+ }
+}
diff --git a/crates/ui-egui/src/panels/project.rs b/crates/ui-egui/src/panels/project.rs
new file mode 100644
index 000000000..bf6eb7e0d
--- /dev/null
+++ b/crates/ui-egui/src/panels/project.rs
@@ -0,0 +1,368 @@
+//! Project panel: bins and items in List or Icon view, search, and the bottom action bar.
+
+use egui::{Align2, Color32, Rect, Sense, Stroke, StrokeKind, pos2, vec2};
+use filmcraft_project::{Bin, BinEntry, ItemId, ItemKind};
+use filmcraft_time::{TimeDisplay, format_time};
+use serde_json::json;
+
+use crate::FilmcraftApp;
+use crate::icons::{self, Icon};
+use crate::state::ProjectView;
+use crate::theme::Tokens;
+
+const ROW_H: f32 = 22.0;
+
+fn item_icon(k: &ItemKind) -> Icon {
+ match k {
+ ItemKind::Media(m) => match m.info.kind {
+ filmcraft_media::MediaKind::AudioOnly => Icon::Audio,
+ filmcraft_media::MediaKind::Still | filmcraft_media::MediaKind::ImageSequence => Icon::Image,
+ _ => Icon::Film,
+ },
+ ItemKind::Sequence(_) => Icon::Sequence,
+ ItemKind::Subclip { .. } => Icon::Film,
+ ItemKind::AdjustmentLayer { .. } => Icon::Adjust,
+ }
+}
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ // header: project file name + item count, search
+ let head = Rect::from_min_size(rect.min + vec2(8.0, 4.0), vec2(rect.width() - 16.0, 22.0));
+ let n_items = app.session.project.items.len();
+ ui.painter().text(pos2(head.min.x, head.center().y), Align2::LEFT_CENTER, format!("{}.fcproj", app.session.project.name), Tokens::ui(11.5), t.text_dim);
+ ui.painter().text(pos2(head.max.x, head.center().y), Align2::RIGHT_CENTER, format!("{n_items} items"), Tokens::ui(11.0), t.text_faint);
+ let search_rect = Rect::from_min_size(pos2(rect.min.x + 8.0, head.max.y + 4.0), vec2(rect.width() - 16.0, 22.0));
+ let mut child = ui.new_child(egui::UiBuilder::new().max_rect(search_rect));
+ let mut q = app.ui.project_search.clone();
+ crate::widgets::search_field(&mut child, &mut q, "Search", search_rect.width(), &t);
+ app.ui.project_search = q;
+ app.auto.add("project.search", search_rect, "Search");
+ let bottom_h = 30.0;
+ let body = Rect::from_min_max(pos2(rect.min.x, search_rect.max.y + 6.0), pos2(rect.max.x, rect.max.y - bottom_h));
+ let mut actions: Vec<(String, serde_json::Value)> = Vec::new();
+ let root = app.session.project.root.clone();
+ let filter = app.ui.project_search.to_ascii_lowercase();
+ let mut body_ui = ui.new_child(egui::UiBuilder::new().max_rect(body).id_salt("project-body"));
+ body_ui.set_clip_rect(body);
+ egui::ScrollArea::vertical().id_salt("project-scroll").auto_shrink([false, false]).show(&mut body_ui, |ui| {
+ match app.ui.project_view {
+ ProjectView::List => {
+ // column header
+ let (hr, _) = ui.allocate_exact_size(vec2(ui.available_width(), 20.0), Sense::hover());
+ let cols = columns(hr);
+ ui.painter().text(pos2(cols[0] + 26.0, hr.center().y), Align2::LEFT_CENTER, "Name", Tokens::ui(11.0), t.text_dim);
+ for (i, name) in ["Frame Rate", "Media Start", "Media Duration"].iter().enumerate() {
+ if cols[i + 1] < hr.max.x - 20.0 {
+ ui.painter().text(pos2(cols[i + 1], hr.center().y), Align2::LEFT_CENTER, *name, Tokens::ui(11.0), t.text_dim);
+ }
+ }
+ ui.painter().line_segment([hr.left_bottom(), hr.right_bottom()], Stroke::new(1.0, t.separator));
+ let mut row = 0usize;
+ list_bin(app, ui, &root, 0, &filter, &mut row, &mut actions, true);
+ }
+ _ => icon_view(app, ui, &root, &filter, &mut actions),
+ }
+ // empty space: click deselects; right-click new items
+ let rest = ui.available_rect_before_wrap();
+ let resp = ui.allocate_rect(Rect::from_min_size(rest.min, vec2(rest.width(), rest.height().max(40.0))), Sense::click());
+ if resp.clicked() {
+ actions.push(("project.select".into(), json!({"items": []})));
+ }
+ if resp.double_clicked() {
+ actions.push(("file.import".into(), json!({})));
+ }
+ resp.context_menu(|ui| {
+ for (label, cmd) in [
+ ("New Bin", "file.newBin"),
+ ("New Sequence…", "file.newSequence"),
+ ("Import…", "file.import"),
+ ("Bars and Tone", "file.newBarsAndTone"),
+ ("Color Matte", "file.newColorMatte"),
+ ("Adjustment Layer", "file.newAdjustmentLayer"),
+ ("Universal Counting Leader", "file.newCountingLeader"),
+ ] {
+ if ui.button(label).clicked() {
+ actions.push((cmd.into(), json!({})));
+ ui.close();
+ }
+ }
+ });
+ });
+ // bottom bar
+ let bar = Rect::from_min_max(pos2(rect.min.x, rect.max.y - bottom_h), rect.max);
+ ui.painter().line_segment([bar.left_top(), bar.right_top()], Stroke::new(1.0, t.separator));
+ let mut x = bar.min.x + 6.0;
+ for (icon, view, tip) in [
+ (Icon::ListView, ProjectView::List, "List View"),
+ (Icon::IconView, ProjectView::Icon, "Icon View"),
+ (Icon::Freeform, ProjectView::Freeform, "Freeform View"),
+ ] {
+ let r = Rect::from_min_size(pos2(x, bar.min.y + 4.0), vec2(24.0, 22.0));
+ let resp = ui.interact(r, egui::Id::new(("pv", tip)), Sense::click()).on_hover_text(tip);
+ app.auto.add(&format!("project.view.{view:?}"), r, tip);
+ if resp.hovered() {
+ ui.painter().rect_filled(r, 3.0, t.hover);
+ }
+ icons::paint(ui.painter(), r.shrink(5.0), icon, if app.ui.project_view == view { t.icon_active } else { t.icon });
+ if resp.clicked() {
+ app.ui.project_view = view;
+ }
+ x += 26.0;
+ }
+ // icon size slider
+ let sr = Rect::from_min_size(pos2(x + 6.0, bar.min.y + 7.0), vec2((bar.width() - 260.0).clamp(40.0, 140.0), 16.0));
+ let mut sz = app.ui.icon_size;
+ ui.put(sr, egui::Slider::new(&mut sz, 60.0..=240.0).show_value(false));
+ app.ui.icon_size = sz;
+ let mut rx = bar.max.x - 6.0;
+ for (icon, cmd, tip) in [
+ (Icon::Trash, "project.delete", "Clear (Delete)"),
+ (Icon::NewItem, "new-item", "New Item"),
+ (Icon::Folder, "file.newBin", "New Bin"),
+ (Icon::Search, "find", "Find"),
+ ] {
+ let r = Rect::from_min_size(pos2(rx - 24.0, bar.min.y + 4.0), vec2(24.0, 22.0));
+ let resp = ui.interact(r, egui::Id::new(("pb", cmd)), Sense::click()).on_hover_text(tip);
+ app.auto.add(&format!("project.button.{cmd}"), r, tip);
+ if resp.hovered() {
+ ui.painter().rect_filled(r, 3.0, t.hover);
+ }
+ icons::paint(ui.painter(), r.shrink(5.0), icon, t.icon);
+ if cmd == "new-item" {
+ egui::Popup::menu(&resp).show(|ui| {
+ for (label, c) in [
+ ("Sequence…", "file.newSequence"),
+ ("Adjustment Layer…", "file.newAdjustmentLayer"),
+ ("Bars and Tone…", "file.newBarsAndTone"),
+ ("Black Video…", "file.newBlackVideo"),
+ ("Color Matte…", "file.newColorMatte"),
+ ("Universal Counting Leader…", "file.newCountingLeader"),
+ ("Transparent Video…", "file.newTransparentVideo"),
+ ("Demo Footage", "file.importDemoFootage"),
+ ] {
+ if ui.button(label).clicked() {
+ actions.push((c.into(), json!({})));
+ }
+ }
+ });
+ } else if resp.clicked() && cmd != "find" {
+ actions.push((cmd.into(), json!({})));
+ }
+ rx -= 26.0;
+ }
+ let ctx = ui.ctx().clone();
+ for (cmd, p) in actions {
+ if let Err(e) = crate::menus::invoke(app, &ctx, &cmd, p) {
+ app.ui.status = e;
+ }
+ }
+}
+
+fn columns(r: Rect) -> [f32; 4] {
+ let w = r.width();
+ let name_w = (w * 0.46).max(160.0);
+ [r.min.x, r.min.x + name_w, r.min.x + name_w + 80.0, r.min.x + name_w + 180.0]
+}
+
+fn matches(app: &FilmcraftApp, id: ItemId, filter: &str) -> bool {
+ filter.is_empty() || app.session.project.item(id).is_some_and(|i| i.name.to_ascii_lowercase().contains(filter))
+}
+
+#[allow(clippy::too_many_arguments)]
+fn list_bin(
+ app: &mut FilmcraftApp,
+ ui: &mut egui::Ui,
+ bin: &Bin,
+ depth: usize,
+ filter: &str,
+ row: &mut usize,
+ actions: &mut Vec<(String, serde_json::Value)>,
+ root: bool,
+) {
+ let t = app.tokens;
+ for e in &bin.children {
+ match e {
+ BinEntry::Bin(b) => {
+ let open = app.ui.expanded_bins.contains(&b.id.0) || !filter.is_empty();
+ let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), ROW_H), Sense::click());
+ if *row % 2 == 1 {
+ ui.painter().rect_filled(r, 0.0, t.row_alt);
+ }
+ *row += 1;
+ let x = r.min.x + 6.0 + depth as f32 * 14.0;
+ icons::paint(
+ ui.painter(),
+ Rect::from_center_size(pos2(x + 5.0, r.center().y), vec2(10.0, 10.0)),
+ if open { Icon::ChevronDown } else { Icon::ChevronRight },
+ t.text_dim,
+ );
+ icons::paint(
+ ui.painter(),
+ Rect::from_center_size(pos2(x + 20.0, r.center().y), vec2(14.0, 14.0)),
+ Icon::Folder,
+ Color32::from_rgb(237, 150, 58),
+ );
+ ui.painter().text(pos2(x + 32.0, r.center().y), Align2::LEFT_CENTER, &b.name, Tokens::ui(12.0), t.text);
+ app.auto.add(&format!("project.bin.{}", b.id.0), r, &b.name);
+ if resp.clicked() {
+ if open {
+ app.ui.expanded_bins.retain(|x| *x != b.id.0);
+ } else {
+ app.ui.expanded_bins.push(b.id.0);
+ }
+ }
+ if open {
+ list_bin(app, ui, b, depth + 1, filter, row, actions, false);
+ }
+ }
+ BinEntry::Item(id) => {
+ if !matches(app, *id, filter) {
+ continue;
+ }
+ let Some(it) = app.session.project.item(*id).cloned() else { continue };
+ let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), ROW_H), Sense::click_and_drag());
+ let selected = app.session.state.project_selection.contains(id);
+ if selected {
+ ui.painter().rect_filled(r, 0.0, t.row_selected);
+ } else if *row % 2 == 1 {
+ ui.painter().rect_filled(r, 0.0, t.row_alt);
+ }
+ *row += 1;
+ let cols = columns(r);
+ let x = r.min.x + 6.0 + depth as f32 * 14.0 + if root { 0.0 } else { 0.0 };
+ // label swatch
+ let lc = it.label.rgb();
+ ui.painter().rect_filled(Rect::from_center_size(pos2(x + 5.0, r.center().y), vec2(8.0, 12.0)), 1.5, Color32::from_rgb(lc[0], lc[1], lc[2]));
+ icons::paint(ui.painter(), Rect::from_center_size(pos2(x + 20.0, r.center().y), vec2(14.0, 14.0)), item_icon(&it.kind), t.icon);
+ let name_clip = ui.painter().with_clip_rect(Rect::from_min_max(r.min, pos2(cols[1] - 6.0, r.max.y)));
+ name_clip.text(pos2(x + 32.0, r.center().y), Align2::LEFT_CENTER, &it.name, Tokens::ui(12.0), t.text);
+ let rate = it.frame_rate();
+ let has_v = it.has_video();
+ let cells = [
+ if has_v { format!("{} fps", rate.label()) } else { String::new() },
+ format_time(filmcraft_time::Tick::ZERO, rate, false, TimeDisplay::Timecode, 48000),
+ format_time(it.duration(), rate, false, TimeDisplay::Timecode, 48000),
+ ];
+ for (i, c) in cells.iter().enumerate() {
+ if cols[i + 1] < r.max.x - 20.0 {
+ ui.painter().text(pos2(cols[i + 1], r.center().y), Align2::LEFT_CENTER, c, Tokens::ui(11.5), t.text_dim);
+ }
+ }
+ app.auto.add(&format!("project.item.{}", id.0), r, &it.name);
+ item_interactions(app, ui, &resp, *id, &it.kind, actions);
+ }
+ }
+ }
+}
+
+fn item_interactions(
+ app: &mut FilmcraftApp,
+ ui: &egui::Ui,
+ resp: &egui::Response,
+ id: ItemId,
+ kind: &ItemKind,
+ actions: &mut Vec<(String, serde_json::Value)>,
+) {
+ if resp.clicked() {
+ let mods = ui.input(|i| i.modifiers);
+ let mut sel = app.session.state.project_selection.clone();
+ if mods.command || mods.shift {
+ if let Some(p) = sel.iter().position(|x| *x == id) {
+ sel.remove(p);
+ } else {
+ sel.push(id);
+ }
+ } else {
+ sel = vec![id];
+ }
+ actions.push(("project.select".into(), json!({"items": sel.iter().map(|i| i.0).collect::<Vec<_>>()})));
+ }
+ if resp.double_clicked() {
+ let cmd = if matches!(kind, ItemKind::Sequence(_)) { "sequence.open" } else { "source.open" };
+ actions.push((cmd.into(), json!({"item": id.0})));
+ }
+ if resp.drag_started() {
+ crate::panels::start_drag_item(ui, id);
+ }
+ resp.context_menu(|ui| {
+ if ui.button("Open in Source Monitor").clicked() {
+ actions.push(("source.open".into(), json!({"item": id.0})));
+ ui.close();
+ }
+ if ui.button("New Sequence From Clip").clicked() {
+ actions.push(("file.newSequence".into(), json!({"fromItem": id.0})));
+ ui.close();
+ }
+ if ui.button("Duplicate").clicked() {
+ actions.push(("project.select".into(), json!({"items": [id.0]})));
+ actions.push(("edit.duplicate".into(), json!({})));
+ ui.close();
+ }
+ ui.menu_button("Label", |ui| {
+ for l in filmcraft_project::Label::ALL {
+ if ui.button(l.name()).clicked() {
+ actions.push(("project.select".into(), json!({"items": [id.0]})));
+ actions.push(("edit.label".into(), json!({"label": l.name()})));
+ ui.close();
+ }
+ }
+ });
+ if ui.button("Clear").clicked() {
+ actions.push(("project.delete".into(), json!({"items": [id.0]})));
+ ui.close();
+ }
+ });
+}
+
+fn icon_view(app: &mut FilmcraftApp, ui: &mut egui::Ui, root: &Bin, filter: &str, actions: &mut Vec<(String, serde_json::Value)>) {
+ let t = app.tokens;
+ let mut ids = Vec::new();
+ root.all_items(&mut ids);
+ let size = app.ui.icon_size;
+ let th_h = size * 9.0 / 16.0;
+ let cell = vec2(size + 12.0, th_h + 34.0);
+ let per_row = ((ui.available_width() - 8.0) / cell.x).floor().max(1.0) as usize;
+ let ctx = ui.ctx().clone();
+ for chunk in ids.iter().filter(|i| matches(app, **i, filter)).copied().collect::<Vec<_>>().chunks(per_row) {
+ let (row, _) = ui.allocate_exact_size(vec2(ui.available_width(), cell.y), Sense::hover());
+ for (k, id) in chunk.iter().enumerate() {
+ let Some(it) = app.session.project.item(*id).cloned() else { continue };
+ let r = Rect::from_min_size(pos2(row.min.x + 6.0 + k as f32 * cell.x, row.min.y + 4.0), vec2(size, th_h));
+ let resp = ui.interact(r.expand(2.0), egui::Id::new(("icon", id.0)), Sense::click_and_drag());
+ ui.painter().rect_filled(r, 3.0, Color32::from_rgb(12, 12, 12));
+ let hover_t = if resp.hovered() {
+ // hover scrub: pointer x picks the time
+ ctx.pointer_hover_pos().map(|p| ((p.x - r.min.x) / r.width()).clamp(0.0, 1.0) as f64).unwrap_or(0.3)
+ } else {
+ 0.3
+ };
+ let dur = it.duration();
+ let tt = filmcraft_time::Tick((dur.0 as f64 * hover_t) as i64);
+ let q = filmcraft_time::Tick((tt.0 / (filmcraft_time::TICKS_PER_SECOND / 4)) * (filmcraft_time::TICKS_PER_SECOND / 4));
+ if let Some((tex, sz)) = app.thumbnail(&ctx, *id, q, (size as u32).clamp(96, 320)) {
+ let fitted = crate::panels::monitor::fit(r, sz.x, sz.y);
+ ui.painter().image(tex, fitted, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);
+ } else {
+ icons::paint(ui.painter(), Rect::from_center_size(r.center(), vec2(28.0, 28.0)), item_icon(&it.kind), t.text_faint);
+ }
+ let selected = app.session.state.project_selection.contains(id);
+ if selected {
+ ui.painter().rect_stroke(r, 3.0, Stroke::new(2.0, t.accent), StrokeKind::Outside);
+ }
+ let lc = it.label.rgb();
+ ui.painter().rect_filled(Rect::from_min_size(pos2(r.min.x, r.max.y + 6.0), vec2(8.0, 12.0)), 1.5, Color32::from_rgb(lc[0], lc[1], lc[2]));
+ let clip = ui.painter().with_clip_rect(Rect::from_min_max(pos2(r.min.x + 12.0, r.max.y), pos2(r.max.x - 44.0, r.max.y + 20.0)));
+ clip.text(pos2(r.min.x + 12.0, r.max.y + 12.0), Align2::LEFT_CENTER, &it.name, Tokens::ui(11.0), t.text);
+ ui.painter().text(
+ pos2(r.max.x, r.max.y + 12.0),
+ Align2::RIGHT_CENTER,
+ format_time(dur, it.frame_rate(), false, TimeDisplay::Timecode, 48000),
+ Tokens::ui(10.0),
+ t.text_dim,
+ );
+ app.auto.add(&format!("project.item.{}", id.0), r, &it.name);
+ item_interactions(app, ui, &resp, *id, &it.kind, actions);
+ }
+ }
+}
diff --git a/crates/ui-egui/src/panels/timeline.rs b/crates/ui-egui/src/panels/timeline.rs
new file mode 100644
index 000000000..a0cdc4939
--- /dev/null
+++ b/crates/ui-egui/src/panels/timeline.rs
@@ -0,0 +1,1464 @@
+//! The Timeline panel.
+//!
+//! Layout (Premiere's): big blue playhead timecode + toggles top-left, ruler with markers /
+//! in-out / render bar top-right, video tracks (V1 lowest) above audio tracks (A1 highest), track
+//! headers on the left, a zoom scroll bar at the bottom.
+//!
+//! Interaction is tool-driven; every gesture ends in exactly one engine command, so it is undoable,
+//! journaled and reproducible over the control channel. Zoom and scroll are *animated* (critically
+//! damped exponential easing, anchored under the cursor) so navigation feels fluid; all geometry is
+//! drawn as GPU meshes by egui's wgpu backend and culled to the visible range.
+
+use std::collections::HashMap;
+use std::sync::{Arc, Mutex};
+
+use egui::{Align2, Color32, CursorIcon, Pos2, Rect, Sense, Stroke, StrokeKind, pos2, vec2};
+use filmcraft_project::{ClipId, ItemId, Sequence, TrackId, TrackItem, TrackKind};
+use filmcraft_time::{FrameRate, TICKS_PER_SECOND, Tick, TimeDisplay, format_time};
+use serde_json::{Value, json};
+
+use crate::FilmcraftApp;
+use crate::icons::{self, Icon};
+use crate::state::{TimelineView, Tool};
+use crate::theme::Tokens;
+
+const TOP_H: f32 = 64.0; // timecode + ruler block
+const RULER_H: f32 = 30.0;
+const SCROLLBAR_H: f32 = 14.0;
+const DIVIDER_H: f32 = 6.0;
+const MASTER_H: f32 = 30.0;
+const SNAP_PX: f32 = 9.0;
+
+/// Transient interaction state.
+#[derive(Default)]
+pub struct TlState {
+ pub drag: Option<Drag>,
+ /// Last layout (for hit-testing from the control channel).
+ pub layout: Option<Layout>,
+ /// Snap indicator x (screen) this frame.
+ snap_x: Option<f32>,
+ pub peaks: Arc<Mutex<HashMap<ItemId, Arc<Vec<(f32, f32)>>>>>,
+ peaks_pending: Arc<Mutex<Vec<ItemId>>>,
+ zoom_anchor: Option<(f64, f32)>,
+}
+
+#[derive(Clone, Debug)]
+pub enum Drag {
+ Scrub,
+ Move { clips: Vec<ClipId>, grab_tick: Tick, start_track: TrackId, offset: Tick, track_delta: i32 },
+ Trim { clip: ClipId, edge: filmcraft_edit::Edge, mode: filmcraft_edit::TrimMode, delta: Tick },
+ Roll { left: ClipId, right: ClipId, delta: Tick },
+ Slip { clip: ClipId, delta: Tick },
+ Slide { clip: ClipId, delta: Tick },
+ Stretch { clip: ClipId, edge: filmcraft_edit::Edge, delta: Tick },
+ Pan { last: Pos2 },
+ Marquee { start: Pos2 },
+ Divider,
+ ZoomBar { grab: f32, mode: u8 },
+}
+
+/// Geometry of one visible track row.
+#[derive(Clone, Debug)]
+pub struct Row {
+ pub track: TrackId,
+ pub kind: TrackKind,
+ pub index: usize,
+ pub rect: Rect,
+}
+
+#[derive(Clone, Debug)]
+pub struct Layout {
+ pub content: Rect,
+ pub ruler: Rect,
+ pub rows: Vec<Row>,
+ pub pps: f64,
+ pub scroll: f64,
+}
+
+impl Layout {
+ pub fn x_of(&self, t: Tick) -> f32 {
+ self.content.min.x + ((t.seconds() - self.scroll) * self.pps) as f32
+ }
+ pub fn tick_at(&self, x: f32) -> Tick {
+ Tick::from_seconds_f64(self.scroll + (x - self.content.min.x) as f64 / self.pps)
+ }
+ pub fn row_at(&self, y: f32) -> Option<&Row> {
+ self.rows.iter().find(|r| r.rect.min.y <= y && y < r.rect.max.y)
+ }
+}
+
+/// Zoom about a time (keeps it under the same screen x).
+pub fn zoom_about(v: &mut TimelineView, factor: f64, anchor_secs: f64, width: f32) {
+ let old = v.target_pps;
+ let new = (old * factor).clamp(0.05, 24_000.0);
+ let x = ((anchor_secs - v.target_scroll) * old) as f32;
+ let x = if (0.0..=width).contains(&x) { x } else { width / 2.0 };
+ v.target_pps = new;
+ v.target_scroll = (anchor_secs - x as f64 / new).max(0.0);
+}
+
+fn label_color(l: filmcraft_project::Label) -> Color32 {
+ let c = l.rgb();
+ Color32::from_rgb(c[0], c[1], c[2])
+}
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let ctx = ui.ctx().clone();
+ let Some(seq_id) = app.session.state.active_sequence else {
+ empty_state(app, ui, rect);
+ return;
+ };
+ let seq = app.session.active_sequence().expect("active").clone();
+ let rate = seq.settings.frame_rate;
+ let dt = ctx.input(|i| i.stable_dt).min(0.05) as f64;
+ let header_w = app.ui.timeline.header_w;
+ let content = Rect::from_min_max(pos2(rect.min.x + header_w, rect.min.y + TOP_H), pos2(rect.max.x - 10.0, rect.max.y - SCROLLBAR_H));
+ let ruler = Rect::from_min_max(pos2(content.min.x, rect.min.y + TOP_H - RULER_H), pos2(content.max.x, rect.min.y + TOP_H));
+ app.last_timeline_width = content.width();
+ let painter = ui.painter().clone();
+ painter.rect_filled(rect, 0.0, t.panel_bg);
+
+ // ---- sequence tabs strip (top-left header block)
+ // ---- animated zoom / scroll
+ let dur_s = seq.duration().seconds().max(1.0);
+ {
+ let v = &mut app.ui.timeline;
+ if v.fit_pending && content.width() > 50.0 {
+ v.target_pps = (content.width() as f64 * 0.94 / dur_s).clamp(0.05, 24_000.0);
+ v.target_scroll = 0.0;
+ v.fit_pending = false;
+ }
+ let k = 1.0 - (-dt * 20.0).exp();
+ let zooming = (v.pps - v.target_pps).abs() / v.target_pps > 0.001;
+ v.pps += (v.target_pps - v.pps) * k;
+ if let Some((anchor_t, anchor_x)) = app.tl.zoom_anchor.filter(|_| zooming) {
+ v.scroll = (anchor_t - (anchor_x - content.min.x) as f64 / v.pps).max(0.0);
+ v.target_scroll = (anchor_t - (anchor_x - content.min.x) as f64 / v.target_pps).max(0.0);
+ } else {
+ v.scroll += (v.target_scroll - v.scroll) * k;
+ app.tl.zoom_anchor = None;
+ }
+ if (v.pps - v.target_pps).abs() > 1e-6 || (v.scroll - v.target_scroll).abs() > 1e-6 {
+ ctx.request_repaint();
+ }
+ if (v.pps - v.target_pps).abs() / v.target_pps < 0.0005 {
+ v.pps = v.target_pps;
+ }
+ if (v.scroll - v.target_scroll).abs() * v.pps < 0.05 {
+ v.scroll = v.target_scroll;
+ }
+ }
+ // follow playhead while playing (page scroll)
+ if app.playback.playing && app.ui.timeline.follow {
+ let v = &mut app.ui.timeline;
+ let px = (app.session.playhead().seconds() - v.scroll) * v.pps;
+ if px > content.width() as f64 * 0.95 || px < 0.0 {
+ v.target_scroll = (app.session.playhead().seconds() - content.width() as f64 * 0.05 / v.pps).max(0.0);
+ v.scroll = v.target_scroll;
+ }
+ }
+ let pps = app.ui.timeline.pps;
+ let scroll = app.ui.timeline.scroll;
+
+ // ---- rows
+ let tracks_area = Rect::from_min_max(content.min, content.max);
+ let split_y = tracks_area.min.y + (tracks_area.height() - DIVIDER_H) * app.ui.timeline.split;
+ let video_area = Rect::from_min_max(pos2(rect.min.x, tracks_area.min.y), pos2(content.max.x, split_y));
+ let audio_area = Rect::from_min_max(pos2(rect.min.x, split_y + DIVIDER_H), pos2(content.max.x, tracks_area.max.y - MASTER_H));
+ let vh = app.ui.timeline.video_track_h;
+ let ah = app.ui.timeline.audio_track_h;
+ let mut rows = Vec::new();
+ // Video: V1 at the bottom of the video area, stacking upward; v_scroll shifts up.
+ let nv = seq.video_tracks.len();
+ let video_total = nv as f32 * vh;
+ let v_off = (video_area.height() - video_total).max(0.0);
+ let max_vs = (video_total - video_area.height()).max(0.0);
+ app.ui.timeline.v_scroll = app.ui.timeline.v_scroll.clamp(0.0, max_vs);
+ for (i, tr) in seq.video_tracks.iter().enumerate() {
+ let top = video_area.min.y + v_off + (nv - 1 - i) as f32 * vh - (max_vs - app.ui.timeline.v_scroll);
+ rows.push(Row { track: tr.id, kind: TrackKind::Video, index: i, rect: Rect::from_min_max(pos2(content.min.x, top), pos2(content.max.x, top + vh)) });
+ }
+ let na = seq.audio_tracks.len();
+ let max_as = (na as f32 * ah - audio_area.height()).max(0.0);
+ app.ui.timeline.a_scroll = app.ui.timeline.a_scroll.clamp(0.0, max_as);
+ for (i, tr) in seq.audio_tracks.iter().enumerate() {
+ let top = audio_area.min.y + i as f32 * ah - app.ui.timeline.a_scroll;
+ rows.push(Row { track: tr.id, kind: TrackKind::Audio, index: i, rect: Rect::from_min_max(pos2(content.min.x, top), pos2(content.max.x, top + ah)) });
+ }
+ let layout = Layout { content, ruler, rows: rows.clone(), pps, scroll };
+ app.tl.layout = Some(layout.clone());
+
+ // ---- backgrounds
+ painter.rect_filled(Rect::from_min_max(pos2(content.min.x, content.min.y), content.max), 0.0, t.tl_bg);
+ let vclip = Rect::from_min_max(pos2(rect.min.x, video_area.min.y), video_area.max);
+ let aclip = Rect::from_min_max(pos2(rect.min.x, audio_area.min.y), audio_area.max);
+ for r in &rows {
+ let clip = if r.kind == TrackKind::Video { vclip } else { aclip };
+ let row = r.rect.intersect(clip);
+ if row.height() <= 0.0 {
+ continue;
+ }
+ let bg = if r.index % 2 == 0 { t.tl_track_bg } else { t.tl_track_bg_alt };
+ painter.rect_filled(row, 0.0, bg);
+ painter.line_segment([pos2(row.min.x, r.rect.max.y - 0.5), pos2(row.max.x, r.rect.max.y - 0.5)], Stroke::new(1.0, t.tl_bg));
+ }
+ // in/out shading across tracks
+ if seq.mark_in.is_some() || seq.mark_out.is_some() {
+ let a = layout.x_of(seq.mark_in.unwrap_or(Tick::ZERO)).max(content.min.x);
+ let b = layout.x_of(seq.mark_out.map(|o| o + rate.frame_duration()).unwrap_or(seq.duration())).min(content.max.x);
+ if b > a {
+ painter.rect_filled(Rect::from_min_max(pos2(a, content.min.y), pos2(b, content.max.y)), 0.0, t.in_out_shade);
+ }
+ }
+
+ // ---- clips
+ let visible = (layout.tick_at(content.min.x - 2.0), layout.tick_at(content.max.x + 2.0));
+ let selection: Vec<ClipId> = app.session.state.selection.clone();
+ let mut previews: HashMap<ClipId, (Tick, Tick, Option<TrackId>)> = HashMap::new(); // live drag preview: (start, dur, track)
+ preview_drag(app, &seq, &layout, &mut previews);
+ for r in &rows {
+ let tr = seq.track(r.track).expect("track");
+ let clip_rect = if r.kind == TrackKind::Video { vclip } else { aclip };
+ let row = r.rect.intersect(clip_rect);
+ if row.height() <= 0.0 {
+ continue;
+ }
+ let p = painter.with_clip_rect(Rect::from_min_max(pos2(content.min.x, row.min.y), pos2(content.max.x, row.max.y)));
+ for it in &tr.items {
+ let (start, dur, moved_track) = previews.get(&it.id).copied().unwrap_or((it.start, it.duration, None));
+ if moved_track.is_some_and(|m| m != r.track) {
+ continue;
+ }
+ if start + dur < visible.0 || start > visible.1 {
+ continue;
+ }
+ let x0 = layout.x_of(start);
+ let x1 = layout.x_of(start + dur);
+ let body = Rect::from_min_max(pos2(x0, r.rect.min.y + 1.0), pos2(x1.max(x0 + 1.0), r.rect.max.y - 1.0));
+ draw_clip(app, &ctx, &p, body, it, r.kind, selection.contains(&it.id), &t, rate);
+ app.auto.add(&format!("timeline.clip.{}", it.id.0), body.intersect(content), &it.name);
+ }
+ // items dragged onto this track from another
+ for (cid, (start, dur, mt)) in &previews {
+ if *mt == Some(r.track)
+ && tr.item(*cid).is_none()
+ && let Some((_, it)) = seq.find_item(*cid)
+ {
+ let body = Rect::from_min_max(pos2(layout.x_of(*start), r.rect.min.y + 1.0), pos2(layout.x_of(*start + *dur), r.rect.max.y - 1.0));
+ draw_clip(app, &ctx, &p, body, it, r.kind, true, &t, rate);
+ }
+ }
+ // transitions
+ for trn in &tr.transitions {
+ let x0 = layout.x_of(trn.start);
+ let x1 = layout.x_of(trn.end());
+ let tr_rect = Rect::from_min_max(pos2(x0, r.rect.min.y + 1.0), pos2(x1, r.rect.min.y + (r.rect.height() * 0.5).max(14.0)));
+ draw_transition(&p, tr_rect, trn, &t);
+ app.auto.add(&format!("timeline.transition.{}", trn.id.0), tr_rect, &trn.effect.effect);
+ }
+ }
+
+ // ---- track headers
+ draw_headers(app, ui, &seq, &rows, rect, vclip, aclip, &t);
+ // divider between video and audio
+ let div = Rect::from_min_max(pos2(rect.min.x, split_y), pos2(content.max.x, split_y + DIVIDER_H));
+ painter.rect_filled(div, 0.0, t.app_bg);
+ let div_resp = ui.interact(div, egui::Id::new("tl-divider"), Sense::drag());
+ if div_resp.hovered() || div_resp.dragged() {
+ ctx.set_cursor_icon(CursorIcon::ResizeVertical);
+ }
+ if div_resp.dragged() {
+ let f = app.ui.timeline.split + div_resp.drag_delta().y / (tracks_area.height() - DIVIDER_H).max(1.0);
+ app.ui.timeline.split = f.clamp(0.1, 0.9);
+ }
+ // master track
+ let master = Rect::from_min_max(pos2(rect.min.x, tracks_area.max.y - MASTER_H), pos2(content.max.x, tracks_area.max.y));
+ painter.rect_filled(master, 0.0, t.tl_header_bg);
+ painter.text(pos2(rect.min.x + 44.0, master.center().y), Align2::LEFT_CENTER, "Mix", Tokens::ui(11.5), t.text);
+ painter.text(
+ pos2(rect.min.x + header_w - 12.0, master.center().y),
+ Align2::RIGHT_CENTER,
+ format!("{:.1}", seq.master_volume_db),
+ Tokens::ui(11.5),
+ t.hot_text,
+ );
+
+ // ---- top block: timecode + toggles, ruler
+ draw_top(app, ui, rect, &seq, &layout, &t, seq_id);
+
+ // ---- playhead
+ let ph = app.session.playhead();
+ let px = layout.x_of(ph);
+ if px >= content.min.x - 1.0 && px <= content.max.x + 1.0 {
+ let head = [
+ pos2(px - 6.0, ruler.min.y + 2.0),
+ pos2(px + 6.0, ruler.min.y + 2.0),
+ pos2(px + 6.0, ruler.max.y - 10.0),
+ pos2(px, ruler.max.y - 4.0),
+ pos2(px - 6.0, ruler.max.y - 10.0),
+ ];
+ painter.add(egui::Shape::convex_polygon(head.to_vec(), t.playhead, Stroke::NONE));
+ painter.line_segment([pos2(px, ruler.max.y - 4.0), pos2(px, content.max.y)], Stroke::new(1.0, t.playhead));
+ }
+ // snap indicator
+ if let Some(sx) = app.tl.snap_x.take() {
+ painter.line_segment([pos2(sx, ruler.max.y), pos2(sx, content.max.y)], Stroke::new(1.0, Color32::from_rgb(250, 250, 250)));
+ for y in [ruler.max.y, content.max.y] {
+ let d = if y == ruler.max.y { 1.0 } else { -1.0 };
+ painter.add(egui::Shape::convex_polygon(vec![pos2(sx - 4.0, y), pos2(sx + 4.0, y), pos2(sx, y + 5.0 * d)], Color32::WHITE, Stroke::NONE));
+ }
+ }
+
+ // ---- scroll bars
+ zoom_scrollbar(app, ui, Rect::from_min_max(pos2(content.min.x, rect.max.y - SCROLLBAR_H + 2.0), pos2(content.max.x, rect.max.y - 2.0)), dur_s, &t);
+ vertical_scrollbar(
+ ui,
+ Rect::from_min_max(pos2(content.max.x + 2.0, video_area.min.y), pos2(rect.max.x - 1.0, video_area.max.y)),
+ &mut app.ui.timeline.v_scroll,
+ max_vs,
+ true,
+ &t,
+ "vs",
+ );
+ vertical_scrollbar(
+ ui,
+ Rect::from_min_max(pos2(content.max.x + 2.0, audio_area.min.y), pos2(rect.max.x - 1.0, audio_area.max.y)),
+ &mut app.ui.timeline.a_scroll,
+ max_as,
+ false,
+ &t,
+ "as",
+ );
+
+ // ---- interaction
+ interact(app, ui, &seq, &layout, rect);
+ let _ = (visible, TICKS_PER_SECOND);
+}
+
+fn empty_state(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ ui.painter().text(rect.center() - vec2(0.0, 12.0), Align2::CENTER_CENTER, "Drop media here to create sequence.", Tokens::ui(13.0), t.text_dim);
+ let b = Rect::from_center_size(rect.center() + vec2(0.0, 20.0), vec2(170.0, 26.0));
+ let resp = ui.interact(b, egui::Id::new("tl-open-demo"), Sense::click());
+ app.auto.add("timeline.openDemo", b, "Open Demo Project");
+ ui.painter().rect_filled(b, 13.0, if resp.hovered() { t.accent_hover } else { t.accent });
+ ui.painter().text(b.center(), Align2::CENTER_CENTER, "Open Demo Project", Tokens::semibold(12.0), Color32::WHITE);
+ if resp.clicked() {
+ let _ = app.session.execute("file.openDemoProject", json!({}));
+ }
+ // accept drops from the project panel
+ if let Some(item) = crate::panels::dragged_project_item(ui)
+ && ui.rect_contains_pointer(rect)
+ && ui.input(|i| i.pointer.any_released())
+ {
+ let _ = app.session.execute("file.newSequence", json!({"fromItem": item.0}));
+ }
+}
+
+#[allow(clippy::too_many_arguments)]
+fn draw_clip(
+ app: &mut FilmcraftApp,
+ ctx: &egui::Context,
+ p: &egui::Painter,
+ body: Rect,
+ it: &TrackItem,
+ kind: TrackKind,
+ selected: bool,
+ t: &Tokens,
+ rate: FrameRate,
+) {
+ let base = label_color(it.label);
+ let fill = if !it.enabled {
+ Color32::from_rgb(70, 70, 70)
+ } else if kind == TrackKind::Video {
+ base.gamma_multiply(0.92)
+ } else {
+ base.gamma_multiply(0.8)
+ };
+ let r = 3.0;
+ p.rect_filled(body, r, fill);
+ let name_h = 16.0;
+ let w = body.width();
+ // thumbnails (video) under the name band
+ if kind == TrackKind::Video && app.ui.timeline.show_thumbnails && body.height() > 30.0 && w > 24.0 && it.enabled {
+ let th_rect = Rect::from_min_max(pos2(body.min.x + 1.0, body.min.y + name_h), pos2(body.max.x - 1.0, body.max.y - 1.0));
+ let th_h = th_rect.height();
+ let aspect = app.session.project.item(it.item).and_then(|pi| match &pi.kind {
+ filmcraft_project::ItemKind::Media(m) => m.info.video.as_ref().map(|v| v.width as f32 / v.height as f32),
+ filmcraft_project::ItemKind::Sequence(s) => Some(s.settings.width as f32 / s.settings.height as f32),
+ _ => None,
+ });
+ if let Some(aspect) = aspect {
+ let th_w = th_h * aspect;
+ let n = ((th_rect.width() / th_w).ceil() as usize).clamp(1, 60);
+ let clip_p = p.with_clip_rect(th_rect.intersect(p.clip_rect()));
+ for k in 0..n {
+ let x = th_rect.min.x + k as f32 * th_w;
+ if x > clip_p.clip_rect().max.x || x + th_w < clip_p.clip_rect().min.x {
+ continue;
+ }
+ let frac = (k as f64 * th_w as f64) / w.max(1.0) as f64;
+ let tl = it.start + Tick((it.duration.0 as f64 * frac) as i64);
+ let mt = it.source_time_at(tl);
+ let mt = rate.snap(mt);
+ // quantise thumbnail times to 1/2 s so the cache hits
+ let q = Tick((mt.0 / (TICKS_PER_SECOND / 2)) * (TICKS_PER_SECOND / 2));
+ if let Some((tex, _)) = app.thumbnail(ctx, it.item, q, 128) {
+ let tr = Rect::from_min_size(pos2(x, th_rect.min.y), vec2(th_w, th_h));
+ clip_p.image(tex, tr, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::from_white_alpha(235));
+ }
+ }
+ }
+ }
+ // waveform (audio)
+ if kind == TrackKind::Audio && app.ui.timeline.show_waveforms && w > 4.0 {
+ draw_waveform(app, p, body, it, fill);
+ }
+ // name band
+ let text_col = if it.enabled { Color32::from_rgb(20, 20, 24) } else { t.text_dim };
+ let mut tx = body.min.x + 5.0;
+ if it.has_standard_effects() || it.has_modified_intrinsics() {
+ let fx = Rect::from_min_size(pos2(tx, body.min.y + 3.0), vec2(15.0, 10.0));
+ if fx.max.x < body.max.x {
+ p.rect_filled(fx, 2.0, if it.has_standard_effects() { Color32::from_rgb(236, 196, 58) } else { Color32::from_rgba_unmultiplied(0, 0, 0, 70) });
+ p.text(fx.center(), Align2::CENTER_CENTER, "fx", Tokens::semibold(8.5), Color32::from_rgb(30, 30, 30));
+ tx += 18.0;
+ }
+ }
+ if w > 30.0 {
+ let clip_p = p.with_clip_rect(body.shrink2(vec2(3.0, 0.0)).intersect(p.clip_rect()));
+ let mut label = it.name.clone();
+ if (it.speed - 1.0).abs() > 1e-6 || it.reverse {
+ label = format!("{label} [{}%]", ((if it.reverse { -1.0 } else { 1.0 }) * it.speed * 100.0).round());
+ }
+ clip_p.text(pos2(tx.max(clip_p.clip_rect().min.x + 4.0), body.min.y + 8.0), Align2::LEFT_CENTER, label, Tokens::ui(10.5), text_col);
+ }
+ if it.link.is_none() && kind == TrackKind::Video && w > 60.0 {
+ // unlinked items show no link indicator; linked ones are default
+ }
+ if selected {
+ p.rect_stroke(body, r, Stroke::new(1.5, t.clip_selected_border), StrokeKind::Inside);
+ } else {
+ p.rect_stroke(body, r, Stroke::new(1.0, Color32::from_black_alpha(90)), StrokeKind::Inside);
+ }
+}
+
+fn draw_waveform(app: &mut FilmcraftApp, p: &egui::Painter, body: Rect, it: &TrackItem, fill: Color32) {
+ let peaks = request_peaks(app, it.item);
+ let Some(peaks) = peaks else { return };
+ // peaks are per 256 samples at 48 kHz
+ let spp = 256.0;
+ let sr = 48_000.0;
+ let area = body.shrink2(vec2(1.0, 3.0));
+ let area = Rect::from_min_max(pos2(area.min.x, area.min.y + 12.0), area.max);
+ if area.height() < 4.0 {
+ return;
+ }
+ let clip = p.clip_rect().intersect(area);
+ let mid = area.center().y;
+ let amp = area.height() * 0.5;
+ let gain = filmcraft_render::audio::db_to_gain(it.effect("volume").map(|e| e.f64_at("level", it.source_in)).unwrap_or(0.0) + it.gain_db);
+ let col = fill.linear_multiply(0.45);
+ let dark = Color32::from_rgba_unmultiplied(0, 0, 0, 90);
+ let mut mesh = egui::Mesh::default();
+ let x_start = clip.min.x.floor() as i32;
+ let x_end = clip.max.x.ceil() as i32;
+ let dur_px = body.width().max(1.0);
+ for x in (x_start..x_end).step_by(1) {
+ let f = (x as f32 - body.min.x) / dur_px;
+ let tl = it.start + Tick((it.duration.0 as f64 * f as f64) as i64);
+ let tl2 = it.start + Tick((it.duration.0 as f64 * ((x as f32 + 1.0 - body.min.x) / dur_px) as f64) as i64);
+ let s0 = (it.source_time_at(tl).seconds() * sr / spp) as usize;
+ let s1 = ((it.source_time_at(tl2).seconds() * sr / spp) as usize).max(s0 + 1);
+ let mut lo = 0f32;
+ let mut hi = 0f32;
+ for (a, b) in peaks.iter().skip(s0).take(s1 - s0) {
+ lo = lo.min(*a);
+ hi = hi.max(*b);
+ }
+ let y0 = mid - (hi * gain).clamp(-1.0, 1.0) * amp;
+ let y1 = mid - (lo * gain).clamp(-1.0, 1.0) * amp;
+ let r = Rect::from_min_max(pos2(x as f32, y0.min(mid - 0.5)), pos2(x as f32 + 1.0, y1.max(mid + 0.5)));
+ mesh.add_colored_rect(r, dark);
+ }
+ let _ = col;
+ p.add(mesh);
+}
+
+fn request_peaks(app: &mut FilmcraftApp, item: ItemId) -> Option<Arc<Vec<(f32, f32)>>> {
+ if let Some(p) = app.tl.peaks.lock().unwrap_or_else(|e| e.into_inner()).get(&item) {
+ return Some(p.clone());
+ }
+ {
+ let mut pend = app.tl.peaks_pending.lock().unwrap_or_else(|e| e.into_inner());
+ if pend.contains(&item) {
+ return None;
+ }
+ pend.push(item);
+ }
+ let src = app.session.source(item)?;
+ let peaks = app.tl.peaks.clone();
+ let pending = app.tl.peaks_pending.clone();
+ let dur = src.info().duration;
+ let run = move || {
+ let sr = 48_000u32;
+ let total = dur.to_units_floor(sr as i64).max(0) as usize;
+ let mut out = Vec::with_capacity(total / 256 + 1);
+ let chunk = 48_000 * 4;
+ let mut s = 0usize;
+ while s < total {
+ let n = chunk.min(total - s);
+ match src.audio(s as i64, n, sr) {
+ Ok(buf) => {
+ let ch = buf.channels.first().cloned().unwrap_or_default();
+ for c in ch.chunks(256) {
+ let (lo, hi) = c.iter().fold((0f32, 0f32), |(l, h), v| (l.min(*v), h.max(*v)));
+ out.push((lo, hi));
+ }
+ }
+ Err(_) => break,
+ }
+ s += n;
+ }
+ peaks.lock().unwrap_or_else(|e| e.into_inner()).insert(item, Arc::new(out));
+ pending.lock().unwrap_or_else(|e| e.into_inner()).retain(|i| *i != item);
+ };
+ #[cfg(not(target_arch = "wasm32"))]
+ std::thread::spawn(run);
+ #[cfg(target_arch = "wasm32")]
+ run();
+ None
+}
+
+fn draw_transition(p: &egui::Painter, r: Rect, trn: &filmcraft_project::Transition, _t: &Tokens) {
+ let fill = Color32::from_rgba_unmultiplied(120, 120, 150, 200);
+ p.rect_filled(r, 2.0, fill);
+ // diagonal (Premiere shows a diagonal line across transitions)
+ let clip = p.with_clip_rect(r.intersect(p.clip_rect()));
+ clip.line_segment([r.left_bottom(), r.right_top()], Stroke::new(1.0, Color32::from_black_alpha(120)));
+ p.rect_stroke(r, 2.0, Stroke::new(1.0, Color32::from_black_alpha(140)), StrokeKind::Inside);
+ if r.width() > 50.0 {
+ let name = trn.effect.def().map(|d| d.name).unwrap_or(&trn.effect.effect);
+ clip.text(pos2(r.min.x + 4.0, r.center().y), Align2::LEFT_CENTER, name, Tokens::ui(9.5), Color32::from_rgb(20, 20, 24));
+ }
+}
+
+#[allow(clippy::too_many_arguments)]
+fn draw_headers(app: &mut FilmcraftApp, ui: &mut egui::Ui, seq: &Sequence, rows: &[Row], rect: Rect, vclip: Rect, aclip: Rect, t: &Tokens) {
+ let hw = app.ui.timeline.header_w;
+ let tg = app.session.targeting();
+ let mut actions: Vec<(String, Value)> = Vec::new();
+ for r in rows {
+ let tr = seq.track(r.track).expect("track");
+ let clip_rect = if r.kind == TrackKind::Video { vclip } else { aclip };
+ let hrect = Rect::from_min_max(pos2(rect.min.x, r.rect.min.y), pos2(rect.min.x + hw - 2.0, r.rect.max.y));
+ let visible = hrect.intersect(clip_rect);
+ if visible.height() <= 0.0 {
+ continue;
+ }
+ let p = ui.painter().with_clip_rect(visible);
+ p.rect_filled(hrect.shrink2(vec2(0.0, 0.5)), 0.0, t.tl_header_bg);
+ let label = format!("{}{}", if r.kind == TrackKind::Video { "V" } else { "A" }, r.index + 1);
+ let cy = hrect.min.y + 13.0f32.min(hrect.height() / 2.0);
+ // source patch (left): shows the source track when patched
+ let patched = if r.kind == TrackKind::Video { tg.video_dest == Some(r.track) } else { tg.audio_dest == Some(r.track) };
+ let pr = Rect::from_center_size(pos2(hrect.min.x + 14.0, cy), vec2(22.0, 17.0));
+ let presp = ui.interact(pr.intersect(visible), egui::Id::new(("patch", r.track.0)), Sense::click());
+ app.auto.add(&format!("timeline.track.{label}.sourcePatch"), pr, "Source patch");
+ if patched {
+ p.rect_filled(pr, 3.0, t.accent);
+ p.text(pr.center(), Align2::CENTER_CENTER, label.clone(), Tokens::semibold(10.0), Color32::WHITE);
+ } else {
+ p.rect_stroke(pr, 3.0, Stroke::new(1.0, t.separator), StrokeKind::Inside);
+ }
+ if presp.clicked() {
+ actions.push(("timeline.setTargeting".into(), json!({"track": r.track.0, "sourcePatch": !patched})));
+ }
+ // target toggle
+ let targeted = tg.targeted.contains(&r.track);
+ let trr = Rect::from_center_size(pos2(hrect.min.x + 40.0, cy), vec2(24.0, 17.0));
+ let tresp = ui.interact(trr.intersect(visible), egui::Id::new(("target", r.track.0)), Sense::click());
+ app.auto.add(&format!("timeline.track.{label}.target"), trr, "Toggle track targeting");
+ p.rect_filled(trr, 3.0, if targeted { Color32::from_rgb(70, 70, 70) } else { Color32::TRANSPARENT });
+ p.rect_stroke(trr, 3.0, Stroke::new(1.0, if targeted { t.accent } else { t.separator }), StrokeKind::Inside);
+ p.text(trr.center(), Align2::CENTER_CENTER, label.clone(), Tokens::semibold(10.0), if targeted { t.tab_text_active } else { t.text_dim });
+ if tresp.clicked() {
+ actions.push(("timeline.setTargeting".into(), json!({"track": r.track.0, "targeted": !targeted})));
+ }
+ // sync lock, lock
+ let mut x = hrect.min.x + 60.0;
+ let mut toggle = |icon: Icon, on: bool, name: &str, key: &str, on_col: Option<Color32>, actions: &mut Vec<(String, Value)>, app: &mut FilmcraftApp| {
+ let br = Rect::from_center_size(pos2(x + 9.0, cy), vec2(18.0, 18.0));
+ let resp = crate::widgets::icon_toggle(ui, br.intersect(visible), icon, on, t, egui::Id::new((key, r.track.0)), on_col);
+ app.auto.add(&format!("timeline.track.{label}.{key}"), br, name);
+ if resp.clicked() {
+ actions.push(("timeline.setTrack".into(), json!({"track": r.track.0, key: !on})));
+ }
+ x += 20.0;
+ };
+ toggle(Icon::SyncLock, tr.sync_lock, "Toggle Sync Lock", "syncLock", Some(t.icon), &mut actions, app);
+ toggle(
+ if tr.locked { Icon::Lock } else { Icon::Unlock },
+ tr.locked,
+ "Toggle Track Lock",
+ "locked",
+ Some(Color32::from_rgb(230, 190, 70)),
+ &mut actions,
+ app,
+ );
+ if r.kind == TrackKind::Video {
+ toggle(if tr.enabled { Icon::Eye } else { Icon::EyeOff }, tr.enabled, "Toggle Track Output", "enabled", Some(t.icon), &mut actions, app);
+ } else {
+ let mr = Rect::from_center_size(pos2(x + 9.0, cy), vec2(17.0, 15.0));
+ let mresp =
+ crate::widgets::letter_toggle(ui, mr.intersect(visible), "M", tr.muted, Color32::from_rgb(70, 190, 110), t, egui::Id::new(("mute", r.track.0)));
+ app.auto.add(&format!("timeline.track.{label}.muted"), mr, "Mute Track");
+ if mresp.clicked() {
+ actions.push(("timeline.setTrack".into(), json!({"track": r.track.0, "muted": !tr.muted})));
+ }
+ let sr = Rect::from_center_size(pos2(x + 29.0, cy), vec2(17.0, 15.0));
+ let sresp =
+ crate::widgets::letter_toggle(ui, sr.intersect(visible), "S", tr.solo, Color32::from_rgb(235, 200, 60), t, egui::Id::new(("solo", r.track.0)));
+ app.auto.add(&format!("timeline.track.{label}.solo"), sr, "Solo Track");
+ if sresp.clicked() {
+ actions.push(("timeline.setTrack".into(), json!({"track": r.track.0, "solo": !tr.solo})));
+ }
+ let vr = Rect::from_center_size(pos2(x + 49.0, cy), vec2(17.0, 15.0));
+ crate::widgets::icon_toggle(ui, vr.intersect(visible), Icon::Mic, false, t, egui::Id::new(("vo", r.track.0)), None);
+ x += 62.0;
+ }
+ // name (when the track is tall enough) or label
+ if hrect.height() >= 38.0 {
+ p.text(pos2(hrect.min.x + 60.0, hrect.max.y - 11.0), Align2::LEFT_CENTER, &tr.name, Tokens::ui(10.5), t.text_dim);
+ } else if x + 30.0 < hrect.max.x {
+ p.text(pos2(hrect.max.x - 8.0, cy), Align2::RIGHT_CENTER, &tr.name, Tokens::ui(10.5), t.text_faint);
+ }
+ // resize track height by dragging the header's bottom edge
+ let edge = Rect::from_min_max(pos2(hrect.min.x, hrect.max.y - 3.0), pos2(hrect.max.x, hrect.max.y + 2.0)).intersect(visible);
+ if edge.height() > 0.0 {
+ let eresp = ui.interact(edge, egui::Id::new(("trackh", r.track.0)), Sense::drag());
+ if eresp.hovered() || eresp.dragged() {
+ ui.ctx().set_cursor_icon(CursorIcon::ResizeVertical);
+ }
+ if eresp.dragged() {
+ let d = eresp.drag_delta().y * if r.kind == TrackKind::Video { -1.0 } else { 1.0 };
+ let h = if r.kind == TrackKind::Video { &mut app.ui.timeline.video_track_h } else { &mut app.ui.timeline.audio_track_h };
+ *h = (*h + d).clamp(22.0, 220.0);
+ }
+ }
+ // double-click header toggles tall/short
+ let resp = ui.interact(hrect.intersect(visible), egui::Id::new(("hdr", r.track.0)), Sense::click());
+ if resp.double_clicked() {
+ let h = if r.kind == TrackKind::Video { &mut app.ui.timeline.video_track_h } else { &mut app.ui.timeline.audio_track_h };
+ *h = if *h < 60.0 { 96.0 } else { 36.0 };
+ }
+ }
+ for (cmd, params) in actions {
+ if let Err(e) = app.session.execute(&cmd, params) {
+ app.ui.status = e.to_string();
+ }
+ }
+}
+
+fn draw_top(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect, seq: &Sequence, layout: &Layout, t: &Tokens, seq_id: ItemId) {
+ let p = ui.painter().clone();
+ let rate = seq.settings.frame_rate;
+ // sequence tabs (open sequences)
+ let tabs_rect = Rect::from_min_max(pos2(rect.min.x, rect.min.y), pos2(rect.max.x, rect.min.y + TOP_H - RULER_H));
+ let _ = tabs_rect;
+ // big timecode
+ let hw = app.ui.timeline.header_w;
+ let tc = format_time(app.session.playhead(), rate, seq.settings.drop_frame, TimeDisplay::Timecode, seq.settings.sample_rate as i64);
+ let tc_rect = Rect::from_min_size(pos2(rect.min.x + 10.0, rect.min.y + 6.0), vec2(hw - 16.0, 24.0));
+ p.text(pos2(tc_rect.min.x, tc_rect.center().y), Align2::LEFT_CENTER, &tc, Tokens::mono(18.0), t.timecode);
+ app.auto.add("timeline.timecode", tc_rect, &tc);
+ // toggle row
+ let mut x = rect.min.x + 10.0;
+ let y = rect.min.y + TOP_H - 16.0;
+ let toggles: [(Icon, &str, bool, &str); 5] = [
+ (Icon::Nest, "nest", true, "Insert and overwrite sequences as nests or individual clips"),
+ (Icon::Magnet, "snap", app.session.state.snapping, "Snap in Timeline (S)"),
+ (Icon::Link, "linked", app.session.state.linked_selection, "Linked Selection"),
+ (Icon::Marker, "marker", false, "Add Marker (M)"),
+ (Icon::Wrench, "settings", false, "Timeline Display Settings"),
+ ];
+ for (icon, key, on, tip) in toggles {
+ let r = Rect::from_center_size(pos2(x + 11.0, y), vec2(22.0, 22.0));
+ let resp = ui.interact(r, egui::Id::new(("tl-toggle", key)), Sense::click()).on_hover_text(tip);
+ app.auto.add(&format!("timeline.toggle.{key}"), r, tip);
+ if resp.hovered() {
+ p.rect_filled(r, 3.0, t.hover);
+ }
+ let col = if on && matches!(key, "snap" | "linked") { t.icon_active } else { t.icon };
+ icons::paint(&p, r.shrink(4.0), icon, col);
+ if resp.clicked() {
+ let _ = match key {
+ "snap" => app.session.execute("sequence.snap", json!({})),
+ "linked" => app.session.execute("sequence.linkedSelection", json!({})),
+ "marker" => app.session.execute("markers.add", json!({})),
+ _ => Ok(Value::Null),
+ };
+ }
+ if key == "settings" {
+ egui::Popup::menu(&resp).show(|ui| {
+ ui.checkbox(&mut app.ui.timeline.show_thumbnails, "Show Video Thumbnails");
+ ui.checkbox(&mut app.ui.timeline.show_waveforms, "Show Audio Waveform");
+ ui.separator();
+ if ui.button("Expand All Tracks").clicked() {
+ app.ui.timeline.video_track_h = 90.0;
+ app.ui.timeline.audio_track_h = 70.0;
+ }
+ if ui.button("Minimize All Tracks").clicked() {
+ app.ui.timeline.video_track_h = 26.0;
+ app.ui.timeline.audio_track_h = 26.0;
+ }
+ });
+ }
+ x += 26.0;
+ }
+ // ruler
+ let ruler = layout.ruler;
+ p.rect_filled(Rect::from_min_max(pos2(ruler.min.x, ruler.min.y - (TOP_H - RULER_H)), ruler.max), 0.0, t.panel_bg);
+ p.rect_filled(ruler, 0.0, t.tl_ruler_bg);
+ let pps = layout.pps;
+ // choose a tick step in frames so labels are ≥ 90 px apart
+ let fps = rate.as_f64();
+ let base = rate.timecode_base();
+ let steps_frames: Vec<i64> = vec![
+ 1,
+ 2,
+ 5,
+ 10,
+ base / 2,
+ base,
+ base * 2,
+ base * 5,
+ base * 10,
+ base * 15,
+ base * 30,
+ base * 60,
+ base * 120,
+ base * 300,
+ base * 600,
+ base * 1800,
+ base * 3600,
+ ];
+ let frame_px = pps / fps;
+ let label_step = *steps_frames.iter().find(|s| **s as f64 * frame_px >= 90.0).unwrap_or(&(base * 3600));
+ let minor = *steps_frames.iter().find(|s| **s as f64 * frame_px >= 9.0).unwrap_or(&label_step);
+ let f0 = rate.frame_at(layout.tick_at(ruler.min.x)).max(0);
+ let f1 = rate.frame_at(layout.tick_at(ruler.max.x)) + 1;
+ let mut f = (f0 / minor) * minor;
+ let clip = p.with_clip_rect(ruler);
+ while f <= f1 {
+ let x = layout.x_of(rate.tick_of(f));
+ let major = f % label_step == 0;
+ let h = if major {
+ 10.0
+ } else if f % (minor * 5) == 0 {
+ 6.0
+ } else {
+ 3.5
+ };
+ clip.line_segment([pos2(x, ruler.max.y - h), pos2(x, ruler.max.y)], Stroke::new(1.0, t.tl_ruler_tick));
+ if major {
+ let label = format_time(rate.tick_of(f), rate, seq.settings.drop_frame, TimeDisplay::Timecode, 48000);
+ clip.text(pos2(x + 3.0, ruler.min.y + 8.0), Align2::LEFT_CENTER, label, Tokens::ui(9.5), t.tl_ruler_text);
+ }
+ f += minor;
+ }
+ // in/out on ruler
+ if seq.mark_in.is_some() || seq.mark_out.is_some() {
+ let a = layout.x_of(seq.mark_in.unwrap_or(Tick::ZERO));
+ let b = layout.x_of(seq.mark_out.map(|o| o + rate.frame_duration()).unwrap_or(seq.duration()));
+ clip.rect_filled(Rect::from_min_max(pos2(a, ruler.min.y + 14.0), pos2(b, ruler.max.y - 6.0)), 0.0, Color32::from_white_alpha(40));
+ if seq.mark_in.is_some() {
+ clip.line_segment([pos2(a, ruler.min.y + 12.0), pos2(a, ruler.max.y)], Stroke::new(1.5, Color32::from_white_alpha(170)));
+ }
+ if seq.mark_out.is_some() {
+ clip.line_segment([pos2(b, ruler.min.y + 12.0), pos2(b, ruler.max.y)], Stroke::new(1.5, Color32::from_white_alpha(170)));
+ }
+ }
+ // render bar: yellow where effects/transitions need GPU work, green where cached
+ let rb = Rect::from_min_max(pos2(ruler.min.x, ruler.max.y - 3.0), pos2(ruler.max.x, ruler.max.y));
+ for tr in &seq.video_tracks {
+ for it in &tr.items {
+ let heavy = it.has_standard_effects() || it.has_modified_intrinsics();
+ let col = if heavy { t.render_yellow } else { continue };
+ let r = Rect::from_min_max(pos2(layout.x_of(it.start), rb.min.y), pos2(layout.x_of(it.end()), rb.max.y)).intersect(ruler);
+ clip.rect_filled(r, 0.0, col);
+ }
+ for trn in &tr.transitions {
+ let r = Rect::from_min_max(pos2(layout.x_of(trn.start), rb.min.y), pos2(layout.x_of(trn.end()), rb.max.y)).intersect(ruler);
+ clip.rect_filled(r, 0.0, t.render_yellow);
+ }
+ }
+ // markers
+ for m in &seq.markers {
+ let x = layout.x_of(m.start);
+ let c = label_color(m.color);
+ let y0 = ruler.min.y + 14.0;
+ let shape = vec![pos2(x - 5.0, y0), pos2(x + 5.0, y0), pos2(x + 5.0, y0 + 7.0), pos2(x, y0 + 11.0), pos2(x - 5.0, y0 + 7.0)];
+ clip.add(egui::Shape::convex_polygon(shape, c, Stroke::NONE));
+ if m.duration > Tick::ZERO {
+ clip.rect_filled(Rect::from_min_max(pos2(x, y0), pos2(layout.x_of(m.start + m.duration), y0 + 7.0)), 0.0, c.gamma_multiply(0.6));
+ }
+ let mr = Rect::from_center_size(pos2(x, y0 + 5.0), vec2(10.0, 11.0));
+ app.auto.add(&format!("timeline.marker.{}", m.id.0), mr, &m.name);
+ if ui.rect_contains_pointer(mr) && !m.name.is_empty() {
+ egui::Tooltip::always_open(ui.ctx().clone(), ui.layer_id(), egui::Id::new(("mk", m.id.0)), egui::PopupAnchor::Pointer).show(|ui| {
+ ui.label(&m.name);
+ });
+ }
+ }
+ let _ = seq_id;
+ app.auto.add("timeline.ruler", ruler, "time ruler");
+}
+
+fn zoom_scrollbar(app: &mut FilmcraftApp, ui: &mut egui::Ui, bar: Rect, dur_s: f64, t: &Tokens) {
+ let p = ui.painter();
+ p.rect_filled(bar, bar.height() / 2.0, t.field_bg);
+ let v = &mut app.ui.timeline;
+ let total = (dur_s * 1.15).max(v.scroll + bar.width() as f64 / v.pps);
+ let vis = bar.width() as f64 / v.pps;
+ let a = bar.min.x + (v.scroll / total) as f32 * bar.width();
+ let b = bar.min.x + ((v.scroll + vis) / total).min(1.0) as f32 * bar.width();
+ let thumb = Rect::from_min_max(pos2(a, bar.min.y + 1.0), pos2(b.max(a + 16.0), bar.max.y - 1.0));
+ let hover = ui.rect_contains_pointer(thumb);
+ p.rect_filled(thumb, thumb.height() / 2.0, if hover { Color32::from_rgb(110, 110, 110) } else { Color32::from_rgb(85, 85, 85) });
+ // end handles (circles) to zoom
+ for x in [thumb.min.x + 5.0, thumb.max.x - 5.0] {
+ p.circle_filled(pos2(x, thumb.center().y), 3.0, Color32::from_rgb(170, 170, 170));
+ }
+ app.auto.add("timeline.zoomBar", thumb, "zoom scroll bar");
+ let resp = ui.interact(bar, egui::Id::new("tl-zoombar"), Sense::drag());
+ if resp.drag_started()
+ && let Some(pos) = resp.interact_pointer_pos()
+ {
+ let mode = if (pos.x - thumb.min.x).abs() < 8.0 {
+ 1
+ } else if (pos.x - thumb.max.x).abs() < 8.0 {
+ 2
+ } else {
+ 0
+ };
+ app.tl.drag = Some(Drag::ZoomBar { grab: pos.x, mode });
+ }
+ if let Some(Drag::ZoomBar { mode, .. }) = app.tl.drag.clone()
+ && resp.dragged()
+ {
+ let dx = resp.drag_delta().x as f64 / bar.width() as f64 * total;
+ let v = &mut app.ui.timeline;
+ match mode {
+ 0 => {
+ v.target_scroll = (v.target_scroll + dx).max(0.0);
+ v.scroll = v.target_scroll;
+ }
+ 1 => {
+ let end = v.scroll + vis;
+ let ns = (v.scroll + dx).clamp(0.0, end - 0.05);
+ v.pps = bar.width() as f64 / (end - ns);
+ v.target_pps = v.pps;
+ v.scroll = ns;
+ v.target_scroll = ns;
+ }
+ _ => {
+ let ne = (v.scroll + vis + dx).max(v.scroll + 0.05);
+ v.pps = bar.width() as f64 / (ne - v.scroll);
+ v.target_pps = v.pps;
+ }
+ }
+ }
+ if resp.drag_stopped() {
+ app.tl.drag = None;
+ }
+}
+
+fn vertical_scrollbar(ui: &mut egui::Ui, bar: Rect, value: &mut f32, max: f32, invert: bool, t: &Tokens, id: &str) {
+ if max <= 0.5 || bar.height() < 20.0 {
+ return;
+ }
+ let p = ui.painter();
+ let frac_vis = bar.height() / (bar.height() + max);
+ let h = (bar.height() * frac_vis).max(18.0);
+ let pos = if invert { 1.0 - *value / max } else { *value / max };
+ let y = bar.min.y + (bar.height() - h) * pos;
+ let thumb = Rect::from_min_size(pos2(bar.min.x + 1.0, y), vec2(bar.width() - 2.0, h));
+ p.rect_filled(thumb, 3.0, Color32::from_rgb(80, 80, 80));
+ let resp = ui.interact(bar, egui::Id::new(("tl-vs", id)), Sense::drag());
+ if resp.dragged() {
+ let d = resp.drag_delta().y / (bar.height() - h).max(1.0) * max;
+ *value = (*value + if invert { -d } else { d }).clamp(0.0, max);
+ }
+ let _ = t;
+}
+
+/// Snap `t` to nearby candidates (edits, playhead, markers, in/out). Returns snapped tick.
+fn snap(app: &mut FilmcraftApp, seq: &Sequence, layout: &Layout, t: Tick, exclude: &[ClipId]) -> Tick {
+ if !app.session.state.snapping {
+ return t;
+ }
+ let mut cands: Vec<Tick> = Vec::with_capacity(64);
+ for tr in seq.all_tracks() {
+ for it in &tr.items {
+ if exclude.contains(&it.id) {
+ continue;
+ }
+ cands.push(it.start);
+ cands.push(it.end());
+ }
+ }
+ cands.push(app.session.playhead());
+ cands.extend(seq.markers.iter().map(|m| m.start));
+ cands.extend(seq.mark_in);
+ cands.extend(seq.mark_out);
+ let x = layout.x_of(t);
+ let mut best: Option<(f32, Tick)> = None;
+ for c in cands {
+ let d = (layout.x_of(c) - x).abs();
+ if d < SNAP_PX && best.is_none_or(|b| d < b.0) {
+ best = Some((d, c));
+ }
+ }
+ match best {
+ Some((_, c)) => {
+ app.tl.snap_x = Some(layout.x_of(c));
+ c
+ }
+ None => t,
+ }
+}
+
+/// What is at a screen point.
+#[derive(Clone, Debug)]
+pub enum Hit {
+ Ruler,
+ Clip { track: TrackId, clip: ClipId, edge: Option<filmcraft_edit::Edge> },
+ Transition { track: TrackId, id: filmcraft_project::TransitionId },
+ Empty { track: TrackId },
+ None,
+}
+
+pub fn hit(seq: &Sequence, layout: &Layout, pos: Pos2) -> Hit {
+ if layout.ruler.contains(pos) {
+ return Hit::Ruler;
+ }
+ if !layout.content.contains(pos) {
+ return Hit::None;
+ }
+ let Some(row) = layout.row_at(pos.y) else { return Hit::None };
+ let tr = seq.track(row.track).expect("track");
+ for trn in &tr.transitions {
+ let x0 = layout.x_of(trn.start);
+ let x1 = layout.x_of(trn.end());
+ if pos.x >= x0 && pos.x <= x1 && pos.y < row.rect.min.y + (row.rect.height() * 0.5).max(14.0) {
+ return Hit::Transition { track: row.track, id: trn.id };
+ }
+ }
+ let t = layout.tick_at(pos.x);
+ let edge_px = 7.0f32;
+ // prefer edges
+ for it in &tr.items {
+ let x0 = layout.x_of(it.start);
+ let x1 = layout.x_of(it.end());
+ let w = x1 - x0;
+ let e = edge_px.min(w / 3.0);
+ if (pos.x - x0).abs() <= e && pos.x >= x0 - e {
+ return Hit::Clip { track: row.track, clip: it.id, edge: Some(filmcraft_edit::Edge::In) };
+ }
+ if (pos.x - x1).abs() <= e && pos.x <= x1 + e {
+ return Hit::Clip { track: row.track, clip: it.id, edge: Some(filmcraft_edit::Edge::Out) };
+ }
+ }
+ if let Some(it) = tr.item_at(t) {
+ return Hit::Clip { track: row.track, clip: it.id, edge: None };
+ }
+ Hit::Empty { track: row.track }
+}
+
+pub fn hit_json(app: &FilmcraftApp, pos: Pos2) -> Value {
+ let (Some(layout), Some(seq)) = (app.tl.layout.as_ref(), app.session.active_sequence()) else { return json!({"hit": "none"}) };
+ let t = layout.tick_at(pos.x);
+ match hit(seq, layout, pos) {
+ Hit::Ruler => json!({"hit": "ruler", "time": t.0}),
+ Hit::Clip { track, clip, edge } => json!({"hit": "clip", "track": track.0, "clip": clip.0, "edge": edge.map(|e| format!("{e:?}")), "time": t.0}),
+ Hit::Transition { track, id } => json!({"hit": "transition", "track": track.0, "transition": id.0}),
+ Hit::Empty { track } => json!({"hit": "empty", "track": track.0, "time": t.0}),
+ Hit::None => json!({"hit": "none"}),
+ }
+}
+
+/// Screen point of a clip (centre, or its in/out edge).
+pub fn locate(app: &FilmcraftApp, clip: u64, edge: Option<&str>) -> Option<(f32, f32)> {
+ let layout = app.tl.layout.as_ref()?;
+ let seq = app.session.active_sequence()?;
+ let (tid, it) = seq.find_item(ClipId(clip))?;
+ let row = layout.rows.iter().find(|r| r.track == tid)?;
+ let y = row.rect.center().y;
+ let x = match edge {
+ Some("in") => layout.x_of(it.start) + 2.0,
+ Some("out") => layout.x_of(it.end()) - 2.0,
+ _ => (layout.x_of(it.start) + layout.x_of(it.end())) / 2.0,
+ };
+ Some((x, y))
+}
+
+fn preview_drag(app: &FilmcraftApp, seq: &Sequence, _layout: &Layout, out: &mut HashMap<ClipId, (Tick, Tick, Option<TrackId>)>) {
+ let Some(d) = &app.tl.drag else { return };
+ match d {
+ Drag::Move { clips, offset, track_delta, .. } => {
+ for c in clips {
+ if let Some((tid, it)) = seq.find_item(*c) {
+ let dest = shift_track(seq, tid, *track_delta);
+ out.insert(*c, ((it.start + *offset).max(Tick::ZERO), it.duration, dest));
+ }
+ }
+ }
+ Drag::Trim { clip, edge, delta, .. } | Drag::Stretch { clip, edge, delta } => {
+ let ids = filmcraft_engine::commands::with_links(&app.session, &[*clip]);
+ for c in ids {
+ if let Some((_, it)) = seq.find_item(c) {
+ let v = match edge {
+ filmcraft_edit::Edge::In => (it.start + *delta, it.duration - *delta, None),
+ filmcraft_edit::Edge::Out => (it.start, it.duration + *delta, None),
+ };
+ out.insert(c, v);
+ }
+ }
+ }
+ Drag::Roll { left, right, delta } => {
+ if let Some((_, l)) = seq.find_item(*left) {
+ out.insert(*left, (l.start, l.duration + *delta, None));
+ }
+ if let Some((_, r)) = seq.find_item(*right) {
+ out.insert(*right, (r.start + *delta, r.duration - *delta, None));
+ }
+ }
+ Drag::Slide { clip, delta } => {
+ if let Some((_, it)) = seq.find_item(*clip) {
+ out.insert(*clip, (it.start + *delta, it.duration, None));
+ }
+ }
+ _ => {}
+ }
+}
+
+fn shift_track(seq: &Sequence, tid: TrackId, delta: i32) -> Option<TrackId> {
+ if delta == 0 {
+ return Some(tid);
+ }
+ for tracks in [&seq.video_tracks, &seq.audio_tracks] {
+ if let Some(i) = tracks.iter().position(|t| t.id == tid) {
+ let ni = (i as i32 + delta).clamp(0, tracks.len() as i32 - 1) as usize;
+ return Some(tracks[ni].id);
+ }
+ }
+ Some(tid)
+}
+
+fn interact(app: &mut FilmcraftApp, ui: &mut egui::Ui, seq: &Sequence, layout: &Layout, rect: Rect) {
+ let ctx = ui.ctx().clone();
+ let area = Rect::from_min_max(pos2(layout.content.min.x, layout.ruler.min.y), layout.content.max);
+ let resp = ui.interact(area, egui::Id::new("timeline-area"), Sense::click_and_drag());
+ let pos = resp.hover_pos().or(resp.interact_pointer_pos());
+ let mods = ctx.input(|i| i.modifiers);
+ let tool = app.ui.tool;
+ let rate = seq.settings.frame_rate;
+
+ // ---- wheel: horizontal scroll; Alt/Cmd+wheel zoom about cursor; Shift+wheel vertical
+ if ui.rect_contains_pointer(rect) {
+ let (scroll, zoom) = ctx.input(|i| (i.smooth_scroll_delta, i.zoom_delta()));
+ if let Some(p) = ctx.pointer_hover_pos() {
+ if (zoom - 1.0).abs() > 1e-4 || ((mods.alt || mods.command) && scroll.y.abs() > 0.0) {
+ let f = if (zoom - 1.0).abs() > 1e-4 { zoom as f64 } else { (1.0 + scroll.y as f64 * 0.01).clamp(0.5, 2.0) };
+ let anchor_t = layout.tick_at(p.x).seconds();
+ let v = &mut app.ui.timeline;
+ v.target_pps = (v.target_pps * f).clamp(0.05, 24_000.0);
+ app.tl.zoom_anchor = Some((anchor_t, p.x));
+ } else if mods.shift && scroll.y.abs() > 0.0 {
+ if layout.rows.iter().find(|r| r.kind == TrackKind::Video).is_some_and(|r| p.y < r.rect.max.y + 200.0) && p.y < layout.content.center().y {
+ app.ui.timeline.v_scroll -= scroll.y;
+ } else {
+ app.ui.timeline.a_scroll -= scroll.y;
+ }
+ } else if scroll.x.abs() > 0.0 || scroll.y.abs() > 0.0 {
+ let d = if scroll.x.abs() > scroll.y.abs() { scroll.x } else { scroll.y };
+ let v = &mut app.ui.timeline;
+ v.target_scroll = (v.target_scroll - d as f64 / v.pps).max(0.0);
+ v.scroll = v.target_scroll;
+ }
+ }
+ }
+
+ // ---- cursor feedback
+ if app.tl.drag.is_none()
+ && let Some(p) = pos
+ && area.contains(p)
+ {
+ let h = hit(seq, layout, p);
+ let cur = match (tool, &h) {
+ (Tool::Selection, Hit::Clip { edge: Some(_), .. }) => CursorIcon::ResizeColumn,
+ (Tool::Ripple | Tool::Rolling | Tool::RateStretch, Hit::Clip { edge: Some(_), .. }) => CursorIcon::ResizeColumn,
+ (Tool::Razor, Hit::Clip { .. }) => CursorIcon::Crosshair,
+ (Tool::Slip | Tool::Slide, Hit::Clip { .. }) => CursorIcon::ResizeHorizontal,
+ (Tool::Hand, _) => CursorIcon::Grab,
+ (Tool::Zoom, _) => CursorIcon::ZoomIn,
+ _ => CursorIcon::Default,
+ };
+ ctx.set_cursor_icon(cur);
+ // razor preview line
+ if tool == Tool::Razor
+ && let Hit::Clip { track, .. } = h
+ && let Some(row) = layout.rows.iter().find(|r| r.track == track)
+ {
+ let t = snap(app, seq, layout, rate.snap_nearest(layout.tick_at(p.x)), &[]);
+ let x = layout.x_of(t);
+ ui.painter().line_segment([pos2(x, row.rect.min.y), pos2(x, row.rect.max.y)], Stroke::new(1.0, Color32::WHITE));
+ }
+ }
+
+ // ---- press
+ if resp.drag_started() || (resp.clicked() && app.tl.drag.is_none()) {
+ let Some(p) = resp.interact_pointer_pos() else { return };
+ let h = hit(seq, layout, p);
+ let t = layout.tick_at(p.x);
+ let started = match (tool, h.clone()) {
+ (_, Hit::Ruler) => Some(Drag::Scrub),
+ (Tool::Hand, _) => Some(Drag::Pan { last: p }),
+ (Tool::Zoom, _) => {
+ if resp.clicked() {
+ let f = if mods.alt { 1.0 / 2.0 } else { 2.0 };
+ app.ui.timeline.target_pps = (app.ui.timeline.target_pps * f).clamp(0.05, 24_000.0);
+ app.tl.zoom_anchor = Some((t.seconds(), p.x));
+ }
+ None
+ }
+ (Tool::Razor, Hit::Clip { clip, .. }) => {
+ if resp.clicked() || resp.drag_started() {
+ let tt = snap(app, seq, layout, rate.snap_nearest(t), &[]);
+ let r = if mods.shift {
+ app.session.execute("timeline.razor", json!({"time": tt.0}))
+ } else {
+ app.session.execute("timeline.razor", json!({"time": tt.0, "clip": clip.0}))
+ };
+ if let Err(e) = r {
+ app.ui.status = e.to_string();
+ }
+ }
+ None
+ }
+ (Tool::TrackSelectForward | Tool::TrackSelectBackward, Hit::Clip { track, .. } | Hit::Empty { track }) => {
+ let fwd = tool == Tool::TrackSelectForward;
+ let ids: Vec<u64> = seq
+ .all_tracks()
+ .filter(|tr| !mods.shift || tr.id == track)
+ .flat_map(|tr| tr.items.iter())
+ .filter(|i| if fwd { i.end() > t } else { i.start < t })
+ .map(|i| i.id.0)
+ .collect();
+ let _ = app.session.execute("timeline.select", json!({"clips": ids}));
+ None
+ }
+ (Tool::Selection | Tool::Ripple | Tool::Rolling | Tool::RateStretch, Hit::Clip { clip, edge: Some(edge), track }) => {
+ let tr = seq.track(track).expect("track");
+ let mode = if tool == Tool::Ripple || (tool == Tool::Selection && mods.command) {
+ filmcraft_edit::TrimMode::Ripple
+ } else {
+ filmcraft_edit::TrimMode::Regular
+ };
+ if tool == Tool::Rolling || (tool == Tool::Selection && mods.command && mods.shift) {
+ // roll the cut between this and its neighbour
+ let it = tr.item(clip).expect("clip");
+ let (l, r) = match edge {
+ filmcraft_edit::Edge::Out => (Some(clip), tr.items.iter().find(|x| x.start == it.end()).map(|x| x.id)),
+ filmcraft_edit::Edge::In => (tr.items.iter().find(|x| x.end() == it.start).map(|x| x.id), Some(clip)),
+ };
+ match (l, r) {
+ (Some(left), Some(right)) => Some(Drag::Roll { left, right, delta: Tick::ZERO }),
+ _ => Some(Drag::Trim { clip, edge, mode, delta: Tick::ZERO }),
+ }
+ } else if tool == Tool::RateStretch {
+ Some(Drag::Stretch { clip, edge, delta: Tick::ZERO })
+ } else {
+ Some(Drag::Trim { clip, edge, mode, delta: Tick::ZERO })
+ }
+ }
+ (Tool::Slip, Hit::Clip { clip, .. }) => Some(Drag::Slip { clip, delta: Tick::ZERO }),
+ (Tool::Slide, Hit::Clip { clip, .. }) => Some(Drag::Slide { clip, delta: Tick::ZERO }),
+ (_, Hit::Clip { clip, track, .. }) => {
+ // select (shift toggles; alt selects one side of a link)
+ let sel = &app.session.state.selection;
+ if mods.shift {
+ let _ = app.session.execute("timeline.select", json!({"clips": [clip.0], "toggle": true}));
+ } else if !sel.contains(&clip) {
+ if mods.alt {
+ app.session.state.selection = vec![clip];
+ } else {
+ let _ = app.session.execute("timeline.select", json!({"clips": [clip.0]}));
+ }
+ }
+ if resp.drag_started() {
+ let clips = app.session.state.selection.clone();
+ Some(Drag::Move { clips, grab_tick: t, start_track: track, offset: Tick::ZERO, track_delta: 0 })
+ } else {
+ None
+ }
+ }
+ (_, Hit::Transition { .. }) => None,
+ (_, Hit::Empty { .. }) => {
+ if resp.drag_started() {
+ Some(Drag::Marquee { start: p })
+ } else {
+ app.session.state.selection.clear();
+ None
+ }
+ }
+ (_, Hit::None) => None,
+ };
+ if let Some(d) = started {
+ if matches!(d, Drag::Scrub) {
+ app.stop();
+ let tt = rate.snap_nearest(layout.tick_at(p.x).max(Tick::ZERO));
+ app.session.set_playhead(tt);
+ }
+ if resp.drag_started() {
+ app.tl.drag = Some(d);
+ }
+ }
+ }
+
+ // ---- drag
+ if resp.dragged()
+ && let Some(p) = resp.interact_pointer_pos()
+ && let Some(d) = app.tl.drag.clone()
+ {
+ let t_here = layout.tick_at(p.x);
+ let new = match d {
+ Drag::Scrub => {
+ let mut tt = rate.snap_nearest(t_here.max(Tick::ZERO));
+ if mods.shift {
+ tt = snap(app, seq, layout, tt, &[]);
+ }
+ app.session.set_playhead(tt);
+ Some(Drag::Scrub)
+ }
+ Drag::Pan { last } => {
+ let dx = p.x - last.x;
+ let v = &mut app.ui.timeline;
+ v.target_scroll = (v.target_scroll - dx as f64 / v.pps).max(0.0);
+ v.scroll = v.target_scroll;
+ app.ui.timeline.v_scroll += p.y - last.y;
+ Some(Drag::Pan { last: p })
+ }
+ Drag::Move { clips, grab_tick, start_track, .. } => {
+ let raw = rate.snap_nearest(t_here - grab_tick);
+ // snap the moved block's start or end
+ let first = clips.iter().filter_map(|c| seq.find_item(*c).map(|(_, i)| i.start)).min().unwrap_or_default();
+ let last = clips.iter().filter_map(|c| seq.find_item(*c).map(|(_, i)| i.end())).max().unwrap_or_default();
+ let s1 = snap(app, seq, layout, first + raw, &clips) - first;
+ let offset = if s1 != raw {
+ s1
+ } else {
+ let s2 = snap(app, seq, layout, last + raw, &clips) - last;
+ s2
+ };
+ let offset = offset.max(-first);
+ let cur_row = layout.row_at(p.y);
+ let start_row = layout.rows.iter().find(|r| r.track == start_track);
+ let track_delta = match (cur_row, start_row) {
+ (Some(c), Some(s)) if c.kind == s.kind => c.index as i32 - s.index as i32,
+ _ => 0,
+ };
+ Some(Drag::Move { clips, grab_tick, start_track, offset, track_delta })
+ }
+ Drag::Trim { clip, edge, mode, .. } => {
+ let (_, it) = seq.find_item(clip).expect("clip");
+ let base = if edge == filmcraft_edit::Edge::In { it.start } else { it.end() };
+ let target = snap(app, seq, layout, rate.snap_nearest(t_here), &[clip]);
+ let delta = target - base;
+ Some(Drag::Trim { clip, edge, mode, delta })
+ }
+ Drag::Stretch { clip, edge, .. } => {
+ let (_, it) = seq.find_item(clip).expect("clip");
+ let base = if edge == filmcraft_edit::Edge::In { it.start } else { it.end() };
+ let target = snap(app, seq, layout, rate.snap_nearest(t_here), &[clip]);
+ Some(Drag::Stretch { clip, edge, delta: target - base })
+ }
+ Drag::Roll { left, right, .. } => {
+ let (_, l) = seq.find_item(left).expect("clip");
+ let target = snap(app, seq, layout, rate.snap_nearest(t_here), &[left, right]);
+ Some(Drag::Roll { left, right, delta: target - l.end() })
+ }
+ Drag::Slip { clip, .. } => {
+ let start = resp.interact_pointer_pos().map(|_| ()).and(ctx.input(|i| i.pointer.press_origin()));
+ let origin = start.map(|o| layout.tick_at(o.x)).unwrap_or(t_here);
+ Some(Drag::Slip { clip, delta: -(rate.snap_nearest(t_here - origin)) })
+ }
+ Drag::Slide { clip, .. } => {
+ let origin = ctx.input(|i| i.pointer.press_origin()).map(|o| layout.tick_at(o.x)).unwrap_or(t_here);
+ Some(Drag::Slide { clip, delta: rate.snap_nearest(t_here - origin) })
+ }
+ Drag::Marquee { start } => {
+ let r = Rect::from_two_pos(start, p);
+ ui.painter().rect_filled(r, 0.0, Color32::from_white_alpha(18));
+ ui.painter().rect_stroke(r, 0.0, Stroke::new(1.0, Color32::from_white_alpha(140)), StrokeKind::Inside);
+ Some(Drag::Marquee { start })
+ }
+ other => Some(other),
+ };
+ app.tl.drag = new;
+ // auto-scroll when dragging near the edges
+ if !matches!(app.tl.drag, Some(Drag::Pan { .. }) | Some(Drag::ZoomBar { .. })) {
+ let v = &mut app.ui.timeline;
+ if p.x > layout.content.max.x - 20.0 {
+ v.target_scroll += 6.0 / v.pps;
+ v.scroll = v.target_scroll;
+ } else if p.x < layout.content.min.x + 10.0 && v.scroll > 0.0 {
+ v.target_scroll = (v.target_scroll - 6.0 / v.pps).max(0.0);
+ v.scroll = v.target_scroll;
+ }
+ }
+ }
+
+ // ---- release: commit exactly one command
+ if resp.drag_stopped()
+ && let Some(d) = app.tl.drag.take()
+ {
+ let r = match d {
+ Drag::Move { clips, offset, track_delta, .. } if offset != Tick::ZERO || track_delta != 0 => {
+ let moves: Vec<Value> = clips
+ .iter()
+ .filter_map(|c| seq.find_item(*c).map(|(tid, it)| json!({"clip": c.0, "track": shift_track(seq, tid, track_delta).unwrap_or(tid).0, "time": (it.start + offset).max(Tick::ZERO).0})))
+ .collect();
+ Some(app.session.execute("timeline.move", json!({"moves": moves, "insert": mods.command})))
+ }
+ Drag::Trim { clip, edge, mode, delta } if delta != Tick::ZERO => Some(app.session.execute(
+ "timeline.trim",
+ json!({"clip": clip.0, "edge": if edge == filmcraft_edit::Edge::In {"in"} else {"out"}, "mode": if mode == filmcraft_edit::TrimMode::Ripple {"ripple"} else {"regular"}, "delta": delta.0}),
+ )),
+ Drag::Stretch { clip, edge, delta } if delta != Tick::ZERO => Some(app.session.execute("timeline.rateStretch", json!({"clip": clip.0, "edge": if edge == filmcraft_edit::Edge::In {"in"} else {"out"}, "delta": delta.0}))),
+ Drag::Roll { left, right, delta } if delta != Tick::ZERO => Some(app.session.execute("timeline.roll", json!({"left": left.0, "right": right.0, "delta": delta.0}))),
+ Drag::Slip { clip, delta } if delta != Tick::ZERO => Some(app.session.execute("timeline.slip", json!({"clip": clip.0, "delta": delta.0}))),
+ Drag::Slide { clip, delta } if delta != Tick::ZERO => Some(app.session.execute("timeline.slide", json!({"clip": clip.0, "delta": delta.0}))),
+ Drag::Marquee { start } => {
+ if let Some(end) = resp.interact_pointer_pos() {
+ let r = Rect::from_two_pos(start, end);
+ let (a, b) = (layout.tick_at(r.min.x), layout.tick_at(r.max.x));
+ let ids: Vec<u64> = layout
+ .rows
+ .iter()
+ .filter(|row| row.rect.intersects(r))
+ .filter_map(|row| seq.track(row.track))
+ .flat_map(|tr| tr.items.iter().filter(|i| i.start < b && i.end() > a).map(|i| i.id.0))
+ .collect();
+ Some(app.session.execute("timeline.select", json!({"clips": ids, "add": mods.shift})))
+ } else {
+ None
+ }
+ }
+ _ => None,
+ };
+ if let Some(Err(e)) = r {
+ app.ui.status = e.to_string();
+ }
+ }
+
+ // ---- context menu on clips
+ resp.context_menu(|ui| {
+ ui.set_min_width(200.0);
+ let sel_n = app.session.state.selection.len();
+ let items: [(&str, &str); 10] = [
+ ("Cut", "edit.cut"),
+ ("Copy", "edit.copy"),
+ ("Clear", "edit.clear"),
+ ("Ripple Delete", "edit.rippleDelete"),
+ ("Enable", "clip.enable"),
+ ("Unlink", "clip.link"),
+ ("Group", "clip.group"),
+ ("Speed/Duration…", "clip.speedDuration"),
+ ("Nest…", "clip.nest"),
+ ("Scale to Frame Size", "clip.scaleToFrameSize"),
+ ];
+ for (label, cmd) in items {
+ if ui.add_enabled(sel_n > 0 && app.session.is_enabled(cmd), egui::Button::new(label)).clicked() {
+ if cmd == "clip.speedDuration" {
+ app.dialog = None;
+ let _ = app.session.execute(cmd, json!({"speed": 50.0}));
+ } else if let Err(e) = app.session.execute(cmd, json!({})) {
+ app.ui.status = e.to_string();
+ }
+ ui.close();
+ }
+ }
+ ui.separator();
+ ui.menu_button("Label", |ui| {
+ for l in filmcraft_project::Label::ALL {
+ if ui.button(l.name()).clicked() {
+ let _ = app.session.execute("edit.label", json!({"label": l.name()}));
+ ui.close();
+ }
+ }
+ });
+ });
+
+ // ---- drops: project items and effects
+ if let Some(item) = crate::panels::dragged_project_item(ui)
+ && let Some(p) = ctx.pointer_hover_pos()
+ && layout.content.contains(p)
+ {
+ let row = layout.row_at(p.y).cloned();
+ let t = snap(app, seq, layout, rate.snap_nearest(layout.tick_at(p.x).max(Tick::ZERO)), &[]);
+ let dur = app.session.project.item(item).map(|i| i.duration()).filter(|d| d.0 > 0).unwrap_or(app.session.project.settings.default_still_duration);
+ if let Some(row) = &row {
+ let r = Rect::from_min_max(pos2(layout.x_of(t), row.rect.min.y + 1.0), pos2(layout.x_of(t + dur), row.rect.max.y - 1.0));
+ ui.painter().rect_filled(r, 3.0, Color32::from_white_alpha(40));
+ ui.painter().rect_stroke(r, 3.0, Stroke::new(1.5, Color32::WHITE), StrokeKind::Inside);
+ if mods.command {
+ ui.painter().text(r.left_top() + vec2(4.0, -2.0), Align2::LEFT_BOTTOM, "Insert", Tokens::ui(10.0), Color32::WHITE);
+ }
+ }
+ if ctx.input(|i| i.pointer.any_released())
+ && let Some(row) = row
+ {
+ let (vt, at) = match row.kind {
+ TrackKind::Video => (Some(row.track.0), seq.audio_tracks.get(row.index).or(seq.audio_tracks.first()).map(|t| t.id.0)),
+ TrackKind::Audio => (seq.video_tracks.get(row.index).or(seq.video_tracks.first()).map(|t| t.id.0), Some(row.track.0)),
+ };
+ let r = app.session.execute("timeline.place", json!({"item": item.0, "track": vt, "audioTrack": at, "time": t.0, "insert": mods.command}));
+ if let Err(e) = r {
+ app.ui.status = e.to_string();
+ }
+ crate::panels::clear_drag(ui);
+ }
+ }
+ if let Some(effect) = crate::panels::dragged_effect(ui)
+ && let Some(p) = ctx.pointer_hover_pos()
+ && layout.content.contains(p)
+ {
+ if let Hit::Clip { clip, .. } = hit(seq, layout, p)
+ && let Some((tid, it)) = seq.find_item(clip)
+ && let Some(row) = layout.rows.iter().find(|r| r.track == tid)
+ {
+ let r = Rect::from_min_max(pos2(layout.x_of(it.start), row.rect.min.y), pos2(layout.x_of(it.end()), row.rect.max.y));
+ ui.painter().rect_stroke(r, 3.0, Stroke::new(2.0, app.tokens.accent), StrokeKind::Inside);
+ if ctx.input(|i| i.pointer.any_released()) {
+ let is_transition = filmcraft_project::find_effect(&effect)
+ .is_some_and(|d| matches!(d.kind, filmcraft_project::EffectKind::VideoTransition | filmcraft_project::EffectKind::AudioTransition));
+ let r = if is_transition {
+ let edge = if p.x - layout.x_of(it.start) < layout.x_of(it.end()) - p.x { "in" } else { "out" };
+ app.session.execute("effects.apply", json!({"effect": effect, "clip": clip.0, "edge": edge}))
+ } else {
+ app.session.execute("effects.apply", json!({"effect": effect, "clips": [clip.0]}))
+ };
+ if let Err(e) = r {
+ app.ui.status = e.to_string();
+ } else {
+ let _ = app.session.execute("timeline.select", json!({"clips": [clip.0]}));
+ }
+ crate::panels::clear_drag(ui);
+ }
+ }
+ }
+ app.auto.add("timeline.tracks", layout.content, "tracks");
+}
diff --git a/crates/ui-egui/src/panels/tools.rs b/crates/ui-egui/src/panels/tools.rs
new file mode 100644
index 000000000..57e3fff9c
--- /dev/null
+++ b/crates/ui-egui/src/panels/tools.rs
@@ -0,0 +1,53 @@
+//! The vertical Tools panel. Grouped tools show a small flyout triangle; right-click (or long
+//! press) opens the group to pick another tool.
+
+use egui::{Rect, Sense, pos2, vec2};
+
+use crate::FilmcraftApp;
+use crate::icons;
+use crate::state::Tool;
+
+pub fn show(app: &mut FilmcraftApp, ui: &mut egui::Ui, rect: Rect) {
+ let t = app.tokens;
+ let mut y = rect.min.y + 4.0;
+ let size = (rect.width() - 6.0).clamp(24.0, 34.0);
+ for group in Tool::groups() {
+ let current = if group.contains(&app.ui.tool) { app.ui.tool } else { group[0] };
+ let r = Rect::from_min_size(pos2(rect.center().x - size / 2.0, y), vec2(size, size));
+ let resp = ui.interact(r, egui::Id::new(("tool", format!("{:?}", group[0]))), Sense::click()).on_hover_text(format!(
+ "{} ({})",
+ current.label(),
+ current.shortcut()
+ ));
+ for tl in &group {
+ app.auto.add(&format!("tools.{tl:?}"), r, tl.label());
+ }
+ let active = group.contains(&app.ui.tool);
+ if active {
+ ui.painter().rect_filled(r, 4.0, t.pressed);
+ } else if resp.hovered() {
+ ui.painter().rect_filled(r, 4.0, t.hover);
+ }
+ icons::paint(ui.painter(), r.shrink(size * 0.22), current.icon(), if active { t.icon_active } else { t.icon });
+ if group.len() > 1 {
+ let c = r.right_bottom() - vec2(3.0, 3.0);
+ ui.painter().add(egui::Shape::convex_polygon(vec![c, c - vec2(5.0, 0.0), c - vec2(0.0, 5.0)], t.text_dim, egui::Stroke::NONE));
+ }
+ if resp.clicked() {
+ app.ui.tool = current;
+ }
+ if group.len() > 1 {
+ egui::Popup::context_menu(&resp).show(|ui| {
+ for tl in &group {
+ if ui.selectable_label(app.ui.tool == *tl, format!("{} {}", tl.label(), tl.shortcut())).clicked() {
+ app.ui.tool = *tl;
+ }
+ }
+ });
+ }
+ y += size + 4.0;
+ if y > rect.max.y - size {
+ break;
+ }
+ }
+}
diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs
new file mode 100644
index 000000000..68ac0d62e
--- /dev/null
+++ b/crates/ui-egui/src/state.rs
@@ -0,0 +1,287 @@
+//! UI state that is not project data: tools, layout, zoom/scroll, monitor settings. Serde so the
+//! control channel can read and set all of it.
+
+use serde::{Deserialize, Serialize};
+
+use crate::dock::{DockNode, PanelKind};
+use crate::icons::Icon;
+
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
+pub enum Tool {
+ #[default]
+ Selection,
+ TrackSelectForward,
+ TrackSelectBackward,
+ Ripple,
+ Rolling,
+ RateStretch,
+ Razor,
+ Slip,
+ Slide,
+ Pen,
+ Rectangle,
+ Ellipse,
+ Hand,
+ Zoom,
+ Type,
+}
+
+impl Tool {
+ pub const ALL: [Tool; 15] = [
+ Tool::Selection,
+ Tool::TrackSelectForward,
+ Tool::TrackSelectBackward,
+ Tool::Ripple,
+ Tool::Rolling,
+ Tool::RateStretch,
+ Tool::Razor,
+ Tool::Slip,
+ Tool::Slide,
+ Tool::Pen,
+ Tool::Rectangle,
+ Tool::Ellipse,
+ Tool::Hand,
+ Tool::Zoom,
+ Tool::Type,
+ ];
+ pub fn label(self) -> &'static str {
+ match self {
+ Tool::Selection => "Selection Tool",
+ Tool::TrackSelectForward => "Track Select Forward Tool",
+ Tool::TrackSelectBackward => "Track Select Backward Tool",
+ Tool::Ripple => "Ripple Edit Tool",
+ Tool::Rolling => "Rolling Edit Tool",
+ Tool::RateStretch => "Rate Stretch Tool",
+ Tool::Razor => "Razor Tool",
+ Tool::Slip => "Slip Tool",
+ Tool::Slide => "Slide Tool",
+ Tool::Pen => "Pen Tool",
+ Tool::Rectangle => "Rectangle Tool",
+ Tool::Ellipse => "Ellipse Tool",
+ Tool::Hand => "Hand Tool",
+ Tool::Zoom => "Zoom Tool",
+ Tool::Type => "Type Tool",
+ }
+ }
+ pub fn shortcut(self) -> &'static str {
+ match self {
+ Tool::Selection => "V",
+ Tool::TrackSelectForward => "A",
+ Tool::TrackSelectBackward => "Shift+A",
+ Tool::Ripple => "B",
+ Tool::Rolling => "N",
+ Tool::RateStretch => "R",
+ Tool::Razor => "C",
+ Tool::Slip => "Y",
+ Tool::Slide => "U",
+ Tool::Pen => "P",
+ Tool::Rectangle | Tool::Ellipse => "",
+ Tool::Hand => "H",
+ Tool::Zoom => "Z",
+ Tool::Type => "T",
+ }
+ }
+ pub fn icon(self) -> Icon {
+ match self {
+ Tool::Selection => Icon::Selection,
+ Tool::TrackSelectForward => Icon::TrackSelectFwd,
+ Tool::TrackSelectBackward => Icon::TrackSelectBack,
+ Tool::Ripple => Icon::Ripple,
+ Tool::Rolling => Icon::Rolling,
+ Tool::RateStretch => Icon::RateStretch,
+ Tool::Razor => Icon::Razor,
+ Tool::Slip => Icon::Slip,
+ Tool::Slide => Icon::Slide,
+ Tool::Pen => Icon::Pen,
+ Tool::Rectangle => Icon::Rectangle,
+ Tool::Ellipse => Icon::Ellipse,
+ Tool::Hand => Icon::Hand,
+ Tool::Zoom => Icon::Zoom,
+ Tool::Type => Icon::Type,
+ }
+ }
+ pub fn from_name(s: &str) -> Option<Tool> {
+ let n = s.to_ascii_lowercase().replace([' ', '_', '-'], "").replace("tool", "");
+ Tool::ALL
+ .iter()
+ .copied()
+ .find(|t| format!("{t:?}").to_ascii_lowercase() == n || t.label().to_ascii_lowercase().replace([' ', '-'], "").replace("tool", "") == n)
+ }
+ /// Tools-panel groups (Premiere groups related tools under one button with a flyout).
+ pub fn groups() -> Vec<Vec<Tool>> {
+ vec![
+ vec![Tool::Selection],
+ vec![Tool::TrackSelectForward, Tool::TrackSelectBackward],
+ vec![Tool::Ripple, Tool::Rolling, Tool::RateStretch],
+ vec![Tool::Razor],
+ vec![Tool::Slip, Tool::Slide],
+ vec![Tool::Pen, Tool::Rectangle, Tool::Ellipse],
+ vec![Tool::Hand, Tool::Zoom],
+ vec![Tool::Type],
+ ]
+ }
+}
+
+/// Playback resolution (Premiere's Full / 1/2 / 1/4 / 1/8 / 1/16).
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
+pub enum PlaybackRes {
+ Full,
+ #[default]
+ Half,
+ Quarter,
+ Eighth,
+ Sixteenth,
+}
+
+impl PlaybackRes {
+ pub const ALL: [PlaybackRes; 5] = [PlaybackRes::Full, PlaybackRes::Half, PlaybackRes::Quarter, PlaybackRes::Eighth, PlaybackRes::Sixteenth];
+ pub fn scale(self) -> f32 {
+ match self {
+ PlaybackRes::Full => 1.0,
+ PlaybackRes::Half => 0.5,
+ PlaybackRes::Quarter => 0.25,
+ PlaybackRes::Eighth => 0.125,
+ PlaybackRes::Sixteenth => 0.0625,
+ }
+ }
+ pub fn label(self) -> &'static str {
+ match self {
+ PlaybackRes::Full => "Full",
+ PlaybackRes::Half => "1/2",
+ PlaybackRes::Quarter => "1/4",
+ PlaybackRes::Eighth => "1/8",
+ PlaybackRes::Sixteenth => "1/16",
+ }
+ }
+}
+
+/// Header mode (Import / Edit / Export).
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
+pub enum Mode {
+ Import,
+ #[default]
+ Edit,
+ Export,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct TimelineView {
+ /// Pixels per second (animated toward `target_pps`).
+ pub pps: f64,
+ pub target_pps: f64,
+ /// Left edge time in seconds (animated toward `target_scroll`).
+ pub scroll: f64,
+ pub target_scroll: f64,
+ /// Vertical scroll of the video / audio halves.
+ pub v_scroll: f32,
+ pub a_scroll: f32,
+ /// Fraction of the track area given to video tracks.
+ pub split: f32,
+ pub video_track_h: f32,
+ pub audio_track_h: f32,
+ pub header_w: f32,
+ pub show_thumbnails: bool,
+ pub show_waveforms: bool,
+ /// Follow playhead during playback (page scroll).
+ pub follow: bool,
+ pub fit_pending: bool,
+}
+
+impl Default for TimelineView {
+ fn default() -> Self {
+ Self {
+ pps: 40.0,
+ target_pps: 40.0,
+ scroll: 0.0,
+ target_scroll: 0.0,
+ v_scroll: 0.0,
+ a_scroll: 0.0,
+ split: 0.5,
+ video_track_h: 46.0,
+ audio_track_h: 44.0,
+ header_w: 196.0,
+ show_thumbnails: true,
+ show_waveforms: true,
+ follow: true,
+ fit_pending: true,
+ }
+ }
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct MonitorView {
+ pub res: PlaybackRes,
+ /// Zoom: None = Fit.
+ pub zoom: Option<f32>,
+ pub safe_margins: bool,
+ pub show_transport: bool,
+}
+
+impl Default for MonitorView {
+ fn default() -> Self {
+ Self { res: PlaybackRes::Half, zoom: None, safe_margins: false, show_transport: true }
+ }
+}
+
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
+pub enum ProjectView {
+ #[default]
+ List,
+ Icon,
+ Freeform,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct UiState {
+ pub tool: Tool,
+ pub mode: Mode,
+ pub workspace: String,
+ pub dock: DockNode,
+ /// Focused panel (blue outline, receives shortcuts).
+ pub focused: PanelKind,
+ pub timeline: TimelineView,
+ pub program: MonitorView,
+ pub source: MonitorView,
+ pub project_view: ProjectView,
+ pub project_search: String,
+ pub effects_search: String,
+ pub icon_size: f32,
+ /// Expanded bins in the project list view.
+ pub expanded_bins: Vec<u64>,
+ /// Expanded folders in the Effects panel.
+ pub expanded_fx: Vec<String>,
+ /// Collapsed effect sections in Effect Controls ("clip:index").
+ pub collapsed_fx: Vec<String>,
+ pub show_menu_bar: bool,
+ pub dark: bool,
+ /// Lumetri scopes visible in the Program monitor area.
+ pub show_scopes: bool,
+ /// Transient status line shown in the footer.
+ pub status: String,
+}
+
+impl Default for UiState {
+ fn default() -> Self {
+ Self {
+ tool: Tool::Selection,
+ mode: Mode::Edit,
+ workspace: "Editing".into(),
+ dock: crate::dock::workspace("Editing"),
+ focused: PanelKind::Timeline,
+ timeline: TimelineView::default(),
+ program: MonitorView::default(),
+ source: MonitorView::default(),
+ project_view: ProjectView::List,
+ project_search: String::new(),
+ effects_search: String::new(),
+ icon_size: 110.0,
+ expanded_bins: vec![],
+ expanded_fx: vec!["Video Transitions".into(), "Video Transitions/Dissolve".into()],
+ collapsed_fx: vec![],
+ show_menu_bar: true,
+ dark: true,
+ show_scopes: false,
+ status: String::new(),
+ }
+ }
+}
diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs
new file mode 100644
index 000000000..fd1aa0a09
--- /dev/null
+++ b/crates/ui-egui/src/theme.rs
@@ -0,0 +1,254 @@
+//! Design tokens. Every widget reads colours/sizes from [`Tokens`] so themes apply everywhere.
+//!
+//! The default theme follows the look of Premiere Pro's current dark UI (values measured from
+//! black-box screenshots, see `plan/premiere/02-ui-ux.md`); fonts are Inter + JetBrains Mono (OFL).
+
+use std::sync::Arc;
+
+use egui::{Color32, FontData, FontDefinitions, FontFamily, FontId, Stroke, TextStyle, Visuals};
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
+pub enum ThemeKind {
+ /// Premiere-style darkest (default).
+ #[default]
+ Dark,
+ /// Slightly lighter grey panels (Premiere's brightness slider mid position).
+ Medium,
+ Light,
+}
+
+impl ThemeKind {
+ pub fn from_name(s: &str) -> Option<ThemeKind> {
+ match s.to_ascii_lowercase().as_str() {
+ "dark" | "darkest" => Some(ThemeKind::Dark),
+ "medium" | "grey" | "gray" => Some(ThemeKind::Medium),
+ "light" => Some(ThemeKind::Light),
+ _ => None,
+ }
+ }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct Tokens {
+ pub kind: ThemeKind,
+ /// Space between panels / app background.
+ pub app_bg: Color32,
+ /// Header bar (top).
+ pub header_bg: Color32,
+ /// Panel body.
+ pub panel_bg: Color32,
+ /// Panel tab strip.
+ pub tab_bg: Color32,
+ pub tab_text: Color32,
+ pub tab_text_active: Color32,
+ /// Blue focus rectangle around the active panel.
+ pub focus: Color32,
+ pub accent: Color32,
+ pub accent_hover: Color32,
+ pub text: Color32,
+ pub text_dim: Color32,
+ pub text_faint: Color32,
+ pub icon: Color32,
+ pub icon_active: Color32,
+ pub hover: Color32,
+ pub pressed: Color32,
+ pub field_bg: Color32,
+ pub field_border: Color32,
+ pub separator: Color32,
+ pub row_alt: Color32,
+ pub row_selected: Color32,
+ /// Scrubby (hot-text) numeric value colour.
+ pub hot_text: Color32,
+ // timeline
+ pub tl_bg: Color32,
+ pub tl_track_bg: Color32,
+ pub tl_track_bg_alt: Color32,
+ pub tl_header_bg: Color32,
+ pub tl_ruler_bg: Color32,
+ pub tl_ruler_tick: Color32,
+ pub tl_ruler_text: Color32,
+ pub playhead: Color32,
+ pub in_out_shade: Color32,
+ pub clip_selected_border: Color32,
+ pub render_red: Color32,
+ pub render_yellow: Color32,
+ pub render_green: Color32,
+ pub monitor_bg: Color32,
+ pub timecode: Color32,
+ pub danger: Color32,
+ pub radius: f32,
+ pub radius_sm: f32,
+ pub gap: f32,
+ pub tab_h: f32,
+}
+
+impl Tokens {
+ pub fn for_kind(kind: ThemeKind) -> Self {
+ let dark = Tokens {
+ kind,
+ app_bg: Color32::from_rgb(10, 10, 10),
+ header_bg: Color32::from_rgb(19, 19, 19),
+ panel_bg: Color32::from_rgb(29, 29, 29),
+ tab_bg: Color32::from_rgb(29, 29, 29),
+ tab_text: Color32::from_rgb(160, 160, 160),
+ tab_text_active: Color32::from_rgb(236, 236, 236),
+ focus: Color32::from_rgb(57, 138, 243),
+ accent: Color32::from_rgb(57, 138, 243),
+ accent_hover: Color32::from_rgb(88, 160, 250),
+ text: Color32::from_rgb(214, 214, 214),
+ text_dim: Color32::from_rgb(160, 160, 160),
+ text_faint: Color32::from_rgb(110, 110, 110),
+ icon: Color32::from_rgb(190, 190, 190),
+ icon_active: Color32::from_rgb(57, 138, 243),
+ hover: Color32::from_rgb(52, 52, 52),
+ pressed: Color32::from_rgb(64, 64, 64),
+ field_bg: Color32::from_rgb(20, 20, 20),
+ field_border: Color32::from_rgb(58, 58, 58),
+ separator: Color32::from_rgb(44, 44, 44),
+ row_alt: Color32::from_rgb(33, 33, 33),
+ row_selected: Color32::from_rgb(52, 76, 110),
+ hot_text: Color32::from_rgb(76, 158, 255),
+ tl_bg: Color32::from_rgb(24, 24, 24),
+ tl_track_bg: Color32::from_rgb(29, 29, 29),
+ tl_track_bg_alt: Color32::from_rgb(33, 33, 33),
+ tl_header_bg: Color32::from_rgb(36, 36, 36),
+ tl_ruler_bg: Color32::from_rgb(29, 29, 29),
+ tl_ruler_tick: Color32::from_rgb(92, 92, 92),
+ tl_ruler_text: Color32::from_rgb(150, 150, 150),
+ playhead: Color32::from_rgb(57, 138, 243),
+ in_out_shade: Color32::from_rgba_unmultiplied(120, 120, 120, 40),
+ clip_selected_border: Color32::from_rgb(240, 240, 240),
+ render_red: Color32::from_rgb(210, 50, 45),
+ render_yellow: Color32::from_rgb(222, 196, 40),
+ render_green: Color32::from_rgb(64, 180, 70),
+ monitor_bg: Color32::from_rgb(0, 0, 0),
+ timecode: Color32::from_rgb(76, 158, 255),
+ danger: Color32::from_rgb(230, 80, 80),
+ radius: 4.0,
+ radius_sm: 3.0,
+ gap: 3.0,
+ tab_h: 28.0,
+ };
+ match kind {
+ ThemeKind::Dark => dark,
+ ThemeKind::Medium => Tokens {
+ app_bg: Color32::from_rgb(22, 22, 22),
+ header_bg: Color32::from_rgb(34, 34, 34),
+ panel_bg: Color32::from_rgb(46, 46, 46),
+ tab_bg: Color32::from_rgb(46, 46, 46),
+ field_bg: Color32::from_rgb(34, 34, 34),
+ tl_bg: Color32::from_rgb(40, 40, 40),
+ tl_track_bg: Color32::from_rgb(46, 46, 46),
+ tl_track_bg_alt: Color32::from_rgb(50, 50, 50),
+ tl_header_bg: Color32::from_rgb(54, 54, 54),
+ tl_ruler_bg: Color32::from_rgb(46, 46, 46),
+ row_alt: Color32::from_rgb(50, 50, 50),
+ hover: Color32::from_rgb(64, 64, 64),
+ ..dark
+ },
+ ThemeKind::Light => Tokens {
+ app_bg: Color32::from_rgb(180, 180, 180),
+ header_bg: Color32::from_rgb(214, 214, 214),
+ panel_bg: Color32::from_rgb(232, 232, 232),
+ tab_bg: Color32::from_rgb(232, 232, 232),
+ tab_text: Color32::from_rgb(90, 90, 90),
+ tab_text_active: Color32::from_rgb(20, 20, 20),
+ text: Color32::from_rgb(34, 34, 34),
+ text_dim: Color32::from_rgb(90, 90, 90),
+ text_faint: Color32::from_rgb(140, 140, 140),
+ icon: Color32::from_rgb(60, 60, 60),
+ hover: Color32::from_rgb(210, 210, 210),
+ pressed: Color32::from_rgb(196, 196, 196),
+ field_bg: Color32::from_rgb(250, 250, 250),
+ field_border: Color32::from_rgb(170, 170, 170),
+ separator: Color32::from_rgb(200, 200, 200),
+ row_alt: Color32::from_rgb(224, 224, 224),
+ row_selected: Color32::from_rgb(170, 200, 240),
+ tl_bg: Color32::from_rgb(210, 210, 210),
+ tl_track_bg: Color32::from_rgb(222, 222, 222),
+ tl_track_bg_alt: Color32::from_rgb(228, 228, 228),
+ tl_header_bg: Color32::from_rgb(214, 214, 214),
+ tl_ruler_bg: Color32::from_rgb(226, 226, 226),
+ tl_ruler_text: Color32::from_rgb(80, 80, 80),
+ ..dark
+ },
+ }
+ }
+
+ /// Mono font for timecode.
+ pub fn mono(size: f32) -> FontId {
+ FontId::new(size, FontFamily::Monospace)
+ }
+ pub fn ui(size: f32) -> FontId {
+ FontId::new(size, FontFamily::Proportional)
+ }
+ pub fn semibold(size: f32) -> FontId {
+ FontId::new(size, FontFamily::Name("semibold".into()))
+ }
+}
+
+/// Install fonts (Inter, Inter SemiBold, JetBrains Mono) and egui visuals.
+pub fn install(ctx: &egui::Context, t: &Tokens) {
+ let mut fonts = FontDefinitions::default();
+ fonts.font_data.insert("inter".into(), Arc::new(FontData::from_static(include_bytes!("../../../assets/fonts/Inter-Regular.ttf"))));
+ fonts.font_data.insert("inter-medium".into(), Arc::new(FontData::from_static(include_bytes!("../../../assets/fonts/Inter-Medium.ttf"))));
+ fonts.font_data.insert("inter-semibold".into(), Arc::new(FontData::from_static(include_bytes!("../../../assets/fonts/Inter-SemiBold.ttf"))));
+ fonts.font_data.insert("jbmono".into(), Arc::new(FontData::from_static(include_bytes!("../../../assets/fonts/JetBrainsMono-Regular.ttf"))));
+ fonts.families.entry(FontFamily::Proportional).or_default().insert(0, "inter".into());
+ fonts.families.entry(FontFamily::Monospace).or_default().insert(0, "jbmono".into());
+ fonts.families.insert(FontFamily::Name("semibold".into()), vec!["inter-semibold".into(), "inter".into()]);
+ fonts.families.insert(FontFamily::Name("medium".into()), vec!["inter-medium".into(), "inter".into()]);
+ ctx.set_fonts(fonts);
+ apply_visuals(ctx, t);
+}
+
+pub fn apply_visuals(ctx: &egui::Context, t: &Tokens) {
+ let mut v = if t.kind == ThemeKind::Light { Visuals::light() } else { Visuals::dark() };
+ v.panel_fill = t.panel_bg;
+ v.window_fill = t.panel_bg;
+ v.extreme_bg_color = t.field_bg;
+ v.faint_bg_color = t.row_alt;
+ v.override_text_color = Some(t.text);
+ v.selection.bg_fill = t.accent;
+ v.selection.stroke = Stroke::new(1.0, Color32::WHITE);
+ v.hyperlink_color = t.accent;
+ v.window_stroke = Stroke::new(1.0, t.field_border);
+ v.window_corner_radius = egui::CornerRadius::same(6);
+ v.menu_corner_radius = egui::CornerRadius::same(5);
+ v.popup_shadow = egui::epaint::Shadow { offset: [0, 4], blur: 16, spread: 0, color: Color32::from_black_alpha(140) };
+ v.window_shadow = v.popup_shadow;
+ for w in [&mut v.widgets.noninteractive, &mut v.widgets.inactive, &mut v.widgets.hovered, &mut v.widgets.active, &mut v.widgets.open] {
+ w.corner_radius = egui::CornerRadius::same(t.radius_sm as u8);
+ }
+ v.widgets.noninteractive.bg_fill = t.panel_bg;
+ v.widgets.noninteractive.weak_bg_fill = t.panel_bg;
+ v.widgets.noninteractive.bg_stroke = Stroke::new(1.0, t.separator);
+ v.widgets.noninteractive.fg_stroke = Stroke::new(1.0, t.text);
+ v.widgets.inactive.bg_fill = t.field_bg;
+ v.widgets.inactive.weak_bg_fill = t.field_bg;
+ v.widgets.inactive.bg_stroke = Stroke::new(1.0, t.field_border);
+ v.widgets.inactive.fg_stroke = Stroke::new(1.0, t.text);
+ v.widgets.hovered.bg_fill = t.hover;
+ v.widgets.hovered.weak_bg_fill = t.hover;
+ v.widgets.hovered.bg_stroke = Stroke::new(1.0, t.field_border);
+ v.widgets.hovered.fg_stroke = Stroke::new(1.0, t.tab_text_active);
+ v.widgets.active.bg_fill = t.pressed;
+ v.widgets.active.weak_bg_fill = t.pressed;
+ v.widgets.active.fg_stroke = Stroke::new(1.0, t.tab_text_active);
+ v.widgets.open.bg_fill = t.hover;
+ v.widgets.open.weak_bg_fill = t.hover;
+ ctx.set_visuals(v);
+ ctx.global_style_mut(|s| {
+ s.spacing.item_spacing = egui::vec2(6.0, 4.0);
+ s.spacing.button_padding = egui::vec2(8.0, 3.0);
+ s.spacing.interact_size.y = 20.0;
+ s.spacing.menu_margin = egui::Margin::same(4);
+ s.text_styles.insert(TextStyle::Body, FontId::new(12.5, FontFamily::Proportional));
+ s.text_styles.insert(TextStyle::Button, FontId::new(12.5, FontFamily::Proportional));
+ s.text_styles.insert(TextStyle::Small, FontId::new(11.0, FontFamily::Proportional));
+ s.text_styles.insert(TextStyle::Heading, FontId::new(15.0, FontFamily::Name("semibold".into())));
+ s.text_styles.insert(TextStyle::Monospace, FontId::new(12.0, FontFamily::Monospace));
+ s.animation_time = 0.12;
+ });
+}
diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs
new file mode 100644
index 000000000..c161b8e16
--- /dev/null
+++ b/crates/ui-egui/src/widgets.rs
@@ -0,0 +1,175 @@
+//! Small custom widgets in Premiere's visual language.
+
+use egui::{Align2, Color32, Rect, Response, Sense, Stroke, StrokeKind, Ui, pos2, vec2};
+
+use crate::icons::{self, Icon};
+use crate::theme::Tokens;
+
+/// Premiere "hot text": a blue number you drag horizontally to scrub, click to type.
+/// Returns (response, Some(new value) when changed).
+pub fn hot_number(ui: &mut Ui, id: egui::Id, value: f64, speed: f64, range: (f64, f64), decimals: usize, suffix: &str, t: &Tokens) -> (Response, Option<f64>) {
+ let editing_id = id.with("editing");
+ let mut editing: Option<String> = ui.data(|d| d.get_temp(editing_id));
+ if let Some(buf) = editing.as_mut() {
+ let r = ui.add(egui::TextEdit::singleline(buf).desired_width(56.0).font(Tokens::ui(12.0)));
+ let mut out = None;
+ if r.lost_focus() {
+ if let Ok(v) = buf.trim().trim_end_matches(suffix).trim().parse::<f64>() {
+ out = Some(v.clamp(range.0, range.1));
+ }
+ ui.data_mut(|d| d.remove::<String>(editing_id));
+ } else {
+ let b = buf.clone();
+ ui.data_mut(|d| d.insert_temp(editing_id, b));
+ r.request_focus();
+ }
+ return (r, out);
+ }
+ let text = format!("{value:.decimals$}{suffix}");
+ let galley = ui.painter().layout_no_wrap(text, Tokens::ui(12.0), t.hot_text);
+ let (rect, resp) = ui.allocate_exact_size(galley.size() + vec2(4.0, 4.0), Sense::click_and_drag());
+ let col = if resp.hovered() || resp.dragged() { t.accent_hover } else { t.hot_text };
+ ui.painter().galley_with_override_text_color(rect.min + vec2(2.0, 2.0), galley, col);
+ if resp.hovered() || resp.dragged() {
+ ui.ctx().set_cursor_icon(egui::CursorIcon::ResizeHorizontal);
+ let y = rect.max.y - 1.0;
+ ui.painter().line_segment([pos2(rect.min.x + 2.0, y), pos2(rect.max.x - 2.0, y)], Stroke::new(1.0, col.gamma_multiply(0.6)));
+ }
+ let mut out = None;
+ if resp.dragged() {
+ let dx = resp.drag_delta().x as f64;
+ let mult = ui.input(|i| {
+ if i.modifiers.shift {
+ 10.0
+ } else if i.modifiers.command {
+ 0.1
+ } else {
+ 1.0
+ }
+ });
+ let nv = (value + dx * speed * mult).clamp(range.0, range.1);
+ if (nv - value).abs() > f64::EPSILON {
+ out = Some(nv);
+ }
+ }
+ if resp.clicked() {
+ ui.data_mut(|d| d.insert_temp(editing_id, format!("{value:.decimals$}")));
+ }
+ (resp, out)
+}
+
+/// A large blue timecode readout (monitors/timeline). Click to type a new time.
+pub fn timecode_label(ui: &mut Ui, rect: Rect, text: &str, size: f32, color: Color32, align: Align2) -> Response {
+ let resp = ui.interact(rect, ui.id().with(("tc", rect.min.x as i32, rect.min.y as i32)), Sense::click_and_drag());
+ ui.painter().text(align.pos_in_rect(&rect), align, text, Tokens::mono(size), color);
+ resp
+}
+
+/// A twirl-down section header (Effect Controls / Lumetri style). Returns open state.
+pub fn section_header(ui: &mut Ui, id: egui::Id, title: &str, open: bool, t: &Tokens, bold: bool) -> (Response, bool) {
+ let w = ui.available_width();
+ let (rect, resp) = ui.allocate_exact_size(vec2(w, 22.0), Sense::click());
+ if resp.hovered() {
+ ui.painter().rect_filled(rect, 0.0, t.hover);
+ }
+ let chev = Rect::from_center_size(pos2(rect.min.x + 10.0, rect.center().y), vec2(12.0, 12.0));
+ icons::paint(ui.painter(), chev, if open { Icon::ChevronDown } else { Icon::ChevronRight }, t.text_dim);
+ ui.painter().text(
+ pos2(rect.min.x + 20.0, rect.center().y),
+ Align2::LEFT_CENTER,
+ title,
+ if bold { Tokens::semibold(12.0) } else { Tokens::ui(12.0) },
+ t.text,
+ );
+ let _ = id;
+ let open = if resp.clicked() { !open } else { open };
+ (resp, open)
+}
+
+/// A small pill toggle button with text (e.g. "M", "S" on track headers).
+pub fn letter_toggle(ui: &mut Ui, rect: Rect, letter: &str, on: bool, on_color: Color32, t: &Tokens, id: egui::Id) -> Response {
+ let resp = ui.interact(rect, id, Sense::click());
+ let bg = if on {
+ on_color
+ } else if resp.hovered() {
+ t.hover
+ } else {
+ Color32::TRANSPARENT
+ };
+ ui.painter().rect_filled(rect, 2.0, bg);
+ if !on {
+ ui.painter().rect_stroke(rect, 2.0, Stroke::new(1.0, t.separator), StrokeKind::Inside);
+ }
+ ui.painter().text(rect.center(), Align2::CENTER_CENTER, letter, Tokens::semibold(10.5), if on { Color32::BLACK } else { t.text_dim });
+ resp
+}
+
+/// A flat icon toggle inside a rect.
+pub fn icon_toggle(ui: &mut Ui, rect: Rect, icon: Icon, on: bool, t: &Tokens, id: egui::Id, on_color: Option<Color32>) -> Response {
+ let resp = ui.interact(rect, id, Sense::click());
+ if resp.hovered() {
+ ui.painter().rect_filled(rect, 2.0, t.hover);
+ }
+ let col = if on { on_color.unwrap_or(t.icon) } else { t.text_faint };
+ icons::paint(ui.painter(), rect.shrink(rect.width() * 0.16), icon, col);
+ resp
+}
+
+/// Search field with a magnifier icon.
+pub fn search_field(ui: &mut Ui, text: &mut String, hint: &str, width: f32, t: &Tokens) -> Response {
+ let h = 22.0;
+ let (rect, _) = ui.allocate_exact_size(vec2(width, h), Sense::hover());
+ ui.painter().rect_filled(rect, h / 2.0, t.field_bg);
+ ui.painter().rect_stroke(rect, h / 2.0, Stroke::new(1.0, t.field_border), StrokeKind::Inside);
+ icons::paint(ui.painter(), Rect::from_center_size(pos2(rect.min.x + 12.0, rect.center().y), vec2(12.0, 12.0)), Icon::Search, t.text_dim);
+ let inner = Rect::from_min_max(pos2(rect.min.x + 22.0, rect.min.y + 2.0), pos2(rect.max.x - 8.0, rect.max.y - 2.0));
+ let mut child = ui.new_child(egui::UiBuilder::new().max_rect(inner));
+ child.add(egui::TextEdit::singleline(text).hint_text(hint).frame(egui::Frame::NONE).desired_width(inner.width()).font(Tokens::ui(12.0)))
+}
+
+/// Premiere-style dropdown text ("Fit ▾").
+pub fn dropdown_text(ui: &mut Ui, rect: Rect, text: &str, t: &Tokens, id: egui::Id) -> Response {
+ let resp = ui.interact(rect, id, Sense::click());
+ if resp.hovered() {
+ ui.painter().rect_filled(rect, 3.0, t.hover);
+ }
+ ui.painter().text(pos2(rect.min.x + 6.0, rect.center().y), Align2::LEFT_CENTER, text, Tokens::ui(11.5), t.text);
+ icons::paint(ui.painter(), Rect::from_center_size(pos2(rect.max.x - 8.0, rect.center().y), vec2(9.0, 9.0)), Icon::ChevronDown, t.text_dim);
+ resp
+}
+
+/// Level meter bar (dBFS), vertical.
+pub fn meter_bar(painter: &egui::Painter, rect: Rect, db: f32, peak_db: f32, t: &Tokens) {
+ painter.rect_filled(rect, 0.0, Color32::from_rgb(12, 12, 12));
+ let norm = |d: f32| ((d + 60.0) / 60.0).clamp(0.0, 1.0);
+ let h = rect.height() * norm(db);
+ if h > 0.0 {
+ // gradient green → yellow → red
+ let n = 24;
+ for i in 0..n {
+ let f0 = i as f32 / n as f32;
+ let f1 = (i + 1) as f32 / n as f32;
+ if f0 * rect.height() > h {
+ break;
+ }
+ let y1 = rect.max.y - f0 * rect.height();
+ let y0 = rect.max.y - (f1 * rect.height()).min(h);
+ let db_here = -60.0 + f1 * 60.0;
+ let c = if db_here > -3.0 {
+ Color32::from_rgb(230, 60, 50)
+ } else if db_here > -12.0 {
+ Color32::from_rgb(225, 200, 50)
+ } else {
+ Color32::from_rgb(60, 190, 80)
+ };
+ painter.rect_filled(Rect::from_min_max(pos2(rect.min.x, y0), pos2(rect.max.x, y1)), 0.0, c);
+ }
+ }
+ let py = rect.max.y - rect.height() * norm(peak_db);
+ if peak_db > -60.0 {
+ painter.line_segment(
+ [pos2(rect.min.x, py), pos2(rect.max.x, py)],
+ Stroke::new(1.0, if peak_db > -0.5 { t.danger } else { Color32::from_rgb(200, 200, 200) }),
+ );
+ }
+}