diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..30f1650 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - blacksmith-4vcpu-ubuntu-2404 + - blacksmith-6vcpu-macos-latest + - blacksmith-4vcpu-windows-2025 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + - uses: useblacksmith/rust-cache@v3 + + - name: Install Linux dependencies + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libasound2-dev libfontconfig-dev libwayland-dev libx11-xcb-dev \ + libxkbcommon-x11-dev libssl-dev libzstd-dev libvulkan1 mesa-vulkan-drivers \ + pkg-config clang ffmpeg libavcodec-dev libavformat-dev libavutil-dev \ + libswscale-dev libswresample-dev libavfilter-dev libavdevice-dev + + # FFmpeg is linked dynamically; the CLI is used by tests and the demo. + - name: Install FFmpeg (macOS) + if: runner.os == 'macOS' + run: brew install ffmpeg pkg-config + + - name: Install FFmpeg (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + $zip = "ffmpeg-n9.0-latest-win64-gpl-shared-9.0" + Invoke-WebRequest "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/$zip.zip" -OutFile ffmpeg.zip + Expand-Archive ffmpeg.zip -DestinationPath $env:RUNNER_TEMP + $dir = Join-Path $env:RUNNER_TEMP $zip + "FFMPEG_DIR=$dir" | Out-File -FilePath $env:GITHUB_ENV -Append + "LIBCLANG_PATH=C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_ENV -Append + Join-Path $dir "bin" | Out-File -FilePath $env:GITHUB_PATH -Append + + - name: Format + if: runner.os == 'Linux' + run: cargo fmt --all --check + - name: Clippy + run: cargo clippy --workspace --all-targets -- -D warnings + - name: Test + run: cargo test --workspace + + # Renders the main window offscreen (lavapipe on Linux, Metal on macOS). + - name: Snapshot + if: runner.os != 'Windows' + continue-on-error: true + run: cargo run -p videode-app --example snapshot -- videode-${{ runner.os }}.png 1440 900 + - uses: actions/upload-artifact@v4 + if: runner.os != 'Windows' + with: + name: snapshot-${{ runner.os }} + path: videode-*.png + if-no-files-found: ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..246ef0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.impeccable/review/ +.impeccable/mocks/ +.impeccable/questions/ +.impeccable/decision-payload.json +/target diff --git a/.impeccable/build/state.json b/.impeccable/build/state.json new file mode 100644 index 0000000..e02ef6f --- /dev/null +++ b/.impeccable/build/state.json @@ -0,0 +1,85 @@ +{ + "tool": "build-phase", + "version": 2, + "startedAt": "2026-10-24T12:51:50.993Z", + "comp": null, + "direction": "none", + "breakpoint": null, + "artifact": "mockup/videode.html", + "phase": "comps", + "phases": { + "comps": { + "status": "open", + "openedAt": "2026-10-24T12:51:50.993Z", + "closedAt": null, + "attempts": 0, + "notes": [], + "gate": null, + "forced": null + }, + "spec": { + "status": "pending", + "openedAt": null, + "closedAt": null, + "attempts": 0, + "notes": [], + "gate": null, + "forced": null + }, + "plates": { + "status": "pending", + "openedAt": null, + "closedAt": null, + "attempts": 0, + "notes": [], + "gate": null, + "forced": null + }, + "hero": { + "status": "pending", + "openedAt": null, + "closedAt": null, + "attempts": 0, + "notes": [], + "gate": null, + "forced": null + }, + "sections": { + "status": "pending", + "openedAt": null, + "closedAt": null, + "attempts": 0, + "notes": [], + "gate": null, + "forced": null + }, + "motion": { + "status": "pending", + "openedAt": null, + "closedAt": null, + "attempts": 0, + "notes": [], + "gate": null, + "forced": null + }, + "responsive": { + "status": "pending", + "openedAt": null, + "closedAt": null, + "attempts": 0, + "notes": [], + "gate": null, + "forced": null + }, + "review": { + "status": "pending", + "openedAt": null, + "closedAt": null, + "attempts": 0, + "notes": [], + "gate": null, + "forced": null + } + }, + "finish": null +} \ No newline at end of file diff --git a/.impeccable/design.json b/.impeccable/design.json new file mode 100644 index 0000000..0cc135e --- /dev/null +++ b/.impeccable/design.json @@ -0,0 +1,78 @@ +{ + "schemaVersion": 2, + "generatedAt": "2026-10-25T00:00:00Z", + "title": "Design System: videode", + "extensions": { + "colorMeta": { + "pluge-sub": { "role": "neutral", "displayName": "PLUGE Sub-black" }, + "pluge-black": { "role": "neutral", "displayName": "PLUGE Black" }, + "pluge-raised": { "role": "neutral", "displayName": "PLUGE Raised" }, + "bone": { "role": "primary", "displayName": "Bone (selection)" }, + "bar-source": { "role": "category", "displayName": "Bar White · Source" }, + "bar-transform": { "role": "category", "displayName": "Bar Yellow · Transform" }, + "bar-look": { "role": "category", "displayName": "Bar Cyan · Color & filter" }, + "bar-composite": { "role": "category", "displayName": "Bar Green · Composite" }, + "bar-audio": { "role": "category", "displayName": "Bar Magenta · Audio" }, + "bar-text": { "role": "category", "displayName": "Bar Red · Text" }, + "bar-output": { "role": "category", "displayName": "Bar Blue · Output" } + }, + "typographyMeta": { + "body": { "displayName": "Body", "purpose": "All shell text." }, + "title": { "displayName": "Title", "purpose": "Pane and inspector headings, palette input." }, + "measure": { "displayName": "Measure", "purpose": "Timecode, numeric values, file facts." }, + "keycap": { "displayName": "Keycap", "purpose": "Shortcut keycaps only." } + }, + "shadows": [ + { "name": "float", "value": "0 18px 48px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.4)", "purpose": "Peek panel." }, + { "name": "overlay", "value": "0 24px 64px rgba(0,0,0,.7)", "purpose": "Palette and sheets." }, + { "name": "menu", "value": "0 16px 40px rgba(0,0,0,.6)", "purpose": "Dropdown menus." }, + { "name": "selected-clip", "value": "0 0 0 1px #f1ede0, 0 4px 14px rgba(0,0,0,.4)", "purpose": "Selected clip ring." } + ], + "motion": [ + { "name": "ease-out-expo", "value": "cubic-bezier(.16,1,.3,1)", "purpose": "Peek unfold (300ms), palette pop (160ms)." }, + { "name": "stagger", "value": "35ms", "purpose": "Nodes appearing inside an unfolding peek." } + ], + "breakpoints": [ + { "name": "compact", "value": "1280px" }, + { "name": "min-window", "value": "1024px" } + ] + }, + "components": [ + { + "name": "Primary Button", "kind": "button", "refersTo": "button-primary", + "description": "The one primary action on screen (Export / Render).", + "html": "", + "css": ".ds-btn-primary{height:26px;padding:0 10px;border-radius:5px;background:#f1ede0;color:#09090a;border:1px solid #f1ede0;font:500 12px Geist,system-ui,sans-serif}.ds-btn-primary:hover{background:#fffaf0}" + }, + { + "name": "Param Field", "kind": "input", "refersTo": "field", + "description": "Numeric inspector field with unit; label scrubs.", + "html": "
EV
", + "css": ".ds-fld{display:flex;align-items:center;height:24px;background:#09090a;border:1px solid #2a2a2f;border-radius:5px;padding:0 7px;gap:4px;width:180px}.ds-fld input{flex:1;min-width:0;background:none;border:0;outline:0;color:#e8e7e2;font:12px 'Geist Mono',monospace}.ds-fld span{color:#8a8984;font:12px 'Geist Mono',monospace}.ds-fld:focus-within{border-color:#f1ede0}" + }, + { + "name": "Clip with chain strip", "kind": "custom", "refersTo": "clip", + "description": "Timeline clip; bottom strip shows its nodes in category colour.", + "html": "
mandel_dive
", + "css": ".ds-clip{width:220px;height:48px;background:#222226;border:1px solid #3a3a41;border-radius:4px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;color:#e8e7e2;font:500 12px Geist,system-ui,sans-serif}.ds-clip span{padding:2px 6px}.ds-clip i{display:flex;gap:1px;height:5px}.ds-clip b{flex:1}" + }, + { + "name": "Node", "kind": "custom", "refersTo": "node", + "description": "Graph node with category cap and mono summary.", + "html": "
Grade+0.35 EV · 5600 K
", + "css": ".ds-node{width:136px;background:#111113;border:1px solid #3a3a41;border-radius:6px;color:#e8e7e2;font:12px Geist,system-ui,sans-serif}.ds-node i{display:block;height:4px;background:#3cc4c4;border-radius:5px 5px 0 0}.ds-node b{display:block;font-weight:600;padding:6px 10px 0}.ds-node small{display:block;padding:0 10px 8px;color:#a3a29d;font:12px 'Geist Mono',monospace}" + } + ], + "narrative": { + "northStar": "The Test Card", + "overview": "SMPTE bars and PLUGE: near-black steps for the shell, seven bar colours reserved for node categories, a conventional NLE layout wrapped around a node graph that is revealed by the chain strip under each clip.", + "keyCharacteristics": ["Three PLUGE surface steps", "Bar colours only identify node categories", "State is line form", "Two type sizes", "Mono for measurement only"], + "rules": [ + { "name": "The Bars-Are-Nodes Rule", "body": "Bar colours appear only where they identify a node category.", "section": "colors" }, + { "name": "The Two-Size Rule", "body": "Shell text is 12px or 13px; rank by weight and tone.", "section": "typography" }, + { "name": "The Line-Form State Rule", "body": "Solid live, dashed offline/bypassed, struck muted, double locked.", "section": "elevation" } + ], + "dos": ["Show every shortcut where its action lives", "Pair state colour with a line form"], + "donts": ["Bar colours on chrome", "A third shell type size", "Side-stripe accents on rows", "Floating panels over the transport"] + } +} diff --git a/.impeccable/surfaces/mockup-videode-html.md b/.impeccable/surfaces/mockup-videode-html.md new file mode 100644 index 0000000..495767c --- /dev/null +++ b/.impeccable/surfaces/mockup-videode-html.md @@ -0,0 +1,22 @@ +--- +version: 1 +slug: "mockup-videode-html" +primary_target: "mockup/videode.html" +related_targets: [] +--- + +# Surface: videode editor mockup + +Scope: the main editor window (single self-contained HTML mockup of the native GPUI app). Mode: Operate. +Audience: newcomers, pro editors and node/motion artists, weighted equally. Job: cut, arrange, preview, export; peek into the node graph behind anything. +Constraints: keyboard-first (Ctrl/Cmd+K palette, rebindable shortcuts), nodes hidden until peeked, no colour-only state. +Open decisions: icon library for the native app; final face licensing for bundling. + +## Direction contract + +THESIS: Everything is a node, and the wrapper shows it without making you learn it. Refuses the category default of a grey NLE with one blue accent and a separate "Fusion page". +OWN-WORLD: SMPTE bars/PLUGE. Surfaces are three near-black PLUGE steps (#09090a / #111113 / #19191c); seven 75%-bar colours belong only to node categories (Source white, Transform yellow, Grade cyan, Composite green, Audio magenta, Text red, Output blue). Geist + Geist Mono for measurement only. Two type sizes. State = line form: solid live, dashed offline, struck muted. +STORY: A newcomer sees a familiar editor and cuts. A curious user sees coloured chain strips under clips, hits Tab, and the strip unfolds into the clip's graph in place. A power user drives everything from the palette and can expand the peek to the full sequence graph. +FIRST VIEWPORT: Top bar (bars logo, breadcrumb, palette field) 36px; media bin 280 left, viewer centre, inspector 300 right with sections coloured by node category; timeline ~40% bottom with guide-word ruler, 4 tracks, chain strips, playhead; status bar with snap/graph counts. +FORM: Test Card, my list #5 (assigned). seed: none (unavailable). Signature interaction: chain strip unfolds into the peek graph (Tab), and peek expands to full sequence graph (Shift+Tab). +FINISH: unreviewed and undocumented is unfinished; this build ends with the finish review, the verdict, DESIGN.md, and every shipping raster carrying its provenance diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..feab25a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,46 @@ +# Contributing + +Thanks for helping with videode. Bug reports, ideas and pull requests are all welcome. + +## Before you start + +For anything bigger than a bug fix, open an issue first and describe what you'd change. videode follows a written plan ([`docs/PLAN.md`](docs/PLAN.md)) and design system ([`DESIGN.md`](DESIGN.md)), and agreeing on the approach early saves rework. + +## Building + +See the Build section of the [README](README.md) for each platform's dependencies, including FFmpeg. Then: + +```sh +cargo run -p videode-app +``` + +The demo project (File → Open demo project) generates its footage with the `ffmpeg` tool on first open, so it's a quick way to try changes with real media. + +## Before opening a pull request + +Run the same checks as CI: + +```sh +cargo fmt --all --check +cargo clippy --workspace --all-targets -- -D warnings +cargo test --workspace +``` + +For UI changes, attach a screenshot. The snapshot example renders the window offscreen: + +```sh +cargo run -p videode-app --example snapshot -- out.png 1440 900 demo +``` + +## Conventions + +- **Commits** follow [Conventional Commits](https://www.conventionalcommits.org/): `feat(media): …`, `fix: …`, `docs: …`, `ci: …`. +- **Everything is a node.** New effects and operations belong in the node graph (`videode-core`), with the editor UI on top. +- **Project files are KDL**, not JSON. Keep `.vde` files readable by hand. +- **No UI in `videode-core`.** It stays testable without a window. +- **Tests:** core logic gets unit tests; UI interactions go in `crates/videode-app/src/tests.rs`. +- Respect the reduce-motion setting for any new animation. + +## License + +By contributing, you agree that your contributions are licensed under the [GNU LGPL v3.0 or later](COPYING.LESSER), the same as the rest of videode. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/COPYING.LESSER b/COPYING.LESSER new file mode 100644 index 0000000..0a04128 --- /dev/null +++ b/COPYING.LESSER @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..0b03e72 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,8743 @@ +# This file is automatically @generated by Cargo. +# 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 = [ + "enumn", + "uuid", +] + +[[package]] +name = "accesskit_atspi_common" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "023da0e5097f46df7092d5280b02efb9bbf8d93298daeced42652463e357d636" +dependencies = [ + "accesskit", + "accesskit_consumer", + "atspi-common", + "phf 0.13.1", + "serde", + "zvariant", +] + +[[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", + "hashbrown 0.16.1", + "objc2 0.5.3", + "objc2-app-kit 0.2.2", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "accesskit_unix" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e156ed3802e35eefe894ef2671bc6c889303d8a7e110b5e1b48f504b91362f" +dependencies = [ + "accesskit", + "accesskit_atspi_common", + "async-channel", + "async-executor", + "async-task", + "atspi", + "futures-lite", + "futures-util", + "serde", + "zbus", +] + +[[package]] +name = "accesskit_windows" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106c2b961215864d1c2e703ee63269c25c4e80a577ffb2c1017b9c17dcdf83a1" +dependencies = [ + "accesskit", + "accesskit_consumer", + "hashbrown 0.16.1", + "static_assertions", + "windows 0.62.2", + "windows-core 0.62.2", +] + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures 0.2.17", + "zeroize", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "const-random", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "aligned" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685" +dependencies = [ + "as-slice", +] + +[[package]] +name = "aligned-vec" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" +dependencies = [ + "equator", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[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 = "annotate-snippets" +version = "0.12.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a5b0a5ab8561c603f16c3b78c24a386b1f70e7fc1b1b1e8c15738828e4a176" +dependencies = [ + "anstyle", + "memchr", + "unicode-width 0.2.2", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "arbitrary" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed" + +[[package]] +name = "arc-swap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380962b3d93b99642e50b9febf72c071e97e8b32d86eae9cf4ef582bb960ae6e" +dependencies = [ + "rustversion", +] + +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[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 = "as-slice" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" +dependencies = [ + "stable_deref_trait", +] + +[[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 = "ashpd" +version = "0.13.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8421aaa9644a5faf26735f258b669b15f063313ef8f8e2bdb28912a1a6f111" +dependencies = [ + "enumflags2", + "futures-channel", + "futures-util", + "getrandom 0.4.3", + "serde", + "serde_repr", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "zbus", +] + +[[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-fs" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[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", + "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-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io", + "blocking", + "futures-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", +] + +[[package]] +name = "async-recursion" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[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", + "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.9", +] + +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "av-scenechange" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" +dependencies = [ + "aligned", + "anyhow", + "arg_enum_proc_macro", + "arrayvec", + "log", + "num-rational", + "num-traits", + "pastey", + "rayon", + "thiserror 2.0.21", + "v_frame", + "y4m", +] + +[[package]] +name = "av1-grain" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom 8.0.0", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7178fe5f7d460b13895ebb9dcb28a3a6216d2df2574a0806cb51b555d297f38" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide 0.8.9", + "object", + "rustc-demangle", + "windows-link 0.2.1", +] + +[[package]] +name = "base62" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3a647dce9631f152a99ec16cfc09267ae55fe280d5dc288964027d458076323" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" + +[[package]] +name = "bindgen" +version = "0.73.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "787ef8ef523575546b106a58213d6e6b06198a05c2f757258c68a74273670cfa" +dependencies = [ + "bitflags 2.13.2", + "cexpr", + "clang-sys", + "proc-macro2", + "quote", + "regex", + "rustc-hash 2.1.3", + "shlex", + "syn 3.0.9", +] + +[[package]] +name = "bit-set" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ddef2995421ab6a5c779542c81ee77c115206f4ad9d5a8e05f4ff49716a3dd" +dependencies = [ + "bit-vec 0.9.1", +] + +[[package]] +name = "bit-set" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c" +dependencies = [ + "bit-vec 0.10.1", +] + +[[package]] +name = "bit-vec" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" + +[[package]] +name = "bit-vec" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "bit_field" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" + +[[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 = "bitstream-io" +version = "4.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eff00be299a18769011411c9def0d827e8f2d7bf0c3dbf53633147a8867fd1f" +dependencies = [ + "no_std_io2", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" +dependencies = [ + "objc2 0.5.3", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2 0.6.5", +] + +[[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 = "borsh" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88b7ea17d208c4193f2c1e6de3c35fe71f98c96982d5ced308bdcc749ff6e1f" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8f347189c62a579b8cd5f80714efa178f52e461dc2e6d701d264f5ff22e566c" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "bstr" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" +dependencies = [ + "memchr", + "regex-automata", + "serde_core", +] + +[[package]] +name = "built" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" + +[[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.9", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "calloop" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b32313e937c8721c9d17ee9bf60699a6402b4b7c2cb6ac1bee0ffcaa4b4e5e" +dependencies = [ + "bitflags 2.13.2", + "polling", + "rustix", + "tracing", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa" +dependencies = [ + "calloop", + "rustix", + "wayland-backend", + "wayland-client", +] + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + +[[package]] +name = "cbindgen" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff" +dependencies = [ + "heck 0.4.1", + "indexmap", + "log", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 2.0.119", + "tempfile", + "toml 0.8.23", +] + +[[package]] +name = "cc" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86e055fa6e3e40ad6187ba25b6855eeb635d5271f8e0f0e1e9a5826b8d75bea0" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom 7.1.3", +] + +[[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 = "chacha20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.1", + "rand_core 0.10.1", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link 0.2.1", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common 0.1.7", + "inout", + "zeroize", +] + +[[package]] +name = "clang-sys" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cocoa" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation 0.1.2", + "core-foundation 0.9.4", + "core-graphics 0.23.2", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad36507aeb7e16159dfe68db81ccc27571c3ccd4b76fb2fb72fc59e7a4b1b64c" +dependencies = [ + "bitflags 2.13.2", + "block", + "cocoa-foundation 0.2.1", + "core-foundation 0.10.1", + "core-graphics 0.24.0", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation 0.9.4", + "core-graphics-types 0.1.3", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81411967c50ee9a1fc11365f8c585f863a22a9697c89239c452292c40ba79b0d" +dependencies = [ + "bitflags 2.13.2", + "block", + "core-foundation 0.10.1", + "core-graphics-types 0.2.0", + "objc", +] + +[[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 0.2.2", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[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 = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.17", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "convert_case" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49" +dependencies = [ + "unicode-segmentation", +] + +[[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" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +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 0.9.4", + "core-graphics-types 0.1.3", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.10.1", + "core-graphics-types 0.2.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-helmer-fork" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32eb7c354ae9f6d437a6039099ce7ecd049337a8109b23d73e48e8ffba8e9cd5" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.9.4", + "core-graphics-types 0.1.3", + "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 0.9.4", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.10.1", + "libc", +] + +[[package]] +name = "core-text" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a593227b66cbd4007b2a050dfdd9e1d1318311409c8d600dc82ba1b15ca9c130" +dependencies = [ + "core-foundation 0.10.1", + "core-graphics 0.24.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + +[[package]] +name = "core_maths" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30" +dependencies = [ + "libm", +] + +[[package]] +name = "cosmic-text" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be17b688510d934ce13f48a2beba700e11583e281e0fda99c22bb256a14eda73" +dependencies = [ + "bitflags 2.13.2", + "fontdb", + "harfrust", + "linebender_resource_handle", + "log", + "rangemap", + "rustc-hash 2.1.3", + "self_cell", + "skrifa 0.40.0", + "smol_str", + "swash", + "sys-locale", + "unicode-bidi", + "unicode-linebreak", + "unicode-script", + "unicode-segmentation", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ba106e844045ddc02c20768ac4b0b7cb45f2cc2ecbd833ac9f5dacb183c2055" +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]] +name = "crossbeam-queue" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d13fb3b09d88be9f4dbc29062c66b19bf7170867ceb746d2a8689bf6c7a26" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-common" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "ctor" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" +dependencies = [ + "link-section", + "linktime-proc-macro", +] + +[[package]] +name = "data-url" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" + +[[package]] +name = "deranged" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e" + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case 0.10.0", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common 0.1.7", + "subtle", +] + +[[package]] +name = "digest" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer 0.12.1", + "const-oid", + "crypto-common 0.2.2", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys 0.5.0", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users 0.4.6", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users 0.5.3", + "windows-sys 0.61.2", +] + +[[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", + "objc2 0.6.5", +] + +[[package]] +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[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 = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dwrote" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b35532432acc8b19ceed096e35dfa088d3ea037fe4f3c085f1f97f33b4d02" +dependencies = [ + "lazy_static", + "libc", + "winapi", + "wio", +] + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "either" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" + +[[package]] +name = "embed-resource" +version = "3.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6168487b5e7eb2673e6efe1200b1848016e436a6ca0b8031bf04bd9d493a249f" +dependencies = [ + "cc", + "memchr", + "rustc_version", + "toml 1.1.8+spec-1.1.0", + "vswhom", + "winreg", +] + +[[package]] +name = "encoding_rs" +version = "0.8.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e985e0451871ad22fb8d2b6b076e2028a502a0d3950998c2c5c0a4f9b5d9679" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "encoding_rs_io" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba3fe847045ecff794b9c138293a80db914678c453ad63fbf0c6a9eb6e00b22" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "endi" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enum-iterator" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4549325971814bda7a44061bf3fe7e487d447cba01e4220a4b454d630d7a016" +dependencies = [ + "enum-iterator-derive", +] + +[[package]] +name = "enum-iterator-derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[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 = "enumn" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "etagere" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc89bf99e5dc15954a60f707c1e09d7540e5cd9af85fa75caa0b510bc08c5342" +dependencies = [ + "euclid", + "svg_fmt", +] + +[[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 = "exr" +version = "1.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711fe42c9964295e01ee3fba3f9fe0e1d24b98886950d68efe81b1c76e21adf3" +dependencies = [ + "bit_field", + "half", + "lebe", + "miniz_oxide 0.8.9", + "num-complex", + "pulp", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[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 = "ffmpeg-next" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6380599799e175191eb7ffe82c97f36a2a90a36cbc54c738a903e5287d7f516a" +dependencies = [ + "bitflags 2.13.2", + "ffmpeg-sys-next", + "libc", +] + +[[package]] +name = "ffmpeg-sys-next" +version = "9.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f932d8c1cede016c65d4f1435f323369c99c74df55143b18676aa10e7603f9" +dependencies = [ + "bindgen", + "cc", + "libc", + "num_cpus", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "filedescriptor" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e40758ed24c9b2eeb76c35fb0aebc66c626084edd827e07e1552279814c6682d" +dependencies = [ + "libc", + "thiserror 1.0.69", + "winapi", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" + +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[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 = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" + +[[package]] +name = "float-ord" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce81f49ae8a0482e4c55ea62ebbd7e5a686af544c00b9d090bba3ff9be97b3d" + +[[package]] +name = "float_next_after" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" + +[[package]] +name = "fluent-uri" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "flume" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.9", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[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.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b38ad915f6dadd993ced50848a8291a543bd41ca62bc10740d5e64e2ab4cfd7" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "font-types" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835ae9d781464a79026cde387f9cbc650c9a4909d7cf7e658b127e3c35d2f35d" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "fontconfig-parser" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646" +dependencies = [ + "roxmltree 0.20.0", +] + +[[package]] +name = "fontdb" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2", + "slotmap", + "tinyvec", + "ttf-parser", +] + +[[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.9", +] + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "freetype-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7edc5b9669349acfda99533e9e0bcf26a51862ab43b08ee7745c55d28eb134" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-concurrency" +version = "7.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175cd8cca9e1d45b87f18ffa75088f2099e3c4fe5e2f83e42de112560bea8ea6" +dependencies = [ + "fixedbitset", + "futures-core", + "futures-lite", + "pin-project", + "smallvec", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-executor" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[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.9", +] + +[[package]] +name = "futures-sink" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" + +[[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-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" +dependencies = [ + "rustix", + "windows-link 0.2.1", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.1", + "wasm-bindgen", +] + +[[package]] +name = "gif" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b" +dependencies = [ + "color_quant", + "weezl", +] + +[[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 = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[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 = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "globset" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c34a9410465b45bd9787443bc7370f37735bad04b0f0cd57ff1a3186c98988" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "globwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +dependencies = [ + "bitflags 1.3.2", + "ignore", + "walkdir", +] + +[[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_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 = "gpu-descriptor" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" +dependencies = [ + "bitflags 2.13.2", + "gpu-descriptor-types", + "hashbrown 0.15.5", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "gpui-base" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5cd7de73d5b2d3d18b94a928abf343922091fa77bc472f77b7d2e7e8b1823a7" +dependencies = [ + "aho-corasick", + "anyhow", + "ashpd", + "async-channel", + "chrono", + "data-url", + "futures", + "gpui-pre", + "gpui-pre-macros", + "gpui-pre-sum-tree", + "html5ever", + "instant", + "itertools 0.13.0", + "lsp-types", + "markdown", + "markup5ever_rcdom", + "num-traits", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "raw-window-handle", + "regex", + "ropey", + "schemars", + "serde", + "serde_json", + "smallvec", + "smol", + "tracing", + "unicode-linebreak", + "unicode-segmentation", + "web-time", + "windows 0.58.0", +] + +[[package]] +name = "gpui-component" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4097e161cc81e86323b439664be0cdd4f7c56148e867ed6f67fd72b966b6c2d1" +dependencies = [ + "anyhow", + "chrono", + "core-text", + "enum-iterator", + "gpui-base", + "gpui-component-macros", + "gpui-kit-assets", + "gpui-pre", + "gpui-pre-macros", + "gpui-pre-sum-tree", + "instant", + "itertools 0.13.0", + "log", + "lsp-types", + "markdown", + "notify", + "num-traits", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "once_cell", + "paste", + "raw-window-handle", + "regex", + "resvg 0.45.1", + "ropey", + "rust-i18n", + "schemars", + "serde", + "serde_json", + "serde_repr", + "similar", + "smallvec", + "smol", + "tracing", + "unicode-segmentation", + "unicode-width 0.2.2", + "uuid", + "windows 0.58.0", +] + +[[package]] +name = "gpui-component-macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b98496748463b60ad69eab80cd91fc9b3807fed9a0e01ab4d5c159c949fd814" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "gpui-kit" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cdcb78553bef8785669e572e79759b0eab47fdd9d318fe0cce1def798189432" +dependencies = [ + "gpui-base", + "gpui-component", + "gpui-kit-assets", + "gpui-pre", + "gpui-pre-macros", + "gpui-pre-platform", + "gpui-pre-web", +] + +[[package]] +name = "gpui-kit-assets" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b037e2fa43d53a567a8aa5be6b1a8931f416cbd010ceee8d4a3727a71e9b1d05" +dependencies = [ + "anyhow", + "gpui-pre", + "gpui-pre-reqwest", + "log", + "rust-embed", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "gpui-pre" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34f61c1cfd36fc9c436af09308c963822ae27a45a84feb21a77ba5c9e051f1c0" +dependencies = [ + "accesskit", + "anyhow", + "async-channel", + "async-task", + "backtrace", + "bitflags 2.13.2", + "chrono", + "ctor", + "derive_more", + "embed-resource", + "etagere", + "futures", + "futures-concurrency", + "getrandom 0.3.4", + "gpui-pre-collections", + "gpui-pre-http-client", + "gpui-pre-macros", + "gpui-pre-refineable", + "gpui-pre-scheduler", + "gpui-pre-shared-string", + "gpui-pre-sum-tree", + "gpui-pre-util", + "heapless", + "image", + "inventory", + "itertools 0.14.0", + "libc", + "log", + "lyon", + "num_cpus", + "objc2-core-foundation", + "objc2-core-video", + "parking", + "parking_lot", + "pin-project", + "pollster 0.4.0", + "postage", + "profiling", + "proptest", + "rand 0.9.5", + "raw-window-handle", + "regex", + "resvg 0.46.0", + "schemars", + "seahash", + "serde", + "serde_json", + "slotmap", + "smallvec", + "spin 0.10.1", + "strum", + "taffy", + "thiserror 2.0.21", + "ttf-parser", + "url", + "usvg 0.46.0", + "uuid", + "waker-fn", + "web-time", + "windows 0.62.2", + "zed-scap", +] + +[[package]] +name = "gpui-pre-apple" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52f58893fe1a0836464428dfad2b5eaf42c9c303a9638f4c2aced5a69072a15" +dependencies = [ + "anyhow", + "async-task", + "block2 0.6.2", + "cbindgen", + "core-foundation 0.10.1", + "core-foundation-sys", + "core-graphics 0.24.0", + "core-text", + "derive_more", + "dispatch2", + "etagere", + "foreign-types", + "futures", + "gpui-pre", + "gpui-pre-collections", + "gpui-pre-util", + "image", + "libc", + "log", + "mach2", + "metal", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-text", + "objc2-core-video", + "objc2-foundation 0.3.2", + "objc2-metal 0.3.2", + "objc2-quartz-core 0.3.2", + "objc2-security", + "parking_lot", + "pathfinder_geometry", + "smallvec", + "thiserror 2.0.21", + "zed-font-kit", +] + +[[package]] +name = "gpui-pre-collections" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "920c2f5b2f1a7813114d89f4841f26f6060d9c35d7c8a852a4205d1a767a7ce0" +dependencies = [ + "gpui-pre-util", + "indexmap", + "rustc-hash 2.1.3", +] + +[[package]] +name = "gpui-pre-derive-refineable" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "947395f26228296c0c79fb889d3687b205e552c25bbcdece216fb2394ea9bcd1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "gpui-pre-http-client" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56cdaa3f1a271162b7fede1d4557879eedb056e293cedbb82743600650b755e" +dependencies = [ + "anyhow", + "bytes", + "futures", + "http", + "http-body", + "log", + "parking_lot", + "serde", + "serde_json", + "serde_urlencoded", + "url", +] + +[[package]] +name = "gpui-pre-linux" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28213c3fde6f13e91ba0b74b90cbaadec9373e36a031eda98561d31059870f3" +dependencies = [ + "accesskit", + "accesskit_unix", + "anyhow", + "as-raw-xcb-connection", + "ashpd", + "bytemuck", + "calloop", + "calloop-wayland-source", + "filedescriptor", + "futures", + "gpui-pre", + "gpui-pre-collections", + "gpui-pre-http-client", + "gpui-pre-util", + "gpui-pre-wgpu", + "libc", + "log", + "notify-rust", + "oo7", + "open", + "parking_lot", + "raw-window-handle", + "smallvec", + "smol", + "strum", + "url", + "uuid", + "wayland-backend", + "wayland-client", + "wayland-cursor", + "wayland-protocols", + "wayland-protocols-plasma", + "wayland-protocols-wlr", + "x11rb", + "xkbcommon", + "zed-scap", + "zed-xim", +] + +[[package]] +name = "gpui-pre-macos" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c988b7e49775cc8542dbe48d5a10e073d8e898a023ef3ff3d24f33363e9863" +dependencies = [ + "accesskit", + "accesskit_macos", + "anyhow", + "block2 0.6.2", + "cocoa 0.26.1", + "core-foundation 0.10.1", + "core-foundation-sys", + "core-graphics 0.24.0", + "ctor", + "dispatch2", + "foreign-types", + "futures", + "gpui-pre", + "gpui-pre-apple", + "gpui-pre-collections", + "gpui-pre-scheduler", + "gpui-pre-util", + "image", + "itertools 0.14.0", + "log", + "objc", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-core-video", + "objc2-foundation 0.3.2", + "objc2-user-notifications", + "parking_lot", + "raw-window-handle", + "semver", + "smallvec", + "strum", + "uuid", +] + +[[package]] +name = "gpui-pre-macros" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb80dac5e1f6b8cde1d2740389e77dfc0071bfcc81fba5526d5dc90f68171cc" +dependencies = [ + "heck 0.5.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "gpui-pre-platform" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbdbdac421178313fed8929fe95b42634a266a735079fcf03ff231bc2ccb2c5e" +dependencies = [ + "anyhow", + "console_error_panic_hook", + "gpui-pre", + "gpui-pre-linux", + "gpui-pre-macos", + "gpui-pre-web", + "gpui-pre-wgpu", + "gpui-pre-windows", +] + +[[package]] +name = "gpui-pre-refineable" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "237703b3b219d11adb50dd33bb0fcca3d34fc001623b3143e72cb051d0fb3777" +dependencies = [ + "gpui-pre-derive-refineable", +] + +[[package]] +name = "gpui-pre-reqwest" +version = "0.12.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05be23908e707966824f8c51a609904b7f30739e8d915e120a53c1b995ba964c" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-native-certs", + "rustls-pemfile", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls", + "tokio-socks", + "tokio-util", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "windows-registry 0.4.0", +] + +[[package]] +name = "gpui-pre-scheduler" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83f342555282a59ed8dd58dd7e0a920524fa8ef6aa8c8f30e2edb7019a8f72cb" +dependencies = [ + "async-task", + "backtrace", + "chrono", + "flume", + "futures", + "parking_lot", + "rand 0.9.5", + "wasm_thread", + "web-time", +] + +[[package]] +name = "gpui-pre-shared-string" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71f488bf4780735f6b2dad24f8db1e3d9e2593de0ec298e3574c788f571b81c4" +dependencies = [ + "schemars", + "serde", + "smol_str", +] + +[[package]] +name = "gpui-pre-sum-tree" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aadb3bd3da22617e2158b1842f5a9c29c1626c926ad0686163ced1a009963ff3" +dependencies = [ + "gpui-pre-ztracing", + "heapless", + "rayon", + "tracing", +] + +[[package]] +name = "gpui-pre-util" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a04ec9abd7a87ac05a221f4629403831c44c17123bc33cb5d271a6303259b340" +dependencies = [ + "anyhow", + "log", + "which", +] + +[[package]] +name = "gpui-pre-web" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedd55b99dc77e28df8202b0ea868aa5c90fda4aefff539ea21087d7c2ff4bfb" +dependencies = [ + "anyhow", + "async-channel", + "console_error_panic_hook", + "futures", + "gpui-pre", + "gpui-pre-http-client", + "gpui-pre-scheduler", + "gpui-pre-wgpu", + "js-sys", + "log", + "parking_lot", + "raw-window-handle", + "smallvec", + "unicode-properties", + "unicode-script", + "unicode-segmentation", + "uuid", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm_thread", + "web-sys", + "web-time", +] + +[[package]] +name = "gpui-pre-wgpu" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b1cdb26c1503bf9662ee8fbc5ab0b44b2deeee4b5c12dc67491ba6fb5fc544b" +dependencies = [ + "anyhow", + "bytemuck", + "cosmic-text", + "etagere", + "gpui-pre", + "gpui-pre-collections", + "gpui-pre-util", + "image", + "itertools 0.14.0", + "log", + "parking_lot", + "profiling", + "raw-window-handle", + "smallvec", + "swash", + "unicode-bidi", + "unicode-segmentation", + "web-sys", + "wgpu", + "zed-font-kit", +] + +[[package]] +name = "gpui-pre-windows" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513d4f0fc7d596d3bdef2a73a524ffb83dabc95bf484f2855a698e7f431290a9" +dependencies = [ + "accesskit", + "accesskit_windows", + "anyhow", + "dunce", + "etagere", + "futures", + "gpui-pre", + "gpui-pre-collections", + "gpui-pre-scheduler", + "gpui-pre-util", + "image", + "itertools 0.14.0", + "log", + "parking_lot", + "rand 0.9.5", + "raw-window-handle", + "smallvec", + "uuid", + "windows 0.62.2", + "windows-core 0.62.2", + "windows-numerics 0.3.1", + "windows-registry 0.6.1", +] + +[[package]] +name = "gpui-pre-ztracing" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17bfd6bd1f77ba5c58181fa6f82fc7a63015a1c58bef94a76e5acb9f8e42572" +dependencies = [ + "gpui-pre-ztracing-macro", + "tracing", +] + +[[package]] +name = "gpui-pre-ztracing-macro" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0d73e1bc02eef886a5947f41b8512708792e9e5d3053d181843311a487f96f" + +[[package]] +name = "granit-parser" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e20f99e46474f56bd905c56e817ebddcf377a611f94c53ac4649e4d3fa3c0cd0" +dependencies = [ + "arraydeque", + "smallvec", +] + +[[package]] +name = "h2" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d29020232d6aa3fb1daca64c1127cf662cf97f254ae16c18c05b8ab635fc118" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[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.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9da2e5ae821f6e96664977bf974d6d6a2d6682f9ccee23e62ec1d134246845f9" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "core_maths", + "read-fonts 0.37.0", + "smallvec", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heapless" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ba4bd83f9415b58b4ed8dc5714c76e626a105be4646c02630ad730ad3b5aa4" +dependencies = [ + "hash32", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[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 = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "html5ever" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "http" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hybrid-array" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17" +dependencies = [ + "typenum", +] + +[[package]] +name = "hyper" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3e324da4c95177d6291d4c8730197c0d1822f8a9766814a4a44fa5ab797c9c" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "hyper", + "libc", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc" + +[[package]] +name = "icu_properties" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf" + +[[package]] +name = "icu_provider" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ignore" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b69833ed729dc5aa7d19541d96d6cf8e9137194207a04916d658e43168402f" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[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", + "exr", + "gif 0.14.2", + "image-webp", + "moxcms", + "num-traits", + "png 0.18.1", + "qoi", + "ravif", + "rayon", + "tiff", + "zune-core 0.5.3", + "zune-jpeg 0.5.15", +] + +[[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 = "imagesize" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" + +[[package]] +name = "imagesize" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e54e57b4c48b40f7aec75635392b12b3421fa26fe8b4332e63138ed278459c" + +[[package]] +name = "imgref" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f" + +[[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", + "serde", + "serde_core", +] + +[[package]] +name = "inotify" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cc00ea907cab49550b7da656f80ebb97be1b997d931fbcd28d39734e17ce592" +dependencies = [ + "bitflags 2.13.2", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c033f80b2c113cdf91ab7a33faa9cbc014726dcad99880c8609af2a370edf37d" +dependencies = [ + "libc", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "inventory" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6928282826c822ad91bf1c9a1cb90a30ba1c26770749929b4656cd6be829cd7c" +dependencies = [ + "rustversion", +] + +[[package]] +name = "ipnet" +version = "2.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[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 = "kdl" +version = "6.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "082ddf81b2acd76fe04412655d17befedfff1837db772f8e74c38050d25ed670" +dependencies = [ + "miette", + "num-traits", + "serde", + "winnow 0.7.15", +] + +[[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 = "kqueue" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d763e5b24120b4ddf50de6c92308156765aabfbbccebf401da7cff2d70a41ea" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087" +dependencies = [ + "bitflags 2.13.2", + "libc", +] + +[[package]] +name = "kurbo" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62" +dependencies = [ + "arrayvec", + "euclid", + "smallvec", +] + +[[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 = "lazy_static" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" + +[[package]] +name = "lebe" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + +[[package]] +name = "libfuzzer-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" +dependencies = [ + "arbitrary", + "cc", +] + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link 0.2.1", +] + +[[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 = [ + "libc", +] + +[[package]] +name = "linebender_resource_handle" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" + +[[package]] +name = "link-section" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c29a617ce3df32c08497bdc1ab6e2376e0b17948ac166a2fbe5977c5954cd9" + +[[package]] +name = "linktime-proc-macro" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e57c38c1e860fd37c604281cdfb1dd2216977fd76a50f85ba2f388ef3219616" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" + +[[package]] +name = "litrs" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4744e383959f0db86ede514b809b1c53251889093803c05267acc7d4e7030d70" + +[[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" +dependencies = [ + "serde_core", +] + +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + +[[package]] +name = "lru-slab" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f" + +[[package]] +name = "lsp-types" +version = "0.97.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53353550a17c04ac46c585feb189c2db82154fc84b79c7a66c96c2c644f66071" +dependencies = [ + "bitflags 1.3.2", + "fluent-uri", + "serde", + "serde_json", + "serde_repr", +] + +[[package]] +name = "lyon" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0578bdecb7d6d88987b8b2b1e3a4e2f81df9d0ece1078623324a567904e7b7" +dependencies = [ + "lyon_algorithms", + "lyon_tessellation", +] + +[[package]] +name = "lyon_algorithms" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a6b9d4e8b48acd531fbf1241ad9b270df6e60b6b92bdea1469f4f40899d805" +dependencies = [ + "lyon_path", + "num-traits", +] + +[[package]] +name = "lyon_geom" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82dd26aa4dc0b5b70b9115de59824842bcb43cf4a28e1b1e6d0ad148c93f93e" +dependencies = [ + "arrayvec", + "euclid", + "num-traits", +] + +[[package]] +name = "lyon_path" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c463f9c428b7fc5ec885dcd39ce4aa61e29111d0e33483f6f98c74e89d8621e" +dependencies = [ + "lyon_geom", + "num-traits", +] + +[[package]] +name = "lyon_tessellation" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd4872650e70dc907dd4f7ebc449d7d657a0d2658e423b2e724970870bbbf75b" +dependencies = [ + "float_next_after", + "lyon_path", + "num-traits", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "mac-notification-sys" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd604973958ddcc11b561193c0fb96ba146506ef2f231ef2e7c35fd2cbc9beca" +dependencies = [ + "cc", + "log", + "objc2 0.6.5", + "objc2-foundation 0.3.2", + "time", + "uuid", +] + +[[package]] +name = "mach2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dae608c151f68243f2b000364e1f7b186d9c29845f7d2d85bd31b9ad77ad552b" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markdown" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5cab8f2cadc416a82d2e783a1946388b31654d391d1c7d92cc1f03e295b1deb" +dependencies = [ + "serde", + "unicode-id", +] + +[[package]] +name = "markup5ever" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" +dependencies = [ + "log", + "phf 0.11.3", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "markup5ever_rcdom" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edaa21ab3701bfee5099ade5f7e1f84553fd19228cf332f13cd6e964bf59be18" +dependencies = [ + "html5ever", + "markup5ever", + "tendril", + "xml5ever", +] + +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] + +[[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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157" +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 = "metal" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15" +dependencies = [ + "bitflags 2.13.2", + "block", + "core-graphics-types 0.2.0", + "foreign-types", + "log", + "objc", + "paste", +] + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ + "cfg-if", + "unicode-width 0.1.14", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[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 = "mio" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.61.2", +] + +[[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 = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + +[[package]] +name = "naga" +version = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2bf919621e7975acb27d881bae2fb993e0d45c8e0446e85e6272971e00dc8df" +dependencies = [ + "arrayvec", + "bit-set 0.9.1", + "bitflags 2.13.2", + "cfg-if", + "cfg_aliases", + "codespan-reporting", + "half", + "hashbrown 0.16.1", + "hexf-parse", + "indexmap", + "libm", + "log", + "num-traits", + "once_cell", + "rustc-hash 1.1.0", + "spirv", + "thiserror 2.0.21", + "unicode-ident", +] + +[[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 = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "no_std_io2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003" +dependencies = [ + "memchr", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + +[[package]] +name = "normpath" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b11ce00d2594068e8a27c9146fdc5cf9f3ac38eb42c7cd34d05fea618873ac9f" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "notify" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" +dependencies = [ + "bitflags 2.13.2", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "log", + "mio", + "notify-types", + "walkdir", + "windows-sys 0.60.2", +] + +[[package]] +name = "notify-rust" +version = "4.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4587364a9a0074333429b3df75a30a205340c56a536ca3eb6ca0e59b87bbf8af" +dependencies = [ + "futures-lite", + "log", + "mac-notification-sys", + "serde", + "tauri-winrt-notification", + "zbus", +] + +[[package]] +name = "notify-types" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "ntapi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" +dependencies = [ + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint-dig" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7f9a86e097b0d187ad0e65667c2f58b9254671e86e7dbb78036b16692eae099" +dependencies = [ + "libm", + "num-integer", + "num-iter", + "num-traits", + "once_cell", + "rand 0.9.5", + "serde", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "bytemuck", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[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-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[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_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d5490aaf8f1d7cf7688dfa9b0ce07900e168852c45cd2c03f534dfd27cfd0b" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" +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.3", + "objc2-core-data 0.2.2", + "objc2-core-image 0.2.2", + "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", + "libc", + "objc2 0.6.5", + "objc2-cloud-kit", + "objc2-core-data 0.3.2", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-core-image 0.3.2", + "objc2-core-text", + "objc2-core-video", + "objc2-foundation 0.3.2", + "objc2-quartz-core 0.3.2", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[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.3", + "objc2-foundation 0.2.2", +] + +[[package]] +name = "objc2-core-data" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-foundation 0.3.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.5", +] + +[[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.5", + "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.3", + "objc2-foundation 0.2.2", + "objc2-metal 0.2.2", +] + +[[package]] +name = "objc2-core-image" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" +dependencies = [ + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc2-core-text" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", +] + +[[package]] +name = "objc2-core-video" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" +dependencies = [ + "bitflags 2.13.2", + "objc2 0.6.5", + "objc2-core-foundation", + "objc2-core-graphics", + "objc2-io-surface", + "objc2-metal 0.3.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", + "libc", + "objc2 0.5.3", +] + +[[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", + "libc", + "objc2 0.6.5", + "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.5", + "objc2-core-foundation", +] + +[[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.3", + "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.5", + "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.3", + "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.5", + "objc2-core-foundation", + "objc2-foundation 0.3.2", + "objc2-metal 0.3.2", +] + +[[package]] +name = "objc2-security" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a" +dependencies = [ + "objc2-core-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" +dependencies = [ + "bitflags 2.13.2", + "block2 0.6.2", + "objc2 0.6.5", + "objc2-foundation 0.3.2", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "oo7" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78f2bfed90f1618b4b48dcad9307f25e14ae894e2949642c87c351601d62cebd" +dependencies = [ + "aes", + "ashpd", + "async-fs", + "async-io", + "async-lock", + "blocking", + "cbc", + "cipher", + "digest 0.10.7", + "endi", + "futures-lite", + "futures-util", + "getrandom 0.4.3", + "hkdf", + "hmac", + "md-5", + "num", + "num-bigint-dig", + "pbkdf2", + "serde", + "serde_bytes", + "sha2 0.10.9", + "subtle", + "zbus", + "zbus_macros", + "zeroize", + "zvariant", +] + +[[package]] +name = "open" +version = "5.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8c8b8e725ad26404d6896eb2f064294a0a7b4f1d9120210d85544684c4ca95" +dependencies = [ + "is-wsl", + "libc", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[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", + "smallvec", + "windows-link 0.2.1", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pastey" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" + +[[package]] +name = "pathfinder_geometry" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3" +dependencies = [ + "log", + "pathfinder_simd", +] + +[[package]] +name = "pathfinder_simd" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4500030c302e4af1d423f36f3b958d1aecb6c04184356ed5a833bf6b60435777" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "hmac", +] + +[[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.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared 0.11.3", +] + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared 0.13.1", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.8", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared 0.13.1", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator 0.13.1", + "phf_shared 0.13.1", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[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 = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide 0.8.9", +] + +[[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", + "windows-sys 0.61.2", +] + +[[package]] +name = "pollster" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" + +[[package]] +name = "pollster" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" + +[[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 = "postage" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3fb618632874fb76937c2361a7f22afd393c982a2165595407edc75b06d3c1" +dependencies = [ + "atomic", + "crossbeam-queue", + "parking_lot", + "pin-project", + "pollster 0.2.5", + "static_assertions", + "thiserror 1.0.69", +] + +[[package]] +name = "potential_utf" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[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 0.25.17+spec-1.1.0", +] + +[[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" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "proptest" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0" +dependencies = [ + "bit-set 0.11.1", + "bit-vec 0.10.1", + "bitflags 2.13.2", + "chacha20", + "core_detect", + "num-traits", + "proptest-macro", + "rand 0.10.3", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "proptest-macro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99782ea31698c2206c6887c1220d2f594b291c26cb9ec5b6d7cf175320bc212" +dependencies = [ + "convert_case 0.11.0", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "pulp" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046aa45b989642ec2e4717c8e72d677b13edd831a4d3b6cf37d9a3e54912496a" +dependencies = [ + "bytemuck", + "cfg-if", + "libm", + "num-complex", + "paste", + "pulp-wasm-simd-flag", + "raw-cpuid", + "reborrow", + "version_check", +] + +[[package]] +name = "pulp-wasm-simd-flag" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8f70e07b9c3962945a74e59ca1c511bba65b6419468acc217c457d93f3c740" + +[[package]] +name = "pxfm" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[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 = "quinn" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.1.3", + "rustls", + "socket2", + "thiserror 2.0.21", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe" +dependencies = [ + "bytes", + "getrandom 0.4.3", + "lru-slab", + "rand 0.10.3", + "rand_pcg", + "ring", + "rustc-hash 2.1.3", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.21", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.61.2", +] + +[[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.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[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 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[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_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core 0.10.1", +] + +[[package]] +name = "rand_xorshift" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf" +dependencies = [ + "rand_core 0.10.1", +] + +[[package]] +name = "range-alloc" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08" + +[[package]] +name = "rangemap" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a611d15b50743feb4c76b7d03edcb0e64f399c26961e4efe6975bc398be6aa3d" + +[[package]] +name = "rav1e" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" +dependencies = [ + "aligned-vec", + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av-scenechange", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.14.0", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "paste", + "profiling", + "rand 0.9.5", + "rand_chacha 0.9.0", + "simd_helpers", + "thiserror 2.0.21", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error 2.0.1", + "rav1e", + "rayon", + "rgb", +] + +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags 2.13.2", +] + +[[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.5", + "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.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b634fabf032fab15307ffd272149b622260f55974d9fad689292a5d33df02e5" +dependencies = [ + "bytemuck", + "core_maths", + "font-types 0.11.3", +] + +[[package]] +name = "read-fonts" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046a7d674daf459825b32f5062056d6882db0d2f5a479fbd76ccfc870ac18709" +dependencies = [ + "bytemuck", + "font-types 0.12.7", + "once_cell", +] + +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + +[[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_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "redox_users" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60dc65c0ff1a7ae1294b0c67b9f14baf70b644404010370171787bfac1038fc0" +dependencies = [ + "libredox", + "thiserror 2.0.21", +] + +[[package]] +name = "ref-cast" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "regex" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[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 = "resvg" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43" +dependencies = [ + "gif 0.13.3", + "image-webp", + "log", + "pico-args", + "rgb", + "svgtypes 0.15.3", + "tiny-skia", + "usvg 0.45.1", + "zune-jpeg 0.4.21", +] + +[[package]] +name = "resvg" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b563218631706d614e23059436526d005b50ab5f2d506b55a17eb65c5eb83419" +dependencies = [ + "gif 0.14.2", + "image-webp", + "log", + "pico-args", + "rgb", + "svgtypes 0.16.1", + "tiny-skia", + "usvg 0.46.0", + "zune-jpeg 0.5.15", +] + +[[package]] +name = "rgb" +version = "0.8.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ropey" +version = "2.0.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4045a00dc327d084a2bbf126976e14125b54f23bd30511d45b842eba76c52d74" +dependencies = [ + "str_indices", +] + +[[package]] +name = "roxmltree" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" + +[[package]] +name = "roxmltree" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9da7f59328b09405b181fee1018925fad50f157afb43c0c0f5c522c256dd5907" +dependencies = [ + "memchr", +] + +[[package]] +name = "rust-embed" +version = "8.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19afa5b4b6a611de00bd1bdae6ae6f39084c9399f0679c3f52d8469cf335cc23" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "8.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0d8afda6374eac59e066abee06d265247ebbaf3006cf878e2879e8356e34053" +dependencies = [ + "mime_guess", + "proc-macro2", + "quote", + "rust-embed-utils", + "shellexpand", + "syn 2.0.119", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "8.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d84e8ba78bd384263e5922f084cbe1b081c3b7e69add59c8fb097b879ba968a" +dependencies = [ + "globset", + "sha2 0.11.1", + "walkdir", +] + +[[package]] +name = "rust-i18n" +version = "4.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8502e73e6461c738659455c5d2cf95bc132760a6f203c717e66ee72b78906d7f" +dependencies = [ + "globwalk", + "regex", + "rust-i18n-macro", + "rust-i18n-support", + "smallvec", +] + +[[package]] +name = "rust-i18n-macro" +version = "4.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54a28dd9d46108d56b9f0c85b220908844233e561c03087890325104f90f2c6" +dependencies = [ + "glob", + "proc-macro2", + "quote", + "rust-i18n-support", + "serde", + "serde_json", + "syn 2.0.119", +] + +[[package]] +name = "rust-i18n-support" +version = "4.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e806c2a9701cbd6043992cd935c30cb1fdb128fa15e7b506f3b46f97045737c0" +dependencies = [ + "arc-swap", + "base62", + "foldhash 0.2.0", + "globwalk", + "itertools 0.11.0", + "normpath", + "serde", + "serde-saphyr", + "serde_json", + "siphasher", + "toml 0.8.23", + "triomphe", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" + +[[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 = "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", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[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 = "rustybuzz" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "core_maths", + "log", + "smallvec", + "ttf-parser", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-properties", + "unicode-script", +] + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[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 = "schannel" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "schemars" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e" +dependencies = [ + "dyn-clone", + "indexmap", + "ref-cast", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1c3a92094fa7d61aa124645844facb6b554dfc797136d0f5fd1f890e2bffc69" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 3.0.9", +] + +[[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 = "screencapturekit" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5eeeb57ac94960cfe5ff4c402be6585ae4c8d29a2cf41b276048c2e849d64e" +dependencies = [ + "screencapturekit-sys", +] + +[[package]] +name = "screencapturekit-sys" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22411b57f7d49e7fe08025198813ee6fd65e1ee5eff4ebc7880c12c82bde4c60" +dependencies = [ + "block", + "dispatch", + "objc", + "objc-foundation", + "objc_id", + "once_cell", +] + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[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" +dependencies = [ + "serde", + "serde_core", +] + +[[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-saphyr" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8050abb251097357e24aff63ba2c52a6309ecb7d23a5474023df960a02694d8" +dependencies = [ + "annotate-snippets", + "base64 0.23.1", + "encoding_rs_io", + "granit-parser", + "nohash-hasher", + "num-traits", + "serde_core", + "smallvec", + "zmij", +] + +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + +[[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.9", +] + +[[package]] +name = "serde_derive_internals" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "foldhash 0.2.0", + "indexmap", + "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.9", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.1", + "digest 0.11.3", +] + +[[package]] +name = "shellexpand" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8" +dependencies = [ + "dirs 6.0.0", +] + +[[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_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" +dependencies = [ + "bstr", + "unicode-segmentation", +] + +[[package]] +name = "simplecss" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c" +dependencies = [ + "log", +] + +[[package]] +name = "siphasher" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" + +[[package]] +name = "skrifa" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac" +dependencies = [ + "bytemuck", + "read-fonts 0.37.0", +] + +[[package]] +name = "skrifa" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819ab7d62b1d3e72d9d9dea5650bac30424f9111364bb94928dbf5ecad1baa68" +dependencies = [ + "bytemuck", + "read-fonts 0.41.0", +] + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8" + +[[package]] +name = "smol" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f" +dependencies = [ + "async-channel", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-net", + "async-process", + "blocking", + "futures-lite", +] + +[[package]] +name = "smol_str" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeb7109d23f319619d4cc0de5464613c8b7b1a09db2774a58101459cf6be2f10" +dependencies = [ + "serde_core", +] + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "spin" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spin" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "023a211cb3138dbc438680b32560ad89f699977624c9f8dbb95a47d5b4c07dd3" +dependencies = [ + "lock_api", +] + +[[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 = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "str_indices" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6" + +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +dependencies = [ + "float-cmp", +] + +[[package]] +name = "string_cache" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared 0.11.3", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", +] + +[[package]] +name = "strum" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "svg_fmt" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb" + +[[package]] +name = "svgtypes" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc" +dependencies = [ + "kurbo 0.11.3", + "siphasher", +] + +[[package]] +name = "svgtypes" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "695b5790b3131dafa99b3bbfd25a216edb3d216dad9ca208d4657bfb8f2abc3d" +dependencies = [ + "kurbo 0.13.1", + "siphasher", +] + +[[package]] +name = "swash" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2499c2d826531388872b2268718aed907a39bd785ab0dcfe57fab26283f92e" +dependencies = [ + "skrifa 0.44.0", + "yazi", + "zeno", +] + +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + +[[package]] +name = "sysinfo" +version = "0.31.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows 0.57.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.13.2", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "taffy" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c034e05f6ee85a12daa63863c2245797715075c70649947aa0da54f3f2ab1d0f" +dependencies = [ + "arrayvec", + "serde", + "slotmap", + "smallvec", +] + +[[package]] +name = "tao-core-video-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271450eb289cb4d8d0720c6ce70c72c8c858c93dd61fc625881616752e6b98f6" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "objc", +] + +[[package]] +name = "tauri-winrt-notification" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f37a6c354fd28fc9e322ed9bd47e3959576dad28c9d58ea1cf888cce1c7ccb36" +dependencies = [ + "thiserror 2.0.21", + "windows 0.62.2", + "windows-version", +] + +[[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", + "windows-sys 0.61.2", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[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.9", +] + +[[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 0.5.15", +] + +[[package]] +name = "time" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "png 0.17.16", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinystr" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" + +[[package]] +name = "tokio" +version = "1.54.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-socks" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e2948f60dbe26b35f2c7fb74ac2854c1fddded0fe9d7548fcc674a246f7615" +dependencies = [ + "either", + "futures-util", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "libc", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml" +version = "1.1.8+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned 1.1.2", + "toml_datetime 1.1.2+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.4", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", + "toml_write", + "winnow 0.7.15", +] + +[[package]] +name = "toml_edit" +version = "0.25.17+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" +dependencies = [ + "indexmap", + "toml_datetime 1.1.2+spec-1.1.0", + "toml_parser", + "winnow 1.0.4", +] + +[[package]] +name = "toml_parser" +version = "1.1.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" +dependencies = [ + "winnow 1.0.4", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "toml_writer" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[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 = "triomphe" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d15f4f5898bcfc5d8a8e45ed30b2f108d710c1a2e5489dbf80e078f707181bc" +dependencies = [ + "arc-swap", + "serde", + "stable_deref_trait", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" +dependencies = [ + "core_maths", +] + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[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 = "unicase" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-bidi-mirroring" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe" + +[[package]] +name = "unicode-ccc" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" + +[[package]] +name = "unicode-id" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65dd75ab2d9d379dbe86d4059e91d8b5a6e7054865eaba1ddbfc7a817ff96392" + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-properties" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" + +[[package]] +name = "unicode-script" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-vo" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "usvg" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef" +dependencies = [ + "base64 0.22.1", + "data-url", + "flate2", + "fontdb", + "imagesize 0.13.0", + "kurbo 0.11.3", + "log", + "pico-args", + "roxmltree 0.20.0", + "rustybuzz", + "simplecss", + "siphasher", + "strict-num", + "svgtypes 0.15.3", + "tiny-skia-path", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "xmlwriter", +] + +[[package]] +name = "usvg" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e419dff010bb12512b0ae9e3d2f318dfbdf0167fde7eb05465134d4e8756076f" +dependencies = [ + "base64 0.22.1", + "data-url", + "flate2", + "fontdb", + "imagesize 0.14.0", + "kurbo 0.13.1", + "log", + "pico-args", + "roxmltree 0.21.2", + "rustybuzz", + "simplecss", + "siphasher", + "strict-num", + "svgtypes 0.16.1", + "tiny-skia-path", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "xmlwriter", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "serde_core", + "sha1_smol", + "wasm-bindgen", +] + +[[package]] +name = "v_frame" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "videode-app" +version = "0.1.0" +dependencies = [ + "anyhow", + "dirs 6.0.0", + "gpui-kit", + "gpui-pre", + "gpui-pre-platform", + "image", + "videode-core", + "videode-media", + "windows-sys 0.59.0", + "winresource", +] + +[[package]] +name = "videode-core" +version = "0.1.0" +dependencies = [ + "kdl", + "thiserror 2.0.21", +] + +[[package]] +name = "videode-media" +version = "0.1.0" +dependencies = [ + "ffmpeg-next", + "futures", + "thiserror 2.0.21", +] + +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "waker-fn" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" + +[[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 = "want" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4cdd0dd910afe868b7ef477227d8d538b46b3075031afee8a9f2acb0a2ed0b" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[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.9", + "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 = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasm_thread" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7516db7f32decdadb1c3b8deb1b7d78b9df7606c5cc2f6241737c2ab3a0258e" +dependencies = [ + "futures", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wayland-backend" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38a91b4eaddff87b1cd1074985e3713da4af2c49742d1b356b2c01670a67a078" +dependencies = [ + "cc", + "downcast-rs", + "log", + "rustix", + "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", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-cursor" +version = "0.31.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a52d18780be9b1314328a3de5f930b73d2200112e3849ca6cb11822793fb34d" +dependencies = [ + "rustix", + "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-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 = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e8840e1ba2881d4cbb18d2147627a56af426ff064c0401eb0c8410c6325d07" +dependencies = [ + "arrayvec", + "bitflags 2.13.2", + "bytemuck", + "cfg-if", + "cfg_aliases", + "document-features", + "hashbrown 0.16.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 = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f519832254e56965a9940c4af57dcb75f702b6f6fa4a0b172f685395843a4d7" +dependencies = [ + "arrayvec", + "bit-set 0.9.1", + "bit-vec 0.9.1", + "bitflags 2.13.2", + "bytemuck", + "cfg_aliases", + "document-features", + "hashbrown 0.16.1", + "indexmap", + "log", + "naga", + "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 = "wgpu-core-deps-apple" +version = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e39e26c4c0e07589e67d18546cf79ff45383659fc72fca4dd293358a0347f3" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-core-deps-emscripten" +version = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01e09be551dc939498bdd5f6b2c66e55ab275dad25825267a08605a80fc9f0af" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-core-deps-wasm" +version = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1fb1798be2a912497d4c224f72d39bb0cb34af50e8bcc29865bc339c943059" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-core-deps-windows-linux-android" +version = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e592c1bbef6ad047647ae6e666ebd8cee7a32bb4544d9700ec96cbf73230257" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-hal" +version = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ace1c17727311c22a46e4e3faf56ea6de81af99dcc839bdfb54857b94d448d" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set 0.9.1", + "bitflags 2.13.2", + "block2 0.6.2", + "bytemuck", + "cfg-if", + "cfg_aliases", + "glow", + "glutin_wgl_sys", + "gpu-allocator", + "gpu-descriptor", + "hashbrown 0.16.1", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "naga", + "ndk-sys", + "objc2 0.6.5", + "objc2-core-foundation", + "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", + "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 = "wgpu-naga-bridge" +version = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95226013f547544b223281cd16a4fb549aa9dcb562adbda0faae4c73ffbbc161" +dependencies = [ + "naga", + "wgpu-types", +] + +[[package]] +name = "wgpu-types" +version = "29.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84bf84cd9ca8ca45e2b223a3868f1adf9bfc0c66aeac212e76ee7e40fdadf8f5" +dependencies = [ + "bitflags 2.13.2", + "bytemuck", + "js-sys", + "log", + "raw-window-handle", + "web-sys", +] + +[[package]] +name = "which" +version = "8.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae2f2b2b816647a1cab1acc91f5bd20812d53cb344382635ec2181940c8034f" +dependencies = [ + "libc", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections 0.2.0", + "windows-core 0.61.2", + "windows-future 0.2.1", + "windows-link 0.1.3", + "windows-numerics 0.2.0", +] + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections 0.3.2", + "windows-core 0.62.2", + "windows-future 0.3.2", + "windows-numerics 0.3.1", +] + +[[package]] +name = "windows-capture" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4df73e95feddb9ec1a7e9c2ca6323b8c97d5eeeff78d28f1eccdf19c882b24" +dependencies = [ + "parking_lot", + "rayon", + "thiserror 2.0.21", + "windows 0.61.3", + "windows-future 0.2.1", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core 0.62.2", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement 0.60.2", + "windows-interface 0.59.3", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading 0.1.0", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core 0.62.2", + "windows-link 0.2.1", + "windows-threading 0.2.1", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core 0.62.2", + "windows-link 0.2.1", +] + +[[package]] +name = "windows-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +dependencies = [ + "windows-result 0.3.4", + "windows-strings 0.3.1", + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "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 = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link 0.2.1", + "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 = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10" +dependencies = [ + "cfg-if", + "windows-sys 0.61.2", +] + +[[package]] +name = "winresource" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bc6d36480b829272a5bdabf08e6dca8004761c1da7e35efef800540c66221b" +dependencies = [ + "toml 1.1.8+spec-1.1.0", + "version_check", +] + +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "writeable" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "rustix", + "x11rb-protocol", + "xcursor", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" + +[[package]] +name = "xcb" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6c2ad15e0e922856ee89afe862b8992334bbe7953adad56cd1199358cb30566" +dependencies = [ + "bitflags 2.13.2", + "libc", + "quick-xml", + "x11", +] + +[[package]] +name = "xcursor" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "163b33ed8786455e2fa5d72f554057ce3f3182425434f756cd39c99839d88e23" + +[[package]] +name = "xim-ctext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac61a7062c40f3c37b6e82eeeef835d5cc7824b632a72784a89b3963c33284c" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "xim-parser" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dcee45f89572d5a65180af3a84e7ddb24f5ea690a6d3aa9de231281544dd7b7" +dependencies = [ + "bitflags 2.13.2", +] + +[[package]] +name = "xkbcommon" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d66ca9352cbd4eecbbc40871d8a11b4ac8107cfc528a6e14d7c19c69d0e1ac9" +dependencies = [ + "as-raw-xcb-connection", + "libc", + "memmap2", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" + +[[package]] +name = "xml-rs" +version = "0.8.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7" + +[[package]] +name = "xml5ever" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bbb26405d8e919bc1547a5aa9abc95cbfa438f04844f5fdd9dc7596b748bf69" +dependencies = [ + "log", + "mac", + "markup5ever", +] + +[[package]] +name = "xmlwriter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" + +[[package]] +name = "y4m" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" + +[[package]] +name = "yazi" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01738255b5a16e78bbb83e7fbba0a1e7dd506905cfc53f4622d89015a03fbb5" + +[[package]] +name = "yeslogic-fontconfig-sys" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8b8abf912b9a29ff112e1671c97c33636903d13a69712037190e6805af4f76" +dependencies = [ + "dlib", + "once_cell", + "pkg-config", +] + +[[package]] +name = "yoke" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", + "synstructure", +] + +[[package]] +name = "zbus" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +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", + "serde", + "serde_repr", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow 1.0.4", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus-lockstep" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6998de05217a084b7578728a9443d04ea4cd80f2a0839b8d78770b76ccd45863" +dependencies = [ + "zbus_xml", + "zvariant", +] + +[[package]] +name = "zbus-lockstep-macros" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10da05367f3a7b7553c8cdf8fa91aee6b64afebe32b51c95177957efc47ca3a0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "zbus-lockstep", + "zbus_xml", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.9", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd" +dependencies = [ + "serde", + "winnow 1.0.4", + "zvariant", +] + +[[package]] +name = "zbus_xml" +version = "5.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1586c021a01ca0a9216dcd874e546382e156a5cbab5fab6cb5f10087e22682a" +dependencies = [ + "serde", + "winnow 1.0.4", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zcheapstr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473" +dependencies = [ + "serde", +] + +[[package]] +name = "zed-font-kit" +version = "0.14.1-zed" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3898e450f36f852edda72e3f985c34426042c4951790b23b107f93394f9bff5" +dependencies = [ + "bitflags 2.13.2", + "byteorder", + "core-foundation 0.10.1", + "core-graphics 0.24.0", + "core-text", + "dirs 5.0.1", + "dwrote", + "float-ord", + "freetype-sys", + "lazy_static", + "libc", + "log", + "pathfinder_geometry", + "pathfinder_simd", + "walkdir", + "winapi", + "yeslogic-fontconfig-sys", +] + +[[package]] +name = "zed-scap" +version = "0.0.8-zed" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b338d705ae33a43ca00287c11129303a7a0aa57b101b72a1c08c863f698ac8" +dependencies = [ + "anyhow", + "cocoa 0.25.0", + "core-graphics-helmer-fork", + "log", + "objc", + "rand 0.8.8", + "screencapturekit", + "screencapturekit-sys", + "sysinfo", + "tao-core-video-sys", + "windows 0.61.3", + "windows-capture", + "x11", + "xcb", +] + +[[package]] +name = "zed-xim" +version = "0.4.0-zed" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0b46ed118eba34d9ba53d94ddc0b665e0e06a2cf874cfa2dd5dec278148642" +dependencies = [ + "ahash", + "hashbrown 0.14.5", + "log", + "x11rb", + "xim-ctext", + "xim-parser", +] + +[[package]] +name = "zeno" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" + +[[package]] +name = "zerocopy" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] +name = "zune-core" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "zune-jpeg" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" +dependencies = [ + "zune-core 0.4.12", +] + +[[package]] +name = "zune-jpeg" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" +dependencies = [ + "zune-core 0.5.3", +] + +[[package]] +name = "zvariant" +version = "5.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7" +dependencies = [ + "endi", + "enumflags2", + "serde", + "serde_bytes", + "winnow 1.0.4", + "zcheapstr", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.9", + "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.9", + "winnow 1.0.4", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..fbbbf96 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,25 @@ +[workspace] +resolver = "3" +members = ["crates/*"] + +[workspace.package] +version = "0.1.0" +edition = "2024" +rust-version = "1.95" +license = "LGPL-3.0-or-later" + +[workspace.dependencies] +videode-core = { path = "crates/videode-core" } +videode-media = { path = "crates/videode-media" } +# gpui-kit pins a matching GPUI snapshot and re-exports gpui, gpui-base and gpui-component. +gpui-kit = "=0.8.0" +anyhow = "1" + +# Line tables only: backtraces keep file:line, but debug builds and test +# binaries stay a fraction of the size (full debuginfo filled the disk). +[profile.dev] +debug = "line-tables-only" + +[profile.dev.package."*"] +opt-level = 2 +debug = "line-tables-only" diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 0000000..d38fe79 --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,207 @@ +--- +name: videode +description: Native node-based video editor; a familiar NLE wrapped around a node graph. +colors: + pluge-sub: "#09090a" + pluge-black: "#111113" + pluge-raised: "#19191c" + pluge-control: "#222226" + pluge-hover: "#2b2b30" + line: "#2a2a2f" + line-strong: "#3a3a41" + ink: "#e8e7e2" + ink-dim: "#a3a29d" + ink-faint: "#8a8984" + bone: "#f1ede0" + bar-source: "#bdbdb8" + bar-transform: "#c9c43c" + bar-look: "#3cc4c4" + bar-composite: "#45c45a" + bar-audio: "#c43cc4" + bar-text: "#d0463f" + bar-output: "#4a62d0" + state-warn: "#e0a03a" + state-error: "#e05a4f" +typography: + body: + fontFamily: "Geist, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif" + fontSize: "12px" + fontWeight: 400 + lineHeight: 1.45 + title: + fontFamily: "Geist, ui-sans-serif, system-ui, sans-serif" + fontSize: "13px" + fontWeight: 600 + letterSpacing: "-0.01em" + measure: + fontFamily: "Geist Mono, ui-monospace, SF Mono, Cascadia Mono, monospace" + fontSize: "12px" + fontWeight: 400 + fontFeature: "tnum" + keycap: + fontFamily: "Geist Mono, ui-monospace, monospace" + fontSize: "11px" + fontWeight: 500 +rounded: + swatch: "2px" + clip: "4px" + control: "5px" + field: "6px" + menu: "8px" + panel: "10px" +spacing: + xs: "4px" + sm: "8px" + md: "12px" + lg: "16px" +components: + button-primary: + backgroundColor: "{colors.bone}" + textColor: "{colors.pluge-sub}" + rounded: "{rounded.control}" + height: "26px" + padding: "0 10px" + button-default: + backgroundColor: "{colors.pluge-raised}" + textColor: "{colors.ink}" + rounded: "{rounded.control}" + height: "26px" + padding: "0 10px" + button-icon: + textColor: "{colors.ink-dim}" + rounded: "{rounded.control}" + size: "28px" + field: + backgroundColor: "{colors.pluge-sub}" + textColor: "{colors.ink}" + typography: "{typography.measure}" + rounded: "{rounded.control}" + height: "24px" + padding: "0 7px" + clip: + backgroundColor: "{colors.pluge-control}" + textColor: "{colors.ink}" + rounded: "{rounded.clip}" + node: + backgroundColor: "{colors.pluge-black}" + textColor: "{colors.ink}" + rounded: "{rounded.field}" + width: "136px" + peek-panel: + backgroundColor: "{colors.pluge-raised}" + rounded: "{rounded.panel}" +--- + +# Design System: videode + +## Overview + +**Creative North Star: "The Test Card"** *(named from the chosen direction; not separately confirmed)* + +videode's world comes from SMPTE colour bars and the PLUGE strip. The interface is a set of near-black steps, the same blacks a colourist uses to set a monitor's black level. Colour belongs only to what the picture is made of. Each of the seven node categories owns one 75%-bar colour, and that colour appears wherever the node appears: as the cap on a node, a segment in a clip's chain strip, the swatch in an inspector section, the swatch in the palette. The chrome itself never carries a category colour. + +The layout is the standard NLE: media bin on the left, viewer in the centre, inspector on the right, timeline below. The node graph sits underneath that layout, and the chain strip under each clip is what connects the two. Tab unfolds the strip into the clip's graph in place. Shift+Tab expands it to the whole sequence graph. Density is pro-tool tight. Everything is reachable from the keyboard and from the Ctrl/Cmd+K palette. + +**Key Characteristics:** +- Three PLUGE surface steps; no tinted chrome. +- Seven bar colours, used only for node-category identity. +- Line form carries state: solid means live, dashed means offline or bypassed, struck means muted, double means locked. +- Two type sizes; rank comes from weight, tone and case. +- Monospace is used only for measurement: timecode, values, keycaps. + +## Colors + +The neutrals are true near-blacks. The seven bar colours are reserved for identifying nodes. + +- **PLUGE Sub-black** (`pluge-sub`): the viewer and timeline ground, and the inside of input fields. +- **PLUGE Black** (`pluge-black`): panes, top bar, status bar. +- **PLUGE Raised** (`pluge-raised`): peek panel, palette, menus, default buttons. +- **Bone** (`bone`): selection, focus, the playhead, the primary button. It is the only "accent", and it means "this one". +- **Bars** (`bar-*`): Source, Transform, Color & filter, Composite, Audio, Text, Output. + +**The Bars-Are-Nodes Rule.** A bar colour may appear only where it identifies a node category: a node cap, a chain-strip segment, a category swatch, or an audio waveform (the audio node's data). It never appears on chrome, buttons or focus. + +**The Warn-Is-State Rule.** `state-warn` marks offline media, always together with a dashed line. `state-error` appears only in the meter's clip zone. + +## Typography + +**Body:** Geist 12px/1.45. **Title:** Geist 13px/600 (pane titles, inspector heading, palette input). **Measure:** Geist Mono 12px with tabular numerals. **Keycap:** Geist Mono 11px/500. + +**The Two-Size Rule.** The shell uses exactly 12px and 13px; keycaps at 11px are the only exception. Rank comes from weight (400, 500, 600) and tone (ink, dim, faint), never from size. + +**The Measurement-Only Mono Rule.** Mono is used for timecode, numeric values, file and codec facts, and keycaps. It is never decoration. + +## Layout + +The app shell is a grid: top bar 38px, workspace, splitter 5px, timeline (default 340px, resizable from 180px), status bar 26px. Workspace columns are bin 264px, viewer `1fr`, inspector 304px. Below 1280px wide these become 224px and 272px. The minimum window width is 1024px. + +The spacing rhythm is 4/8/12/16. Pane header bars are 32px, field rows 28px, clip rows 48–64px. + +The full sequence graph takes over the workspace and timeline. The inspector stays docked. + +## Elevation & Depth + +Depth comes from tonal steps. Shadows are reserved for floating layers: peek, palette, menus, tooltips and drag ghosts. They use an offset and a soft blur, for example `0 18px 48px rgba(0,0,0,.6)`. A selected clip adds a 1px bone ring plus a small drop shadow. + +## Shapes + +Radii are small and functional: +- 2px on swatches +- 4px on clips +- 5px on controls +- 6px on fields and nodes +- 8px on menus +- 10px on the peek panel and palette + +Pills are used only for the track pin in peek. + +## Components + +- **Clip:** has a name row (17px), a filmstrip or waveform, and a 5px **chain strip** along the bottom with one segment per node in category colour. Bypassed segments drop to 25% opacity. Clips have 7px trim handles on each edge. Fades are shown as darkened corner triangles. +- **Node:** 136px wide, with a 4px category cap, the title at 600 weight, and a one-line mono summary. In/out ports are 9px rings. A bypassed node gets a dashed border and a struck title. +- **Peek panel:** opens directly below the clip when there is room, otherwise above it, and never covers the transport. It unfolds with a 300ms ease-out (GPUI can't transform elements, so the panel grows in height rather than scaling from the chain strip). The nodes inside stagger in at 35ms intervals. Dragging a card shows a bone insertion line; the generator's slot is fixed. +- **Inspector section:** an 8px swatch, the node name, and bypass and remove buttons. Params use a 96px label column. Dragging the label scrubs the value; Shift multiplies the step by 10 and Alt divides it by 10. Double-clicking the label resets it. +- **Command palette:** results grouped as Recent, Actions, Add node, Clips and Media. Fuzzy matches are highlighted in bone. Disabled items say why they're unavailable. +- **Typing safety:** single-key shortcuts are bound under `Workspace && !Input`, so they never fire while a text field or the palette has focus. +- **Buttons:** there is one primary button (bone, for Export/Render). Default buttons are raised. Ghost buttons sit in toolbars. Every tooltip shows its shortcut as a keycap. + +## Brand + +**The Merge mark.** A lowercase v drawn as a node graph: a picture port (`bar-look` cyan) and a sound port (`bar-audio` magenta) flow down bone wires into one Output node (`bar-output` blue), on a `pluge-black` tile with a 228/1024 corner radius. It is the one place bar colours appear outside node identity, and they keep their meaning there. + +- Masters live in `assets/brand/`: `videode.svg` (layered `tile`/`wires`/`ports`/`output` for Icon Composer), `videode-small.svg` (heavier strokes, tighter crop, for 16–32px), `videode-glyph.svg` (no tile) and the two lockups. `scripts/brand.sh` regenerates every PNG, the `.ico` and the `.icns`. +- In the app, the mark is painted natively (`brand.rs`) so it is crisp at any size and can build in. +- The wordmark is Geist SemiBold, lowercase, tracked −2.5%. Brand surfaces (About, splash) may set it at 24–36px; this is the only exception to the Two-Size Rule. +- The macOS `.icns` is a placeholder until a Liquid Glass icon is made in Icon Composer. + +## Motion + +Motion explains what changed. It never delays input and never sits between a keystroke and its result. + +| What | How | Time | +|---|---|---| +| Hover | background layer fades in under the control | 120ms in, 90ms out | +| Press | control dims to 75% while held | instant | +| Menus, tooltips | fade and drop in (GPUI Kit) | 150ms | +| Dialogs | backdrop fades, panel rises 10px | 160ms | +| Status message | rises 6px and fades in | 180ms | +| Keyboard/button zoom, fit | eases to the new scale | 180ms | +| Split, blade | red cut line fades out at the cut | 380ms | +| Undo, redo | changed clips get a bone ring that fades | 520ms | +| Switches | knob slides | 140ms | +| Launch splash | ports pop, wires draw, node drops, wordmark slides; any key skips | 1.3s | +| About | the mark builds in | 700ms | + +- **One curve.** Ease-out quint (`motion::ease_out`), the native stand-in for `cubic-bezier(.16,1,.3,1)`. Leaving is faster than arriving. +- **No motion on direct manipulation.** Drag, trim, scrub, wheel zoom, playback and meters are never eased; the wheel cancels an eased zoom. +- **One switch.** Settings › Animations is Follow system (default), On or Off, and drives GPUI's `reduce_motion`. Every animation goes through `with_animation` or checks `settings::motion`, so Off shows end states immediately and the splash is skipped. Follow system reads GNOME/KDE settings on Linux, Reduce Motion on macOS and "Show animations" on Windows. + +## Do's and Don'ts + +- Do show every action's shortcut where the action lives (tooltip, menu, palette). +- Do pair every state colour with a line form (dashed offline, struck muted). +- Don't put bar colours on chrome, buttons or selection. +- Don't add a third type size to the shell. +- Don't use side-stripe accents on list rows; use the 8px category swatch. +- Don't hide the transport behind floating panels. +- Don't add an animation that has no instant end state, or that runs while the user is dragging. diff --git a/PRODUCT.md b/PRODUCT.md new file mode 100644 index 0000000..d1a3fcb --- /dev/null +++ b/PRODUCT.md @@ -0,0 +1,38 @@ +# Product + + + +## Platform + +desktop (native, Windows / macOS / Linux). Built with Rust + GPUI; HTML is used only for mockups. + +## Stack + +Rust workspace, GPUI for UI, FFmpeg (dynamically linked) for decode/encode, cpal for audio. Project files are KDL (`.vde`). No JSON for project data. + +## Users + +Equal weight across: +- **Newcomers / creators** cutting vlogs, tutorials, shorts. Must be able to import, cut, and export without ever seeing a node. +- **Pro editors / post** coming from Resolve, Premiere, Nuke. Expect dense info, full keyboard control, command palette, precise numeric entry. +- **Motion / generative artists** who want to live in the graph. + +## Purpose & mechanism + +videode is a video editor where **everything is a node**. Media, clips, effects, tracks, transitions, the sequence itself and the export are all nodes in one graph. The familiar NLE interface (media bin, viewer, timeline, inspector) is a wrapper that edits that graph. + +- **Peek on demand.** Nodes stay hidden by default. Any clip, track or sequence can be "peeked" with Tab or a peek affordance, which reveals the subgraph behind it. A docked split view is available for those who want it permanently. +- Every edit in the wrapper UI is a graph edit. Every graph edit is reflected in the wrapper. + +## Terminology + +- **Node**: the unit of computation (Source, Trim, Transform, Grade, Blur, Mix, Text, Output, ...). +- **Clip**: the wrapper's view of a Source → ... → track-input chain. +- **Peek**: opening the graph behind a wrapper element in place. +- **Sequence**: a graph whose output is a timeline composite. Sequences can nest as nodes. + +## Constraints + +- Keyboard-first: every action reachable via command palette (Ctrl/Cmd+K) and rebindable shortcuts. +- Must stay approachable: no node jargon is required for basic editing. +- Accessibility: visible focus, sufficient contrast on dark UI, no color-only signalling for track/clip state. diff --git a/README.md b/README.md index 30c01da..8495a76 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,76 @@ # videode -Created in [T3 Code](https://t3.codes). +A native, node-based video editor for Windows, macOS and Linux, written in Rust with [GPUI](https://www.gpui.rs/). + +Inside, everything is a node: media, clips, effects, tracks, the sequence and the export. Outside, it is a familiar editor (media bin, viewer, inspector, timeline). Press **Tab** on a clip to peek at its nodes, or **Shift+Tab** to see the whole sequence as a graph. + +- Interactive UI mockup: [`mockup/videode.html`](mockup/videode.html) +- Product context: [`PRODUCT.md`](PRODUCT.md) · Design system: [`DESIGN.md`](DESIGN.md) · Plan: [`docs/PLAN.md`](docs/PLAN.md) + +## Status + +Milestone M3: media and preview. The viewer shows real footage: + +- **Import:** File → Import media…, Ctrl/Cmd I, the bin's import button, or drop files on the window. Files are probed with FFmpeg (codec, size, frame rate, duration, audio) and added as one undo step. +- **Bin:** thumbnails decode in the background; missing files show as offline. +- **Viewer:** frame-accurate at the playhead, decoded at display size by a pool of decoder threads with a frame cache. Transform (position, scale), Crop, Opacity and Fade are applied; titles draw on top. +- **Demo:** File → Open demo project generates its test-pattern footage with the `ffmpeg` tool on first open. + +From M2: every clip is a chain of nodes. Edit any value in the inspector, peek at a clip's nodes with **Tab**, see the whole sequence as a graph with **Shift+Tab**, and search everything with the command palette (**Ctrl/Cmd K**). From M1: timeline editing, undo/redo and `.vde` project files. Playback with sound and export arrive in M4–M5. + +![M3 viewer and bin](docs/m3-media.png) + +## Build + +Requires Rust 1.95 or newer (`rustup update stable`) and FFmpeg (shared libraries plus the `ffmpeg` tool, developed against 9.0), found through `pkg-config`. + +```sh +cargo run -p videode-app # opens the editor +cargo run -p videode-app --example snapshot -- out.png 1440 900 # offscreen screenshot +cargo run -p videode-app --example snapshot -- out.png 1440 900 demo # same, demo project + # (also: settings, about, splash@0.4, + # media, peek, graph, output, focus, edit, palette=) +./scripts/brand.sh # regenerate icons from assets/brand/*.svg +./packaging/linux/install.sh # install binary, launcher and icons to ~/.local +``` + +macOS: + +```sh +brew install ffmpeg pkg-config +``` + +Linux (Debian/Ubuntu) needs GPUI's system libraries and FFmpeg's development packages: + +```sh +sudo apt install libasound2-dev libfontconfig-dev libwayland-dev libx11-xcb-dev \ + libxkbcommon-x11-dev libssl-dev libzstd-dev libvulkan1 pkg-config clang \ + ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \ + libswresample-dev libavfilter-dev libavdevice-dev +``` + +Windows: download a shared FFmpeg build (for example from [BtbN/FFmpeg-Builds](https://github.com/BtbN/FFmpeg-Builds/releases)), set `FFMPEG_DIR` to it, put its `bin` folder on `PATH`, and install LLVM for `libclang`. + +See [CONTRIBUTING.md](CONTRIBUTING.md) for tests and pull requests. + +## Layout + +``` +crates/ + videode-core/ project model and node graph engine (no UI) + videode-media/ FFmpeg probing, frame-accurate decoding, decoder pool, demo footage + videode-app/ the GPUI application: window, theme, editor shell +assets/fonts/ Geist and Geist Mono (SIL OFL 1.1) +mockup/ approved HTML mockup with synthetic demo media +``` + +## License + +videode is free software under the [GNU Lesser General Public License v3.0 or later](COPYING.LESSER), which builds on the [GNU GPL v3](COPYING). + +FFmpeg is linked dynamically and is not bundled. If you distribute videode with an FFmpeg build that includes GPL components, that distribution as a whole falls under the GPL. + +Bundled fonts are under the SIL Open Font License (`assets/fonts/OFL-Geist.txt`); icons are Lucide (ISC), via GPUI Kit. + +Found a security problem? See [SECURITY.md](SECURITY.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..e2bc32a --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,23 @@ +# Security + +## Reporting a vulnerability + +Please report security problems privately through GitHub: on the repository's **Security** tab, choose **Report a vulnerability**. Don't open a public issue. + +Include what you found, how to reproduce it (a sample `.vde` project or media file helps), and the videode version or commit and operating system. + +You'll get an acknowledgement within a week. Once a fix is ready, it ships in a release and you're credited in the advisory unless you'd rather not be. + +## Scope + +videode opens files that may come from anyone, so the most likely problems are in reading them: + +- `.vde` project files (KDL), including paths they point at +- media files, which are decoded by FFmpeg +- the demo footage generator, which runs the `ffmpeg` command-line tool + +Bugs in FFmpeg itself should go to the [FFmpeg project](https://ffmpeg.org/security.html); tell us too if videode makes them easier to reach. + +## Supported versions + +videode is pre-1.0. Only the latest commit on `main` gets security fixes. diff --git a/assets/brand/png/videode-1024.png b/assets/brand/png/videode-1024.png new file mode 100644 index 0000000..c1c1d87 Binary files /dev/null and b/assets/brand/png/videode-1024.png differ diff --git a/assets/brand/png/videode-128.png b/assets/brand/png/videode-128.png new file mode 100644 index 0000000..2cf8137 Binary files /dev/null and b/assets/brand/png/videode-128.png differ diff --git a/assets/brand/png/videode-16.png b/assets/brand/png/videode-16.png new file mode 100644 index 0000000..00050fd Binary files /dev/null and b/assets/brand/png/videode-16.png differ diff --git a/assets/brand/png/videode-24.png b/assets/brand/png/videode-24.png new file mode 100644 index 0000000..bac631b Binary files /dev/null and b/assets/brand/png/videode-24.png differ diff --git a/assets/brand/png/videode-256.png b/assets/brand/png/videode-256.png new file mode 100644 index 0000000..4a6b4cc Binary files /dev/null and b/assets/brand/png/videode-256.png differ diff --git a/assets/brand/png/videode-32.png b/assets/brand/png/videode-32.png new file mode 100644 index 0000000..fe1680f Binary files /dev/null and b/assets/brand/png/videode-32.png differ diff --git a/assets/brand/png/videode-48.png b/assets/brand/png/videode-48.png new file mode 100644 index 0000000..80ecf87 Binary files /dev/null and b/assets/brand/png/videode-48.png differ diff --git a/assets/brand/png/videode-512.png b/assets/brand/png/videode-512.png new file mode 100644 index 0000000..67f707f Binary files /dev/null and b/assets/brand/png/videode-512.png differ diff --git a/assets/brand/png/videode-64.png b/assets/brand/png/videode-64.png new file mode 100644 index 0000000..2ada884 Binary files /dev/null and b/assets/brand/png/videode-64.png differ diff --git a/assets/brand/png/videode-lockup-dark.png b/assets/brand/png/videode-lockup-dark.png new file mode 100644 index 0000000..837cb6a Binary files /dev/null and b/assets/brand/png/videode-lockup-dark.png differ diff --git a/assets/brand/png/videode-lockup-light.png b/assets/brand/png/videode-lockup-light.png new file mode 100644 index 0000000..b6d4da9 Binary files /dev/null and b/assets/brand/png/videode-lockup-light.png differ diff --git a/assets/brand/videode-glyph.svg b/assets/brand/videode-glyph.svg new file mode 100644 index 0000000..816ab17 --- /dev/null +++ b/assets/brand/videode-glyph.svg @@ -0,0 +1,13 @@ + + videode glyph + + + + + + + + + + + diff --git a/assets/brand/videode-lockup-dark.svg b/assets/brand/videode-lockup-dark.svg new file mode 100644 index 0000000..9fc5c34 --- /dev/null +++ b/assets/brand/videode-lockup-dark.svg @@ -0,0 +1,13 @@ + + videode lockup (dark) + + + + + + + + + + videode + diff --git a/assets/brand/videode-lockup-light.svg b/assets/brand/videode-lockup-light.svg new file mode 100644 index 0000000..97a9133 --- /dev/null +++ b/assets/brand/videode-lockup-light.svg @@ -0,0 +1,13 @@ + + videode lockup (light) + + + + + + + + + + videode + diff --git a/assets/brand/videode-small.svg b/assets/brand/videode-small.svg new file mode 100644 index 0000000..2362137 --- /dev/null +++ b/assets/brand/videode-small.svg @@ -0,0 +1,14 @@ + + videode (16–32 px) + + + + + + + + + + + + diff --git a/assets/brand/videode.icns b/assets/brand/videode.icns new file mode 100644 index 0000000..cad0ec7 Binary files /dev/null and b/assets/brand/videode.icns differ diff --git a/assets/brand/videode.ico b/assets/brand/videode.ico new file mode 100644 index 0000000..dd8e234 Binary files /dev/null and b/assets/brand/videode.ico differ diff --git a/assets/brand/videode.svg b/assets/brand/videode.svg new file mode 100644 index 0000000..4e3dbd5 --- /dev/null +++ b/assets/brand/videode.svg @@ -0,0 +1,21 @@ + + videode + + + + + + + + + + + + + + + + + + diff --git a/assets/fonts/Geist-Medium.ttf b/assets/fonts/Geist-Medium.ttf new file mode 100644 index 0000000..1c1afa0 Binary files /dev/null and b/assets/fonts/Geist-Medium.ttf differ diff --git a/assets/fonts/Geist-Regular.ttf b/assets/fonts/Geist-Regular.ttf new file mode 100644 index 0000000..c9319eb Binary files /dev/null and b/assets/fonts/Geist-Regular.ttf differ diff --git a/assets/fonts/Geist-SemiBold.ttf b/assets/fonts/Geist-SemiBold.ttf new file mode 100644 index 0000000..2c9ce8e Binary files /dev/null and b/assets/fonts/Geist-SemiBold.ttf differ diff --git a/assets/fonts/GeistMono-Medium.ttf b/assets/fonts/GeistMono-Medium.ttf new file mode 100644 index 0000000..85508ad Binary files /dev/null and b/assets/fonts/GeistMono-Medium.ttf differ diff --git a/assets/fonts/GeistMono-Regular.ttf b/assets/fonts/GeistMono-Regular.ttf new file mode 100644 index 0000000..d1bb290 Binary files /dev/null and b/assets/fonts/GeistMono-Regular.ttf differ diff --git a/assets/fonts/GeistMono-SemiBold.ttf b/assets/fonts/GeistMono-SemiBold.ttf new file mode 100644 index 0000000..c6caefc Binary files /dev/null and b/assets/fonts/GeistMono-SemiBold.ttf differ diff --git a/assets/fonts/OFL-Geist.txt b/assets/fonts/OFL-Geist.txt new file mode 100644 index 0000000..8d003fe --- /dev/null +++ b/assets/fonts/OFL-Geist.txt @@ -0,0 +1,92 @@ +Copyright (c) 2023 Vercel, in collaboration with basement.studio + +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/icon.svg b/assets/icon.svg index a9913b4..4e3dbd5 100644 --- a/assets/icon.svg +++ b/assets/icon.svg @@ -1,4 +1,21 @@ - - - V + + videode + + + + + + + + + + + + + + + + + diff --git a/crates/videode-app/Cargo.toml b/crates/videode-app/Cargo.toml new file mode 100644 index 0000000..ef0f2ec --- /dev/null +++ b/crates/videode-app/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "videode-app" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true + +[lib] +path = "src/lib.rs" + +[[bin]] +name = "videode" +path = "src/main.rs" + +[dependencies] +videode-core.workspace = true +videode-media.workspace = true +gpui-kit.workspace = true +anyhow.workspace = true +dirs = "6" +image = { version = "0.25", default-features = false, features = ["png"] } + +[target.'cfg(windows)'.dependencies] +windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_UI_WindowsAndMessaging"] } + +# Embeds assets/brand/videode.ico in videode.exe (see build.rs). +[target.'cfg(windows)'.build-dependencies] +winresource = "0.1" + +[dev-dependencies] +# Headless rendering for screenshot snapshots. Enabled on GPUI directly because +# gpui-kit's own `test-support` pulls in gpui-fast, which conflicts on macOS deps. +gpui = { package = "gpui-pre", version = "=0.3.9", features = ["test-support"] } +gpui_platform = { package = "gpui-pre-platform", version = "=0.3.9", features = ["test-support"] } + +# Read by cargo-bundle for the macOS .app. The .icns is a placeholder until the +# Icon Composer (Liquid Glass) icon lands. +[package.metadata.bundle] +name = "videode" +identifier = "dev.videode.videode" +icon = ["../../assets/brand/videode.icns", "../../assets/brand/png/videode-256.png"] +category = "public.app-category.video" +short_description = "A video editor where everything is a node" diff --git a/crates/videode-app/build.rs b/crates/videode-app/build.rs new file mode 100644 index 0000000..2fd6fbe --- /dev/null +++ b/crates/videode-app/build.rs @@ -0,0 +1,10 @@ +fn main() { + println!("cargo:rerun-if-changed=../../assets/brand/videode.ico"); + // The build script runs on the host, so this only fires on Windows hosts. + #[cfg(windows)] + if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") { + let mut res = winresource::WindowsResource::new(); + res.set_icon("../../assets/brand/videode.ico"); + res.compile().expect("failed to embed the Windows icon"); + } +} diff --git a/crates/videode-app/examples/snapshot.rs b/crates/videode-app/examples/snapshot.rs new file mode 100644 index 0000000..86a3570 --- /dev/null +++ b/crates/videode-app/examples/snapshot.rs @@ -0,0 +1,113 @@ +//! Renders the main window offscreen and writes a PNG, for visual checks +//! without a display: `cargo run -p videode-app --example snapshot -- out.png 1440 900 [modes]` +//! +//! Modes, comma-separated: +//! - `demo`: the demo project with a clip selected and the playhead inside it +//! - `settings`, `about`: open that dialog +//! - `splash@0.4`: the launch splash frozen 0.4 s in +//! - `media`, `peek`, `graph`, `output`, `focus`, `edit`, `palette=`: see +//! `Workspace::preview` +//! +//! Animations are off (end states) except in `splash@` mode. +//! +//! Needs GPUI's headless renderer (WGPU on Linux, Metal on macOS). + +use std::sync::Arc; +use std::time::Duration; + +use gpui::{ + AppContext as _, Bounds, HeadlessAppContext, WindowBounds, WindowOptions, point, px, size, +}; +use videode_app::workspace::{Modal, Workspace}; +use videode_core::{ClipId, Document, demo::demo_project}; + +fn main() -> anyhow::Result<()> { + let mut args = std::env::args().skip(1); + let out = args.next().unwrap_or_else(|| "videode.png".into()); + let width: f32 = args.next().and_then(|s| s.parse().ok()).unwrap_or(1440.); + let height: f32 = args.next().and_then(|s| s.parse().ok()).unwrap_or(900.); + let modes = args.next().unwrap_or_default(); + let has = |m: &str| modes.split(',').any(|x| x == m); + let demo = has("demo"); + let splash: Option = modes + .split(',') + .find_map(|m| m.strip_prefix("splash@").and_then(|s| s.parse().ok())); + + // Never read or write the user's real settings. + let config = std::env::temp_dir().join("videode-snapshot-config"); + // SAFETY: set before any other thread starts. + unsafe { std::env::set_var("VIDEODE_CONFIG_DIR", &config) }; + + let mut cx = HeadlessAppContext::with_platform( + gpui_platform::current_platform(true).text_system(), + Arc::new(videode_app::assets::AppAssets), + gpui_platform::current_headless_renderer, + ); + cx.update(videode_app::init); + cx.update(|cx| cx.set_reduce_motion(splash.is_none())); + + let (handle, _) = cx.update(|cx| { + gpui_kit::open_window( + WindowOptions { + window_bounds: Some(WindowBounds::Windowed(Bounds { + origin: point(px(0.), px(0.)), + size: size(px(width), px(height)), + })), + focus: false, + show: false, + ..Default::default() + }, + cx, + |window, cx| { + cx.new(|cx| { + let mut ws = if demo { + let project = demo_project(); + let selected: Option = project + .sequence + .clips + .iter() + .find(|c| c.nodes.len() >= 3 && c.media.is_some()) + .map(|c| c.id); + let mut ws = + Workspace::with_document(Document::new(project, None), window, cx); + ws.set_view(240, selected); + ws + } else { + Workspace::new(window, cx) + }; + if has("settings") { + ws.show_modal(Modal::Settings); + } else if has("about") { + ws.show_modal(Modal::About); + } + for mode in modes.split(',') { + ws.preview(mode, window, cx); + } + if let Some(t) = splash { + ws.preview_splash(Duration::from_secs_f32(t)); + } + ws + }) + }, + ) + })?; + // Frames and thumbnails decode on their own threads: draw, give them a + // moment, and draw again until nothing new arrives. + for _ in 0..4 { + cx.run_until_parked(); + cx.update_window(handle, |_, window, cx| { + window.refresh(); + window.draw(cx).clear(cx); + })?; + std::thread::sleep(std::time::Duration::from_millis(250)); + } + cx.run_until_parked(); + cx.update_window(handle, |_, window, cx| { + window.refresh(); + window.draw(cx).clear(cx); + })?; + let image = cx.capture_screenshot(handle)?; + image.save(&out)?; + println!("wrote {out} ({}x{})", image.width(), image.height()); + Ok(()) +} diff --git a/crates/videode-app/src/actions.rs b/crates/videode-app/src/actions.rs new file mode 100644 index 0000000..db8cf67 --- /dev/null +++ b/crates/videode-app/src/actions.rs @@ -0,0 +1,152 @@ +//! Every user command is a GPUI action, so menus, shortcuts and (later) the +//! command palette all go through one path. + +use gpui_kit::{App, KeyBinding, actions}; + +actions!( + videode, + [ + NewProject, + OpenProject, + OpenDemo, + SaveProject, + SaveProjectAs, + Quit, + Undo, + Redo, + Split, + DeleteClip, + RippleDelete, + Deselect, + SelectTool, + BladeTool, + ToggleSnap, + ToggleTrack, + ZoomIn, + ZoomOut, + ZoomToFit, + TogglePlay, + ShuttleForward, + ShuttleStop, + ShuttleBackward, + StepBack, + StepForward, + SecondBack, + SecondForward, + PrevEdit, + NextEdit, + GoToStart, + GoToEnd, + Export, + OpenSettings, + About, + TogglePeek, + ToggleGraph, + CommandPalette, + OpenOutput, + BypassNode, + AddNodeMenu, + ImportMedia, + ] +); + +pub const CONTEXT: &str = "Workspace"; +/// Single-key shortcuts must not fire while typing in a text field. +pub const NOT_TYPING: &str = "Workspace && !Input"; + +pub fn bind_keys(cx: &mut App) { + let ctx = Some(CONTEXT); + let keys = Some(NOT_TYPING); + cx.bind_keys([ + KeyBinding::new("secondary-n", NewProject, ctx), + KeyBinding::new("secondary-o", OpenProject, ctx), + KeyBinding::new("secondary-s", SaveProject, ctx), + KeyBinding::new("secondary-shift-s", SaveProjectAs, ctx), + KeyBinding::new("secondary-q", Quit, ctx), + KeyBinding::new("secondary-z", Undo, keys), + KeyBinding::new("secondary-shift-z", Redo, keys), + KeyBinding::new("secondary-y", Redo, keys), + KeyBinding::new("secondary-e", Export, ctx), + KeyBinding::new("secondary-,", OpenSettings, ctx), + KeyBinding::new("secondary-k", CommandPalette, ctx), + KeyBinding::new("secondary-i", ImportMedia, ctx), + KeyBinding::new("escape", Deselect, keys), + KeyBinding::new("tab", TogglePeek, keys), + KeyBinding::new("shift-tab", ToggleGraph, keys), + KeyBinding::new("s", Split, keys), + KeyBinding::new("delete", DeleteClip, keys), + KeyBinding::new("backspace", DeleteClip, keys), + KeyBinding::new("shift-delete", RippleDelete, keys), + KeyBinding::new("shift-backspace", RippleDelete, keys), + KeyBinding::new("v", SelectTool, keys), + KeyBinding::new("b", BladeTool, keys), + KeyBinding::new("shift-b", BypassNode, keys), + KeyBinding::new("a", AddNodeMenu, keys), + KeyBinding::new("n", ToggleSnap, keys), + KeyBinding::new("m", ToggleTrack, keys), + KeyBinding::new("=", ZoomIn, keys), + KeyBinding::new("-", ZoomOut, keys), + KeyBinding::new("shift-z", ZoomToFit, keys), + KeyBinding::new("space", TogglePlay, keys), + KeyBinding::new("l", ShuttleForward, keys), + KeyBinding::new("k", ShuttleStop, keys), + KeyBinding::new("j", ShuttleBackward, keys), + KeyBinding::new("left", StepBack, keys), + KeyBinding::new("right", StepForward, keys), + KeyBinding::new("shift-left", SecondBack, keys), + KeyBinding::new("shift-right", SecondForward, keys), + KeyBinding::new("up", PrevEdit, keys), + KeyBinding::new("down", NextEdit, keys), + KeyBinding::new("home", GoToStart, keys), + KeyBinding::new("end", GoToEnd, keys), + ]); +} + +/// A binding as keycap text in the Test Card style, e.g. `Ctrl K`, `⇧ Tab`. +pub fn shortcut_text(binding: &KeyBinding) -> String { + binding + .keystrokes() + .iter() + .map(|k| { + let text = k.to_string(); + if text == "-" { + return "−".to_string(); + } + text.split('-') + .map(|part| match part { + "ctrl" => "Ctrl".to_string(), + "alt" => { + if cfg!(target_os = "macos") { + "⌥".into() + } else { + "Alt".into() + } + } + "shift" => "⇧".into(), + "cmd" | "super" | "win" => { + if cfg!(target_os = "macos") { + "⌘".into() + } else { + "Super".into() + } + } + "space" => "Space".into(), + "tab" => "Tab".into(), + "escape" => "Esc".into(), + "delete" => "Del".into(), + "backspace" => "⌫".into(), + "left" => "←".into(), + "right" => "→".into(), + "up" => "↑".into(), + "down" => "↓".into(), + "home" => "Home".into(), + "end" => "End".into(), + "" => "-".into(), + other => other.to_uppercase(), + }) + .collect::>() + .join(" ") + }) + .collect::>() + .join(", ") +} diff --git a/crates/videode-app/src/assets.rs b/crates/videode-app/src/assets.rs new file mode 100644 index 0000000..4bdec59 --- /dev/null +++ b/crates/videode-app/src/assets.rs @@ -0,0 +1,54 @@ +//! Asset source: GPUI Kit's default icons plus the extra Lucide icons the +//! editor uses. Only the listed icons are embedded. + +use std::borrow::Cow; + +use gpui_kit::assets::{Assets, icon_assets}; +use gpui_kit::{AssetSource, Result, SharedString}; + +icon_assets!( + EditorIcons, + [ + Film, + Import, + Upload, + Scissors, + Magnet, + MousePointer, + Layers, + Workflow, + SkipBack, + SkipForward, + StepBack, + StepForward, + Play, + Pause, + Keyboard, + Volume2, + VolumeX, + Eye, + EyeOff, + Lock, + LockOpen, + Link, + Power, + Trash, + Code, + ] +); + +#[derive(Clone, Copy, Debug, Default)] +pub struct AppAssets; + +impl AssetSource for AppAssets { + fn load(&self, path: &str) -> Result>> { + match EditorIcons.load(path)? { + Some(bytes) => Ok(Some(bytes)), + None => Assets.load(path), + } + } + + fn list(&self, path: &str) -> Result> { + Assets.list(path) + } +} diff --git a/crates/videode-app/src/brand.rs b/crates/videode-app/src/brand.rs new file mode 100644 index 0000000..68d8d62 --- /dev/null +++ b/crates/videode-app/src/brand.rs @@ -0,0 +1,139 @@ +//! The Merge mark, painted natively so it is crisp at any size and can be +//! animated: two ports (picture, sound) flow down bone wires into one Output +//! node. Geometry matches `assets/brand/videode.svg` on its 1024 grid. + +use gpui_kit::prelude::*; +use gpui_kit::{ + BorderStyle, Bounds, Hsla, PathBuilder, Pixels, Point, Window, canvas, point, px, quad, size, +}; + +use crate::motion::{ease_out, lerp}; +use crate::theme::{Category, CategoryExt, c, hex}; + +/// The glyph's box on the 1024 grid (the mark without its tile). +const GLYPH_X: f32 = 192.; +const GLYPH_Y: f32 = 184.; +const GLYPH_W: f32 = 640.; + +const WIRE: f32 = 64.; +const PORT_R: f32 = 74.; +const PORT_RING: f32 = 44.; + +/// Splash timing, in seconds from launch. +pub const SPLASH_MARK: f32 = 0.7; +pub const SPLASH_WORD: (f32, f32) = (0.45, 0.8); +pub const SPLASH_FADE: (f32, f32) = (1.05, 1.3); + +fn phase(t: f32, start: f32, end: f32) -> f32 { + ease_out(((t - start) / (end - start)).clamp(0., 1.)) +} + +type P = (f32, f32); + +fn mix(a: P, b: P, t: f32) -> P { + (lerp(a.0, b.0, t), lerp(a.1, b.1, t)) +} + +/// The part of a cubic Bézier from 0 to `t`, as a new cubic (de Casteljau). +fn cubic_head(p0: P, p1: P, p2: P, p3: P, t: f32) -> (P, P, P, P) { + let (a, b, c) = (mix(p0, p1, t), mix(p1, p2, t), mix(p2, p3, t)); + let (d, e) = (mix(a, b, t), mix(b, c, t)); + (p0, a, d, mix(d, e, t)) +} + +/// The mark as an element `size` px square. `progress` runs 0→1 through the +/// build: ports pop in, wires draw down, the Output node drops into place. +pub fn mark(size_px: f32, progress: f32) -> impl IntoElement { + canvas( + |_, _, _| (), + move |bounds, _, window, _| paint_mark(window, bounds, progress), + ) + .w(px(size_px)) + .h(px(size_px)) + .flex_none() +} + +fn paint_mark(window: &mut Window, bounds: Bounds, t: f32) { + let k = f32::from(bounds.size.width) / GLYPH_W; + let at = |x: f32, y: f32| -> Point { + point( + bounds.origin.x + px((x - GLYPH_X) * k), + bounds.origin.y + px((y - GLYPH_Y) * k), + ) + }; + let bone = c(hex::BONE); + let circle = + |window: &mut Window, cx: f32, cy: f32, r: f32, fill: Hsla, ring: f32, ring_color: Hsla| { + let o = at(cx - r, cy - r); + window.paint_quad(quad( + Bounds::new(o, size(px(2. * r * k), px(2. * r * k))), + px(r * k), + fill, + px(ring * k), + ring_color, + BorderStyle::Solid, + )); + }; + + let ports = phase(t, 0., 0.35); + let wires = phase(t, 0.2, 0.7); + let node = phase(t, 0.55, 1.); + + // Wires, drawn as polylines up to `wires` along each curve, with round caps. + if wires > 0. { + for side in [300., 724.] { + let curve = ((side, 300.), (side, 520.), (512., 560.), (512., 724.)); + let (p0, c0, c1, end) = cubic_head(curve.0, curve.1, curve.2, curve.3, wires); + let mut path = PathBuilder::stroke(px(WIRE * k)); + path.move_to(at(p0.0, p0.1)); + path.cubic_bezier_to(at(end.0, end.1), at(c0.0, c0.1), at(c1.0, c1.1)); + if let Ok(path) = path.build() { + window.paint_path(path, bone); + } + circle(window, end.0, end.1, WIRE / 2., bone, 0., bone); + } + } + + // Ports scale up from their centres. + if ports > 0. { + let s = ports; + let outer = (PORT_R + PORT_RING / 2.) * s; + for (x, cat) in [(300., Category::Look), (724., Category::Audio)] { + circle( + window, + x, + 300., + outer, + c(hex::PLUGE_BLACK), + PORT_RING * s, + cat.color(), + ); + } + } + + // The Output node drops 40 units into place as it fades in. + if node > 0. { + let dy = lerp(-40., 0., node); + let o = at(402., 648. + dy); + let mut blue = Category::Output.color(); + blue.a = node; + window.paint_quad(quad( + Bounds::new(o, size(px(220. * k), px(152. * k))), + px(34. * k), + blue, + px(0.), + blue, + BorderStyle::Solid, + )); + let mut sheen: Hsla = c(0x6f84e6); + sheen.a = 0.55 * node; + window.paint_quad(quad( + Bounds::new(o, size(px(220. * k), px(26. * k))), + px(13. * k), + sheen, + px(0.), + sheen, + BorderStyle::Solid, + )); + } +} diff --git a/crates/videode-app/src/dialogs.rs b/crates/videode-app/src/dialogs.rs new file mode 100644 index 0000000..144e310 --- /dev/null +++ b/crates/videode-app/src/dialogs.rs @@ -0,0 +1,443 @@ +//! Dialogs over the editor (Settings, About) and the launch splash. + +use std::time::Instant; + +use gpui_kit::prelude::*; +use gpui_kit::{ + AnimationExt as _, AnyElement, Context, FontWeight, MouseButton, SharedString, Window, div, + hsla, px, +}; +use videode_core::Animations; +use videode_core::settings::ZOOM_STEPS; + +use crate::brand::{self, SPLASH_FADE, SPLASH_MARK, SPLASH_WORD}; +use crate::motion::{self, anim, ease_out, hover_fx, key, lerp, switch}; +use crate::settings; +use crate::theme::{self, c, hex}; +use crate::ui::{button, icon_button, kbd, tip}; +use crate::workspace::{Modal, Workspace}; + +/// How long the About mark takes to build. +const ABOUT_BUILD: f32 = 0.7; + +/// Brand surfaces (splash, About) may use this display size; the shell keeps +/// to the two-size rule. +const WORDMARK: f32 = 24.; + +fn segmented( + id: &str, + options: &[(T, &str)], + current: T, + on_pick: impl Fn(T, &mut gpui_kit::App) + Clone + 'static, +) -> impl IntoElement { + div() + .flex() + .flex_none() + .p(px(1.)) + .rounded(px(6.)) + .border_1() + .border_color(c(hex::LINE)) + .bg(c(hex::PLUGE_SUB)) + .children(options.iter().enumerate().map(|(i, &(value, label))| { + let selected = value == current; + let item_id = SharedString::from(format!("{id}-{i}")); + let on_pick = on_pick.clone(); + div() + .id(item_id.clone()) + .h(px(24.)) + .px(px(10.)) + .flex() + .items_center() + .rounded(px(5.)) + .cursor_pointer() + .text_color(c(if selected { hex::INK } else { hex::INK_DIM })) + .when(selected, |d| d.bg(c(hex::PLUGE_CONTROL))) + .map(|d| hover_fx(d, item_id, c(hex::PLUGE_RAISED), px(5.))) + .hover(|s| s.text_color(c(hex::INK))) + .on_click(move |_, _, cx| on_pick(value, cx)) + .child(label.to_string()) + })) +} + +fn setting_row( + title: &'static str, + detail: impl Into, + control: impl IntoElement, +) -> impl IntoElement { + div() + .flex() + .items_start() + .gap(px(16.)) + .py(px(10.)) + .border_b_1() + .border_color(c(hex::LINE)) + .child( + div() + .flex_1() + .min_w_0() + .child(div().font_weight(FontWeight::MEDIUM).child(title)) + .child(div().text_color(c(hex::INK_FAINT)).child(detail.into())), + ) + .child(div().flex_none().pt(px(2.)).child(control)) +} + +fn section_title(text: &'static str) -> impl IntoElement { + div() + .pt(px(14.)) + .pb(px(2.)) + .font_weight(FontWeight::SEMIBOLD) + .text_color(c(hex::INK_DIM)) + .child(text) +} + +impl Workspace { + pub(crate) fn close_modal(&mut self, cx: &mut Context) { + self.modal = None; + cx.notify(); + } + + pub(crate) fn render_modal(&self, modal: Modal, cx: &mut Context) -> AnyElement { + let (panel, width) = match modal { + Modal::Settings => (self.settings_panel(cx), 520.), + Modal::About => (self.about_panel(cx), 380.), + }; + let panel = div() + .id("modal-panel") + .w(px(width)) + .max_h(gpui_kit::relative(0.85)) + .flex() + .flex_col() + .rounded(px(10.)) + .border_1() + .border_color(c(hex::LINE_STRONG)) + .bg(c(hex::PLUGE_RAISED)) + .shadow(vec![gpui_kit::BoxShadow { + color: hsla(0., 0., 0., 0.6), + offset: gpui_kit::point(px(0.), px(18.)), + blur_radius: px(48.), + spread_radius: px(0.), + inset: false, + }]) + // Clicks inside the panel don't reach the backdrop. + .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) + .child(panel) + .with_animation(key("modal", modal as u64), anim(motion::DIALOG), |d, t| { + d.opacity(t).mt(px(lerp(10., 0., t))) + }); + + div() + .id("modal-backdrop") + .absolute() + .top_0() + .left_0() + .size_full() + .flex() + .items_center() + .justify_center() + .occlude() + .bg(hsla(0., 0., 0., 0.5)) + .on_mouse_down( + MouseButton::Left, + cx.listener(|this, _, _, cx| this.close_modal(cx)), + ) + .child(panel) + .with_animation( + key("backdrop", modal as u64), + anim(motion::DIALOG), + |d, t| d.opacity(t), + ) + .into_any_element() + } + + fn dialog_header(&self, title: &'static str, cx: &mut Context) -> impl IntoElement { + div() + .h(px(44.)) + .flex_none() + .flex() + .items_center() + .gap(px(8.)) + .pl(px(16.)) + .pr(px(8.)) + .border_b_1() + .border_color(c(hex::LINE)) + .child( + div() + .flex_1() + .text_size(theme::TITLE) + .font_weight(FontWeight::SEMIBOLD) + .child(title), + ) + .child(kbd("Esc")) + .child( + icon_button("modal-close", "close", false, false) + .tooltip(tip("Close", Some("Esc".into()))) + .on_click(cx.listener(|this, _, _, cx| this.close_modal(cx))), + ) + } + + fn settings_panel(&self, cx: &mut Context) -> AnyElement { + let app = cx.global::(); + let s = app.settings.clone(); + let system = app.system_reduces_motion; + let path = app.path.as_ref().map(|p| p.display().to_string()); + let notes = app.notes.clone(); + + let motion_note = match (s.animations, system) { + (Animations::System, Some(true)) => { + "Your system asks for reduced motion, so animations are off." + } + (Animations::System, Some(false)) => "Your system allows motion, so animations are on.", + (Animations::System, None) => "Couldn't read the system setting, so animations are on.", + (Animations::On, _) => "Animations always play.", + (Animations::Off, _) => "Every change is instant.", + }; + let refresh = cx.entity().downgrade(); + let changed = move |cx: &mut gpui_kit::App| { + refresh.update(cx, |_, cx| cx.notify()).ok(); + }; + + let animations = { + let changed = changed.clone(); + segmented( + "set-anim", + &[ + (Animations::System, "Follow system"), + (Animations::On, "On"), + (Animations::Off, "Off"), + ], + s.animations, + move |a, cx| { + settings::update(cx, |s| s.animations = a); + changed(cx); + }, + ) + }; + let splash = { + let changed = changed.clone(); + switch("set-splash", s.splash).on_click(move |_, _, cx| { + settings::update(cx, |s| s.splash = !s.splash); + changed(cx); + }) + }; + let snap = { + let changed = changed.clone(); + switch("set-snap", s.snap).on_click(move |_, _, cx| { + settings::update(cx, |s| s.snap = !s.snap); + changed(cx); + }) + }; + let zoom = segmented( + "set-zoom", + &[ + (ZOOM_STEPS[0], "1.25×"), + (ZOOM_STEPS[1], "1.4×"), + (ZOOM_STEPS[2], "2×"), + ], + s.zoom_step, + move |z, cx| { + settings::update(cx, |s| s.zoom_step = z); + changed(cx); + }, + ); + + div() + .flex() + .flex_col() + .min_h_0() + .child(self.dialog_header("Settings", cx)) + .child( + div() + .id("settings-body") + .flex_1() + .min_h_0() + .overflow_y_scroll() + .px(px(16.)) + .pb(px(6.)) + .child(section_title("Appearance")) + .child(setting_row("Animations", motion_note, animations)) + .child(setting_row( + "Splash on launch", + "Plays the mark once while the window opens. Any key skips it.", + splash, + )) + .child(section_title("Editing")) + .child(setting_row( + "Snap in new windows", + "Toggle any time with N.", + snap, + )) + .child(setting_row( + "Zoom step", + "How far = and − zoom per press.", + zoom, + )), + ) + .child( + div() + .flex_none() + .flex() + .flex_col() + .gap(px(2.)) + .px(px(16.)) + .py(px(10.)) + .border_t_1() + .border_color(c(hex::LINE)) + .text_color(c(hex::INK_FAINT)) + .child(match path { + Some(p) => div() + .flex() + .gap(px(6.)) + .child("Saved as you change them to") + .child( + div() + .min_w_0() + .font_family(theme::MONO) + .overflow_hidden() + .whitespace_nowrap() + .text_ellipsis() + .child(p), + ), + None => div().child("Settings can't be saved: no config folder was found."), + }) + .children( + notes + .into_iter() + .map(|n| div().text_color(c(hex::WARN)).child(n)), + ), + ) + .into_any_element() + } + + fn about_panel(&self, cx: &mut Context) -> AnyElement { + let progress = self.timed(self.modal_opened, ABOUT_BUILD, cx); + div() + .flex() + .flex_col() + .child(self.dialog_header("About", cx)) + .child( + div() + .flex() + .items_center() + .gap(px(18.)) + .p(px(20.)) + .child(brand::mark(72., progress)) + .child( + div() + .flex() + .flex_col() + .gap(px(2.)) + .child( + div() + .text_size(px(WORDMARK)) + .font_weight(FontWeight::SEMIBOLD) + .line_height(px(30.)) + .child("videode"), + ) + .child( + div() + .text_color(c(hex::INK_DIM)) + .child("A video editor where everything is a node."), + ) + .child( + div() + .font_family(theme::MONO) + .text_color(c(hex::INK_FAINT)) + .child(format!( + "{} · {} {}", + env!("CARGO_PKG_VERSION"), + std::env::consts::OS, + std::env::consts::ARCH + )), + ), + ), + ) + .child( + div() + .flex() + .items_center() + .gap(px(8.)) + .px(px(20.)) + .py(px(12.)) + .border_t_1() + .border_color(c(hex::LINE)) + .text_color(c(hex::INK_FAINT)) + .child( + div() + .flex_1() + .child("Built with GPUI · Geist (OFL) · Lucide (ISC)"), + ) + .child( + button("about-done", None, "Done", false) + .on_click(cx.listener(|this, _, _, cx| this.close_modal(cx))), + ), + ) + .into_any_element() + } + + /// 0→1 over `seconds` since `since`, or 1 straight away without motion. + /// Keeps frames coming while it runs. + fn timed(&self, since: Instant, seconds: f32, cx: &mut Context) -> f32 { + if !settings::motion(cx) { + return 1.; + } + let t = since.elapsed().as_secs_f32() / seconds; + if t < 1. { + cx.notify(); + } + t.min(1.) + } + + pub(crate) fn render_splash( + &mut self, + window: &mut Window, + cx: &mut Context, + ) -> Option { + let started = self.splash?; + let t = started.elapsed().as_secs_f32(); + if t >= SPLASH_FADE.1 || !settings::motion(cx) { + self.splash = None; + return None; + } + window.request_animation_frame(); + let phase = |(a, b): (f32, f32)| ease_out(((t - a) / (b - a)).clamp(0., 1.)); + let word = phase(SPLASH_WORD); + let fade = phase(SPLASH_FADE); + Some( + div() + .id("splash") + .absolute() + .top_0() + .left_0() + .size_full() + .flex() + .items_center() + .justify_center() + .occlude() + .bg(c(hex::PLUGE_SUB)) + .opacity(1. - fade) + .on_mouse_down( + MouseButton::Left, + cx.listener(|this, _, _, cx| { + this.splash = None; + cx.notify(); + }), + ) + .child( + div() + .flex() + .items_center() + .gap(px(16.)) + .child(brand::mark(88., (t / SPLASH_MARK).min(1.))) + .child( + div() + .ml(px(lerp(-8., 0., word))) + .opacity(word) + .text_size(px(WORDMARK * 1.5)) + .font_weight(FontWeight::SEMIBOLD) + .child("videode"), + ), + ) + .into_any_element(), + ) + } +} diff --git a/crates/videode-app/src/graph_view.rs b/crates/videode-app/src/graph_view.rs new file mode 100644 index 0000000..23a5637 --- /dev/null +++ b/crates/videode-app/src/graph_view.rs @@ -0,0 +1,375 @@ +//! The graph view (Shift+Tab): everything in the sequence as one node graph. +//! Drag to pan, scroll to zoom, double-click a clip to cut it in the timeline. + +use gpui_kit::prelude::*; +use gpui_kit::{ + AnyElement, Context, CursorStyle, FontWeight, MouseButton, MouseDownEvent, PathBuilder, + ScrollWheelEvent, SharedString, Window, canvas, div, hsla, point, px, +}; +use videode_core::graph::{GraphRef, NODE_H, NODE_W, layout}; + +use crate::actions::ToggleGraph; +use crate::peek::{card, node_card, port}; +use crate::theme::{self, ALL_CATEGORIES, CategoryExt, c, hex}; +use crate::ui::{ghost_button, icon_button, tip}; +use crate::workspace::{PointerDrag, View, Workspace}; + +const MIN_ZOOM: f32 = 0.3; +const MAX_ZOOM: f32 = 2.; + +impl Workspace { + pub(crate) fn open_graph(&mut self) { + self.peek = None; + self.view = View::Graph; + self.graph.fit_pending = true; + self.say("Graph view · everything in the sequence is a node · Esc returns to the timeline"); + } + + pub(crate) fn close_graph(&mut self) { + self.view = View::Timeline; + self.say("Timeline"); + } + + fn fit_graph(&mut self) { + let b = self.graph.bounds.get(); + let (w, h) = (f32::from(b.size.width), f32::from(b.size.height)); + if w <= 0. { + return; + } + let l = layout(self.project()); + let (aw, ah) = (w - 48., h - 112.); + let z = (aw / l.width).min(ah / l.height).clamp(0.45, 1.15); + self.graph.zoom = z; + self.graph.x = 24. + ((aw - l.width * z) / 2.).max(0.); + self.graph.y = 56. + ((ah - l.height * z) / 2.).max(0.); + self.graph.fit_pending = false; + } + + fn graph_wheel(&mut self, e: &ScrollWheelEvent, cx: &mut Context) { + let b = self.graph.bounds.get(); + let delta = e.delta.pixel_delta(px(20.)); + let (dx, dy) = (f32::from(delta.x), f32::from(delta.y)); + if e.modifiers.shift { + self.graph.x += if dx != 0. { dx } else { dy }; + } else { + let (ax, ay) = ( + f32::from(e.position.x - b.origin.x), + f32::from(e.position.y - b.origin.y), + ); + let z0 = self.graph.zoom; + let z1 = (z0 * (dy * 0.0025).exp()).clamp(MIN_ZOOM, MAX_ZOOM); + self.graph.x = ax - (ax - self.graph.x) * z1 / z0; + self.graph.y = ay - (ay - self.graph.y) * z1 / z0; + self.graph.zoom = z1; + } + cx.notify(); + } + + fn graph_node_click(&mut self, r: GraphRef, cx: &mut Context) { + match r { + GraphRef::ClipNode { clip, node } => { + self.select(Some(clip)); + self.focus_node = Some(node); + } + GraphRef::Output => { + self.inspect_output = true; + } + GraphRef::Sequence => { + self.select(None); + self.inspect_output = false; + } + GraphRef::Track(t) => { + let label = self + .project() + .track(t) + .map(|t| t.label.clone()) + .unwrap_or_default(); + self.say(format!( + "Track {label} · mute, hide and lock it from the timeline header" + )); + } + GraphRef::Composite => { + self.say("Composite stacks the video tracks, top track over bottom") + } + GraphRef::Mix => self.say("Mix sums the audio tracks"), + } + cx.notify(); + } + + /// Back to the timeline with this clip selected, scrolled into view and peeked. + fn graph_open_clip(&mut self, clip: videode_core::ClipId, cx: &mut Context) { + self.view = View::Timeline; + self.select(Some(clip)); + self.reveal_clip(clip); + self.open_peek(); + self.say("Back in the timeline · peeking at the clip you opened"); + cx.notify(); + } + + pub(crate) fn render_graph( + &mut self, + window: &mut Window, + cx: &mut Context, + ) -> impl IntoElement + use<> { + if self.graph.fit_pending { + if f32::from(self.graph.bounds.get().size.width) > 0. { + self.fit_graph(); + } else { + window.request_animation_frame(); + } + } + let l = layout(self.project()); + let (gx, gy, z) = (self.graph.x, self.graph.y, self.graph.zoom); + let p = self.project(); + + // Canvas: dot grid, then wires; it also records the view's bounds. + let bounds_cell = self.graph.bounds.clone(); + let wires: Vec<_> = l.wires().collect(); + let backdrop = canvas( + move |b, _, _| bounds_cell.set(b), + move |b, _, window, _| { + let at = |x: f32, y: f32| { + point(b.origin.x + px(gx + x * z), b.origin.y + px(gy + y * z)) + }; + let step = 24. * z; + if step >= 8. { + let (w, h) = (f32::from(b.size.width), f32::from(b.size.height)); + let mut y = gy.rem_euclid(step); + while y < h { + let mut x = gx.rem_euclid(step); + while x < w { + window.paint_quad(gpui_kit::fill( + gpui_kit::Bounds::new( + point(b.origin.x + px(x), b.origin.y + px(y)), + gpui_kit::size(px(1.5), px(1.5)), + ), + hsla(0., 0., 1., 0.06), + )); + x += step; + } + y += step; + } + } + for ((x1, y1), (x2, y2), bypass) in &wires { + let dx = ((x2 - x1) / 2.).max(30.); + let mut path = PathBuilder::stroke(px((1.5 * z).max(1.))); + if *bypass { + path = path.dash_array(&[px(4.), px(3.)]); + } + path.move_to(at(*x1, *y1)); + path.cubic_bezier_to(at(*x2, *y2), at(x1 + dx, *y1), at(x2 - dx, *y2)); + if let Ok(p) = path.build() { + window.paint_path(p, hsla(0., 0., 0.85, 0.45)); + } + } + }, + ) + .absolute() + .top_0() + .left_0() + .size_full(); + + let mut world: Vec = Vec::new(); + let sx = |x: f32| gx + x * z; + let sy = |y: f32| gy + y * z; + for g in &l.groups { + let Some(clip) = p.clip(g.clip) else { continue }; + let offline = clip + .media + .and_then(|m| p.media(m)) + .is_some_and(|m| m.offline); + let selected = self.selection == Some(clip.id); + let id = clip.id; + world.push( + div() + .id(SharedString::from(format!("group-{}", id.0))) + .absolute() + .left(px(sx(g.x))) + .top(px(sy(g.y))) + .w(px(g.w * z)) + .h(px(g.h * z)) + .rounded(px(8. * z)) + .border_1() + .border_color(c(if selected { + hex::BONE + } else if offline { + hex::WARN + } else { + hex::LINE + })) + .when(offline, |d| d.border_dashed()) + .bg(hsla(0., 0., 0.07, 0.7)) + .px(px(8. * z)) + .pt(px(4. * z)) + .flex() + .gap(px(8. * z)) + .text_size(px(11. * z)) + .whitespace_nowrap() + .overflow_hidden() + .cursor_pointer() + .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) + .on_click(cx.listener(move |this, e: &gpui_kit::ClickEvent, _, cx| { + if e.click_count() >= 2 { + this.graph_open_clip(id, cx); + } else { + this.select(Some(id)); + cx.notify(); + } + })) + .tooltip(tip( + "Click to select · double-click to open in the timeline", + None, + )) + .child( + div() + .font_weight(FontWeight::SEMIBOLD) + .child(p.clip_name(clip)), + ) + .child( + div() + .font_family(theme::MONO) + .text_color(c(hex::INK_FAINT)) + .child(self.tc(clip.start)), + ) + .into_any_element(), + ); + } + for (i, n) in l.graph.nodes.iter().enumerate() { + let (x, y) = l.pos[i]; + let r = n.id; + let focused = match r { + GraphRef::ClipNode { node, .. } => self.focus_node == Some(node), + GraphRef::Output => self.inspect_output, + _ => false, + }; + let (card, generator) = match r { + GraphRef::ClipNode { clip, node } => { + let Some(c) = p.clip(clip) else { continue }; + let Some(node) = c.node(node) else { continue }; + ( + node_card(node, self.node_summary(c, node), focused, z), + node.kind.is_generator(), + ) + } + _ => ( + card( + n.label.clone().into(), + n.summary.clone(), + n.category.color(), + focused, + n.bypass, + z, + ), + false, + ), + }; + if !generator { + world.push(port(sx(x), sy(y + NODE_H / 2.), 8. * z).into_any_element()); + } + if r != GraphRef::Output { + world.push(port(sx(x + NODE_W), sy(y + NODE_H / 2.), 8. * z).into_any_element()); + } + world.push( + card.id(SharedString::from(format!("gnode-{i}"))) + .absolute() + .left(px(sx(x))) + .top(px(sy(y))) + .cursor_pointer() + .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) + .on_click(cx.listener(move |this, _, _, cx| this.graph_node_click(r, cx))) + .into_any_element(), + ); + } + + let hud = div() + .absolute() + .top(px(12.)) + .left(px(12.)) + .flex() + .items_center() + .gap(px(8.)) + .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) + .child( + ghost_button("graph-back", "chevron-left", "Timeline", Some("Esc")) + .border_1() + .border_color(c(hex::LINE_STRONG)) + .bg(c(hex::PLUGE_BLACK)) + .on_click(|_, w, cx| w.dispatch_action(Box::new(ToggleGraph), cx)), + ) + .child( + icon_button("graph-fit", "maximize", false, false) + .tooltip(tip("Fit the graph", None)) + .on_click(cx.listener(|this, _, _, cx| { + this.fit_graph(); + cx.notify(); + })), + ) + .child(div().text_color(c(hex::INK_FAINT)).child( + "Drag to pan · scroll to zoom · double-click a clip to open it in the timeline", + )); + let legend = div() + .absolute() + .bottom(px(12.)) + .left(px(12.)) + .flex() + .gap(px(12.)) + .px(px(10.)) + .py(px(6.)) + .rounded(px(8.)) + .border_1() + .border_color(c(hex::LINE)) + .bg(c(hex::PLUGE_BLACK)) + .text_color(c(hex::INK_DIM)) + .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) + .children(ALL_CATEGORIES.map(|cat| { + div() + .flex() + .items_center() + .gap(px(6.)) + .child(crate::ui::swatch(cat)) + .child(cat.label()) + })); + let zoom = div() + .absolute() + .bottom(px(14.)) + .right(px(14.)) + .font_family(theme::MONO) + .text_color(c(hex::INK_FAINT)) + .child(format!("{:.0}%", z * 100.)); + + div() + .id("graph") + .flex_1() + .min_w_0() + .h_full() + .relative() + .overflow_hidden() + .bg(c(hex::PLUGE_SUB)) + .cursor(if matches!(self.pdrag, Some(PointerDrag::Pan { .. })) { + CursorStyle::ClosedHand + } else { + CursorStyle::Arrow + }) + .on_scroll_wheel( + cx.listener(|this, e: &ScrollWheelEvent, _, cx| this.graph_wheel(e, cx)), + ) + .on_mouse_down( + MouseButton::Left, + cx.listener(|this, e: &MouseDownEvent, window, cx| { + window.focus(&this.focus, cx); + this.pdrag = Some(PointerDrag::Pan { + x0: f32::from(e.position.x), + y0: f32::from(e.position.y), + gx: this.graph.x, + gy: this.graph.y, + }); + cx.notify(); + }), + ) + .child(backdrop) + .children(world) + .child(hud) + .child(legend) + .child(zoom) + } +} diff --git a/crates/videode-app/src/inspector.rs b/crates/videode-app/src/inspector.rs new file mode 100644 index 0000000..7c1b65f --- /dev/null +++ b/crates/videode-app/src/inspector.rs @@ -0,0 +1,1037 @@ +//! The inspector: the selected clip's node chain with every value editable, +//! the Output node, or the sequence. Values can be typed (click the value), +//! scrubbed (drag the label; Shift ×10, Alt ÷10; double-click resets) or +//! stepped with the arrow keys while typing. + +use gpui_kit::component::Sizable as _; +use gpui_kit::component::button::{Button, ButtonCustomVariant, ButtonVariants as _}; +use gpui_kit::component::input::{Escape, Input, InputEvent, InputState, MoveDown, MoveUp}; +use gpui_kit::component::menu::{DropdownMenu as _, PopupMenu, PopupMenuItem}; +use gpui_kit::prelude::*; +use gpui_kit::{ + AnyElement, Context, CursorStyle, FontWeight, MouseButton, MouseDownEvent, SharedString, + WeakEntity, Window, div, px, +}; +use videode_core::{ + Clip, ClipId, ClipKind, Node, NodeId, NodeKind, OutputField, ParamKind, ParamSpec, Value, time, +}; + +use crate::actions::OpenOutput; +use crate::theme::{self, Category, CategoryExt, c, hex}; +use crate::ui::{button, cmd_key, field_row, icon_button, kbd, pane_header, swatch, tip}; +use crate::workspace::{FieldEdit, FieldTarget, PointerDrag, Workspace}; + +const INSPECTOR_W: f32 = 304.; +const LABEL_W: f32 = 96.; + +/// Menu items adding each node that fits `kind` to `clip`. +pub(crate) fn add_node_items( + mut menu: PopupMenu, + clip: ClipId, + kind: ClipKind, + ws: WeakEntity, +) -> PopupMenu { + let mut last = None; + for k in NodeKind::ALL.into_iter().filter(|k| k.applies_to(kind)) { + let cat = k.category(); + if last.is_some_and(|l| l != cat) { + menu = menu.separator(); + } + last = Some(cat); + let ws = ws.clone(); + menu = menu.item( + PopupMenuItem::new(k.name()) + .icon( + gpui_kit::component::Icon::empty() + .path("icons/square.svg") + .text_color(cat.color()), + ) + .on_click(move |_, _, cx| { + ws.update(cx, |ws, cx| ws.add_node(clip, k, cx)).ok(); + }), + ); + } + menu +} + +fn field_box() -> gpui_kit::Div { + div() + .flex_1() + .min_w_0() + .h(px(24.)) + .px(px(7.)) + .flex() + .items_center() + .gap(px(4.)) + .rounded(px(5.)) + .border_1() + .border_color(c(hex::LINE)) + .bg(c(hex::PLUGE_SUB)) + .whitespace_nowrap() + .overflow_hidden() +} + +impl Workspace { + /* ---------- edits ---------- */ + + pub(crate) fn add_node(&mut self, clip: ClipId, kind: NodeKind, cx: &mut Context) { + if let Some(id) = self.apply("add node", cx, |p| p.add_node(clip, kind)) { + self.focus_node = Some(id); + self.say(format!("Added {} · {} to undo", kind.name(), cmd_key("Z"))); + } + } + + pub(crate) fn remove_node(&mut self, clip: ClipId, node: NodeId, cx: &mut Context) { + let name = self.node_name(clip, node); + if self + .apply("remove node", cx, |p| p.remove_node(clip, node)) + .is_some() + { + if self.focus_node == Some(node) { + self.focus_node = None; + } + self.say(format!("Removed {name} · {} to undo", cmd_key("Z"))); + } + } + + pub(crate) fn toggle_bypass(&mut self, clip: ClipId, node: NodeId, cx: &mut Context) { + let Some(bypass) = self + .project() + .clip(clip) + .and_then(|c| c.node(node)) + .map(|n| !n.bypass) + else { + return; + }; + let name = self.node_name(clip, node); + let label = if bypass { "bypass node" } else { "enable node" }; + if self + .apply(label, cx, |p| p.set_bypass(clip, node, bypass)) + .is_some() + { + self.say(format!( + "{name} {}", + if bypass { "bypassed" } else { "enabled" } + )); + } + } + + fn node_name(&self, clip: ClipId, node: NodeId) -> &'static str { + self.project() + .clip(clip) + .and_then(|c| c.node(node)) + .map_or("Node", |n| n.kind.name()) + } + + /// Sets one param. With `coalesce`, repeated calls with the same key + /// (one scrub) make a single undo step. + pub(crate) fn set_param( + &mut self, + clip: ClipId, + node: NodeId, + key: &'static str, + value: Value, + coalesce: Option, + cx: &mut Context, + ) { + let label = self + .project() + .clip(clip) + .and_then(|c| c.node(node)) + .and_then(|n| n.kind.param(key)) + .map_or_else( + || "edit value".to_string(), + |s| format!("edit {}", s.label.to_lowercase()), + ); + let result = match &coalesce { + Some(k) => self + .doc + .edit_coalesced(&label, k, |p| p.set_param(clip, node, key, value)), + None => self + .doc + .edit(&label, |p| p.set_param(clip, node, key, value)), + }; + if let Err(e) = result { + self.say_error(e.to_string()); + } + cx.notify(); + } + + fn param_spec( + &self, + clip: ClipId, + node: NodeId, + key: &str, + ) -> Option<(&'static ParamSpec, Value)> { + let n = self.project().clip(clip)?.node(node)?; + let spec = n.kind.param(key)?; + Some(( + spec, + n.get(key).cloned().unwrap_or_else(|| spec.default_value()), + )) + } + + /* ---------- typing ---------- */ + + pub(crate) fn begin_field( + &mut self, + target: FieldTarget, + text: String, + window: &mut Window, + cx: &mut Context, + ) { + self.commit_field(window, cx); + let input = cx.new(|cx| InputState::new(window, cx).default_value(text)); + input.update(cx, |s, cx| { + s.focus(window, cx); + s.select_all(window, cx); + }); + let subscription = + cx.subscribe_in(&input, window, |this, _, event: &InputEvent, window, cx| { + if matches!(event, InputEvent::PressEnter { .. } | InputEvent::Blur) { + this.commit_field(window, cx); + } + }); + self.field = Some(FieldEdit { + target, + input, + _subscription: subscription, + }); + cx.notify(); + } + + pub(crate) fn commit_field(&mut self, window: &mut Window, cx: &mut Context) { + let Some(f) = self.field.take() else { + return; + }; + let text = f.input.read(cx).value().to_string(); + match f.target { + FieldTarget::Param { clip, node, key } => { + if let Some((spec, current)) = self.param_spec(clip, node, key) { + match spec.parse(&text) { + Some(v) if v != current => self.set_param(clip, node, key, v, None, cx), + Some(_) => {} + None => self.say_error(format!( + "“{}” isn't a valid {}", + text.trim(), + spec.label.to_lowercase() + )), + } + } + } + FieldTarget::Output(field) => { + if self.project().output.get(field) != text.trim() { + let label = format!("set output {}", field.label().to_lowercase()); + self.apply(&label, cx, |p| p.set_output(field, &text)); + } + } + } + window.focus(&self.focus, cx); + cx.notify(); + } + + fn cancel_field(&mut self, window: &mut Window, cx: &mut Context) { + self.field = None; + window.focus(&self.focus, cx); + cx.notify(); + } + + /// Arrow keys while typing a number: step the value and keep typing. + fn step_field(&mut self, dir: f64, big: bool, window: &mut Window, cx: &mut Context) { + let Some(f) = &self.field else { + return; + }; + let FieldTarget::Param { clip, node, key } = f.target else { + return; + }; + let Some((spec, current)) = self.param_spec(clip, node, key) else { + return; + }; + let typed = spec.parse(&f.input.read(cx).value()).unwrap_or(current); + let Some(next) = spec.nudge(&typed, dir * if big { 10. } else { 1. }) else { + return; + }; + let text = number_text(spec, &next); + let input = f.input.clone(); + self.set_param( + clip, + node, + key, + next, + Some(format!("step-{}-{key}", node.0)), + cx, + ); + input.update(cx, |s, cx| { + s.set_value(text, window, cx); + s.select_all(window, cx); + }); + } + + /* ---------- scrubbing ---------- */ + + pub(crate) fn scrub_to(&mut self, x: f32, shift: bool, alt: bool, cx: &mut Context) { + let Some(PointerDrag::Scrub { + clip, + node, + key, + x0, + v0, + }) = self.pdrag + else { + return; + }; + let Some((spec, _)) = self.param_spec(clip, node, key) else { + return; + }; + let rate = if shift { + 10. + } else if alt { + 0.1 + } else { + 1. + }; + let steps = (((x - x0) / 2.) * rate).round() as f64; + if let Some(v) = spec.nudge(&Value::Number(v0), steps) { + let key_id = format!("scrub-{}-{key}-{x0}", node.0); + self.set_param(clip, node, key, v, Some(key_id), cx); + } + } + + fn label_down( + &mut self, + clip: ClipId, + node: NodeId, + key: &'static str, + e: &MouseDownEvent, + window: &mut Window, + cx: &mut Context, + ) { + let Some((spec, value)) = self.param_spec(clip, node, key) else { + return; + }; + self.commit_field(window, cx); + if e.click_count >= 2 { + self.pdrag = None; + self.set_param(clip, node, key, spec.default_value(), None, cx); + self.say(format!("Reset {}", spec.label.to_lowercase())); + return; + } + if let Value::Number(v0) = value { + self.pdrag = Some(PointerDrag::Scrub { + clip, + node, + key, + x0: f32::from(e.position.x), + v0, + }); + } + cx.notify(); + } + + /* ---------- rendering ---------- */ + + pub(crate) fn render_inspector(&self, cx: &mut Context) -> impl IntoElement + use<> { + let body = if self.inspect_output { + self.output_inspector(cx) + } else { + match self.selection.and_then(|id| self.project().clip(id)) { + Some(clip) => self.clip_inspector(clip, cx), + None => self.sequence_inspector(), + } + }; + div() + .w(px(INSPECTOR_W)) + .h_full() + .flex_none() + .flex() + .flex_col() + .bg(c(hex::PLUGE_BLACK)) + .border_l_1() + .border_color(c(hex::LINE)) + .child( + pane_header().child( + div() + .h(px(24.)) + .px(px(9.)) + .flex() + .items_center() + .rounded(px(5.)) + .bg(c(hex::PLUGE_CONTROL)) + .font_weight(FontWeight::MEDIUM) + .child("Inspector"), + ), + ) + .child( + div() + .id("inspector-body") + .flex_1() + .min_h_0() + .overflow_y_scroll() + .child(body), + ) + } + + fn sequence_inspector(&self) -> AnyElement { + let p = self.project(); + let seq = &p.sequence; + let o = &p.output; + let hint = |text: &'static str, key: SharedString| { + div() + .flex() + .items_center() + .justify_between() + .gap(px(8.)) + .child(text) + .child(kbd(key)) + }; + let clips = seq.clips.len(); + div() + .child(title_block( + format!("{} Sequence", seq.name), + if clips == 0 { + "Sequence node · empty".into() + } else { + format!("Sequence node · {clips} clips · {} nodes", p.node_count()) + }, + None, + )) + .child(section_shell( + Category::Composite, + "Sequence", + false, + false, + div(), + vec![ + field_row( + "Resolution", + format!("{} × {}", seq.width, seq.height), + true, + ), + field_row("Frame rate", seq.fps.to_string(), true), + field_row("Duration", self.tc(p.end()), true), + field_row("Color space", "Rec.709 · gamma 2.4", false), + ] + .into_iter() + .map(IntoElement::into_any_element) + .collect(), + )) + .child(section_shell( + Category::Output, + "Output", + false, + false, + button("open-output", None, "Open", false) + .h(px(22.)) + .on_click(|_, w, cx| w.dispatch_action(Box::new(OpenOutput), cx)), + vec![ + div() + .text_color(c(hex::INK_DIM)) + .child(format!("{} · {} · {}", o.container, o.codec, o.resolution)) + .into_any_element(), + ], + )) + .child( + div() + .flex() + .flex_col() + .gap(px(8.)) + .px(px(12.)) + .py(px(14.)) + .text_color(c(hex::INK_DIM)) + .child(hint("Select a clip to see its nodes", "click".into())) + .child(hint("Peek inside the selected clip", "Tab".into())) + .child(hint("See the whole sequence as a graph", "⇧ Tab".into())) + .child(hint("Find any action", cmd_key("K"))), + ) + .into_any_element() + } + + fn clip_inspector(&self, clip: &Clip, cx: &mut Context) -> AnyElement { + let p = self.project(); + let fps = p.sequence.fps; + let track = p + .track(clip.track) + .map(|t| format!("{} {}", t.label, t.name)) + .unwrap_or_default(); + let strip = div() + .mt(px(8.)) + .h(px(4.)) + .flex() + .gap(px(1.)) + .children(clip.nodes.iter().map(|n| { + div() + .flex_1() + .h_full() + .bg(n.kind.category().color()) + .when(n.bypass, |d| d.opacity(0.25)) + })); + let mut root = div().child(title_block( + p.clip_name(clip), + format!( + "{track} · {}–{} · {} nodes", + time::timecode_short(clip.start, fps), + time::timecode_short(clip.end(), fps), + clip.nodes.len() + ), + Some(strip.into_any_element()), + )); + for node in &clip.nodes { + root = root.child(self.node_section(clip, node, cx)); + } + let ws = cx.entity().downgrade(); + let (id, kind) = (clip.id, clip.kind); + root.child( + div().p(px(12.)).child( + Button::new("add-node") + .label("Add node") + .icon(gpui_kit::component::IconName::Plus) + .outline() + .small() + .w_full() + .dropdown_menu(move |menu, _, _| { + add_node_items(menu.min_w(px(200.)), id, kind, ws.clone()) + }), + ), + ) + .child( + div() + .px(px(12.)) + .pb(px(14.)) + .text_color(c(hex::INK_FAINT)) + .child("Drag a label to scrub · Shift ×10 · Alt ÷10 · double-click resets"), + ) + .into_any_element() + } + + fn node_section(&self, clip: &Clip, node: &Node, cx: &mut Context) -> AnyElement { + let (clip_id, node_id) = (clip.id, node.id); + let focused = self.focus_node == Some(node.id); + let fixed = node.kind.is_generator(); + let actions = div().flex().when(!fixed, |d| { + d.child( + icon_button( + SharedString::from(format!("bypass-{}", node_id.0)), + "power", + node.bypass, + false, + ) + .tooltip(tip( + if node.bypass { + "Enable node" + } else { + "Bypass node" + }, + Some("⇧ B".into()), + )) + .on_click( + cx.listener(move |this, _, _, cx| this.toggle_bypass(clip_id, node_id, cx)), + ), + ) + .child( + icon_button( + SharedString::from(format!("remove-{}", node_id.0)), + "trash", + false, + false, + ) + .tooltip(tip("Remove node", Some("Del".into()))) + .on_click( + cx.listener(move |this, _, _, cx| this.remove_node(clip_id, node_id, cx)), + ), + ) + }); + + let mut rows: Vec = Vec::new(); + if node.kind == NodeKind::Source { + let p = self.project(); + let fps = p.sequence.fps; + if let Some(m) = clip.media.and_then(|m| p.media(m)) { + rows.push(field_row("File", m.file_name(), true).into_any_element()); + rows.push( + field_row("Format", format!("{} · {}", m.codec, m.format), true) + .into_any_element(), + ); + rows.push( + field_row("In", time::timecode(clip.source_in, fps), true).into_any_element(), + ); + rows.push( + field_row( + "Out", + time::timecode(clip.source_in + clip.duration, fps), + true, + ) + .into_any_element(), + ); + if m.offline { + rows.push( + div() + .text_color(c(hex::WARN)) + .child("File not found · relinking arrives with media import (M3)") + .into_any_element(), + ); + } + } + } + for spec in node.kind.params() { + rows.push(self.param_row(clip_id, node, spec, cx)); + } + + let header_name = div() + .id(SharedString::from(format!("node-name-{}", node_id.0))) + .cursor_pointer() + .font_weight(FontWeight::SEMIBOLD) + .when(node.bypass, |d| d.line_through()) + .on_click(cx.listener(move |this, _, _, cx| { + this.focus_node = Some(node_id); + cx.notify(); + })) + .child(node.kind.name()); + section_shell( + node.kind.category(), + "", + node.bypass, + focused, + actions, + rows, + ) + .child_header_name(header_name) + } + + fn param_row( + &self, + clip: ClipId, + node: &Node, + spec: &'static ParamSpec, + cx: &mut Context, + ) -> AnyElement { + let node_id = node.id; + let key = spec.key; + let value = node + .get(key) + .cloned() + .unwrap_or_else(|| spec.default_value()); + let changed = !spec.is_default(&value); + let target = FieldTarget::Param { + clip, + node: node_id, + key, + }; + let is_number = matches!(spec.kind, ParamKind::Number { .. }); + + let label = div() + .id(SharedString::from(format!("lbl-{}-{key}", node_id.0))) + .w(px(LABEL_W)) + .flex_none() + .text_color(c(hex::INK_DIM)) + .whitespace_nowrap() + .overflow_hidden() + .text_ellipsis() + .when(is_number, |d| { + d.cursor(CursorStyle::ResizeLeftRight) + .hover(|s| s.text_color(c(hex::INK))) + .tooltip(tip( + "Drag to scrub · Shift ×10 · Alt ÷10 · double-click to reset", + None, + )) + .on_mouse_down( + MouseButton::Left, + cx.listener(move |this, e: &MouseDownEvent, window, cx| { + this.label_down(clip, node_id, key, e, window, cx) + }), + ) + }) + .child(spec.label); + + let field: AnyElement = match spec.kind { + ParamKind::Choice { options, .. } => { + let current = value.as_text().unwrap_or_default().to_string(); + let ws = cx.entity().downgrade(); + div() + .flex_1() + .min_w_0() + .child( + choice_button( + SharedString::from(format!("choice-{}-{key}", node_id.0)), + current.clone(), + changed, + cx, + ) + .dropdown_menu(move |mut menu, _, _| { + for &o in options { + let ws = ws.clone(); + menu = menu.item( + PopupMenuItem::new(o).checked(o == current).on_click( + move |_, _, cx| { + ws.update(cx, |ws, cx| { + ws.set_param( + clip, + node_id, + key, + Value::Text(o.into()), + None, + cx, + ) + }) + .ok(); + }, + ), + ); + } + menu + }), + ) + .into_any_element() + } + _ => self.text_field( + target, + FieldLook { + shown: spec_display(spec, &value), + edit: number_text(spec, &value), + unit: spec.unit, + changed, + number: is_number, + }, + cx, + ), + }; + + div() + .flex() + .items_center() + .gap(px(8.)) + .min_h(px(28.)) + .child(label) + .child(field) + .into_any_element() + } + + /// A value shown as text; click to type. While typing, Enter commits, + /// Esc cancels and (for numbers) ↑/↓ step. + fn text_field( + &self, + target: FieldTarget, + look: FieldLook, + cx: &mut Context, + ) -> AnyElement { + let FieldLook { + shown, + edit: edit_text, + unit, + changed, + number, + } = look; + if let Some(f) = self.field.as_ref().filter(|f| f.target == target) { + return field_box() + .border_color(c(hex::BONE)) + .key_context("ParamField") + .capture_action(cx.listener(|this, _: &Escape, window, cx| { + cx.stop_propagation(); + this.cancel_field(window, cx); + })) + .when(number, |d| { + d.capture_action(cx.listener(|this, _: &MoveUp, window, cx| { + cx.stop_propagation(); + let big = window.modifiers().shift; + this.step_field(1., big, window, cx); + })) + .capture_action(cx.listener( + |this, _: &MoveDown, window, cx| { + cx.stop_propagation(); + let big = window.modifiers().shift; + this.step_field(-1., big, window, cx); + }, + )) + }) + .when(number, |d| d.font_family(theme::MONO)) + .child( + div() + .flex_1() + .min_w_0() + .child(Input::new(&f.input).appearance(false).small()), + ) + .when(!unit.is_empty(), |d| { + d.child(div().flex_none().text_color(c(hex::INK_FAINT)).child(unit)) + }) + .into_any_element(); + } + let id = match target { + FieldTarget::Param { node, key, .. } => format!("val-{}-{key}", node.0), + FieldTarget::Output(f) => format!("out-{f:?}"), + }; + div() + .id(SharedString::from(id)) + .flex_1() + .min_w_0() + .cursor(CursorStyle::IBeam) + .on_click(cx.listener(move |this, _, window, cx| { + this.begin_field(target, edit_text.clone(), window, cx) + })) + .child( + field_box() + .hover(|s| s.border_color(c(hex::LINE_STRONG))) + .when(number, |d| d.font_family(theme::MONO)) + .child( + div() + .flex_1() + .min_w_0() + .overflow_hidden() + .text_ellipsis() + .text_color(c(if changed { hex::INK } else { hex::INK_DIM })) + .child(shown), + ) + .when(!unit.is_empty(), |d| { + d.child(div().flex_none().text_color(c(hex::INK_FAINT)).child(unit)) + }), + ) + .into_any_element() + } + + fn output_inspector(&self, cx: &mut Context) -> AnyElement { + let o = self.project().output.clone(); + let mut rows: Vec = Vec::new(); + for field in OutputField::ALL { + let value = o.get(field).to_string(); + let label = div() + .w(px(LABEL_W)) + .flex_none() + .text_color(c(hex::INK_DIM)) + .child(field.label()); + let control: AnyElement = if field.options().is_empty() { + self.text_field( + FieldTarget::Output(field), + FieldLook { + shown: value.clone(), + edit: value, + unit: "", + changed: true, + number: false, + }, + cx, + ) + } else { + let ws = cx.entity().downgrade(); + let current = value.clone(); + div() + .flex_1() + .min_w_0() + .child( + choice_button( + SharedString::from(format!("out-{field:?}")), + value, + true, + cx, + ) + .dropdown_menu(move |mut menu, _, _| { + for &opt in field.options() { + let ws = ws.clone(); + menu = menu.item( + PopupMenuItem::new(opt).checked(opt == current).on_click( + move |_, _, cx| { + ws.update(cx, |ws, cx| { + let label = format!( + "set output {}", + field.label().to_lowercase() + ); + ws.apply(&label, cx, |p| p.set_output(field, opt)); + }) + .ok(); + }, + ), + ); + } + menu + }), + ) + .into_any_element() + }; + rows.push( + div() + .flex() + .items_center() + .gap(px(8.)) + .min_h(px(28.)) + .child(label) + .child(control) + .into_any_element(), + ); + } + let close = icon_button("close-output", "close", false, false) + .tooltip(tip("Back to the selection", Some("Esc".into()))) + .on_click(cx.listener(|this, _, _, cx| { + this.inspect_output = false; + cx.notify(); + })); + div() + .child(title_block( + "Output".into(), + format!("Output node · renders {} Sequence to a file", self.project().sequence.name), + None, + )) + .child(section_shell(Category::Output, "Export", false, false, close, rows)) + .child( + div() + .flex() + .flex_col() + .gap(px(8.)) + .p(px(12.)) + .text_color(c(hex::INK_DIM)) + .child(format!("Range: whole sequence · {}", self.tc(self.project().end()))) + .child( + button("render", Some("upload"), "Render", true) + .justify_center() + .on_click(cx.listener(|this, _, _, cx| { + this.say("Rendering arrives with export (M5) · these settings are saved with the project"); + cx.notify(); + })), + ), + ) + .into_any_element() + } +} + +/// How a typed field looks when it isn't being edited, and what typing +/// starts from. +struct FieldLook { + shown: String, + edit: String, + unit: &'static str, + changed: bool, + number: bool, +} + +/// The display text of a value, without its unit (shown separately). +fn spec_display(spec: &ParamSpec, value: &Value) -> String { + let s = spec.format(value); + s.strip_suffix(spec.unit) + .map(|t| t.trim_end().to_string()) + .unwrap_or(s) +} + +/// The text placed in the box when typing starts: plain ASCII digits. +pub(crate) fn number_text(spec: &ParamSpec, value: &Value) -> String { + match (spec.kind, value) { + (ParamKind::Number { decimals, .. }, Value::Number(n)) => { + format!("{:.*}", decimals as usize, n) + } + (_, Value::Text(t)) => t.clone(), + (_, Value::Number(n)) => n.to_string(), + } +} + +fn choice_button(id: SharedString, label: String, changed: bool, cx: &mut gpui_kit::App) -> Button { + let variant = ButtonCustomVariant::new(cx) + .color(c(hex::PLUGE_SUB)) + .foreground(c(if changed { hex::INK } else { hex::INK_DIM })) + .hover(c(hex::PLUGE_RAISED)) + .active(c(hex::PLUGE_CONTROL)); + Button::new(id) + .custom(variant) + .label(label) + .dropdown_caret(true) + .small() + .border_1() + .border_color(c(hex::LINE)) + .w_full() + .justify_between() +} + +fn title_block(title: String, subtitle: String, extra: Option) -> impl IntoElement { + div() + .px(px(12.)) + .pt(px(12.)) + .pb(px(10.)) + .border_b_1() + .border_color(c(hex::LINE)) + .child( + div() + .text_size(theme::TITLE) + .font_weight(FontWeight::SEMIBOLD) + .whitespace_nowrap() + .overflow_hidden() + .text_ellipsis() + .child(title), + ) + .child(div().text_color(c(hex::INK_DIM)).child(subtitle)) + .children(extra) +} + +/// A node section: swatch, name, actions on the right, then rows. Bypassed +/// sections are dashed and dimmed; the focused one is raised. +struct Section { + cat: Category, + title: &'static str, + name: Option, + bypass: bool, + focused: bool, + actions: AnyElement, + rows: Vec, +} + +fn section_shell( + cat: Category, + title: &'static str, + bypass: bool, + focused: bool, + actions: impl IntoElement, + rows: Vec, +) -> Section { + Section { + cat, + title, + name: None, + bypass, + focused, + actions: actions.into_any_element(), + rows, + } +} + +impl Section { + fn child_header_name(mut self, name: impl IntoElement) -> AnyElement { + self.name = Some(name.into_any_element()); + self.into_any_element() + } +} + +impl IntoElement for Section { + type Element = AnyElement; + + fn into_element(self) -> Self::Element { + let name = self.name.unwrap_or_else(|| { + div() + .font_weight(FontWeight::SEMIBOLD) + .child(self.title) + .into_any_element() + }); + div() + .border_b_1() + .border_color(c(hex::LINE)) + .when(self.focused, |d| d.bg(c(hex::PLUGE_RAISED))) + .child( + div() + .h(px(34.)) + .flex() + .items_center() + .gap(px(7.)) + .pl(px(12.)) + .pr(px(6.)) + .child(swatch(self.cat).when(self.bypass, |d| d.opacity(0.3))) + .child(name) + .when(self.bypass, |d| { + d.child(div().text_color(c(hex::INK_FAINT)).child("bypassed")) + }) + .child(div().flex_1()) + .child(self.actions), + ) + .when(!self.rows.is_empty(), |d| { + d.child( + div() + .px(px(12.)) + .pb(px(10.)) + .when(self.bypass, |d| d.opacity(0.55)) + .children(self.rows), + ) + }) + .into_any_element() + } +} diff --git a/crates/videode-app/src/lib.rs b/crates/videode-app/src/lib.rs new file mode 100644 index 0000000..c3594aa --- /dev/null +++ b/crates/videode-app/src/lib.rs @@ -0,0 +1,91 @@ +//! The videode desktop application: window, theme, actions and the editor. + +pub mod actions; +pub mod assets; +mod brand; +mod dialogs; +mod graph_view; +mod inspector; +mod media; +mod motion; +mod palette; +mod panels; +mod peek; +pub mod settings; +#[cfg(test)] +mod tests; +pub mod theme; +mod timeline; +mod ui; +pub mod workspace; + +use std::borrow::Cow; + +use gpui_kit::{ + App, AppContext as _, Bounds, Result, TitlebarOptions, WindowBounds, WindowOptions, px, size, +}; + +use crate::workspace::Workspace; + +const FONTS: [&[u8]; 6] = [ + include_bytes!("../../../assets/fonts/Geist-Regular.ttf"), + include_bytes!("../../../assets/fonts/Geist-Medium.ttf"), + include_bytes!("../../../assets/fonts/Geist-SemiBold.ttf"), + include_bytes!("../../../assets/fonts/GeistMono-Regular.ttf"), + include_bytes!("../../../assets/fonts/GeistMono-Medium.ttf"), + include_bytes!("../../../assets/fonts/GeistMono-SemiBold.ttf"), +]; + +/// Matches the Linux .desktop file and icon names in packaging/linux. +pub const APP_ID: &str = "dev.videode.videode"; + +/// The window icon (used on X11; other platforms take it from the bundle). +fn window_icon() -> Option> { + let png = include_bytes!("../../../assets/brand/png/videode-256.png"); + image::load_from_memory_with_format(png, image::ImageFormat::Png) + .ok() + .map(|i| std::sync::Arc::new(i.into_rgba8())) +} + +/// Registers bundled fonts, GPUI Kit components and the videode theme. +/// Must run before any window opens. +pub fn init(cx: &mut App) { + let fonts = FONTS.iter().map(|bytes| Cow::Borrowed(*bytes)).collect(); + if let Err(error) = cx.text_system().add_fonts(fonts) { + eprintln!("videode: failed to load bundled fonts: {error:#}"); + } + gpui_kit::init(cx); + theme::apply(cx); + settings::init(cx); + media::init(cx); + actions::bind_keys(cx); +} + +pub fn main_window_options(cx: &App) -> WindowOptions { + WindowOptions { + window_bounds: Some(WindowBounds::Windowed(Bounds::centered( + None, + size(px(1440.), px(900.)), + cx, + ))), + titlebar: Some(TitlebarOptions { + title: Some("videode".into()), + ..Default::default() + }), + window_min_size: Some(size(px(1024.), px(640.))), + app_id: Some(APP_ID.into()), + icon: window_icon(), + ..Default::default() + } +} + +pub fn open_main_window(cx: &mut App) -> Result<()> { + gpui_kit::open_window(main_window_options(cx), cx, |window, cx| { + cx.new(|cx| { + let mut ws = Workspace::new(window, cx); + ws.start_splash(cx); + ws + }) + })?; + Ok(()) +} diff --git a/crates/videode-app/src/main.rs b/crates/videode-app/src/main.rs new file mode 100644 index 0000000..7dc46ab --- /dev/null +++ b/crates/videode-app/src/main.rs @@ -0,0 +1,9 @@ +fn main() { + gpui_kit::application() + .with_assets(videode_app::assets::AppAssets) + .run(|cx| { + videode_app::init(cx); + videode_app::open_main_window(cx).expect("failed to open the videode window"); + cx.activate(true); + }); +} diff --git a/crates/videode-app/src/media.rs b/crates/videode-app/src/media.rs new file mode 100644 index 0000000..66ebf1d --- /dev/null +++ b/crates/videode-app/src/media.rs @@ -0,0 +1,424 @@ +//! Media in the app: importing files, generating the demo footage, bin +//! thumbnails, and the frame the viewer shows. Decoding happens on the +//! `videode_media` pool's threads; results come back as GPUI images. +//! +//! GPUI keeps every image it has drawn in its texture atlas until told to +//! drop it, so the viewer drops each frame it replaces. + +use std::collections::HashMap; +use std::hash::{DefaultHasher, Hash, Hasher}; +use std::path::{Path, PathBuf}; +use std::sync::Arc; + +use gpui_kit::{App, Context, Global, PathPromptOptions, RenderImage, Window}; +use videode_core::{Media, MediaKind, Project}; +use videode_media::{FramePool, FrameRequest, Kind, MediaError, Picture, demo}; + +use crate::actions::ImportMedia; +use crate::workspace::{BinTab, View, Workspace}; + +pub const THUMB_W: u32 = 160; +pub const THUMB_H: u32 = 90; +/// Viewer frames are decoded no larger than this. +const VIEWER_MAX: (u32, u32) = (1920, 1080); +const VIEWER_SLOT: u64 = 1; + +pub enum Thumb { + Loading, + Ready(Arc), + Failed, +} + +pub struct MediaEngine { + pub pool: FramePool, + pub thumbs: HashMap, + /// Demo footage is being generated. + pub generating: bool, +} + +impl Global for MediaEngine {} + +pub fn init(cx: &mut App) { + cx.set_global(MediaEngine { + // Three decoders and 384 MB of decoded frames. + pool: FramePool::new(3, 384), + thumbs: HashMap::new(), + generating: false, + }); +} + +/// Where the demo project's `media/` folder lives. +pub fn demo_root() -> PathBuf { + dirs::data_dir() + .unwrap_or_else(std::env::temp_dir) + .join("videode") + .join("demo") +} + +/// A decoded picture as a GPUI image. Both are BGRA, so no conversion. +pub fn render_image(p: &Picture) -> Arc { + let buffer = image::RgbaImage::from_raw(p.width, p.height, p.bgra.clone()) + .expect("picture buffer matches its size"); + Arc::new(RenderImage::new(vec![image::Frame::new(buffer)])) +} + +/// What the viewer wants on screen: a file, a time in it, and a size. +#[derive(Clone, Debug, PartialEq)] +pub struct FrameKey { + pub path: PathBuf, + /// Milliseconds into the file. + pub ms: i64, + pub w: u32, + pub h: u32, +} + +pub struct ViewerFrame { + pub key: FrameKey, + pub image: Arc, +} + +fn slot_for(path: &Path) -> u64 { + let mut h = DefaultHasher::new(); + path.hash(&mut h); + h.finish() | 1 << 63 +} + +impl Workspace { + /// A media file's location on disk: absolute paths as written, relative + /// ones against the project's folder. + pub(crate) fn media_path(&self, m: &Media) -> PathBuf { + if m.path.is_absolute() { + m.path.clone() + } else { + self.media_root.join(&m.path) + } + } + + /// Marks missing files offline and reports how many are. + pub(crate) fn refresh_media(&mut self) -> usize { + let root = self.media_root.clone(); + self.doc.refresh_offline(|m| { + let path = if m.path.is_absolute() { + m.path.clone() + } else { + root.join(&m.path) + }; + !path.exists() + }) + } + + /// Before saving to `dir`, rewrites relative media paths that wouldn't + /// resolve from there as absolute ones. + pub(crate) fn rebase_media(&mut self, dir: &Path) { + if dir == self.media_root { + return; + } + let root = self.media_root.clone(); + self.doc.rebase_media(|m| { + if m.path.is_relative() { + m.path = root.join(&m.path); + } + }); + self.media_root = dir.to_path_buf(); + } + + /// Opens the demo, generating its footage first if it's missing. + pub(crate) fn prepare_demo_media(&mut self, window: &mut Window, cx: &mut Context) { + let dir = self.media_root.join("media"); + let missing = demo::missing_demo_media(&dir); + if missing.is_empty() { + let offline = self.refresh_media(); + self.say(format!( + "Opened the Signal Study demo · {offline} file offline on purpose, to show how missing media looks" + )); + return; + } + self.refresh_media(); + if !demo::ffmpeg_cli_available() { + self.say_error("The demo's footage is generated with the ffmpeg command-line tool, which isn't installed"); + return; + } + if cx.global::().generating { + return; + } + cx.global_mut::().generating = true; + self.say(format!( + "Making the demo footage ({} files, about 10 s)…", + missing.len() + )); + let job = cx + .background_executor() + .spawn(async move { demo::generate_demo_media(&dir, |_, _| {}) }); + cx.spawn_in(window, async move |this, cx| { + let result = job.await; + this.update(cx, |ws, cx| { + cx.global_mut::().generating = false; + let offline = ws.refresh_media(); + match result { + Ok(()) => ws.say(format!( + "Demo footage ready · {offline} file offline on purpose" + )), + Err(e) => ws.say_error(format!("Couldn't make the demo footage: {e}")), + } + cx.notify(); + }) + .ok(); + }) + .detach(); + } + + /* ---------- import ---------- */ + + pub(crate) fn import_media(&mut self, _: &ImportMedia, _: &mut Window, cx: &mut Context) { + let paths = cx.prompt_for_paths(PathPromptOptions { + files: true, + directories: false, + multiple: true, + prompt: Some("Import".into()), + }); + cx.spawn(async move |this, cx| { + let Ok(Ok(Some(paths))) = paths.await else { + return; + }; + this.update(cx, |ws, cx| ws.import_paths(paths, cx)).ok(); + }) + .detach(); + } + + /// Probes files in the background, then adds the readable ones to the + /// bin as one undoable step. + pub(crate) fn import_paths(&mut self, paths: Vec, cx: &mut Context) { + if paths.is_empty() { + return; + } + self.say(format!( + "Importing {} file{}…", + paths.len(), + if paths.len() == 1 { "" } else { "s" } + )); + cx.notify(); + let probes = cx.background_executor().spawn(async move { + paths + .into_iter() + .map(|p| { + let r = videode_media::probe(&p); + (p, r) + }) + .collect::>() + }); + cx.spawn(async move |this, cx| { + let results = probes.await; + this.update(cx, |ws, cx| ws.finish_import(results, cx)).ok(); + }) + .detach(); + } + + fn finish_import( + &mut self, + results: Vec<( + PathBuf, + Result, + )>, + cx: &mut Context, + ) { + let fps = self.fps(); + let mut failed = Vec::new(); + let mut ok = Vec::new(); + for (path, r) in results { + match r { + Ok(p) => ok.push((path, p)), + Err(e) => failed.push(format!( + "{}: {e}", + path.file_name().unwrap_or_default().to_string_lossy() + )), + } + } + let existing: Vec = self + .project() + .media + .iter() + .map(|m| self.media_path(m)) + .collect(); + ok.retain(|(path, _)| !existing.contains(path)); + let added = ok.len(); + if added > 0 { + self.apply("import media", cx, |p: &mut Project| { + for (path, probe) in &ok { + let kind = match probe.kind { + Kind::Video => MediaKind::Video, + Kind::Audio => MediaKind::Audio, + Kind::Image => MediaKind::Image, + }; + let duration = probe.duration.map(|d| fps.seconds_to_frames(d).max(1)); + p.add_media( + path.clone(), + kind, + duration, + probe.codec.clone(), + probe.format_text(), + ); + } + Ok(()) + }); + self.bin_tab = BinTab::Media; + } + match (added, failed.len()) { + (0, 0) => self.say("Already in the bin"), + (n, 0) => self.say(format!( + "Imported {n} file{} · double-click one to add it at the playhead", + if n == 1 { "" } else { "s" } + )), + (0, _) => self.say_error(format!("Couldn't import {}", failed.join(" · "))), + (n, _) => self.say_error(format!( + "Imported {n}; couldn't import {}", + failed.join(" · ") + )), + } + cx.notify(); + } + + /* ---------- thumbnails ---------- */ + + /// The bin thumbnail for `m`, starting a decode the first time. + pub(crate) fn thumbnail(&self, m: &Media, cx: &mut Context) -> Option> { + if m.offline || m.kind == MediaKind::Audio { + return None; + } + let path = self.media_path(m); + match cx.global::().thumbs.get(&path) { + Some(Thumb::Ready(img)) => return Some(img.clone()), + Some(_) => return None, + None => {} + } + let secs = m + .duration + .map_or(0., |d| (self.fps().frames_to_seconds(d) * 0.1).min(2.)); + let engine = cx.global_mut::(); + engine.thumbs.insert(path.clone(), Thumb::Loading); + let rx = engine.pool.request(FrameRequest { + path: path.clone(), + time: secs, + max_w: THUMB_W, + max_h: THUMB_H, + slot: slot_for(&path), + }); + cx.spawn(async move |this, cx| { + let thumb = match rx.await { + Ok(Ok(p)) => Thumb::Ready(render_image(&p)), + _ => Thumb::Failed, + }; + this.update(cx, |_, cx| { + cx.global_mut::().thumbs.insert(path, thumb); + cx.notify(); + }) + .ok(); + }) + .detach(); + None + } + + /* ---------- viewer ---------- */ + + /// The frame the viewer should show now, if any: the topmost enabled + /// media clip on a video track at the playhead. + pub(crate) fn wanted_frame(&self, window: &Window) -> Option { + let clip = self.picture_clip()?; + let p = self.project(); + let m = clip.media.and_then(|id| p.media(id))?; + if m.offline { + return None; + } + let secs = match m.kind { + MediaKind::Image => 0., + _ => self + .fps() + .frames_to_seconds(clip.source_in + (self.playhead - clip.start)), + }; + let b = self.viewer_bounds.get(); + let scale = window.scale_factor(); + let w = ((f32::from(b.size.width) * scale) as u32).clamp(64, VIEWER_MAX.0); + let h = ((f32::from(b.size.height) * scale) as u32).clamp(36, VIEWER_MAX.1); + Some(FrameKey { + path: self.media_path(m), + ms: (secs * 1000.).round() as i64, + w, + h, + }) + } + + /// Keeps the viewer's picture in step with the playhead: shows a cached + /// frame at once, otherwise asks the pool and keeps the old frame up + /// until the new one arrives. + pub(crate) fn sync_viewer_frame(&mut self, window: &mut Window, cx: &mut Context) { + if self.view == View::Graph { + // The viewer isn't on screen; catch up when it is. + return; + } + let wanted = self.wanted_frame(window); + let Some(key) = wanted else { + if let Some(old) = self.frame.take() { + window.drop_image(old.image).ok(); + } + self.frame_pending = None; + self.frame_generation += 1; + return; + }; + let shown = self.frame.as_ref().is_some_and(|f| f.key == key); + if shown + || self.frame_pending.as_ref() == Some(&key) + || self.frame_failed.as_ref() == Some(&key) + { + return; + } + let req = FrameRequest { + path: key.path.clone(), + time: key.ms as f64 / 1000., + max_w: key.w, + max_h: key.h, + slot: VIEWER_SLOT, + }; + // Replies to anything asked for before this are stale: requests to + // different files run on different workers and can finish out of order. + self.frame_generation += 1; + let generation = self.frame_generation; + let pool = &cx.global::().pool; + if let Some(p) = pool.cached(&req) { + self.show_frame(key, &p, window); + return; + } + let rx = pool.request(req); + self.frame_pending = Some(key.clone()); + cx.spawn_in(window, async move |this, cx| { + let result = rx.await; + this.update_in(cx, |ws, window, cx| { + if ws.frame_generation != generation { + return; + } + ws.frame_pending = None; + match result { + Ok(Ok(p)) => ws.show_frame(key, &p, window), + // A newer frame was asked for; it will arrive instead. + Ok(Err(MediaError::Superseded)) => {} + Ok(Err(e)) => { + ws.frame_failed = Some(key); + ws.say_error(format!("Couldn't decode this frame: {e}")); + } + Err(_) => {} + } + cx.notify(); + }) + .ok(); + }) + .detach(); + } + + fn show_frame(&mut self, key: FrameKey, p: &Picture, window: &mut Window) { + if let Some(old) = self.frame.take() { + window.drop_image(old.image).ok(); + } + self.frame = Some(ViewerFrame { + key, + image: render_image(p), + }); + } +} diff --git a/crates/videode-app/src/motion.rs b/crates/videode-app/src/motion.rs new file mode 100644 index 0000000..d17019d --- /dev/null +++ b/crates/videode-app/src/motion.rs @@ -0,0 +1,146 @@ +//! Motion: one easing curve, the standard durations, and the hover layer. +//! +//! Everything here animates through GPUI's `with_animation`, which renders +//! the end state immediately when `reduce_motion` is set, so the Animations +//! setting switches all of it at once. See DESIGN.md › Motion. + +use std::cell::RefCell; +use std::collections::HashSet; +use std::time::Duration; + +use gpui_kit::prelude::*; +use gpui_kit::{ + Animation, AnimationExt as _, Div, ElementId, Hsla, Pixels, SharedString, Stateful, div, px, +}; + +use crate::theme::{c, hex}; + +pub const HOVER_IN: Duration = Duration::from_millis(120); +pub const HOVER_OUT: Duration = Duration::from_millis(90); +pub const STATUS: Duration = Duration::from_millis(180); +pub const ZOOM: Duration = Duration::from_millis(180); +pub const CUT: Duration = Duration::from_millis(380); +pub const FLASH: Duration = Duration::from_millis(520); +pub const DIALOG: Duration = Duration::from_millis(160); +pub const SWITCH: Duration = Duration::from_millis(140); + +/// Ease-out quint, the stand-in for DESIGN.md's `cubic-bezier(.16,1,.3,1)`. +pub fn ease_out(t: f32) -> f32 { + 1. - (1. - t.clamp(0., 1.)).powi(5) +} + +pub fn lerp(a: f32, b: f32, t: f32) -> f32 { + a + (b - a) * t +} + +pub fn anim(duration: Duration) -> Animation { + Animation::new(duration).with_easing(ease_out) +} + +/// A key that changes whenever `state` does, so `with_animation` restarts. +pub fn key(name: impl Into, state: u64) -> ElementId { + ElementId::NamedInteger(name.into(), state) +} + +#[derive(Default)] +struct HoverState { + current: Option, + /// Elements that have ever been hovered or toggled. Others render + /// statically, so nothing animates just because it appeared. + touched: HashSet, +} + +thread_local! { + static HOVER: RefCell = RefCell::default(); +} + +fn touched(id: &SharedString) -> bool { + HOVER.with(|h| h.borrow().touched.contains(id)) +} + +fn touch(id: &SharedString) { + HOVER.with(|h| h.borrow_mut().touched.insert(id.clone())); +} + +/// Adds an animated hover background to `el`. Call before adding children so +/// the layer paints underneath them. `el` becomes `relative`. +pub fn hover_fx( + el: Stateful
, + id: impl Into, + hot: Hsla, + radius: Pixels, +) -> Stateful
{ + let id = id.into(); + let hovered = HOVER.with(|h| h.borrow().current.as_ref() == Some(&id)); + let layer = touched(&id).then(|| { + let (from, to, duration) = if hovered { + (0., 1., HOVER_IN) + } else { + (1., 0., HOVER_OUT) + }; + div() + .absolute() + .top_0() + .left_0() + .size_full() + .rounded(radius) + .bg(hot) + .with_animation( + key(format!("hover-{id}"), hovered as u64), + anim(duration), + move |d, t| d.opacity(lerp(from, to, t)), + ) + }); + el.relative() + .children(layer) + .on_hover(move |&now, window, _| { + HOVER.with(|h| { + let mut h = h.borrow_mut(); + if now { + h.current = Some(id.clone()); + h.touched.insert(id.clone()); + } else if h.current.as_ref() == Some(&id) { + h.current = None; + } + }); + window.refresh(); + }) +} + +/// An on/off switch whose knob slides when it changes. +pub fn switch(id: impl Into, on: bool) -> Stateful
{ + let id: SharedString = id.into(); + let knob_x = |on: bool| if on { 14. } else { 2. }; + let knob = div() + .absolute() + .top(px(2.)) + .w(px(12.)) + .h(px(12.)) + .rounded_full() + .bg(c(if on { hex::PLUGE_SUB } else { hex::INK_DIM })); + let knob = if touched(&id) { + let (from, to) = (knob_x(!on), knob_x(on)); + knob.with_animation( + key(format!("switch-{id}"), on as u64), + anim(SWITCH), + move |d, t| d.left(px(lerp(from, to, t))), + ) + .into_any_element() + } else { + knob.left(px(knob_x(on))).into_any_element() + }; + let touch_id = id.clone(); + div() + .id(id) + .relative() + .flex_none() + .w(px(30.)) + .h(px(18.)) + .rounded_full() + .border_1() + .cursor_pointer() + .border_color(c(if on { hex::BONE } else { hex::LINE_STRONG })) + .bg(c(if on { hex::BONE } else { hex::PLUGE_CONTROL })) + .on_mouse_down(gpui_kit::MouseButton::Left, move |_, _, _| touch(&touch_id)) + .child(knob) +} diff --git a/crates/videode-app/src/palette.rs b/crates/videode-app/src/palette.rs new file mode 100644 index 0000000..07dba82 --- /dev/null +++ b/crates/videode-app/src/palette.rs @@ -0,0 +1,568 @@ +//! The command palette (Ctrl/Cmd+K): every action, node, clip and media +//! file, fuzzy-matched. Disabled entries say why instead of disappearing. + +use gpui_kit::component::input::{Escape, Input, InputEvent, InputState, MoveDown, MoveUp}; +use gpui_kit::prelude::*; +use gpui_kit::{ + Action, AnimationExt as _, AnyElement, Context, Entity, FontWeight, HighlightStyle, Hsla, + MouseButton, SharedString, StyledText, Subscription, Window, div, hsla, point, px, +}; +use videode_core::fuzzy::fuzzy; +use videode_core::{ClipId, MediaId, NodeKind}; + +use crate::actions::*; +use crate::theme::{self, CategoryExt, c, hex}; +use crate::ui::{icon, kbd}; +use crate::workspace::{View, Workspace}; + +const WIDTH: f32 = 580.; +const ROW_H: f32 = 30.; +const MAX_VISIBLE: usize = 12; + +pub(crate) struct Palette { + pub input: Entity, + pub selected: usize, + pub _subscription: Subscription, +} + +#[derive(Clone)] +enum Run { + Action(SharedString), + AddNode(NodeKind), + Clip(ClipId), + Media(MediaId), +} + +struct Item { + group: &'static str, + id: String, + label: String, + detail: Option, + color: Option, + shortcut: Option, + disabled: Option<&'static str>, + run: Run, + positions: Vec, + score: i32, +} + +/// Every action the palette offers, with when it's unavailable. +/// When an action can't run, the reason shown next to it. +type Unavailable = fn(&Workspace) -> Option<&'static str>; + +fn actions() -> Vec<(&'static str, Box, Unavailable)> { + fn always(_: &Workspace) -> Option<&'static str> { + None + } + fn needs_clip(ws: &Workspace) -> Option<&'static str> { + ws.selection.is_none().then_some("select a clip first") + } + fn needs_node(ws: &Workspace) -> Option<&'static str> { + let processing = ws + .focus_node + .zip(ws.selection.and_then(|id| ws.project().clip(id))) + .and_then(|(n, c)| c.node(n)) + .is_some_and(|n| !n.kind.is_generator()); + (!processing).then_some("click a node in the inspector or peek first") + } + fn needs_undo(ws: &Workspace) -> Option<&'static str> { + ws.doc.undo_label().is_none().then_some("nothing to undo") + } + fn needs_redo(ws: &Workspace) -> Option<&'static str> { + ws.doc.redo_label().is_none().then_some("nothing to redo") + } + vec![ + ("Split at playhead", Box::new(Split), always), + ("Delete clip", Box::new(DeleteClip), needs_clip), + ("Ripple delete clip", Box::new(RippleDelete), needs_clip), + ("Peek at nodes", Box::new(TogglePeek), needs_clip), + ("Graph view", Box::new(ToggleGraph), always), + ("Add node…", Box::new(AddNodeMenu), needs_clip), + ("Bypass or enable node", Box::new(BypassNode), needs_node), + ("Undo", Box::new(Undo), needs_undo), + ("Redo", Box::new(Redo), needs_redo), + ("Blade tool", Box::new(BladeTool), always), + ("Select tool", Box::new(SelectTool), always), + ("Toggle snapping", Box::new(ToggleSnap), always), + ("Mute or hide track", Box::new(ToggleTrack), needs_clip), + ("Zoom in", Box::new(ZoomIn), always), + ("Zoom out", Box::new(ZoomOut), always), + ("Zoom to fit", Box::new(ZoomToFit), always), + ("Play / pause", Box::new(TogglePlay), always), + ("Go to start", Box::new(GoToStart), always), + ("Go to end", Box::new(GoToEnd), always), + ("Previous edit point", Box::new(PrevEdit), always), + ("Next edit point", Box::new(NextEdit), always), + ("Open Output node (export)", Box::new(OpenOutput), always), + ("New project", Box::new(NewProject), always), + ("Open project…", Box::new(OpenProject), always), + ("Open demo project", Box::new(OpenDemo), always), + ("Import media…", Box::new(ImportMedia), always), + ("Save", Box::new(SaveProject), always), + ("Save as…", Box::new(SaveProjectAs), always), + ("Settings", Box::new(OpenSettings), always), + ("About videode", Box::new(About), always), + ("Quit", Box::new(Quit), always), + ] +} + +impl Workspace { + pub(crate) fn open_palette( + &mut self, + prefill: &str, + window: &mut Window, + cx: &mut Context, + ) { + self.commit_field(window, cx); + let input = cx.new(|cx| { + InputState::new(window, cx).placeholder("Search actions, nodes, clips, media…") + }); + input.update(cx, |s, cx| { + // set_value leaves the caret at the end, ready to keep typing. + s.set_value(prefill.to_string(), window, cx); + s.focus(window, cx); + }); + let subscription = cx.subscribe_in( + &input, + window, + |this, _, event: &InputEvent, window, cx| match event { + InputEvent::Change => { + if let Some(p) = &mut this.palette { + p.selected = 0; + } + cx.notify(); + } + InputEvent::PressEnter { .. } => this.run_palette(None, window, cx), + _ => {} + }, + ); + self.palette = Some(Palette { + input, + selected: 0, + _subscription: subscription, + }); + cx.notify(); + } + + pub(crate) fn close_palette(&mut self, window: &mut Window, cx: &mut Context) { + self.palette = None; + window.focus(&self.focus, cx); + cx.notify(); + } + + fn palette_items(&self, query: &str, window: &Window) -> Vec { + let p = self.project(); + let clip_kind = self.selection.and_then(|id| p.clip(id)).map(|c| c.kind); + let mut items = Vec::new(); + for (label, action, unavailable) in actions() { + let shortcut = window + .highest_precedence_binding_for_action(&*action) + .map(|b| shortcut_text(&b)); + items.push(Item { + group: "Actions", + id: format!("action:{}", action.name()), + label: label.into(), + detail: None, + color: None, + shortcut, + disabled: unavailable(self), + run: Run::Action(action.name().into()), + positions: Vec::new(), + score: 0, + }); + } + for kind in NodeKind::ALL.into_iter().filter(|k| !k.is_generator()) { + let disabled = match clip_kind { + None => Some("select a clip first"), + Some(k) if !kind.applies_to(k) => Some("doesn't work on this kind of clip"), + _ => None, + }; + items.push(Item { + group: "Add node", + id: format!("node:{}", kind.ident()), + label: format!("Add {}", kind.name()), + detail: Some(kind.description().into()), + color: Some(kind.category().color()), + shortcut: None, + disabled, + run: Run::AddNode(kind), + positions: Vec::new(), + score: 0, + }); + } + for clip in &p.sequence.clips { + let track = p + .track(clip.track) + .map(|t| t.label.clone()) + .unwrap_or_default(); + items.push(Item { + group: "Clips", + id: format!("clip:{}", clip.id.0), + label: p.clip_name(clip), + detail: Some(format!("{track} · {}", self.tc(clip.start))), + color: clip.nodes.first().map(|n| n.kind.category().color()), + shortcut: None, + disabled: None, + run: Run::Clip(clip.id), + positions: Vec::new(), + score: 0, + }); + } + for m in &p.media { + items.push(Item { + group: "Media", + id: format!("media:{}", m.id.0), + label: m.file_name(), + detail: Some(if m.offline { + "offline".into() + } else { + "add at the playhead".into() + }), + color: None, + shortcut: None, + disabled: None, + run: Run::Media(m.id), + positions: Vec::new(), + score: 0, + }); + } + + if query.trim().is_empty() { + // Recent first, then everything in its group order. + let mut recent: Vec = Vec::new(); + for id in &self.recent_commands { + if let Some(i) = items.iter().position(|it| &it.id == id) { + let mut it = items.remove(i); + it.group = "Recent"; + recent.push(it); + } + } + recent.extend(items); + return recent; + } + let mut matched: Vec = items + .into_iter() + .filter_map(|mut it| { + let m = fuzzy(query, &it.label)?; + it.positions = m.positions; + it.score = m.score - if it.disabled.is_some() { 20 } else { 0 }; + Some(it) + }) + .collect(); + matched.sort_by_key(|it| std::cmp::Reverse(it.score)); + // Keep groups together, ordered by their best match. + let mut order: Vec<&'static str> = Vec::new(); + for it in &matched { + if !order.contains(&it.group) { + order.push(it.group); + } + } + let mut grouped = Vec::with_capacity(matched.len()); + for g in order { + let (these, rest): (Vec, Vec) = + matched.into_iter().partition(|it| it.group == g); + grouped.extend(these); + matched = rest; + } + grouped + } + + /// Runs the selected entry, or entry `index` when clicked. + fn run_palette(&mut self, index: Option, window: &mut Window, cx: &mut Context) { + let Some(p) = &self.palette else { + return; + }; + let query = p.input.read(cx).value().to_string(); + let items = self.palette_items(&query, window); + let Some(item) = items.into_iter().nth(index.unwrap_or(p.selected)) else { + return; + }; + if let Some(why) = item.disabled { + self.say(format!("{} · {why}", item.label)); + cx.notify(); + return; + } + self.recent_commands.retain(|id| *id != item.id); + self.recent_commands.insert(0, item.id.clone()); + self.recent_commands.truncate(3); + self.close_palette(window, cx); + match item.run { + Run::Action(name) => { + if let Some(action) = actions() + .into_iter() + .find(|(_, a, _)| a.name() == name.as_ref()) + .map(|(_, a, _)| a) + { + window.dispatch_action(action, cx); + } + } + Run::AddNode(kind) => { + if let Some(clip) = self.selection { + self.add_node(clip, kind, cx); + } + } + Run::Clip(clip) => { + self.view = View::Timeline; + self.select(Some(clip)); + self.reveal_clip(clip); + let name = self + .project() + .clip(clip) + .map(|c| self.project().clip_name(c)) + .unwrap_or_default(); + self.say(format!("Selected {name} · Tab to peek at its nodes")); + } + Run::Media(media) => self.add_media_at_playhead(media, cx), + } + cx.notify(); + } + + fn move_palette(&mut self, delta: isize, window: &Window, cx: &mut Context) { + let Some(p) = &self.palette else { + return; + }; + let query = p.input.read(cx).value().to_string(); + let count = self.palette_items(&query, window).len(); + if count == 0 { + return; + } + if let Some(p) = &mut self.palette { + p.selected = (p.selected as isize + delta).rem_euclid(count as isize) as usize; + } + cx.notify(); + } + + pub(crate) fn render_palette( + &self, + window: &mut Window, + cx: &mut Context, + ) -> Option { + let p = self.palette.as_ref()?; + let query = p.input.read(cx).value().to_string(); + let items = self.palette_items(&query, window); + let selected = p.selected.min(items.len().saturating_sub(1)); + + let mut rows: Vec = Vec::new(); + let mut last_group = ""; + for (i, it) in items.iter().enumerate() { + if it.group != last_group { + last_group = it.group; + rows.push( + div() + .px(px(14.)) + .pt(px(8.)) + .pb(px(3.)) + .font_weight(FontWeight::MEDIUM) + .text_color(c(hex::INK_FAINT)) + .child(it.group) + .into_any_element(), + ); + } + rows.push(self.palette_row(i, it, i == selected, cx)); + } + if items.is_empty() { + rows.push( + div() + .px(px(14.)) + .py(px(16.)) + .text_color(c(hex::INK_DIM)) + .child(format!("Nothing matches “{query}”")) + .into_any_element(), + ); + } + + let panel = div() + .id("palette") + .w(px(WIDTH)) + .flex() + .flex_col() + .rounded(px(10.)) + .border_1() + .border_color(c(hex::LINE_STRONG)) + .bg(c(hex::PLUGE_RAISED)) + .shadow(vec![gpui_kit::BoxShadow { + color: hsla(0., 0., 0., 0.6), + offset: point(px(0.), px(18.)), + blur_radius: px(48.), + spread_radius: px(0.), + inset: false, + }]) + .overflow_hidden() + .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) + .capture_action(cx.listener(|this, _: &MoveUp, window, cx| { + cx.stop_propagation(); + this.move_palette(-1, window, cx); + })) + .capture_action(cx.listener(|this, _: &MoveDown, window, cx| { + cx.stop_propagation(); + this.move_palette(1, window, cx); + })) + .capture_action(cx.listener(|this, _: &Escape, window, cx| { + cx.stop_propagation(); + this.close_palette(window, cx); + })) + .child( + div() + .h(px(44.)) + .flex() + .items_center() + .gap(px(10.)) + .px(px(14.)) + .border_b_1() + .border_color(c(hex::LINE)) + .text_size(theme::TITLE) + .child(icon("search", px(16.), c(hex::INK_DIM))) + .child(div().flex_1().child(Input::new(&p.input).appearance(false))) + .child(kbd("Esc")), + ) + .child( + div() + .id("palette-list") + .max_h(px(ROW_H * MAX_VISIBLE as f32 + 60.)) + .overflow_y_scroll() + .py(px(4.)) + .children(rows), + ) + .child( + div() + .h(px(30.)) + .flex() + .items_center() + .gap(px(14.)) + .px(px(14.)) + .border_t_1() + .border_color(c(hex::LINE)) + .text_color(c(hex::INK_FAINT)) + .child( + div() + .flex() + .gap(px(6.)) + .items_center() + .child(kbd("↑ ↓")) + .child("move"), + ) + .child( + div() + .flex() + .gap(px(6.)) + .items_center() + .child(kbd("Enter")) + .child("run"), + ) + .child( + div() + .flex() + .gap(px(6.)) + .items_center() + .child(kbd("Esc")) + .child("close"), + ), + ) + .with_animation( + crate::motion::key("palette", 0), + crate::motion::anim(crate::motion::DIALOG), + |d, t| d.opacity(t).mt(px(crate::motion::lerp(-6., 0., t))), + ); + + Some( + div() + .id("palette-scrim") + .absolute() + .top_0() + .left_0() + .size_full() + .flex() + .flex_col() + .items_center() + .pt(px(72.)) + .occlude() + .bg(hsla(0., 0., 0., 0.35)) + .on_mouse_down( + MouseButton::Left, + cx.listener(|this, _, window, cx| this.close_palette(window, cx)), + ) + .child(panel) + .into_any_element(), + ) + } + + fn palette_row( + &self, + i: usize, + it: &Item, + selected: bool, + cx: &mut Context, + ) -> AnyElement { + // Matched characters in bone and medium weight. + let label = it.label.clone(); + let highlights: Vec<_> = label + .char_indices() + .enumerate() + .filter(|(ci, _)| it.positions.contains(ci)) + .map(|(_, (b, ch))| { + ( + b..b + ch.len_utf8(), + HighlightStyle { + color: Some(c(hex::BONE)), + font_weight: Some(FontWeight::SEMIBOLD), + ..Default::default() + }, + ) + }) + .collect(); + let text = StyledText::new(label).with_highlights(highlights); + div() + .id(SharedString::from(format!("pal-{i}"))) + .h(px(ROW_H)) + .mx(px(4.)) + .px(px(10.)) + .flex() + .items_center() + .gap(px(10.)) + .rounded(px(6.)) + .cursor_pointer() + .when(selected, |d| d.bg(c(hex::PLUGE_HOVER))) + .when(it.disabled.is_some(), |d| d.text_color(c(hex::INK_FAINT))) + .on_hover(cx.listener(move |this, hovered: &bool, _, cx| { + if *hovered + && let Some(p) = &mut this.palette + && p.selected != i + { + p.selected = i; + cx.notify(); + } + })) + .on_click(cx.listener(move |this, _, window, cx| this.run_palette(Some(i), window, cx))) + .child( + div() + .w(px(8.)) + .h(px(8.)) + .flex_none() + .rounded(px(2.)) + .when_some(it.color, |d, col| d.bg(col)) + .when(it.color.is_none(), |d| { + d.border_1().border_color(c(hex::LINE_STRONG)) + }), + ) + .child(div().flex_none().child(text)) + .when_some(it.detail.clone(), |d, detail| { + d.child( + div() + .min_w_0() + .overflow_hidden() + .whitespace_nowrap() + .text_ellipsis() + .text_color(c(hex::INK_FAINT)) + .child(detail), + ) + }) + .child(div().flex_1()) + .when_some(it.disabled, |d, why| { + d.child(div().flex_none().text_color(c(hex::INK_FAINT)).child(why)) + }) + .when(it.disabled.is_none(), |d| { + d.when_some(it.shortcut.clone(), |d, k| d.child(kbd(k))) + }) + .into_any_element() + } +} diff --git a/crates/videode-app/src/panels.rs b/crates/videode-app/src/panels.rs new file mode 100644 index 0000000..d6f6a98 --- /dev/null +++ b/crates/videode-app/src/panels.rs @@ -0,0 +1,1028 @@ +//! The panels around the timeline: top bar with menus, media bin and node +//! library, viewer and transport, inspector, and status bar. + +use gpui_kit::component::Sizable as _; +use gpui_kit::component::button::{Button, ButtonVariants as _}; +use gpui_kit::component::menu::{DropdownMenu as _, PopupMenu}; +use gpui_kit::prelude::*; +use gpui_kit::{ + AnimationExt as _, AnyElement, Context, FocusHandle, FontWeight, ImageSource, SharedString, + canvas, div, img, px, +}; +use videode_core::look::look_at; +use videode_core::{Clip, MediaId, MediaKind, NodeKind, time}; + +use crate::actions::*; +use crate::brand; +use crate::media::MediaEngine; +use crate::motion::{self, anim, hover_fx, key, lerp}; +use crate::theme::{self, Category, CategoryExt, c, hex}; +use crate::ui::{button, cmd_key, icon, icon_button, kbd, pane_header, swatch, tip}; +use crate::workspace::{BinTab, View, Workspace}; + +const TOP_BAR_H: f32 = 38.; +const STATUS_H: f32 = 26.; +const BIN_W: f32 = 264.; + +type MenuBuilder = fn(PopupMenu, &Workspace) -> PopupMenu; + +fn file_menu(m: PopupMenu, _: &Workspace) -> PopupMenu { + m.menu("New project", Box::new(NewProject)) + .menu("Open…", Box::new(OpenProject)) + .menu("Open demo project", Box::new(OpenDemo)) + .separator() + .menu("Import media…", Box::new(ImportMedia)) + .separator() + .menu("Save", Box::new(SaveProject)) + .menu("Save as…", Box::new(SaveProjectAs)) + .separator() + .menu("Export…", Box::new(Export)) + .separator() + .menu("Settings…", Box::new(OpenSettings)) + .separator() + .menu("Quit", Box::new(Quit)) +} + +fn edit_menu(m: PopupMenu, ws: &Workspace) -> PopupMenu { + let undo = ws.doc.undo_label().map(|l| format!("Undo {l}")); + let redo = ws.doc.redo_label().map(|l| format!("Redo {l}")); + m.menu_with_disabled( + undo.clone().unwrap_or("Undo".into()), + Box::new(Undo), + undo.is_none(), + ) + .menu_with_disabled( + redo.clone().unwrap_or("Redo".into()), + Box::new(Redo), + redo.is_none(), + ) + .separator() + .menu("Deselect", Box::new(Deselect)) +} + +fn clip_menu(m: PopupMenu, ws: &Workspace) -> PopupMenu { + let none = ws.selection.is_none(); + m.menu("Split at playhead", Box::new(Split)) + .menu_with_disabled("Peek at nodes", Box::new(TogglePeek), none) + .menu_with_disabled("Add node…", Box::new(AddNodeMenu), none) + .menu_with_disabled( + "Bypass or enable node", + Box::new(BypassNode), + ws.focused_node().is_none(), + ) + .separator() + .menu_with_disabled("Delete", Box::new(DeleteClip), none) + .menu_with_disabled("Ripple delete", Box::new(RippleDelete), none) + .separator() + .menu_with_disabled("Mute or hide track", Box::new(ToggleTrack), none) +} + +fn view_menu(m: PopupMenu, ws: &Workspace) -> PopupMenu { + m.menu_with_check( + "Select tool", + ws.tool == crate::workspace::Tool::Select, + Box::new(SelectTool), + ) + .menu_with_check( + "Blade tool", + ws.tool == crate::workspace::Tool::Blade, + Box::new(BladeTool), + ) + .menu_with_check("Snapping", ws.snap, Box::new(ToggleSnap)) + .separator() + .menu_with_check("Graph view", ws.view == View::Graph, Box::new(ToggleGraph)) + .menu("Command palette", Box::new(CommandPalette)) + .separator() + .menu("Zoom in", Box::new(ZoomIn)) + .menu("Zoom out", Box::new(ZoomOut)) + .menu("Zoom to fit", Box::new(ZoomToFit)) +} + +fn playback_menu(m: PopupMenu, ws: &Workspace) -> PopupMenu { + m.menu( + if ws.is_playing() { "Pause" } else { "Play" }, + Box::new(TogglePlay), + ) + .menu("Play backward / faster", Box::new(ShuttleBackward)) + .menu("Stop", Box::new(ShuttleStop)) + .menu("Play forward / faster", Box::new(ShuttleForward)) + .separator() + .menu("Previous frame", Box::new(StepBack)) + .menu("Next frame", Box::new(StepForward)) + .menu("Back one second", Box::new(SecondBack)) + .menu("Forward one second", Box::new(SecondForward)) + .separator() + .menu("Previous edit point", Box::new(PrevEdit)) + .menu("Next edit point", Box::new(NextEdit)) + .menu("Go to start", Box::new(GoToStart)) + .menu("Go to end", Box::new(GoToEnd)) +} + +fn help_menu(m: PopupMenu, _: &Workspace) -> PopupMenu { + m.menu("Settings…", Box::new(OpenSettings)) + .separator() + .menu("About videode", Box::new(About)) +} + +impl Workspace { + fn menu( + &self, + name: &'static str, + build: MenuBuilder, + cx: &mut Context, + ) -> impl IntoElement + use<> { + let this = cx.entity().downgrade(); + let focus: FocusHandle = self.focus.clone(); + Button::new(SharedString::from(format!("menu-{name}"))) + .label(name) + .ghost() + .small() + .dropdown_menu(move |menu, _, cx| { + let menu = menu.action_context(focus.clone()).min_w(px(220.)); + match this.upgrade() { + Some(ws) => build(menu, ws.read(cx)), + None => menu, + } + }) + } + + pub(crate) fn render_top_bar(&self, cx: &mut Context) -> impl IntoElement + use<> { + let logo = div() + .id("logo") + .mr(px(2.)) + .cursor_pointer() + .tooltip(tip("About videode", None)) + .on_click(|_, w, cx| w.dispatch_action(Box::new(About), cx)) + .child(brand::mark(20., 1.)); + + let p = self.project(); + let crumbs = div() + .flex() + .items_center() + .gap(px(6.)) + .ml(px(14.)) + .flex_shrink_0() + .whitespace_nowrap() + .text_color(c(hex::INK_DIM)) + .child(SharedString::from(p.name.clone())) + .when(self.doc.is_dirty(), |d| { + d.child( + div() + .id("dirty") + .w(px(6.)) + .h(px(6.)) + .rounded_full() + .bg(c(hex::INK_DIM)) + .tooltip(tip("Unsaved changes", Some(cmd_key("S")))), + ) + }) + .child(icon("chevron-right", px(12.), c(hex::INK_FAINT))) + .child( + div() + .text_color(c(hex::INK)) + .font_weight(FontWeight::MEDIUM) + .child(SharedString::from(format!("{} Sequence", p.sequence.name))), + ) + .map(|d| { + let tail = match ( + self.view, + self.peek, + self.selection.and_then(|id| p.clip(id)), + ) { + (View::Graph, ..) => Some(("Graph".to_string(), None)), + (View::Timeline, Some(_), Some(clip)) => { + Some((p.clip_name(clip), Some("nodes"))) + } + _ => None, + }; + match tail { + Some((name, suffix)) => d + .child(icon("chevron-right", px(12.), c(hex::INK_FAINT))) + .child( + div() + .text_color(c(hex::INK)) + .font_weight(FontWeight::MEDIUM) + .child(name), + ) + .when_some(suffix, |d, s| { + d.child(div().text_color(c(hex::INK_FAINT)).child(s)) + }), + None => d, + } + }); + + let command = div() + .id("command-palette") + .w(px(340.)) + .min_w(px(150.)) + .flex_shrink(1.) + .h(px(26.)) + .flex() + .items_center() + .gap(px(8.)) + .pl(px(8.)) + .pr(px(4.)) + .rounded(px(6.)) + .border_1() + .border_color(c(hex::LINE_STRONG)) + .bg(c(hex::PLUGE_SUB)) + .text_color(c(hex::INK_DIM)) + .cursor_pointer() + .map(|d| hover_fx(d, "command-palette", c(hex::PLUGE_RAISED), px(5.))) + .hover(|s| s.text_color(c(hex::INK))) + .tooltip(tip("Every action, node and clip", Some(cmd_key("K")))) + .on_click(|_, w, cx| w.dispatch_action(Box::new(CommandPalette), cx)) + .child(icon("search", px(16.), c(hex::INK_DIM))) + .child( + div() + .flex_1() + .min_w_0() + .overflow_hidden() + .whitespace_nowrap() + .text_ellipsis() + .child("Search actions, nodes, clips…"), + ) + .child(kbd(cmd_key("K"))); + + let undo = self.doc.undo_label().map(|l| format!("Undo {l}")); + let redo = self.doc.redo_label().map(|l| format!("Redo {l}")); + + div() + .h(px(TOP_BAR_H)) + .flex_none() + .flex() + .items_center() + .gap(px(6.)) + .pl(px(12.)) + .pr(px(10.)) + .bg(c(hex::PLUGE_BLACK)) + .border_b_1() + .border_color(c(hex::LINE)) + .child(logo) + .child( + div() + .mr(px(8.)) + .text_size(theme::TITLE) + .font_weight(FontWeight::SEMIBOLD) + .child("videode"), + ) + .child( + div() + .flex() + .child(self.menu("File", file_menu, cx)) + .child(self.menu("Edit", edit_menu, cx)) + .child(self.menu("Clip", clip_menu, cx)) + .child(self.menu("View", view_menu, cx)) + .child(self.menu("Playback", playback_menu, cx)) + .child(self.menu("Help", help_menu, cx)), + ) + .child(crumbs) + .child( + div() + .ml_auto() + .min_w_0() + .flex() + .items_center() + .gap(px(6.)) + .child(command) + .child( + icon_button("undo", "undo", false, undo.is_none()) + .tooltip(tip( + undo.unwrap_or("Nothing to undo".into()), + Some(cmd_key("Z")), + )) + .on_click(|_, w, cx| w.dispatch_action(Box::new(Undo), cx)), + ) + .child( + icon_button("redo", "redo", false, redo.is_none()) + .tooltip(tip( + redo.unwrap_or("Nothing to redo".into()), + Some(cmd_key("⇧ Z")), + )) + .on_click(|_, w, cx| w.dispatch_action(Box::new(Redo), cx)), + ) + .child( + button("export", Some("upload"), "Export", true) + .tooltip(tip("Open the Output node", Some(cmd_key("E")))) + .on_click(|_, w, cx| w.dispatch_action(Box::new(Export), cx)), + ), + ) + } + + /* ---------- bin ---------- */ + + pub(crate) fn add_media_at_playhead(&mut self, media: MediaId, cx: &mut Context) { + let at = self.playhead; + if let Some(id) = self.apply("add clip", cx, |p| p.add_media_clip(media, None, at)) { + self.select(Some(id)); + let p = self.project(); + if let Some(clip) = p.clip(id) { + let track = p + .track(clip.track) + .map(|t| t.label.clone()) + .unwrap_or_default(); + let msg = format!( + "Added {} to {track} at {}", + p.clip_name(clip), + self.tc(clip.start) + ); + self.say(msg); + } + } + } + + fn add_node_to_selection(&mut self, kind: NodeKind, cx: &mut Context) { + let Some(clip) = self.selection else { + self.say(format!( + "Select a clip first, then click {} to add it", + kind.name() + )); + cx.notify(); + return; + }; + if self + .apply("add node", cx, |p| p.add_node(clip, kind)) + .is_some() + { + self.say(format!("Added {} · {} to undo", kind.name(), cmd_key("Z"))); + } + } + + pub(crate) fn render_bin(&self, cx: &mut Context) -> impl IntoElement + use<> { + let tab = |id: &'static str, + label: &'static str, + which: BinTab, + this: &Self, + cx: &mut Context| { + let selected = this.bin_tab == which; + div() + .id(id) + .h(px(24.)) + .px(px(9.)) + .flex() + .items_center() + .rounded(px(5.)) + .font_weight(FontWeight::MEDIUM) + .cursor_pointer() + .text_color(c(if selected { hex::INK } else { hex::INK_DIM })) + .when(selected, |d| d.bg(c(hex::PLUGE_CONTROL))) + .map(|d| hover_fx(d, id, c(hex::PLUGE_CONTROL), px(5.))) + .hover(|s| s.text_color(c(hex::INK))) + .on_click(cx.listener(move |this, _, _, cx| { + this.bin_tab = which; + cx.notify(); + })) + .child(label) + }; + + let header = pane_header() + .child(tab("bin-media", "Media", BinTab::Media, self, cx)) + .child(tab("bin-nodes", "Nodes", BinTab::Nodes, self, cx)) + .child(div().flex_1()) + .child( + icon_button("import", "import", false, false) + .tooltip(tip("Import media", Some(cmd_key("I")))) + .on_click(|_, w, cx| w.dispatch_action(Box::new(ImportMedia), cx)), + ); + + let (body, footer): (AnyElement, String) = match self.bin_tab { + BinTab::Media => (self.render_media_list(cx), self.media_footer()), + BinTab::Nodes => (self.render_node_library(cx), self.nodes_footer()), + }; + + div() + .w(px(BIN_W)) + .flex_none() + .flex() + .flex_col() + .bg(c(hex::PLUGE_BLACK)) + .border_r_1() + .border_color(c(hex::LINE)) + .child(header) + .child( + div() + .id("bin-body") + .flex_1() + .min_h_0() + .overflow_y_scroll() + .child(body), + ) + .child( + div() + .h(px(26.)) + .flex_none() + .flex() + .items_center() + .px(px(10.)) + .border_t_1() + .border_color(c(hex::LINE)) + .text_color(c(hex::INK_FAINT)) + .whitespace_nowrap() + .overflow_hidden() + .text_ellipsis() + .child(footer), + ) + } + + fn media_footer(&self) -> String { + match self.project().media.len() { + 1 => "1 item · double-click to add at the playhead".into(), + n => format!("{n} items · double-click to add at the playhead"), + } + } + + fn nodes_footer(&self) -> String { + match self.selection.and_then(|id| self.project().clip(id)) { + Some(clip) => format!( + "Click a node to add it to {}", + self.project().clip_name(clip) + ), + None => "Select a clip, then click a node to add it".into(), + } + } + + fn render_media_list(&self, cx: &mut Context) -> AnyElement { + let p = self.project(); + if p.media.is_empty() { + return div() + .h_full() + .flex() + .flex_col() + .items_center() + .justify_center() + .gap(px(10.)) + .px(px(16.)) + .py(px(40.)) + .text_color(c(hex::INK_DIM)) + .child(icon("film", px(24.), c(hex::INK_FAINT))) + .child( + div() + .text_color(c(hex::INK)) + .font_weight(FontWeight::MEDIUM) + .child("No media yet"), + ) + .child( + div() + .text_center() + .child("Drop files anywhere on the window, or import them."), + ) + .child( + button("bin-import", Some("import"), "Import media", false) + .on_click(|_, w, cx| w.dispatch_action(Box::new(ImportMedia), cx)), + ) + .child( + div() + .id("bin-demo") + .cursor_pointer() + .text_color(c(hex::INK_FAINT)) + .hover(|s| s.text_color(c(hex::INK))) + .on_click(|_, w, cx| w.dispatch_action(Box::new(OpenDemo), cx)) + .child("or open the demo project"), + ) + .into_any_element(); + } + let in_use = |id: MediaId| { + p.sequence + .clips + .iter() + .filter(|c| c.media == Some(id)) + .count() + }; + let fps = p.sequence.fps; + div() + .flex() + .flex_col() + .p(px(6.)) + .gap(px(1.)) + .children(p.media.iter().map(|m| { + let id = m.id; + let kind_icon = match m.kind { + MediaKind::Audio => "volume-2", + MediaKind::Video | MediaKind::Image => "film", + }; + let length = m + .duration + .map(|d| time::timecode_short(d, fps)) + .unwrap_or("still".into()); + let uses = in_use(id); + let thumb = self.thumbnail(m, cx); + let shown_path = self.media_path(m); + div() + .id(SharedString::from(format!("media-{}", id.0))) + .flex() + .items_center() + .gap(px(8.)) + .px(px(8.)) + .py(px(5.)) + .rounded(px(5.)) + .cursor_pointer() + .map(|d| hover_fx(d, format!("media-{}", id.0), c(hex::PLUGE_RAISED), px(5.))) + .tooltip(tip( + if m.offline { + format!("{} · file not found", shown_path.display()) + } else { + format!( + "{} · double-click to add at the playhead", + shown_path.display() + ) + }, + None, + )) + .on_click(cx.listener(move |this, e: &gpui_kit::ClickEvent, _, cx| { + if e.click_count() >= 2 { + this.add_media_at_playhead(id, cx); + } + })) + .child( + div() + .w(px(64.)) + .h(px(36.)) + .flex_none() + .flex() + .items_center() + .justify_center() + .overflow_hidden() + .rounded(px(3.)) + .border_1() + .border_color(c(if m.offline { hex::WARN } else { hex::LINE })) + .when(m.offline, |d| d.border_dashed()) + .bg(c(hex::PLUGE_SUB)) + .map(|d| match thumb { + Some(image) => d.child(img(ImageSource::Render(image)).size_full()), + None => d.child(icon(kind_icon, px(14.), c(hex::INK_FAINT))), + }), + ) + .child( + div() + .flex_1() + .min_w_0() + .flex() + .flex_col() + .child( + div() + .whitespace_nowrap() + .overflow_hidden() + .text_ellipsis() + .font_weight(FontWeight::MEDIUM) + .when(m.offline, |d| d.text_color(c(hex::WARN))) + .child(m.file_name()), + ) + .child( + div() + .whitespace_nowrap() + .overflow_hidden() + .text_ellipsis() + .text_color(c(hex::INK_FAINT)) + .child(if m.offline { + "offline".to_string() + } else { + format!("{} · {}", m.codec, m.format) + }), + ), + ) + .child( + div() + .flex_none() + .flex() + .flex_col() + .items_end() + .font_family(theme::MONO) + .text_color(c(hex::INK_DIM)) + .child(length) + .child(div().text_color(c(hex::INK_FAINT)).child(if uses == 0 { + String::new() + } else { + format!("×{uses}") + })), + ) + })) + .into_any_element() + } + + fn render_node_library(&self, cx: &mut Context) -> AnyElement { + let target = self + .selection + .and_then(|id| self.project().clip(id)) + .map(|c| c.kind); + let mut list = div().flex().flex_col().px(px(8.)).pb(px(8.)); + let mut last: Option = None; + for kind in NodeKind::ALL.into_iter().filter(|k| !k.is_generator()) { + let cat = kind.category(); + if last != Some(cat) { + list = list.child( + div() + .flex() + .items_center() + .gap(px(7.)) + .pt(px(10.)) + .pb(px(4.)) + .px(px(2.)) + .font_weight(FontWeight::MEDIUM) + .text_color(c(hex::INK_DIM)) + .child(swatch(cat)) + .child(cat.label()), + ); + last = Some(cat); + } + let unusable = target.is_some_and(|k| !kind.applies_to(k)); + list = list.child( + div() + .id(SharedString::from(format!("node-{}", kind.ident()))) + .flex() + .items_center() + .gap(px(8.)) + .px(px(8.)) + .py(px(6.)) + .rounded(px(5.)) + .when(unusable, |d| d.opacity(0.4)) + .when(!unusable, |d| { + hover_fx( + d.cursor_pointer(), + format!("node-{}", kind.ident()), + c(hex::PLUGE_RAISED), + px(5.), + ) + }) + .on_click( + cx.listener(move |this, _, _, cx| this.add_node_to_selection(kind, cx)), + ) + .child(swatch(cat)) + .child( + div() + .flex() + .flex_col() + .child(div().font_weight(FontWeight::MEDIUM).child(kind.name())) + .child( + div() + .text_color(c(hex::INK_FAINT)) + .child(kind.description()), + ), + ), + ); + } + list.into_any_element() + } + + /* ---------- viewer ---------- */ + + /// The topmost enabled video clip under the playhead. + /// The topmost enabled media clip on a video track at the playhead. + pub(crate) fn picture_clip(&self) -> Option<&Clip> { + let p = self.project(); + p.sequence + .tracks + .iter() + .filter(|t| t.enabled && t.kind == videode_core::StreamKind::Video) + .filter_map(|t| p.clip_at(t.id, self.playhead)) + .find(|c| c.media.is_some()) + } + + /// The picture, then text clips above it, laid out on a screen of + /// `(w, h)` pixels showing the sequence frame scaled to fit. + fn screen_layers(&self, w: f32, h: f32, generating: bool) -> Vec { + let p = self.project(); + let seq = &p.sequence; + let k = w / seq.width.max(1) as f32; + let mut layers: Vec = Vec::new(); + let picture = self.picture_clip(); + + if let (Some(clip), Some(frame)) = (picture, &self.frame) { + let size = frame.image.size(0); + let (pw, ph) = ( + (i32::from(size.width) as f32).max(1.), + (i32::from(size.height) as f32).max(1.), + ); + // Contain the picture in the frame, then apply the clip's look. + let fit = (w / pw).min(h / ph); + let l = look_at(clip, self.playhead); + let (iw, ih) = (pw * fit * l.scale as f32, ph * fit * l.scale as f32); + let (cx, cy) = (w / 2. + l.x as f32 * k, h / 2. + l.y as f32 * k); + let [cl, cr, ct, cb] = l.crop.map(|v| v as f32); + let (left, top) = (cx - iw / 2., cy - ih / 2.); + layers.push( + div() + .absolute() + .left(px(left + iw * cl)) + .top(px(top + ih * ct)) + .w(px(iw * (1. - cl - cr))) + .h(px(ih * (1. - ct - cb))) + .overflow_hidden() + .opacity(l.opacity as f32) + .child( + img(ImageSource::Render(frame.image.clone())) + .absolute() + .left(px(-iw * cl)) + .top(px(-ih * ct)) + .w(px(iw)) + .h(px(ih)), + ) + .into_any_element(), + ); + } else if let Some(clip) = picture { + let offline = clip + .media + .and_then(|m| p.media(m)) + .is_some_and(|m| m.offline); + let note = if offline && generating { + Some(("Making the demo footage…", hex::INK_DIM)) + } else if offline { + Some(("Media offline", hex::WARN)) + } else { + None + }; + if let Some((text, color)) = note { + layers.push(centered( + div() + .flex() + .flex_col() + .items_center() + .gap(px(4.)) + .child( + div() + .text_size(theme::TITLE) + .font_weight(FontWeight::MEDIUM) + .text_color(c(color)) + .child(p.clip_name(clip)), + ) + .child(div().text_color(c(hex::INK_FAINT)).child(text)), + )); + } + } + + // Text clips, bottom track first so higher tracks draw over. + let mut texts = 0; + for t in seq + .tracks + .iter() + .rev() + .filter(|t| t.enabled && t.kind == videode_core::StreamKind::Video) + { + let Some(clip) = p.clip_at(t.id, self.playhead) else { + continue; + }; + let Some(text) = clip.first(NodeKind::Text) else { + continue; + }; + texts += 1; + let l = look_at(clip, self.playhead); + let size = (text.number("size") * l.scale) as f32 * k; + let weight = text.text("weight").parse::().unwrap_or(500.); + layers.push( + div() + .absolute() + .left_0() + .top_0() + .size_full() + .flex() + .items_center() + .justify_center() + .opacity(l.opacity as f32) + .child( + div() + .relative() + .left(px(l.x as f32 * k)) + .top(px(l.y as f32 * k)) + .text_size(px(size.max(1.))) + .line_height(gpui_kit::relative(1.1)) + .font_weight(FontWeight(weight)) + .text_color(gpui_kit::white()) + .whitespace_nowrap() + .child(text.text("text").to_string()), + ) + .into_any_element(), + ); + } + if picture.is_none() && texts == 0 { + layers.push(centered( + div() + .text_color(c(hex::INK_FAINT)) + .child("No picture at playhead"), + )); + } + layers + } + + pub(crate) fn render_viewer(&self, cx: &mut Context) -> impl IntoElement + use<> { + let p = self.project(); + let seq = &p.sequence; + let b = self.viewer_bounds.get(); + let generating = cx.global::().generating; + let layers = self.screen_layers( + f32::from(b.size.width), + f32::from(b.size.height), + generating, + ); + let bounds = self.viewer_bounds.clone(); + + let screen = div() + .relative() + .h_full() + .max_w_full() + .aspect_ratio(seq.width as f32 / seq.height.max(1) as f32) + .overflow_hidden() + .bg(gpui_kit::black()) + .border_1() + .border_color(c(hex::LINE)) + .child( + canvas(move |b, _, _| bounds.set(b), |_, _, _, _| {}) + .absolute() + .size_full(), + ) + .children(layers); + + let playing = self.is_playing(); + let transport = div() + .h(px(44.)) + .flex_none() + .flex() + .items_center() + .px(px(14.)) + .bg(c(hex::PLUGE_BLACK)) + .border_t_1() + .border_color(c(hex::LINE)) + .child( + div() + .flex_1() + .flex() + .items_center() + .gap(px(8.)) + .font_family(theme::MONO) + .text_size(theme::TITLE) + .font_weight(FontWeight::MEDIUM) + .child(self.tc(self.playhead)) + .when_some( + self.playback.as_ref().filter(|pb| pb.speed != 1.), + |d, pb| { + d.child( + div() + .text_size(theme::TEXT) + .text_color(c(hex::INK_DIM)) + .child(format!("{}×", pb.speed)), + ) + }, + ), + ) + .child( + div() + .flex() + .gap(px(2.)) + .child( + icon_button("to-start", "skip-back", false, false) + .tooltip(tip("Go to start", Some("Home".into()))) + .on_click( + cx.listener(|this, _, w, cx| this.go_start(&GoToStart, w, cx)), + ), + ) + .child( + icon_button("step-back", "step-back", false, false) + .tooltip(tip("Previous frame", Some("←".into()))) + .on_click( + cx.listener(|this, _, w, cx| this.step_back(&StepBack, w, cx)), + ), + ) + .child( + icon_button("play", if playing { "pause" } else { "play" }, true, false) + .bg(c(hex::PLUGE_CONTROL)) + .tooltip(tip( + if playing { "Pause" } else { "Play" }, + Some("Space".into()), + )) + .on_click( + cx.listener(|this, _, w, cx| this.toggle_play(&TogglePlay, w, cx)), + ), + ) + .child( + icon_button("step-fwd", "step-forward", false, false) + .tooltip(tip("Next frame", Some("→".into()))) + .on_click( + cx.listener(|this, _, w, cx| { + this.step_forward(&StepForward, w, cx) + }), + ), + ) + .child( + icon_button("to-end", "skip-forward", false, false) + .tooltip(tip("Go to end", Some("End".into()))) + .on_click(cx.listener(|this, _, w, cx| this.go_end(&GoToEnd, w, cx))), + ), + ) + .child( + div() + .flex_1() + .flex() + .justify_end() + .font_family(theme::MONO) + .text_color(c(hex::INK_DIM)) + .child(self.tc(p.end())), + ); + + div() + .flex_1() + .min_w_0() + .flex() + .flex_col() + .bg(c(hex::PLUGE_SUB)) + .child( + div() + .h(px(32.)) + .flex_none() + .flex() + .items_center() + .px(px(10.)) + .gap(px(8.)) + .text_color(c(hex::INK_DIM)) + .child(SharedString::from(format!("{} Sequence", seq.name))) + .child(div().flex_1()) + .child( + div() + .font_family(theme::MONO) + .child(format!("{}×{} · {}", seq.width, seq.height, seq.fps)), + ), + ) + .child( + div() + .flex_1() + .min_h_0() + .flex() + .items_center() + .justify_center() + .px(px(16.)) + .pt(px(4.)) + .pb(px(8.)) + .child(screen), + ) + .child(transport) + } + + /* ---------- status bar ---------- */ + + pub(crate) fn render_status_bar(&self) -> impl IntoElement + use<> { + let item = |icon_name: &'static str, label: String| { + div() + .flex() + .flex_none() + .items_center() + .gap(px(6.)) + .child(icon(icon_name, px(14.), c(hex::INK_DIM))) + .child(label) + }; + let p = self.project(); + let seq = &p.sequence; + div() + .h(px(STATUS_H)) + .flex_none() + .flex() + .items_center() + .gap(px(16.)) + .px(px(10.)) + .bg(c(hex::PLUGE_BLACK)) + .border_t_1() + .border_color(c(hex::LINE)) + .text_color(c(hex::INK_DIM)) + .child( + div().flex_1().min_w_0().overflow_hidden().child( + div() + .relative() + .w_full() + .overflow_hidden() + .whitespace_nowrap() + .text_ellipsis() + .when(self.status.error, |d| d.text_color(c(hex::ERROR))) + .child(self.status.text.clone()) + .with_animation( + key("status", self.status.seq), + anim(motion::STATUS), + |d, t| d.opacity(t).top(px(lerp(6., 0., t))), + ), + ), + ) + .child(item( + "magnet", + if self.snap { + "Snap · 1 s grid".into() + } else { + "Snap off".into() + }, + )) + .child(item("workflow", format!("{} nodes", p.node_count()))) + .child( + div() + .flex_none() + .font_family(theme::MONO) + .child(format!("{}×{} · {}", seq.width, seq.height, seq.fps)), + ) + } +} + +fn centered(content: impl IntoElement) -> AnyElement { + div() + .absolute() + .left_0() + .top_0() + .size_full() + .flex() + .items_center() + .justify_center() + .child(content) + .into_any_element() +} diff --git a/crates/videode-app/src/peek.rs b/crates/videode-app/src/peek.rs new file mode 100644 index 0000000..df0db31 --- /dev/null +++ b/crates/videode-app/src/peek.rs @@ -0,0 +1,528 @@ +//! Peek (Tab): the selected clip's node chain, unfolded in place below the +//! clip. Click a node to inspect it, drag to reorder, + to add, Del to remove. + +use std::time::Duration; + +use gpui_kit::component::IconName; +use gpui_kit::component::Sizable as _; +use gpui_kit::component::button::Button; +use gpui_kit::component::menu::DropdownMenu as _; +use gpui_kit::prelude::*; +use gpui_kit::{ + Animation, AnimationExt as _, AnyElement, BoxShadow, Context, CursorStyle, FontWeight, + MouseButton, MouseDownEvent, PathBuilder, SharedString, Window, canvas, div, hsla, point, px, +}; +use videode_core::{Clip, ClipId, Node, NodeId}; + +use crate::actions::ToggleGraph; +use crate::inspector::add_node_items; +use crate::motion::{ease_out, key, lerp}; +use crate::theme::{self, CategoryExt, c, hex}; +use crate::timeline; +use crate::ui::{ghost_button, icon_button, kbd, tip}; +use crate::workspace::{PointerDrag, Workspace}; + +pub(crate) const CARD_W: f32 = 136.; +pub(crate) const CARD_H: f32 = 58.; +const GAP: f32 = 40.; +const PAD: f32 = 16.; +const ADD: f32 = 30.; +const PIN_W: f32 = 116.; +const HEADER_H: f32 = 38.; +const BODY_H: f32 = CARD_H + 28.; +const FOOTER_H: f32 = 32.; +const PANEL_H: f32 = HEADER_H + BODY_H + FOOTER_H; +const UNFOLD: Duration = Duration::from_millis(300); +const STAGGER_MS: f32 = 35.; + +fn card_x(i: usize) -> f32 { + PAD + i as f32 * (CARD_W + GAP) +} + +fn panel_width(nodes: usize) -> f32 { + card_x(nodes) + ADD + GAP + PIN_W + PAD +} + +/// Where a card dragged by `dx` from slot `from` would land. Slot 0 is the +/// generator's, so processing nodes land at 1 or later. +fn drop_index(from: usize, dx: f32, count: usize) -> usize { + let centre = card_x(from) + CARD_W / 2. + dx; + let before = (0..count) + .filter(|&i| i != from) + .filter(|&i| { + // A card dragged exactly onto a neighbour's centre passes it. + let other = card_x(i) + CARD_W / 2.; + if dx < 0. { + other < centre + } else { + other <= centre + } + }) + .count(); + before.clamp(1, count.saturating_sub(1).max(1)) +} + +/// One node card, shared by peek and the graph. `z` scales it. +pub(crate) fn node_card(node: &Node, summary: String, focused: bool, z: f32) -> gpui_kit::Div { + card( + node.kind.name().into(), + summary, + node.kind.category().color(), + focused, + node.bypass, + z, + ) +} + +/// A card with a category cap, a title and a one-line mono summary. Bypassed +/// cards are dashed, dimmed and struck through. +pub(crate) fn card( + title: SharedString, + summary: String, + cap: gpui_kit::Hsla, + focused: bool, + bypass: bool, + z: f32, +) -> gpui_kit::Div { + div() + .w(px(CARD_W * z)) + .h(px(CARD_H * z)) + .flex() + .flex_col() + .rounded(px(6. * z)) + .border_1() + .border_color(c(if focused { hex::BONE } else { hex::LINE_STRONG })) + .when(bypass, |d| d.border_dashed().opacity(0.55)) + .bg(c(hex::PLUGE_BLACK)) + .overflow_hidden() + .child(div().h(px(4. * z)).flex_none().bg(cap)) + .child( + div() + .flex_1() + .flex() + .flex_col() + .justify_center() + .px(px(9. * z)) + .child( + div() + .text_size(px(12. * z)) + .font_weight(FontWeight::SEMIBOLD) + .when(bypass, |d| d.line_through()) + .child(title), + ) + .child( + div() + .font_family(theme::MONO) + .text_size(px(11. * z)) + .text_color(c(hex::INK_FAINT)) + .whitespace_nowrap() + .overflow_hidden() + .text_ellipsis() + .child(if summary.is_empty() { + " ".to_string() + } else { + summary + }), + ), + ) +} + +pub(crate) fn port(x: f32, y: f32, d: f32) -> impl IntoElement { + div() + .absolute() + .left(px(x - d / 2.)) + .top(px(y - d / 2.)) + .w(px(d)) + .h(px(d)) + .rounded_full() + .border(px((d / 6.).max(1.))) + .border_color(c(hex::INK_DIM)) + .bg(c(hex::PLUGE_RAISED)) +} + +impl Workspace { + pub(crate) fn node_summary(&self, clip: &Clip, node: &Node) -> String { + if node.kind == videode_core::NodeKind::Source { + clip.media + .and_then(|m| self.project().media(m)) + .map(|m| m.file_name()) + .unwrap_or_default() + } else { + node.summary() + } + } + + pub(crate) fn open_peek(&mut self) { + let seq = self.next_seq(); + self.peek = Some(seq); + } + + pub(crate) fn node_down( + &mut self, + clip: ClipId, + node: NodeId, + generator: bool, + e: &MouseDownEvent, + cx: &mut Context, + ) { + cx.stop_propagation(); + self.focus_node = Some(node); + if !generator { + self.pdrag = Some(PointerDrag::Node { + clip, + node, + x0: f32::from(e.position.x), + dx: 0., + moved: false, + }); + } + cx.notify(); + } + + pub(crate) fn drop_node( + &mut self, + clip: ClipId, + node: NodeId, + dx: f32, + cx: &mut Context, + ) { + let Some(c) = self.project().clip(clip) else { + return; + }; + let Some(from) = c.node_index(node) else { + return; + }; + let to = drop_index(from, dx, c.nodes.len()); + if to != from { + let name = c.nodes[from].kind.name(); + if self + .apply("reorder node", cx, |p| p.move_node(clip, node, to)) + .is_some() + { + self.say(format!("Moved {name} to position {} in the chain", to + 1)); + } + } + cx.notify(); + } + + pub(crate) fn render_peek( + &self, + window: &mut Window, + cx: &mut Context, + ) -> Option { + let seq = self.peek?; + let clip = self.selection.and_then(|id| self.project().clip(id))?; + let track = self.project().track(clip.track)?; + + // Anchor to the clip on screen: below it when there's room, else above. + let lanes = self.tl.bounds.get(); + let viewport = window.viewport_size(); + let (win_w, win_h) = (f32::from(viewport.width), f32::from(viewport.height)); + let track_top: f32 = self + .project() + .sequence + .tracks + .iter() + .take_while(|t| t.id != clip.track) + .map(timeline::track_height) + .sum(); + let clip_top = f32::from(lanes.origin.y) + track_top; + let clip_bottom = clip_top + timeline::track_height(track); + let lanes_left = f32::from(lanes.origin.x); + let lanes_right = lanes_left + f32::from(lanes.size.width); + let x0 = (lanes_left + self.frame_x(clip.start)).max(lanes_left); + let x1 = (lanes_left + self.frame_x(clip.end())).min(lanes_right); + let w = panel_width(clip.nodes.len()).min(win_w - 24.); + let left = ((x0 + x1) / 2. - w / 2.).clamp(12., (win_w - w - 12.).max(12.)); + let floor = win_h - 26. - 8.; + let mut top = clip_bottom + 8.; + if top + PANEL_H > floor { + top = clip_top - PANEL_H - 8.; + let ceiling = f32::from(lanes.origin.y) - 60.; + if top < ceiling { + top = (floor - PANEL_H).max(ceiling); + } + } + + let dragging = match self.pdrag { + Some(PointerDrag::Node { + node, + dx, + moved: true, + .. + }) => Some((node, dx)), + _ => None, + }; + let n = clip.nodes.len(); + let mid = 14. + CARD_H / 2.; + + // Wires run card to card, then past the + to the track pin. + let wires = { + let bypassed: Vec = clip.nodes.iter().map(|n| n.bypass).collect(); + canvas( + |_, _, _| (), + move |b, _, window, _| { + let at = |x: f32, y: f32| point(b.origin.x + px(x), b.origin.y + px(y)); + let mut seg = |x1: f32, x2: f32, dashed: bool| { + let mut path = PathBuilder::stroke(px(1.5)); + if dashed { + path = path.dash_array(&[px(4.), px(3.)]); + } + path.move_to(at(x1, mid)); + path.line_to(at(x2, mid)); + if let Ok(p) = path.build() { + window.paint_path(p, c(hex::INK_FAINT)); + } + }; + for i in 0..n.saturating_sub(1) { + seg(card_x(i) + CARD_W, card_x(i + 1), bypassed[i + 1]); + } + seg(card_x(n - 1) + CARD_W, card_x(n) + ADD + GAP, false); + }, + ) + .absolute() + .top_0() + .left_0() + .size_full() + }; + + let total_ms = UNFOLD.as_millis() as f32 + STAGGER_MS * (n + 2) as f32; + let stagger = move |i: usize| { + let delay = 60. + i as f32 * STAGGER_MS; + Animation::new(Duration::from_millis(total_ms as u64)) + .with_easing(move |t| ease_out(((t * total_ms - delay) / 240.).clamp(0., 1.))) + }; + + let mut body: Vec = vec![wires.into_any_element()]; + let ws = cx.entity().downgrade(); + let drop_at = dragging + .and_then(|(node, dx)| clip.node_index(node).map(|from| drop_index(from, dx, n))); + for (i, node) in clip.nodes.iter().enumerate() { + let (clip_id, node_id, generator) = (clip.id, node.id, node.kind.is_generator()); + let dx = dragging.filter(|(id, _)| *id == node.id).map(|(_, dx)| dx); + let x = card_x(i) + dx.unwrap_or(0.); + let card = node_card( + node, + self.node_summary(clip, node), + self.focus_node == Some(node.id), + 1., + ) + .id(SharedString::from(format!("peek-node-{}", node.id.0))) + .absolute() + .left(px(x)) + .top(px(14.)) + .when(!generator, |d| d.cursor(CursorStyle::OpenHand)) + .when(dx.is_some(), |d| { + d.cursor(CursorStyle::ClosedHand).shadow(vec![BoxShadow { + color: hsla(0., 0., 0., 0.5), + offset: point(px(0.), px(8.)), + blur_radius: px(20.), + spread_radius: px(0.), + inset: false, + }]) + }) + .on_mouse_down( + MouseButton::Left, + cx.listener(move |this, e: &MouseDownEvent, _, cx| { + this.node_down(clip_id, node_id, generator, e, cx) + }), + ) + .tooltip(tip( + if generator { + "What this clip is made from" + } else { + "Click to inspect · drag to reorder" + }, + None, + )); + let card = if dx.is_some() { + card.into_any_element() + } else { + card.with_animation(key("peek-node", seq * 64 + i as u64), stagger(i), |d, t| { + d.opacity(t).mt(px(lerp(6., 0., t))) + }) + .into_any_element() + }; + if !generator { + body.push(port(card_x(i), mid, 9.).into_any_element()); + } + body.push(port(card_x(i) + CARD_W, mid, 9.).into_any_element()); + body.push(card); + } + if let Some(to) = drop_at { + let x = if to == 0 { + card_x(0) + } else { + card_x(to) - GAP / 2. + }; + body.push( + div() + .absolute() + .left(px(x - 1.)) + .top(px(10.)) + .w(px(2.)) + .h(px(CARD_H + 8.)) + .bg(c(hex::BONE)) + .into_any_element(), + ); + } + let (clip_id, clip_kind) = (clip.id, clip.kind); + body.push( + div() + .absolute() + .left(px(card_x(n))) + .top(px(mid - ADD / 2.)) + .child( + Button::new("peek-add") + .icon(IconName::Plus) + .outline() + .small() + .tooltip("Add node A") + .dropdown_menu(move |menu, _, _| { + add_node_items(menu.min_w(px(200.)), clip_id, clip_kind, ws.clone()) + }), + ) + .into_any_element(), + ); + body.push( + div() + .absolute() + .left(px(card_x(n) + ADD + GAP)) + .top(px(mid - 15.)) + .h(px(30.)) + .px(px(12.)) + .flex() + .items_center() + .gap(px(5.)) + .rounded_full() + .border_1() + .border_color(c(hex::LINE_STRONG)) + .text_color(c(hex::INK_DIM)) + .child("to") + .child( + div() + .font_family(theme::MONO) + .font_weight(FontWeight::SEMIBOLD) + .text_color(c(hex::INK)) + .child(SharedString::from(track.label.clone())), + ) + .child(SharedString::from(track.name.clone())) + .into_any_element(), + ); + body.push(port(card_x(n) + ADD + GAP, mid, 9.).into_any_element()); + + let header = div() + .h(px(HEADER_H)) + .flex_none() + .flex() + .items_center() + .gap(px(8.)) + .pl(px(14.)) + .pr(px(6.)) + .border_b_1() + .border_color(c(hex::LINE)) + .child(crate::ui::icon("layers", px(16.), c(hex::INK_DIM))) + .child( + div() + .font_weight(FontWeight::SEMIBOLD) + .child(self.project().clip_name(clip)), + ) + .child(div().text_color(c(hex::INK_FAINT)).child(format!( + "{n} node{} · drag to reorder", + if n == 1 { "" } else { "s" } + ))) + .child(div().flex_1()) + .child( + ghost_button("peek-graph", "workflow", "Whole graph", Some("⇧ Tab")) + .on_click(|_, w, cx| w.dispatch_action(Box::new(ToggleGraph), cx)), + ) + .child( + icon_button("peek-close", "close", false, false) + .tooltip(tip("Close", Some("Esc".into()))) + .on_click(cx.listener(|this, _, _, cx| { + this.peek = None; + cx.notify(); + })), + ); + let hint = |k: &'static str, text: &'static str| { + div() + .flex() + .items_center() + .gap(px(6.)) + .child(kbd(k)) + .child(text) + }; + let footer = div() + .h(px(FOOTER_H)) + .flex_none() + .flex() + .items_center() + .gap(px(16.)) + .px(px(14.)) + .text_color(c(hex::INK_FAINT)) + .child(hint("click", "inspect node")) + .child(hint("Del", "remove focused node")) + .child(hint("⇧ B", "bypass")) + .child(hint("Esc", "close")); + + Some( + div() + .id("peek") + .absolute() + .left(px(left)) + .top(px(top)) + .w(px(w)) + .h(px(PANEL_H)) + .flex() + .flex_col() + .overflow_hidden() + .occlude() + .rounded(px(10.)) + .border_1() + .border_color(c(hex::LINE_STRONG)) + .bg(c(hex::PLUGE_RAISED)) + .shadow(vec![BoxShadow { + color: hsla(0., 0., 0., 0.6), + offset: point(px(0.), px(18.)), + blur_radius: px(48.), + spread_radius: px(0.), + inset: false, + }]) + .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) + .child(header) + .child( + div() + .id("peek-body") + .relative() + .h(px(BODY_H)) + .flex_none() + .overflow_x_scroll() + .children(body), + ) + .child(footer) + .with_animation( + key("peek", seq), + Animation::new(UNFOLD).with_easing(ease_out), + |d, t| d.h(px(lerp(12., PANEL_H, t))).opacity(lerp(0.3, 1., t)), + ) + .into_any_element(), + ) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn drop_index_respects_generator_slot() { + // Three nodes; drag the last one far left: it lands at 1, not 0. + assert_eq!(drop_index(2, -1000., 3), 1); + // A small wiggle leaves it in place. + assert_eq!(drop_index(1, 10., 3), 1); + // Past the next card's centre swaps them. + assert_eq!(drop_index(1, CARD_W + GAP, 3), 2); + // And the same exact distance back to the left. + assert_eq!(drop_index(2, -(CARD_W + GAP), 3), 1); + } +} diff --git a/crates/videode-app/src/settings.rs b/crates/videode-app/src/settings.rs new file mode 100644 index 0000000..2125ee1 --- /dev/null +++ b/crates/videode-app/src/settings.rs @@ -0,0 +1,187 @@ +//! App-wide settings: loaded at startup, saved on every change, and applied +//! immediately. The animation setting drives GPUI's `reduce_motion` flag, +//! which every animation in the app checks. + +use std::path::PathBuf; + +use gpui_kit::{App, Global}; +use videode_core::Settings; + +pub struct AppSettings { + pub settings: Settings, + /// Where settings are saved; `None` if no config folder could be found. + pub path: Option, + /// The operating system's reduce-motion preference, if it could be read. + pub system_reduces_motion: Option, + /// Problems from loading or saving, shown in the settings panel. + pub notes: Vec, +} + +impl Global for AppSettings {} + +/// `VIDEODE_CONFIG_DIR` overrides the platform config folder (used by the +/// snapshot tool so it never reads or writes real settings). +fn settings_path() -> Option { + let dir = match std::env::var_os("VIDEODE_CONFIG_DIR") { + Some(dir) => PathBuf::from(dir), + None => dirs::config_dir()?.join("videode"), + }; + Some(dir.join("settings.kdl")) +} + +fn load() -> (Settings, Vec) { + let Some(path) = settings_path() else { + return ( + Settings::default(), + vec!["No config folder found; settings won't be saved".into()], + ); + }; + match std::fs::read_to_string(&path) { + Err(e) if e.kind() == std::io::ErrorKind::NotFound => (Settings::default(), Vec::new()), + Err(e) => ( + Settings::default(), + vec![format!("Couldn't read {}: {e}", path.display())], + ), + Ok(text) => match Settings::from_kdl(&text) { + Ok((s, notes)) => (s, notes), + Err(e) => ( + Settings::default(), + vec![format!( + "{} isn't valid KDL, using defaults: {e}", + path.display() + )], + ), + }, + } +} + +pub fn init(cx: &mut App) { + let (settings, notes) = load(); + cx.set_global(AppSettings { + settings, + path: settings_path(), + system_reduces_motion: system_reduces_motion(), + notes, + }); + apply_motion(cx); +} + +pub fn get(cx: &App) -> &Settings { + &cx.global::().settings +} + +/// Changes settings, saves them and applies the result. +pub fn update(cx: &mut App, f: impl FnOnce(&mut Settings)) { + let s = cx.global_mut::(); + f(&mut s.settings); + if let Some(path) = s.path.clone() { + let text = s.settings.to_kdl(); + let saved = path + .parent() + .map_or(Ok(()), std::fs::create_dir_all) + .and_then(|()| std::fs::write(&path, text)); + s.notes.retain(|n| !n.starts_with("Couldn't save")); + if let Err(e) = saved { + s.notes + .push(format!("Couldn't save {}: {e}", path.display())); + } + } + apply_motion(cx); +} + +/// Re-reads the OS preference; called when the settings panel opens so a +/// change made while videode runs is picked up. +pub fn refresh_system(cx: &mut App) { + cx.global_mut::().system_reduces_motion = system_reduces_motion(); + apply_motion(cx); +} + +fn apply_motion(cx: &mut App) { + let s = cx.global::(); + let on = s + .settings + .animations + .enabled(s.system_reduces_motion.unwrap_or(false)); + cx.set_reduce_motion(!on); +} + +pub fn motion(cx: &App) -> bool { + !cx.reduce_motion() +} + +/* ---------- OS reduce-motion preference ---------- */ + +#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))] +fn command_output(program: &str, args: &[&str]) -> Option { + let out = std::process::Command::new(program) + .args(args) + .output() + .ok()?; + out.status + .success() + .then(|| String::from_utf8_lossy(&out.stdout).trim().to_string()) +} + +#[cfg(any(target_os = "linux", target_os = "freebsd"))] +fn system_reduces_motion() -> Option { + // GNOME and most GTK desktops. + if let Some(v) = command_output( + "gsettings", + &["get", "org.gnome.desktop.interface", "enable-animations"], + ) { + return Some(v == "false"); + } + // KDE Plasma: an animation speed of 0 means "instant". + for tool in ["kreadconfig6", "kreadconfig5"] { + if let Some(v) = command_output( + tool, + &[ + "--file", + "kdeglobals", + "--group", + "KDE", + "--key", + "AnimationDurationFactor", + ], + ) { + return Some(v.parse::().is_ok_and(|f| f == 0.0)); + } + } + None +} + +#[cfg(target_os = "macos")] +fn system_reduces_motion() -> Option { + // Missing key means the user never turned it on. + Some( + command_output( + "defaults", + &["read", "com.apple.universalaccess", "reduceMotion"], + ) + .as_deref() + == Some("1"), + ) +} + +#[cfg(windows)] +fn system_reduces_motion() -> Option { + use windows_sys::Win32::UI::WindowsAndMessaging::{ + SPI_GETCLIENTAREAANIMATION, SystemParametersInfoW, + }; + // "Show animations in Windows" in Settings › Accessibility › Visual effects. + let mut enabled: i32 = 1; + let ok = unsafe { + SystemParametersInfoW(SPI_GETCLIENTAREAANIMATION, 0, (&raw mut enabled).cast(), 0) + }; + (ok != 0).then_some(enabled == 0) +} + +#[cfg(not(any( + target_os = "linux", + target_os = "freebsd", + target_os = "macos", + windows +)))] +fn system_reduces_motion() -> Option { + None +} diff --git a/crates/videode-app/src/tests.rs b/crates/videode-app/src/tests.rs new file mode 100644 index 0000000..de13e73 --- /dev/null +++ b/crates/videode-app/src/tests.rs @@ -0,0 +1,324 @@ +//! Interaction tests on GPUI's test platform: real keystrokes and input +//! through the real key bindings, checked against the document. + +use gpui::{Entity, TestAppContext, VisualTestContext}; +use videode_core::{ClipId, Document, NodeKind, demo::demo_project}; + +use crate::workspace::{FieldTarget, PointerDrag, View, Workspace}; + +#[cfg(target_os = "macos")] +const MOD: &str = "cmd"; +#[cfg(not(target_os = "macos"))] +const MOD: &str = "ctrl"; + +fn open(cx: &mut TestAppContext) -> (Entity, &mut VisualTestContext) { + let config = std::env::temp_dir().join(format!("videode-test-{}", std::process::id())); + // SAFETY: every test sets the same value before reading it. + unsafe { std::env::set_var("VIDEODE_CONFIG_DIR", config) }; + cx.update(crate::init); + cx.update(|cx| cx.set_reduce_motion(true)); + cx.add_window_view(|window, cx| { + Workspace::with_document(Document::new(demo_project(), None), window, cx) + }) +} + +/// The demo clip with a Grade node (dusk_gradient), selected. +fn select_graded(ws: &Entity, cx: &mut VisualTestContext) -> ClipId { + ws.update(cx, |ws, cx| { + let id = ws + .doc + .project + .sequence + .clips + .iter() + .find(|c| c.first(NodeKind::Grade).is_some() && c.media.is_some()) + .expect("demo has a graded clip") + .id; + ws.select(Some(id)); + cx.notify(); + id + }) +} + +fn exposure(ws: &Entity, cx: &mut VisualTestContext, clip: ClipId) -> f64 { + ws.read_with(cx, |ws, _| { + ws.doc + .project + .clip(clip) + .unwrap() + .first(NodeKind::Grade) + .unwrap() + .number("exposure") + }) +} + +#[gpui::test] +fn tab_peeks_and_shift_tab_shows_the_graph(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + select_graded(&ws, cx); + cx.simulate_keystrokes("tab"); + assert!( + ws.read_with(cx, |ws, _| ws.peek.is_some()), + "Tab opens peek" + ); + cx.simulate_keystrokes("escape"); + assert!( + ws.read_with(cx, |ws, _| ws.peek.is_none()), + "Esc closes peek first" + ); + cx.simulate_keystrokes("shift-tab"); + assert_eq!(ws.read_with(cx, |ws, _| ws.view), View::Graph); + cx.simulate_keystrokes("escape"); + assert_eq!(ws.read_with(cx, |ws, _| ws.view), View::Timeline); + assert!( + ws.read_with(cx, |ws, _| ws.selection.is_some()), + "Esc from the graph keeps the selection" + ); +} + +#[gpui::test] +fn typing_in_the_palette_does_not_trigger_shortcuts(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + let clips = ws.read_with(cx, |ws, _| ws.doc.project.sequence.clips.len()); + cx.simulate_keystrokes(&format!("{MOD}-k")); + assert!(ws.read_with(cx, |ws, _| ws.palette.is_some())); + // S splits and Space plays in the timeline; here they are just text. + cx.simulate_input("s "); + cx.run_until_parked(); + assert_eq!( + ws.read_with(cx, |ws, _| ws.doc.project.sequence.clips.len()), + clips + ); + assert!(ws.read_with(cx, |ws, _| ws.playback.is_none())); + let query = ws.read_with(cx, |ws, cx| { + ws.palette + .as_ref() + .unwrap() + .input + .read(cx) + .value() + .to_string() + }); + assert_eq!(query, "s "); + cx.simulate_keystrokes("escape"); + assert!(ws.read_with(cx, |ws, _| ws.palette.is_none())); +} + +#[gpui::test] +fn the_palette_runs_the_best_match(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + cx.simulate_keystrokes(&format!("{MOD}-k")); + cx.simulate_input("graph view"); + cx.simulate_keystrokes("enter"); + cx.run_until_parked(); + assert_eq!(ws.read_with(cx, |ws, _| ws.view), View::Graph); + assert!(ws.read_with(cx, |ws, _| ws.palette.is_none())); + assert_eq!(ws.read_with(cx, |ws, _| ws.recent_commands.len()), 1); +} + +#[gpui::test] +fn palette_adds_nodes_to_the_selection(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + let clip = select_graded(&ws, cx); + let before = ws.read_with(cx, |ws, _| ws.doc.project.clip(clip).unwrap().nodes.len()); + cx.simulate_keystrokes("a"); + cx.simulate_input("blur"); + cx.simulate_keystrokes("enter"); + cx.run_until_parked(); + let nodes = ws.read_with(cx, |ws, _| { + ws.doc + .project + .clip(clip) + .unwrap() + .nodes + .iter() + .map(|n| n.kind) + .collect::>() + }); + assert_eq!(nodes.len(), before + 1); + assert_eq!(nodes.last(), Some(&NodeKind::Blur)); +} + +#[gpui::test] +fn typed_values_commit_on_enter_and_cancel_on_escape(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + let clip = select_graded(&ws, cx); + let target = ws.read_with(cx, |ws, _| { + let node = ws + .doc + .project + .clip(clip) + .unwrap() + .first(NodeKind::Grade) + .unwrap() + .id; + FieldTarget::Param { + clip, + node, + key: "exposure", + } + }); + let start = |cx: &mut VisualTestContext| { + ws.update_in(cx, |ws, window, cx| { + ws.begin_field(target, "0".into(), window, cx) + }); + }; + + start(cx); + cx.simulate_input("1.5"); + cx.simulate_keystrokes("enter"); + cx.run_until_parked(); + assert_eq!(exposure(&ws, cx, clip), 1.5); + assert!(ws.read_with(cx, |ws, _| ws.field.is_none())); + + start(cx); + cx.simulate_input("3"); + cx.simulate_keystrokes("escape"); + cx.run_until_parked(); + assert_eq!(exposure(&ws, cx, clip), 1.5, "Esc discards the typed value"); + + start(cx); + cx.simulate_input("bright"); + cx.simulate_keystrokes("enter"); + cx.run_until_parked(); + assert_eq!(exposure(&ws, cx, clip), 1.5); + assert!( + ws.read_with(cx, |ws, _| ws.status.error), + "invalid input is reported" + ); +} + +/// Drags the selected clip's exposure label from x = 100 to `to`. +fn scrub_exposure(ws: &Entity, cx: &mut VisualTestContext, clip: ClipId, to: f32) { + let v0 = exposure(ws, cx, clip); + ws.update(cx, |ws, cx| { + let node = ws + .doc + .project + .clip(clip) + .unwrap() + .first(NodeKind::Grade) + .unwrap() + .id; + ws.pdrag = Some(PointerDrag::Scrub { + clip, + node, + key: "exposure", + x0: 100., + v0, + }); + for x in [110., (110. + to) / 2., to] { + ws.pointer_move( + gpui::point(gpui::px(x), gpui::px(0.)), + Default::default(), + cx, + ); + } + ws.pointer_up(cx); + }); +} + +#[gpui::test] +fn scrubbing_is_one_undo_step(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + let clip = select_graded(&ws, cx); + let before = exposure(&ws, cx, clip); + scrub_exposure(&ws, cx, clip, 160.); + let after = exposure(&ws, cx, clip); + assert!(after > before, "dragging right raises the value"); + cx.simulate_keystrokes(&format!("{MOD}-z")); + assert_eq!(exposure(&ws, cx, clip), before, "one undo restores it"); +} + +#[gpui::test] +fn each_scrub_is_its_own_undo_step(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + let clip = select_graded(&ws, cx); + scrub_exposure(&ws, cx, clip, 160.); + let first = exposure(&ws, cx, clip); + scrub_exposure(&ws, cx, clip, 160.); + assert!(exposure(&ws, cx, clip) > first); + cx.simulate_keystrokes(&format!("{MOD}-z")); + assert_eq!( + exposure(&ws, cx, clip), + first, + "undo only takes back the second drag, though both started at the same x" + ); +} + +#[gpui::test] +fn delete_in_peek_removes_the_focused_node_not_the_clip(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + let clip = select_graded(&ws, cx); + let clips = ws.read_with(cx, |ws, _| ws.doc.project.sequence.clips.len()); + ws.update(cx, |ws, cx| { + ws.focus_node = ws + .doc + .project + .clip(clip) + .unwrap() + .first(NodeKind::Grade) + .map(|n| n.id); + ws.open_peek(); + cx.notify(); + }); + cx.simulate_keystrokes("delete"); + ws.read_with(cx, |ws, _| { + assert_eq!(ws.doc.project.sequence.clips.len(), clips); + assert!( + ws.doc + .project + .clip(clip) + .unwrap() + .first(NodeKind::Grade) + .is_none() + ); + }); + cx.simulate_keystrokes("shift-b"); + assert!( + ws.read_with(cx, |ws, _| ws.status.text.contains("Click a node")), + "nothing focused to bypass" + ); +} + +#[gpui::test] +fn bypass_and_reorder_from_peek(cx: &mut TestAppContext) { + let (ws, cx) = open(cx); + let clip = select_graded(&ws, cx); + let (grade, fade) = ws.read_with(cx, |ws, _| { + let c = ws.doc.project.clip(clip).unwrap(); + ( + c.first(NodeKind::Grade).unwrap().id, + c.first(NodeKind::Fade).unwrap().id, + ) + }); + ws.update(cx, |ws, cx| { + ws.focus_node = Some(grade); + cx.notify(); + }); + cx.simulate_keystrokes("shift-b"); + assert!(ws.read_with(cx, |ws, _| { + ws.doc + .project + .clip(clip) + .unwrap() + .node(grade) + .unwrap() + .bypass + })); + // Drag Fade (slot 2) one slot left. + ws.update(cx, |ws, cx| { + ws.drop_node(clip, fade, -(crate::peek::CARD_W + 40.), cx) + }); + let order = ws.read_with(cx, |ws, _| { + ws.doc + .project + .clip(clip) + .unwrap() + .nodes + .iter() + .map(|n| n.kind) + .collect::>() + }); + assert_eq!(order, [NodeKind::Source, NodeKind::Fade, NodeKind::Grade]); +} diff --git a/crates/videode-app/src/theme.rs b/crates/videode-app/src/theme.rs new file mode 100644 index 0000000..4032d2d --- /dev/null +++ b/crates/videode-app/src/theme.rs @@ -0,0 +1,123 @@ +//! The "Test Card" design system (see DESIGN.md at the repo root). +//! +//! Surfaces are PLUGE near-black steps. The seven 75%-bar colours belong to +//! node categories only and never to chrome. + +use gpui_kit::component::{Theme, ThemeMode}; +use gpui_kit::{App, Hsla, Pixels, px, rgb, rgba}; + +pub const FONT: &str = "Geist"; +pub const MONO: &str = "Geist Mono"; + +/// The only two shell type sizes; keycaps use [`KEYCAP`]. +pub const TEXT: Pixels = px(12.); +pub const TITLE: Pixels = px(13.); +pub const KEYCAP: Pixels = px(11.); + +pub mod hex { + pub const PLUGE_SUB: u32 = 0x09090a; + pub const PLUGE_BLACK: u32 = 0x111113; + pub const PLUGE_RAISED: u32 = 0x19191c; + pub const PLUGE_CONTROL: u32 = 0x222226; + pub const PLUGE_HOVER: u32 = 0x2b2b30; + pub const LINE: u32 = 0x2a2a2f; + pub const LINE_STRONG: u32 = 0x3a3a41; + pub const INK: u32 = 0xe8e7e2; + pub const INK_DIM: u32 = 0xa3a29d; + pub const INK_FAINT: u32 = 0x8a8984; + pub const BONE: u32 = 0xf1ede0; + pub const WARN: u32 = 0xe0a03a; + pub const ERROR: u32 = 0xe05a4f; +} + +pub fn c(hex: u32) -> Hsla { + rgb(hex).into() +} + +pub use videode_core::Category; + +/// Node categories each own one 75% SMPTE bar colour. +pub trait CategoryExt { + fn color(self) -> Hsla; + fn label(self) -> &'static str; +} + +impl CategoryExt for Category { + fn color(self) -> Hsla { + c(match self { + Category::Source => 0xbdbdb8, + Category::Transform => 0xc9c43c, + Category::Look => 0x3cc4c4, + Category::Composite => 0x45c45a, + Category::Audio => 0xc43cc4, + Category::Text => 0xd0463f, + Category::Output => 0x4a62d0, + }) + } + + fn label(self) -> &'static str { + match self { + Category::Source => "Source", + Category::Transform => "Transform", + Category::Look => "Color & filter", + Category::Composite => "Composite", + Category::Audio => "Audio", + Category::Text => "Text", + Category::Output => "Output", + } + } +} + +pub const ALL_CATEGORIES: [Category; 7] = [ + Category::Source, + Category::Transform, + Category::Look, + Category::Composite, + Category::Audio, + Category::Text, + Category::Output, +]; + +/// Points GPUI Kit's component theme at the Test Card palette so menus, +/// inputs and popovers from the kit match the shell. +pub fn apply(cx: &mut App) { + Theme::change(ThemeMode::Dark, None, cx); + Theme::update(cx, |t| { + t.font_family = FONT.into(); + t.mono_font_family = MONO.into(); + t.font_size = TEXT; + t.mono_font_size = TEXT; + t.radius = px(5.); + t.radius_lg = px(10.); + + t.background = c(hex::PLUGE_BLACK); + t.foreground = c(hex::INK); + t.border = c(hex::LINE); + t.muted = c(hex::PLUGE_RAISED); + t.muted_foreground = c(hex::INK_DIM); + t.popover = c(hex::PLUGE_RAISED); + t.popover_foreground = c(hex::INK); + t.accent = c(hex::PLUGE_HOVER); + t.accent_foreground = c(hex::INK); + t.input = c(hex::LINE_STRONG); + t.ring = c(hex::BONE); + t.caret = c(hex::BONE); + t.selection = rgba(0xf1ede040).into(); + t.primary = c(hex::BONE); + t.primary_hover = c(0xfffaf0); + t.primary_active = c(hex::BONE); + t.primary_foreground = c(hex::PLUGE_SUB); + t.secondary = c(hex::PLUGE_RAISED); + t.secondary_hover = c(hex::PLUGE_CONTROL); + t.secondary_active = c(hex::PLUGE_HOVER); + t.secondary_foreground = c(hex::INK); + t.title_bar = c(hex::PLUGE_BLACK); + t.title_bar_border = c(hex::LINE); + t.status_bar = c(hex::PLUGE_BLACK); + t.status_bar_border = c(hex::LINE); + t.scrollbar_thumb = c(hex::PLUGE_HOVER); + t.scrollbar_thumb_hover = c(hex::LINE_STRONG); + t.warning = c(hex::WARN); + t.danger = c(hex::ERROR); + }); +} diff --git a/crates/videode-app/src/timeline.rs b/crates/videode-app/src/timeline.rs new file mode 100644 index 0000000..1552ee3 --- /dev/null +++ b/crates/videode-app/src/timeline.rs @@ -0,0 +1,1111 @@ +//! The timeline: ruler, track headers, clips with chain strips, playhead, +//! and the pointer interactions (select, move, trim, blade, scrub, zoom). +//! +//! Hit-testing is done here from the project data rather than per element, +//! so drags keep working while clips re-render under the pointer. + +use std::cell::Cell; +use std::rc::Rc; +use std::time::Instant; + +use gpui_kit::prelude::*; +use gpui_kit::{ + AnimationExt as _, AnyElement, Bounds, BoxShadow, Context, CursorStyle, DispatchPhase, + FontWeight, Hsla, Modifiers, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Pixels, + Point, ScrollWheelEvent, SharedString, Window, canvas, div, point, px, +}; +use videode_core::{ + Clip, ClipId, ClipKind, Frame, NodeKind, StreamKind, Track, TrackId, snap, time, +}; + +use crate::actions::{Split, ToggleGraph, TogglePeek, ZoomIn, ZoomOut, ZoomToFit}; +use crate::motion::{self, anim, ease_out, key, lerp}; +use crate::theme::{self, CategoryExt, c, hex}; +use crate::ui::{self, ghost_button, icon_button, tip}; +use crate::workspace::{Tool, Workspace}; + +const TOOLBAR_H: f32 = 32.; +const RULER_H: f32 = 28.; +const HEADS_W: f32 = 168.; +const EDGE_PX: f32 = 6.; +const SNAP_PX: f32 = 8.; +const MIN_PPF: f32 = 0.05; +const MAX_PPF: f32 = 40.; + +pub(crate) fn track_height(t: &Track) -> f32 { + match t.kind { + StreamKind::Video => 60., + StreamKind::Audio => 48., + } +} + +#[derive(Clone, Copy, Debug)] +pub(crate) enum Drag { + Move { + clip: ClipId, + grab: Frame, + from_track: TrackId, + }, + TrimStart { + clip: ClipId, + }, + TrimEnd { + clip: ClipId, + }, + Scrub, +} + +/// View (pixels per frame, scroll) moving from `from` to `to`. +pub(crate) struct ZoomTween { + from: (f32, f32), + to: (f32, f32), + started: Instant, +} + +pub(crate) struct TimelineState { + /// Pixels per frame. + pub ppf: f32, + pub scroll_x: f32, + pub fit_pending: bool, + pub drag: Option, + pub snap_line: Option, + pub hover_frame: Option, + /// An eased zoom in progress (keyboard, buttons and fit only). + pub zoom: Option, + /// Lanes area in window coordinates, captured each frame. + pub bounds: Rc>>, +} + +impl Default for TimelineState { + fn default() -> Self { + Self { + ppf: 1.2, + scroll_x: 0., + fit_pending: true, + drag: None, + snap_line: None, + zoom: None, + hover_frame: None, + bounds: Rc::default(), + } + } +} + +enum Hit { + Clip { id: ClipId, edge: Option }, + Empty, +} + +impl Workspace { + pub(crate) fn lanes_width(&self) -> f32 { + f32::from(self.tl.bounds.get().size.width) + } + + fn frame_at(&self, window_x: Pixels) -> Frame { + let local = f32::from(window_x - self.tl.bounds.get().origin.x); + ((local + self.tl.scroll_x) / self.tl.ppf).round() as Frame + } + + pub(crate) fn frame_x(&self, frame: Frame) -> f32 { + frame as f32 * self.tl.ppf - self.tl.scroll_x + } + + fn track_at(&self, window_y: Pixels) -> Option { + let mut y = f32::from(window_y - self.tl.bounds.get().origin.y); + for t in &self.project().sequence.tracks { + let h = track_height(t); + if y >= 0. && y < h { + return Some(t.id); + } + y -= h; + } + None + } + + fn hit(&self, position: Point) -> Hit { + let track = self.track_at(position.y); + let local = f32::from(position.x - self.tl.bounds.get().origin.x); + if let Some(track) = track { + for clip in self.project().clips_on(track) { + let x0 = self.frame_x(clip.start); + let x1 = self.frame_x(clip.end()); + if local >= x0 && local <= x1 { + let zone = EDGE_PX.min((x1 - x0) / 3.); + let edge = if local - x0 <= zone { + Some(false) + } else if x1 - local <= zone { + Some(true) + } else { + None + }; + return Hit::Clip { id: clip.id, edge }; + } + } + } + Hit::Empty + } + + fn snap_tolerance(&self) -> Frame { + ((SNAP_PX / self.tl.ppf).ceil() as Frame).max(1) + } + + /// Snaps to clip edges and the playhead, then to whole seconds when the + /// grid is visible. Returns the snapped frame and whether it snapped. + fn snapped(&self, frame: Frame, exclude: Option) -> (Frame, bool) { + if !self.snap { + return (frame, false); + } + let points = self.project().snap_points(exclude, &[self.playhead]); + let tol = self.snap_tolerance(); + if let Some(f) = snap(frame, &points, tol) { + return (f, true); + } + let sec = self.fps().nominal(); + if self.tl.ppf * sec as f32 >= 12. { + let grid = ((frame as f64 / sec as f64).round() as Frame) * sec; + if (grid - frame).abs() <= tol / 2 { + return (grid, true); + } + } + (frame, false) + } + + pub(crate) fn follow_playhead(&mut self) { + let w = self.lanes_width(); + if w <= 0. { + return; + } + let x = self.frame_x(self.playhead); + if x > w - 40. { + self.tl.scroll_x = (self.playhead as f32 * self.tl.ppf - 60.).max(0.); + } else if x < 0. { + self.tl.scroll_x = (self.playhead as f32 * self.tl.ppf - w + 60.).max(0.); + } + } + + fn clamp_scroll(&mut self) { + let w = self.lanes_width(); + let tail = 20 * self.fps().nominal(); + let content = (self.project().end() + tail) as f32 * self.tl.ppf; + self.tl.scroll_x = self.tl.scroll_x.clamp(0., (content - w).max(0.)); + } + + fn zoom_at(&mut self, factor: f32, anchor_x: f32) { + let frame = (anchor_x + self.tl.scroll_x) / self.tl.ppf; + self.tl.ppf = (self.tl.ppf * factor).clamp(MIN_PPF, MAX_PPF); + self.tl.scroll_x = frame * self.tl.ppf - anchor_x; + self.clamp_scroll(); + } + + /// Runs `f` against the view a running zoom is heading to (so repeated + /// presses accumulate), then eases or jumps to the result. + fn retarget(&mut self, animate: bool, f: impl FnOnce(&mut Self)) { + let shown = (self.tl.ppf, self.tl.scroll_x); + if let Some(z) = self.tl.zoom.take() { + (self.tl.ppf, self.tl.scroll_x) = z.to; + } + f(self); + let to = (self.tl.ppf, self.tl.scroll_x); + if animate && to != shown { + (self.tl.ppf, self.tl.scroll_x) = shown; + self.tl.zoom = Some(ZoomTween { + from: shown, + to, + started: Instant::now(), + }); + } + } + + pub(crate) fn zoom_around_playhead(&mut self, factor: f32, animate: bool) { + self.retarget(animate, |this| { + let x = this + .frame_x(this.playhead) + .clamp(0., this.lanes_width().max(0.)); + this.zoom_at(factor, x); + }); + } + + pub(crate) fn fit(&mut self, animate: bool) { + self.retarget(animate, |this| { + let w = this.lanes_width(); + let end = this.project().end().max(30 * this.fps().nominal()); + this.tl.ppf = ((w - 40.) / end as f32).clamp(MIN_PPF, MAX_PPF); + this.tl.scroll_x = 0.; + }); + } + + fn tick_zoom(&mut self, window: &mut Window) { + let Some(z) = &self.tl.zoom else { + return; + }; + let t = z.started.elapsed().as_secs_f32() / motion::ZOOM.as_secs_f32(); + let e = ease_out(t); + self.tl.ppf = lerp(z.from.0, z.to.0, e); + self.tl.scroll_x = lerp(z.from.1, z.to.1, e); + if t >= 1. { + self.tl.zoom = None; + } else { + window.request_animation_frame(); + } + } + + pub(crate) fn cancel_drag(&mut self) { + if matches!( + self.tl.drag, + Some(Drag::Move { .. } | Drag::TrimStart { .. } | Drag::TrimEnd { .. }) + ) { + self.doc.cancel_gesture(); + } + self.tl.drag = None; + self.tl.snap_line = None; + } + + /* ---------- pointer ---------- */ + + fn lanes_mouse_down( + &mut self, + e: &MouseDownEvent, + window: &mut Window, + cx: &mut Context, + ) { + window.focus(&self.focus, cx); + match self.hit(e.position) { + Hit::Empty => { + self.select(None); + self.seek(self.frame_at(e.position.x)); + self.tl.drag = Some(Drag::Scrub); + } + Hit::Clip { id, edge } => { + if self.tool == Tool::Blade { + let (at, _) = self.snapped(self.frame_at(e.position.x), None); + if self.apply("split", cx, |p| p.split(id, at)).is_some() { + let tc = self.tc(at); + self.say(format!("Cut at {tc} · {} to undo", ui::cmd_key("Z"))); + self.flash_cut(at); + } + return; + } + self.select(Some(id)); + let clip = self.project().clip(id).expect("hit-tested"); + let locked = self.project().track(clip.track).is_some_and(|t| t.locked); + if locked { + let label = self.project().track(clip.track).map(|t| t.label.clone()); + self.say(format!( + "{} is locked · unlock it in the track header to edit", + label.unwrap_or_default() + )); + } else { + let grab = self.frame_at(e.position.x) - clip.start; + let from_track = clip.track; + self.doc.begin_gesture(); + self.tl.drag = Some(match edge { + Some(false) => Drag::TrimStart { clip: id }, + Some(true) => Drag::TrimEnd { clip: id }, + None => Drag::Move { + clip: id, + grab, + from_track, + }, + }); + } + } + } + cx.notify(); + } + + fn drag_move(&mut self, position: Point, modifiers: Modifiers, cx: &mut Context) { + let Some(drag) = self.tl.drag else { + return; + }; + let frame = self.frame_at(position.x); + self.tl.snap_line = None; + match drag { + Drag::Scrub => { + let f = if modifiers.shift { + self.snapped(frame, None).0 + } else { + frame + }; + self.seek(f); + } + Drag::Move { + clip, + grab, + from_track, + } => { + let Some(c) = self.doc.project.clip(clip) else { + return; + }; + let (kind, duration) = (c.kind, c.duration); + let desired = frame - grab; + let (s, s_hit) = self.snapped(desired, Some(clip)); + let (e, e_hit) = self.snapped(desired + duration, Some(clip)); + let start = match (s_hit, e_hit) { + (true, true) if (e - desired - duration).abs() < (s - desired).abs() => { + e - duration + } + (true, _) => s, + (false, true) => e - duration, + _ => desired, + }; + if s_hit || e_hit { + self.tl.snap_line = Some(if start == s { s } else { e }); + } + let target = self + .track_at(position.y) + .filter(|t| { + self.project() + .track(*t) + .is_some_and(|t| t.kind == kind.stream() && !t.locked) + }) + .unwrap_or(from_track); + let moved = self.doc.gesture(|p| p.move_clip(clip, target, start)); + if moved.is_err() { + self.doc + .gesture(|p| p.move_clip(clip, from_track, start)) + .ok(); + } + } + Drag::TrimStart { clip } => { + let (f, hit) = self.snapped(frame, Some(clip)); + if hit { + self.tl.snap_line = Some(f); + } + self.doc.gesture(|p| p.trim_start(clip, f)).ok(); + } + Drag::TrimEnd { clip } => { + let (f, hit) = self.snapped(frame, Some(clip)); + if hit { + self.tl.snap_line = Some(f); + } + self.doc.gesture(|p| p.trim_end(clip, f)).ok(); + } + } + cx.notify(); + } + + fn drag_end(&mut self, cx: &mut Context) { + let Some(drag) = self.tl.drag.take() else { + return; + }; + self.tl.snap_line = None; + let (label, clip) = match drag { + Drag::Scrub => { + cx.notify(); + return; + } + Drag::Move { clip, .. } => ("move", clip), + Drag::TrimStart { clip } | Drag::TrimEnd { clip } => ("trim", clip), + }; + if self.doc.end_gesture(label) + && let Some(c) = self.project().clip(clip) + { + let msg = format!( + "{} {} · {} – {}", + if label == "move" { "Moved" } else { "Trimmed" }, + self.project().clip_name(c), + self.tc(c.start), + self.tc(c.end()) + ); + self.say(msg); + } + cx.notify(); + } + + fn lanes_hover(&mut self, e: &MouseMoveEvent, cx: &mut Context) { + if self.tool == Tool::Blade && self.tl.drag.is_none() { + let (f, _) = self.snapped(self.frame_at(e.position.x), None); + if self.tl.hover_frame != Some(f) { + self.tl.hover_frame = Some(f); + cx.notify(); + } + } else if self.tl.hover_frame.take().is_some() { + cx.notify(); + } + } + + fn wheel(&mut self, e: &ScrollWheelEvent, cx: &mut Context) { + // The wheel is direct manipulation: it takes over from any eased zoom. + if let Some(z) = self.tl.zoom.take() { + (self.tl.ppf, self.tl.scroll_x) = z.to; + } + let delta = e.delta.pixel_delta(px(20.)); + let (dx, dy) = (f32::from(delta.x), f32::from(delta.y)); + if e.modifiers.secondary() { + let anchor = f32::from(e.position.x - self.tl.bounds.get().origin.x); + self.zoom_at((dy * 0.0025).exp(), anchor); + } else { + self.tl.scroll_x -= if dx.abs() > dy.abs() { dx } else { dy }; + self.clamp_scroll(); + } + cx.notify(); + } + + /* ---------- rendering ---------- */ + + pub(crate) fn render_timeline( + &mut self, + window: &mut Window, + cx: &mut Context, + ) -> impl IntoElement + use<> { + if self.tl.fit_pending { + if self.lanes_width() > 0. { + self.fit(false); + self.tl.fit_pending = false; + } else { + window.request_animation_frame(); + } + } + + self.tick_zoom(window); + + let tracks: Vec = self.project().sequence.tracks.clone(); + let lanes_h: f32 = tracks.iter().map(track_height).sum(); + + div() + .h(px(340.)) + .flex_none() + .flex() + .flex_col() + .bg(c(hex::PLUGE_BLACK)) + .child(self.render_toolbar(cx)) + .child( + div() + .flex_1() + .min_h_0() + .flex() + .child(self.render_heads(&tracks, cx)) + .child( + div() + .flex_1() + .min_w_0() + .flex() + .flex_col() + .overflow_hidden() + .on_scroll_wheel( + cx.listener(|this, e: &ScrollWheelEvent, _, cx| this.wheel(e, cx)), + ) + .child(self.render_ruler(cx)) + .child(self.render_lanes(&tracks, lanes_h, cx)), + ), + ) + .when(self.tl.drag.is_some(), |d| d.child(self.drag_listeners(cx))) + } + + /// While dragging, follow the pointer anywhere in the window. + fn drag_listeners(&self, cx: &mut Context) -> impl IntoElement + use<> { + let this = cx.entity().downgrade(); + canvas( + |_, _, _| (), + move |_, _, window, _| { + let move_target = this.clone(); + window.on_mouse_event(move |e: &MouseMoveEvent, phase, _, cx| { + if phase == DispatchPhase::Bubble { + move_target + .update(cx, |ws, cx| ws.drag_move(e.position, e.modifiers, cx)) + .ok(); + } + }); + let up_target = this.clone(); + window.on_mouse_event(move |_: &MouseUpEvent, phase, _, cx| { + if phase == DispatchPhase::Bubble { + up_target.update(cx, |ws, cx| ws.drag_end(cx)).ok(); + } + }); + }, + ) + .absolute() + .size_0() + } + + fn render_toolbar(&self, cx: &mut Context) -> impl IntoElement + use<> { + let snap_on = self.snap; + div() + .h(px(TOOLBAR_H)) + .flex_none() + .flex() + .items_center() + .gap(px(6.)) + .px(px(8.)) + .border_b_1() + .border_color(c(hex::LINE)) + .child( + div() + .flex() + .p(px(1.)) + .rounded(px(6.)) + .border_1() + .border_color(c(hex::LINE)) + .bg(c(hex::PLUGE_SUB)) + .child( + icon_button( + "tool-select", + "mouse-pointer", + self.tool == Tool::Select, + false, + ) + .tooltip(tip("Select and move", Some("V".into()))) + .on_click(cx.listener(|this, _, _, cx| this.set_tool(Tool::Select, cx))), + ) + .child( + icon_button("tool-blade", "scissors", self.tool == Tool::Blade, false) + .tooltip(tip("Blade: click a clip to cut it", Some("B".into()))) + .on_click(cx.listener(|this, _, _, cx| this.set_tool(Tool::Blade, cx))), + ), + ) + .child( + icon_button("snap", "magnet", snap_on, false) + .tooltip(tip("Snap to grid, edges and playhead", Some("N".into()))) + .on_click(cx.listener(|this, _, w, cx| { + this.toggle_snap(&crate::actions::ToggleSnap, w, cx) + })), + ) + .child(div().w(px(1.)).h(px(16.)).mx(px(4.)).bg(c(hex::LINE))) + .child( + ghost_button("split", "scissors", "Split", Some("S")) + .tooltip(tip("Split at the playhead", None)) + .on_click(|_, w, cx| w.dispatch_action(Box::new(Split), cx)), + ) + .child( + ghost_button("peek", "layers", "Peek nodes", Some("Tab")) + .tooltip(tip("Unfold the selected clip's nodes", None)) + .on_click(|_, w, cx| w.dispatch_action(Box::new(TogglePeek), cx)), + ) + .child( + ghost_button("graph", "workflow", "Graph", Some("⇧ Tab")) + .tooltip(tip("The whole sequence as a node graph", None)) + .on_click(|_, w, cx| w.dispatch_action(Box::new(ToggleGraph), cx)), + ) + .child(div().flex_1()) + .child( + div() + .font_family(theme::MONO) + .text_color(c(hex::INK_FAINT)) + .mr(px(6.)) + .child(format!("{:.0}%", self.tl.ppf / 1.2 * 100.)), + ) + .child( + icon_button("zoom-out", "minus", false, false) + .tooltip(tip("Zoom out", Some("−".into()))) + .on_click(|_, w, cx| w.dispatch_action(Box::new(ZoomOut), cx)), + ) + .child( + icon_button("zoom-in", "plus", false, false) + .tooltip(tip("Zoom in", Some("=".into()))) + .on_click(|_, w, cx| w.dispatch_action(Box::new(ZoomIn), cx)), + ) + .child( + icon_button("zoom-fit", "maximize", false, false) + .tooltip(tip("Fit sequence", Some("⇧ Z".into()))) + .on_click(|_, w, cx| w.dispatch_action(Box::new(ZoomToFit), cx)), + ) + } + + fn render_heads(&self, tracks: &[Track], cx: &mut Context) -> impl IntoElement + use<> { + let selected_track = self + .selection + .and_then(|id| self.project().clip(id)) + .map(|c| c.track); + div() + .w(px(HEADS_W)) + .flex_none() + .flex() + .flex_col() + .border_r_1() + .border_color(c(hex::LINE)) + .child( + div() + .h(px(RULER_H)) + .flex_none() + .flex() + .items_center() + .px(px(10.)) + .border_b_1() + .border_color(c(hex::LINE)) + .font_family(theme::MONO) + .font_weight(FontWeight::MEDIUM) + .child(self.tc(self.playhead)), + ) + .children(tracks.iter().map(|t| { + let id = t.id; + let enable_icon = match (t.kind, t.enabled) { + (StreamKind::Video, true) => "eye", + (StreamKind::Video, false) => "eye-off", + (StreamKind::Audio, true) => "volume-2", + (StreamKind::Audio, false) => "volume-x", + }; + let enable_tip = match (t.kind, t.enabled) { + (StreamKind::Video, true) => "Hide track", + (StreamKind::Video, false) => "Show track", + (StreamKind::Audio, true) => "Mute track", + (StreamKind::Audio, false) => "Unmute track", + }; + div() + .h(px(track_height(t))) + .flex_none() + .flex() + .items_center() + .gap(px(6.)) + .pl(px(10.)) + .pr(px(4.)) + .border_b_1() + .border_color(c(hex::LINE)) + .when(selected_track == Some(id), |d| d.bg(c(hex::PLUGE_RAISED))) + .child( + div() + .w(px(22.)) + .font_family(theme::MONO) + .font_weight(FontWeight::SEMIBOLD) + .child(SharedString::from(t.label.clone())), + ) + .child( + div() + .flex_1() + .min_w_0() + .whitespace_nowrap() + .text_ellipsis() + .when(!t.enabled, |d| d.line_through().text_color(c(hex::INK_DIM))) + .child(SharedString::from(t.name.clone())), + ) + .child( + icon_button( + SharedString::from(format!("{}-enable", t.label)), + enable_icon, + false, + false, + ) + .when(!t.enabled, |d| d.text_color(c(hex::INK_FAINT))) + .tooltip(tip(enable_tip, Some("M".into()))) + .on_click( + cx.listener(move |this, _, _, cx| this.toggle_track_enabled(id, cx)), + ), + ) + .child( + icon_button( + SharedString::from(format!("{}-lock", t.label)), + if t.locked { "lock" } else { "lock-open" }, + false, + false, + ) + .text_color(c(if t.locked { hex::INK } else { hex::INK_FAINT })) + .tooltip(tip( + if t.locked { + "Unlock track" + } else { + "Lock track" + }, + None, + )) + .on_click( + cx.listener(move |this, _, _, cx| this.toggle_track_locked(id, cx)), + ), + ) + })) + } + + fn render_ruler(&self, cx: &mut Context) -> impl IntoElement + use<> { + let fps = self.fps(); + let w = self.lanes_width(); + let ppf = self.tl.ppf; + let step = [1, 2, 6, 12, 24, 48, 120, 240, 480, 720, 1440, 2880, 7200] + .into_iter() + .map(|s| s * fps.nominal() / 24) + .find(|s| *s as f32 * ppf >= 86.) + .unwrap_or(7200) + .max(1); + let minor = if step % 6 == 0 { + step / 6 + } else { + (step / 2).max(1) + }; + let f0 = (self.tl.scroll_x / ppf) as Frame / minor * minor; + let f1 = ((self.tl.scroll_x + w) / ppf) as Frame + minor; + + let mut ticks: Vec = Vec::new(); + let mut f = f0; + while f <= f1 { + let x = self.frame_x(f); + let major = f % step == 0; + ticks.push( + div() + .absolute() + .left(px(x)) + .bottom_0() + .w(px(1.)) + .h(px(if major { 14. } else { 7. })) + .bg(c(if major { 0x5a5a62 } else { 0x34343a })) + .into_any_element(), + ); + if major { + ticks.push( + div() + .absolute() + .left(px(x + 4.)) + .top(px(3.)) + .font_family(theme::MONO) + .text_color(c(hex::INK_DIM)) + .whitespace_nowrap() + .child(time::timecode_short(f, fps)) + .into_any_element(), + ); + } + f += minor; + } + + let guide = |text: String| { + div() + .absolute() + .top_0() + .h_full() + .flex() + .items_center() + .px(px(6.)) + .bg(c(hex::PLUGE_BLACK)) + .border_color(c(hex::LINE)) + .font_family(theme::MONO) + .font_weight(FontWeight::MEDIUM) + .child(text) + }; + let first = (self.tl.scroll_x / ppf).floor() as Frame; + let last = ((self.tl.scroll_x + w) / ppf).floor() as Frame; + let ph = self.frame_x(self.playhead); + + div() + .id("ruler") + .h(px(RULER_H)) + .flex_none() + .relative() + .overflow_hidden() + .border_b_1() + .border_color(c(hex::LINE)) + .cursor(CursorStyle::IBeam) + .on_mouse_down( + MouseButton::Left, + cx.listener(|this, e: &MouseDownEvent, window, cx| { + window.focus(&this.focus, cx); + this.seek(this.frame_at(e.position.x)); + this.tl.drag = Some(Drag::Scrub); + cx.notify(); + }), + ) + .children(ticks) + .child(guide(self.tc(first)).left_0().border_r_1()) + .child(guide(self.tc(last)).right_0().border_l_1()) + .when(ph >= -6. && ph <= w + 6., |d| { + d.child( + div() + .absolute() + .left(px(ph - 5.)) + .top_0() + .w(px(11.)) + .h(px(9.)) + .rounded_b(px(3.)) + .bg(c(hex::BONE)), + ) + }) + } + + fn render_lanes( + &self, + tracks: &[Track], + lanes_h: f32, + cx: &mut Context, + ) -> impl IntoElement + use<> { + let w = self.lanes_width(); + let fps = self.fps(); + let mut children: Vec = Vec::new(); + + // Visible one-second grid while snapping. + let sec_px = fps.nominal() as f32 * self.tl.ppf; + if self.snap && sec_px >= 12. { + let s0 = (self.tl.scroll_x / sec_px).floor() as i64; + let s1 = ((self.tl.scroll_x + w) / sec_px).ceil() as i64; + for s in s0..=s1 { + children.push( + div() + .absolute() + .left(px(s as f32 * sec_px - self.tl.scroll_x)) + .top_0() + .h(px(lanes_h)) + .w(px(1.)) + .bg(gpui_kit::hsla(0., 0., 1., 0.035)) + .into_any_element(), + ); + } + } + + let mut y = 0.; + for t in tracks { + let h = track_height(t); + children.push( + div() + .absolute() + .left_0() + .right_0() + .top(px(y + h - 1.)) + .h(px(1.)) + .bg(c(hex::LINE)) + .into_any_element(), + ); + for clip in self.project().clips_on(t.id) { + let x = self.frame_x(clip.start); + let cw = clip.duration as f32 * self.tl.ppf; + if x + cw < 0. || x > w { + continue; + } + children.push(self.render_clip(clip, t, x, y, cw, h).into_any_element()); + } + y += h; + } + + if let Some(f) = self.tl.snap_line { + children.push(vline(self.frame_x(f), lanes_h, c(0xc9c43c)).into_any_element()); + } + if self.tool == Tool::Blade + && let Some(f) = self.tl.hover_frame + { + children.push(vline(self.frame_x(f), lanes_h, c(0xd0463f)).into_any_element()); + } + if let Some((f, seq)) = self.fx.cut { + let x = self.frame_x(f); + children.push( + div() + .absolute() + .top_0() + .left(px(x - 1.)) + .w(px(3.)) + .h(px(lanes_h)) + .bg(c(0xd0463f)) + .opacity(0.) + .with_animation(key("cut", seq), anim(motion::CUT), |d, t| d.opacity(1. - t)) + .into_any_element(), + ); + } + let ph = self.frame_x(self.playhead); + if ph >= 0. && ph <= w { + children.push(vline(ph, lanes_h, c(hex::BONE)).into_any_element()); + } + + let empty = self.project().sequence.clips.is_empty(); + let bounds = self.tl.bounds.clone(); + + div() + .id("lanes") + .flex_1() + .relative() + .overflow_hidden() + .when(self.tool == Tool::Blade, |d| { + d.cursor(CursorStyle::Crosshair) + }) + .on_mouse_down( + MouseButton::Left, + cx.listener(|this, e: &MouseDownEvent, window, cx| { + this.lanes_mouse_down(e, window, cx) + }), + ) + .on_mouse_move(cx.listener(|this, e: &MouseMoveEvent, _, cx| this.lanes_hover(e, cx))) + .child( + canvas(move |b, _, _| bounds.set(b), |_, _, _, _| {}) + .absolute() + .size_full(), + ) + .children(children) + .when(empty, |d| { + d.child( + div() + .absolute() + .top_0() + .left_0() + .right_0() + .h(px(lanes_h)) + .flex() + .flex_col() + .items_center() + .justify_center() + .gap(px(4.)) + .text_color(c(hex::INK_DIM)) + .child( + div() + .text_color(c(hex::INK)) + .font_weight(FontWeight::MEDIUM) + .child("The timeline is empty"), + ) + .child("Open the demo project from the bin, or open a .vde project"), + ) + }) + } + + fn render_clip( + &self, + clip: &Clip, + track: &Track, + x: f32, + y: f32, + w: f32, + h: f32, + ) -> impl IntoElement + use<> { + let p = self.project(); + let selected = self.selection == Some(clip.id); + let flash = self + .fx + .flash + .as_ref() + .filter(|(ids, _)| ids.contains(&clip.id)) + .map(|(_, seq)| *seq); + let media = clip.media.and_then(|m| p.media(m)); + let offline = media.is_some_and(|m| m.offline); + let muted = !track.enabled; + let name = p.clip_name(clip); + let detail: String = match (clip.kind, media) { + (ClipKind::Text, _) => { + let t = clip + .first(NodeKind::Text) + .expect("text clips start with Text"); + format!("{} px · {}", t.number("size"), t.text("weight")) + } + (_, Some(m)) => format!( + "{} · in {}", + m.file_name(), + time::timecode_short(clip.source_in, p.sequence.fps) + ), + _ => String::new(), + }; + + let border = if selected { + c(hex::BONE) + } else if offline { + c(hex::WARN) + } else { + c(hex::LINE_STRONG) + }; + let body_bg = match clip.kind { + ClipKind::Audio => c(0x221a24), + ClipKind::Text => c(0x241b1b), + ClipKind::Video => c(hex::PLUGE_CONTROL), + }; + + div() + .absolute() + .left(px(x)) + .top(px(y + 3.)) + .w(px(w.max(2.))) + .h(px(h - 7.)) + .flex() + .flex_col() + .overflow_hidden() + .rounded(px(4.)) + .border_1() + .border_color(border) + .when(offline, |d| d.border_dashed()) + .bg(if muted || offline { + c(hex::PLUGE_RAISED) + } else { + body_bg + }) + .when(selected, |d| { + d.shadow(vec![BoxShadow { + color: c(hex::BONE), + offset: point(px(0.), px(0.)), + blur_radius: px(0.), + spread_radius: px(1.), + inset: false, + }]) + }) + .when(track.locked, |d| d.opacity(0.7)) + .child( + div() + .h(px(18.)) + .flex_none() + .flex() + .items_center() + .gap(px(6.)) + .px(px(6.)) + .overflow_hidden() + .whitespace_nowrap() + .font_weight(FontWeight::MEDIUM) + .when(track.locked, |d| { + d.child(ui::icon("lock", px(12.), c(hex::INK_DIM))) + }) + .child( + div() + .min_w_0() + .text_ellipsis() + .when(offline, |d| d.text_color(c(hex::WARN))) + .when(muted, |d| d.line_through().text_color(c(hex::INK_DIM))) + .child(name), + ) + .when(offline, |d| { + d.child( + div() + .font_family(theme::MONO) + .text_color(c(hex::INK_DIM)) + .child("offline"), + ) + }), + ) + .child( + div() + .flex_1() + .min_h_0() + .px(px(6.)) + .overflow_hidden() + .whitespace_nowrap() + .text_ellipsis() + .text_color(c(hex::INK_FAINT)) + .child(detail), + ) + .child( + div() + .h(px(5.)) + .flex_none() + .flex() + .gap(px(1.)) + .children(clip.nodes.iter().map(|n| { + div() + .flex_1() + .h_full() + .bg(n.kind.category().color()) + .when(n.bypass, |d| d.opacity(0.25)) + })), + ) + .children(flash.map(|seq| { + div() + .absolute() + .top_0() + .left_0() + .size_full() + .rounded(px(3.)) + .border_2() + .border_color(c(hex::BONE)) + .opacity(0.) + .with_animation( + key(format!("flash-{}", clip.id.0), seq), + anim(motion::FLASH), + |d, t| d.opacity(1. - t), + ) + })) + .child(edge_handle(true)) + .child(edge_handle(false)) + } +} + +fn vline(x: f32, h: f32, color: Hsla) -> impl IntoElement { + div() + .absolute() + .left(px(x)) + .top_0() + .w(px(1.)) + .h(px(h)) + .bg(color) +} + +fn edge_handle(left: bool) -> impl IntoElement { + div() + .absolute() + .top_0() + .bottom_0() + .w(px(EDGE_PX)) + .when(left, |d| d.left_0()) + .when(!left, |d| d.right_0()) + .cursor(CursorStyle::ResizeLeftRight) +} diff --git a/crates/videode-app/src/ui.rs b/crates/videode-app/src/ui.rs new file mode 100644 index 0000000..b687d41 --- /dev/null +++ b/crates/videode-app/src/ui.rs @@ -0,0 +1,223 @@ +//! Small shared pieces of the Test Card UI: icons, keycaps, buttons, swatches. + +use gpui_kit::component::{Icon, tooltip::Tooltip}; +use gpui_kit::prelude::*; +use gpui_kit::{Div, FontWeight, Hsla, Pixels, SharedString, Stateful, div, px}; + +use crate::motion::hover_fx; +use crate::theme::{self, Category, CategoryExt, c, hex}; + +pub fn cmd_key(key: &str) -> SharedString { + if cfg!(target_os = "macos") { + format!("⌘ {key}").into() + } else { + format!("Ctrl {key}").into() + } +} + +pub fn icon(name: &str, size: Pixels, color: Hsla) -> Icon { + Icon::empty() + .path(SharedString::from(format!("icons/{name}.svg"))) + .size(size) + .text_color(color) +} + +pub fn swatch(cat: Category) -> Div { + div() + .w(px(8.)) + .h(px(8.)) + .flex_none() + .rounded(px(2.)) + .bg(cat.color()) +} + +pub fn kbd(label: impl Into) -> Div { + div() + .flex_none() + .min_w(px(18.)) + .h(px(18.)) + .px(px(4.)) + .flex() + .items_center() + .justify_center() + .rounded(px(4.)) + .border_1() + .border_b(px(2.)) + .border_color(c(hex::LINE_STRONG)) + .bg(c(hex::PLUGE_BLACK)) + .font_family(theme::MONO) + .text_size(theme::KEYCAP) + .font_weight(FontWeight::MEDIUM) + .text_color(c(hex::INK_DIM)) + .child(label.into()) +} + +pub fn pane_header() -> Div { + div() + .h(px(32.)) + .flex_none() + .flex() + .items_center() + .gap(px(2.)) + .px(px(6.)) + .border_b_1() + .border_color(c(hex::LINE)) +} + +/// A tooltip that names the action and, when given, its shortcut. +pub fn tip( + text: impl Into, + key: Option, +) -> impl Fn(&mut gpui_kit::Window, &mut gpui_kit::App) -> gpui_kit::AnyView + 'static { + let text = text.into(); + move |window, cx| { + let label: SharedString = match &key { + Some(k) => format!("{text} {k}").into(), + None => text.clone(), + }; + Tooltip::new(label).build(window, cx) + } +} + +pub fn icon_button( + id: impl Into, + icon_name: &str, + pressed: bool, + disabled: bool, +) -> Stateful
{ + let id = id.into(); + let el = div() + .id(id.clone()) + .w(px(28.)) + .h(px(26.)) + .flex_none() + .flex() + .items_center() + .justify_center() + .rounded(px(5.)) + .text_color(c(if pressed { hex::INK } else { hex::INK_DIM })) + .when(pressed, |d| d.bg(c(hex::PLUGE_HOVER))) + .when(disabled, |d| d.opacity(0.35)); + let el = if disabled { + el + } else { + let hot = c(if pressed { + hex::PLUGE_HOVER + } else { + hex::PLUGE_CONTROL + }); + hover_fx(el, id, hot, px(5.)) + .cursor_pointer() + .hover(|s| s.text_color(c(hex::INK))) + .active(|s| s.opacity(0.75)) + }; + el.child( + Icon::empty() + .path(SharedString::from(format!("icons/{icon_name}.svg"))) + .size(px(16.)), + ) +} + +pub fn button( + id: impl Into, + icon_name: Option<&str>, + label: impl Into, + primary: bool, +) -> Stateful
{ + let (bg, fg, border) = if primary { + (hex::BONE, hex::PLUGE_SUB, hex::BONE) + } else { + (hex::PLUGE_RAISED, hex::INK, hex::LINE_STRONG) + }; + let id = id.into(); + let hot = c(if primary { + 0xfffaf0 + } else { + hex::PLUGE_CONTROL + }); + let el = div() + .id(id.clone()) + .h(px(26.)) + .px(px(10.)) + .flex() + .flex_none() + .items_center() + .gap(px(6.)) + .rounded(px(5.)) + .border_1() + .border_color(c(border)) + .bg(c(bg)) + .text_color(c(fg)) + .cursor_pointer() + .active(|s| s.opacity(0.75)) + .when(primary, |d| d.font_weight(FontWeight::MEDIUM)); + hover_fx(el, id, hot, px(4.)) + .when_some(icon_name, |d, name| d.child(icon(name, px(16.), c(fg)))) + .child(label.into()) +} + +pub fn ghost_button( + id: impl Into, + icon_name: &str, + label: &'static str, + key: Option<&'static str>, +) -> Stateful
{ + let id = id.into(); + let el = div() + .id(id.clone()) + .h(px(26.)) + .px(px(8.)) + .flex() + .flex_none() + .items_center() + .gap(px(6.)) + .rounded(px(5.)) + .text_color(c(hex::INK_DIM)) + .cursor_pointer() + .hover(|s| s.text_color(c(hex::INK))) + .active(|s| s.opacity(0.75)); + hover_fx(el, id, c(hex::PLUGE_CONTROL), px(5.)) + .child(icon(icon_name, px(16.), c(hex::INK_DIM))) + .child(label) + .when_some(key, |d, k| d.child(kbd(k))) +} + +/// Label/value row used in the inspector. +pub fn field_row( + label: impl Into, + value: impl Into, + mono: bool, +) -> Div { + div() + .flex() + .items_center() + .gap(px(8.)) + .min_h(px(28.)) + .child( + div() + .w(px(96.)) + .flex_none() + .text_color(c(hex::INK_DIM)) + .whitespace_nowrap() + .text_ellipsis() + .child(label.into()), + ) + .child( + div() + .flex_1() + .min_w_0() + .h(px(24.)) + .px(px(7.)) + .flex() + .items_center() + .rounded(px(5.)) + .border_1() + .border_color(c(hex::LINE)) + .bg(c(hex::PLUGE_SUB)) + .when(mono, |d| d.font_family(theme::MONO)) + .whitespace_nowrap() + .overflow_hidden() + .text_ellipsis() + .child(value.into()), + ) +} diff --git a/crates/videode-app/src/workspace.rs b/crates/videode-app/src/workspace.rs new file mode 100644 index 0000000..6ff45fe --- /dev/null +++ b/crates/videode-app/src/workspace.rs @@ -0,0 +1,1222 @@ +//! The editor window: owns the document being edited and the view state +//! (playhead, selection, tool, zoom), handles every action, and lays out the +//! panels. Panels live in `panels.rs`, the timeline in `timeline.rs`, and the +//! settings and about dialogs and launch splash in `dialogs.rs`. + +use std::path::{Path, PathBuf}; +use std::time::Instant; + +use gpui_kit::component::input::InputState; +use gpui_kit::prelude::*; +use gpui_kit::{ + Context, FocusHandle, PathPromptOptions, PromptLevel, Render, SharedString, Window, div, px, + relative, +}; +use gpui_kit::{Entity, Subscription}; +use videode_core::kdl_io::{from_kdl, to_kdl}; +use videode_core::{ + ClipId, Document, EditResult, Frame, NodeId, OutputField, Project, TrackId, demo::demo_project, + time, +}; + +use crate::actions::*; +use crate::media::{FrameKey, ViewerFrame}; +use crate::settings; +use crate::theme::{self, c, hex}; +use crate::timeline::TimelineState; +use crate::ui::cmd_key; + +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub enum Tool { + Select, + Blade, +} + +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub enum BinTab { + Media, + Nodes, +} + +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub enum View { + Timeline, + /// Shift+Tab: the whole sequence as one node graph. + Graph, +} + +/// A value being typed into. +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub(crate) enum FieldTarget { + Param { + clip: ClipId, + node: NodeId, + key: &'static str, + }, + Output(OutputField), +} + +pub(crate) struct FieldEdit { + pub target: FieldTarget, + pub input: Entity, + pub _subscription: Subscription, +} + +/// Pointer drags outside the timeline. Each follows the pointer anywhere in +/// the window until release. +#[derive(Clone, Copy, Debug)] +pub(crate) enum PointerDrag { + /// Dragging a param label left/right to change its value. + Scrub { + clip: ClipId, + node: NodeId, + key: &'static str, + x0: f32, + v0: f64, + }, + /// Dragging a node card in the peek panel to reorder it. + Node { + clip: ClipId, + node: NodeId, + x0: f32, + dx: f32, + moved: bool, + }, + /// Panning the graph canvas. + Pan { x0: f32, y0: f32, gx: f32, gy: f32 }, +} + +/// The graph canvas transform: screen = origin + layout × zoom. +pub(crate) struct GraphView { + pub x: f32, + pub y: f32, + pub zoom: f32, + pub fit_pending: bool, + pub bounds: std::rc::Rc>>, +} + +pub(crate) struct Playback { + origin: Frame, + started: Instant, + pub(crate) speed: f64, +} + +pub(crate) struct Status { + pub text: SharedString, + pub error: bool, + /// Bumped on every message so the status line animates in. + pub seq: u64, +} + +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub enum Modal { + Settings, + About, +} + +/// One-shot feedback animations. Each carries a sequence number that keys +/// its animation, so a repeat restarts it. +#[derive(Default)] +pub(crate) struct Fx { + /// Clips changed by the last undo or redo. + pub flash: Option<(Vec, u64)>, + /// Where the last split or blade cut happened. + pub cut: Option<(Frame, u64)>, + seq: u64, +} + +impl Fx { + fn next(&mut self) -> u64 { + self.seq += 1; + self.seq + } +} + +pub struct Workspace { + pub(crate) doc: Document, + pub(crate) focus: FocusHandle, + pub(crate) playhead: Frame, + pub(crate) selection: Option, + pub(crate) tool: Tool, + pub(crate) snap: bool, + pub(crate) bin_tab: BinTab, + pub(crate) tl: TimelineState, + pub(crate) status: Status, + pub(crate) playback: Option, + pub(crate) modal: Option, + pub(crate) modal_opened: Instant, + /// When the launch splash started; `None` once it's gone. + pub(crate) splash: Option, + pub(crate) fx: Fx, + pub(crate) view: View, + /// The peek panel is open on the selected clip; the number keys its + /// unfold animation. + pub(crate) peek: Option, + /// The node highlighted in peek, graph and inspector. + pub(crate) focus_node: Option, + /// The inspector shows the Output node instead of the selection. + pub(crate) inspect_output: bool, + pub(crate) field: Option, + pub(crate) pdrag: Option, + pub(crate) graph: GraphView, + pub(crate) palette: Option, + /// Palette entries run most recently, newest first. + pub(crate) recent_commands: Vec, + /// Folder that relative media paths are resolved against: the project + /// file's folder, or the demo's. + pub(crate) media_root: PathBuf, + /// The picture in the viewer, and the frame being decoded to replace it. + pub(crate) frame: Option, + pub(crate) frame_pending: Option, + /// Bumped whenever the viewer wants a different frame; replies from + /// older requests are dropped. + pub(crate) frame_generation: u64, + /// A frame that failed to decode, so it isn't retried every render. + pub(crate) frame_failed: Option, + /// The viewer's screen in window coordinates, captured each frame. + pub(crate) viewer_bounds: std::rc::Rc>>, + title: String, +} + +impl Workspace { + pub fn new(window: &mut Window, cx: &mut Context) -> Self { + Self::with_document(Document::new(Project::default(), None), window, cx) + } + + pub fn with_document(doc: Document, window: &mut Window, cx: &mut Context) -> Self { + let focus = cx.focus_handle(); + window.focus(&focus, cx); + let snap = !cx.has_global::() || settings::get(cx).snap; + let mut ws = Self { + doc, + focus, + playhead: 0, + selection: None, + tool: Tool::Select, + snap, + bin_tab: BinTab::Media, + tl: TimelineState::default(), + status: Status { + text: "New project · open the demo to try editing, or open a .vde project".into(), + error: false, + seq: 0, + }, + playback: None, + modal: None, + modal_opened: Instant::now(), + splash: None, + fx: Fx::default(), + view: View::Timeline, + peek: None, + focus_node: None, + inspect_output: false, + field: None, + pdrag: None, + graph: GraphView { + x: 0., + y: 0., + zoom: 1., + fit_pending: true, + bounds: Default::default(), + }, + palette: None, + recent_commands: Vec::new(), + media_root: std::env::current_dir().unwrap_or_default(), + frame: None, + frame_pending: None, + frame_generation: 0, + frame_failed: None, + viewer_bounds: Default::default(), + title: String::new(), + }; + ws.refresh_media(); + ws + } + + /// For snapshots: open a dialog directly. + pub fn show_modal(&mut self, modal: Modal) { + self.modal = Some(modal); + self.modal_opened = Instant::now(); + } + + /// For snapshots: put the window in a state by name: `peek`, `graph`, + /// `output`, `media` (use the generated demo footage), `focus` (second + /// node of the selection), `edit` (typing into its first value) or + /// `palette=`. + pub fn preview(&mut self, mode: &str, window: &mut Window, cx: &mut Context) { + match mode { + "peek" => self.open_peek(), + "graph" => self.open_graph(), + "output" => self.inspect_output = true, + "media" => { + self.media_root = crate::media::demo_root(); + self.refresh_media(); + } + "focus" | "edit" => { + let Some(clip) = self.selection.and_then(|id| self.project().clip(id)) else { + return; + }; + let Some(node) = clip.nodes.get(1) else { + return; + }; + let (clip_id, node_id) = (clip.id, node.id); + let spec = node.kind.params().first(); + let text = spec + .and_then(|spec| { + node.get(spec.key) + .map(|v| crate::inspector::number_text(spec, v)) + }) + .unwrap_or_default(); + self.focus_node = Some(node_id); + if mode == "edit" + && let Some(spec) = spec + { + let target = FieldTarget::Param { + clip: clip_id, + node: node_id, + key: spec.key, + }; + self.begin_field(target, text, window, cx); + } + } + m => { + if let Some(q) = m.strip_prefix("palette=") { + self.open_palette(q, window, cx); + } + } + } + } + + /// For snapshots: show the launch splash as it looks `elapsed` in. + pub fn preview_splash(&mut self, elapsed: std::time::Duration) { + self.splash = Instant::now().checked_sub(elapsed); + } + + /// For tests and snapshots: set the playhead and selection directly. + pub fn set_view(&mut self, playhead: Frame, selection: Option) { + self.playhead = playhead; + self.select(selection); + } + + pub fn document(&self) -> &Document { + &self.doc + } + + pub(crate) fn project(&self) -> &Project { + &self.doc.project + } + + pub(crate) fn fps(&self) -> videode_core::Fps { + self.doc.project.sequence.fps + } + + pub(crate) fn tc(&self, f: Frame) -> String { + time::timecode(f, self.fps()) + } + + pub(crate) fn say(&mut self, text: impl Into) { + self.set_status(text.into(), false); + } + + pub(crate) fn say_error(&mut self, text: impl Into) { + self.set_status(text.into(), true); + } + + fn set_status(&mut self, text: SharedString, error: bool) { + if self.status.text != text || self.status.error != error { + self.status = Status { + text, + error, + seq: self.status.seq + 1, + }; + } + } + + /// Plays the launch splash, if enabled and motion is allowed. + pub fn start_splash(&mut self, cx: &mut Context) { + if settings::get(cx).splash && settings::motion(cx) { + self.splash = Some(Instant::now()); + cx.notify(); + } + } + + pub(crate) fn next_seq(&mut self) -> u64 { + self.fx.next() + } + + /// Selects a clip (or nothing), resetting what hangs off the old one. + pub(crate) fn select(&mut self, clip: Option) { + if self.selection != clip { + self.focus_node = None; + if clip.is_none() { + self.peek = None; + } + } + self.selection = clip; + if clip.is_some() { + self.inspect_output = false; + } + } + + pub(crate) fn flash_cut(&mut self, at: Frame) { + let seq = self.fx.next(); + self.fx.cut = Some((at, seq)); + } + + /// Runs one undoable edit, reporting failures in the status bar. + pub(crate) fn apply( + &mut self, + label: &str, + cx: &mut Context, + f: impl FnOnce(&mut Project) -> EditResult, + ) -> Option { + let r = match self.doc.edit(label, f) { + Ok(r) => Some(r), + Err(e) => { + self.say_error(capitalize(&e.to_string())); + None + } + }; + cx.notify(); + r + } + + /// Drops a selection that no longer exists and flashes the clips that + /// changed, so it's clear what undo or redo touched. + fn after_history_change(&mut self, before: &Project) { + let changed: Vec = self + .doc + .project + .sequence + .clips + .iter() + .filter(|c| before.clip(c.id) != Some(*c)) + .map(|c| c.id) + .collect(); + if !changed.is_empty() { + let seq = self.fx.next(); + self.fx.flash = Some((changed, seq)); + } + if let Some(id) = self.selection + && self.doc.project.clip(id).is_none() + { + self.select(None); + } + } + + pub(crate) fn seek(&mut self, frame: Frame) { + self.playhead = frame.max(0); + if let Some(pb) = &mut self.playback { + pb.origin = self.playhead; + pb.started = Instant::now(); + } + } + + fn replace_document(&mut self, doc: Document) { + self.doc = doc; + self.select(None); + self.view = View::Timeline; + self.inspect_output = false; + self.field = None; + self.playback = None; + self.playhead = 0; + self.tl.scroll_x = 0.; + self.tl.fit_pending = true; + } + + /* ---------- file actions ---------- */ + + /// Runs `then` now, or after the user agrees to discard unsaved changes. + fn guard_unsaved( + &mut self, + window: &mut Window, + cx: &mut Context, + then: impl FnOnce(&mut Self, &mut Window, &mut Context) + 'static, + ) { + if !self.doc.is_dirty() { + then(self, window, cx); + return; + } + let message = format!("Discard unsaved changes to “{}”?", self.doc.project.name); + let answer = window.prompt( + PromptLevel::Warning, + &message, + Some("Your edits since the last save will be lost."), + &["Discard", "Cancel"], + cx, + ); + cx.spawn_in(window, async move |this, cx| { + if answer.await == Ok(0) { + this.update_in(cx, |this, window, cx| then(this, window, cx)) + .ok(); + } + }) + .detach(); + } + + fn new_project(&mut self, _: &NewProject, window: &mut Window, cx: &mut Context) { + self.guard_unsaved(window, cx, |this, _, cx| { + this.replace_document(Document::new(Project::default(), None)); + this.say("New project"); + cx.notify(); + }); + } + + fn open_demo(&mut self, _: &OpenDemo, window: &mut Window, cx: &mut Context) { + self.guard_unsaved(window, cx, |this, window, cx| { + this.replace_document(Document::new(demo_project(), None)); + this.media_root = crate::media::demo_root(); + this.prepare_demo_media(window, cx); + cx.notify(); + }); + } + + fn open_project(&mut self, _: &OpenProject, window: &mut Window, cx: &mut Context) { + self.guard_unsaved(window, cx, |_, window, cx| { + let paths = cx.prompt_for_paths(PathPromptOptions { + files: true, + directories: false, + multiple: false, + prompt: Some("Open".into()), + }); + cx.spawn_in(window, async move |this, cx| { + let Ok(Ok(Some(paths))) = paths.await else { + return; + }; + let Some(path) = paths.into_iter().next() else { + return; + }; + this.update(cx, |this, cx| { + this.load(&path); + cx.notify(); + }) + .ok(); + }) + .detach(); + }); + } + + pub fn load(&mut self, path: &Path) { + let result = std::fs::read_to_string(path) + .map_err(|e| e.to_string()) + .and_then(|text| from_kdl(&text).map_err(|e| e.to_string())); + match result { + Ok(project) => { + self.replace_document(Document::new(project, Some(path.to_path_buf()))); + self.media_root = path.parent().map(Path::to_path_buf).unwrap_or_default(); + match self.refresh_media() { + 0 => self.say(format!("Opened {}", path.display())), + n => self.say_error(format!( + "Opened {} · {n} media file{} can't be found", + path.display(), + if n == 1 { "" } else { "s" } + )), + } + } + Err(e) => self.say_error(format!("Couldn't open {}: {e}", path.display())), + } + } + + fn write(&mut self, path: PathBuf) { + // Relative media paths must still resolve from the new location. + if let Some(dir) = path.parent() { + self.rebase_media(dir); + } + match std::fs::write(&path, to_kdl(&self.doc.project)) { + Ok(()) => { + self.say(format!("Saved {}", path.display())); + self.doc.mark_saved(path); + } + Err(e) => self.say_error(format!("Couldn't save {}: {e}", path.display())), + } + } + + fn save(&mut self, _: &SaveProject, window: &mut Window, cx: &mut Context) { + match self.doc.path.clone() { + Some(path) => { + self.write(path); + cx.notify(); + } + None => self.save_as(&SaveProjectAs, window, cx), + } + } + + fn save_as(&mut self, _: &SaveProjectAs, window: &mut Window, cx: &mut Context) { + let dir = self + .doc + .path + .as_ref() + .and_then(|p| p.parent().map(Path::to_path_buf)) + .or_else(|| std::env::var_os("HOME").map(PathBuf::from)) + .unwrap_or_else(|| PathBuf::from(".")); + let name = format!("{}.vde", self.doc.project.name); + let path = cx.prompt_for_new_path(&dir, Some(&name)); + cx.spawn_in(window, async move |this, cx| { + let Ok(Ok(Some(mut path))) = path.await else { + return; + }; + if path.extension().is_none() { + path.set_extension("vde"); + } + this.update(cx, |this, cx| { + this.write(path); + cx.notify(); + }) + .ok(); + }) + .detach(); + } + + fn quit(&mut self, _: &Quit, window: &mut Window, cx: &mut Context) { + self.guard_unsaved(window, cx, |_, _, cx| cx.quit()); + } + + fn export(&mut self, _: &Export, window: &mut Window, cx: &mut Context) { + self.open_output(&OpenOutput, window, cx); + } + + /* ---------- node views ---------- */ + + fn open_output(&mut self, _: &OpenOutput, _: &mut Window, cx: &mut Context) { + self.inspect_output = true; + self.say("Export is a node: the Output node is open in the inspector"); + cx.notify(); + } + + fn toggle_peek(&mut self, _: &TogglePeek, _: &mut Window, cx: &mut Context) { + if self.peek.is_some() { + self.peek = None; + } else if let Some(clip) = self.selection { + if self.view == View::Graph { + self.view = View::Timeline; + } + self.reveal_clip(clip); + self.open_peek(); + self.say("Peeking at the clip's nodes · click one to inspect it, drag to reorder"); + } else { + self.say("Select a clip, then press Tab to peek at its nodes"); + } + cx.notify(); + } + + fn toggle_graph(&mut self, _: &ToggleGraph, _: &mut Window, cx: &mut Context) { + if self.view == View::Graph { + self.close_graph(); + } else { + self.open_graph(); + } + cx.notify(); + } + + fn command_palette(&mut self, _: &CommandPalette, window: &mut Window, cx: &mut Context) { + if self.palette.is_some() { + self.close_palette(window, cx); + } else { + self.open_palette("", window, cx); + } + } + + fn add_node_menu(&mut self, _: &AddNodeMenu, window: &mut Window, cx: &mut Context) { + if self.selection.is_none() { + self.say("Select a clip first, then add a node"); + cx.notify(); + return; + } + self.open_palette("Add ", window, cx); + } + + /// The focused node, if it belongs to the selected clip. + pub(crate) fn focused_node(&self) -> Option<(ClipId, NodeId)> { + let clip = self.selection?; + let node = self.focus_node?; + self.project().clip(clip)?.node(node)?; + Some((clip, node)) + } + + fn bypass_node(&mut self, _: &BypassNode, _: &mut Window, cx: &mut Context) { + match self.focused_node() { + Some((clip, node)) => self.toggle_bypass(clip, node, cx), + None => { + self.say("Click a node in the inspector or peek first"); + cx.notify(); + } + } + } + + /// Scrolls the timeline so `clip` is on screen. + pub(crate) fn reveal_clip(&mut self, clip: ClipId) { + let Some(c) = self.project().clip(clip) else { + return; + }; + let (x0, x1) = (self.frame_x(c.start), self.frame_x(c.end())); + let w = self.lanes_width(); + if w > 0. && (x1 < 0. || x0 > w) { + self.tl.scroll_x = (c.start as f32 * self.tl.ppf - 80.).max(0.); + } + } + + /* ---------- window-wide pointer drags ---------- */ + + pub(crate) fn pointer_move( + &mut self, + pos: gpui_kit::Point, + m: gpui_kit::Modifiers, + cx: &mut Context, + ) { + let (x, y) = (f32::from(pos.x), f32::from(pos.y)); + match &mut self.pdrag { + Some(PointerDrag::Scrub { .. }) => self.scrub_to(x, m.shift, m.alt, cx), + Some(PointerDrag::Node { x0, dx, moved, .. }) => { + *dx = x - *x0; + *moved |= dx.abs() > 4.; + cx.notify(); + } + Some(PointerDrag::Pan { x0, y0, gx, gy }) => { + self.graph.x = *gx + x - *x0; + self.graph.y = *gy + y - *y0; + cx.notify(); + } + None => {} + } + } + + pub(crate) fn pointer_up(&mut self, cx: &mut Context) { + match self.pdrag.take() { + Some(PointerDrag::Node { + clip, + node, + dx, + moved: true, + .. + }) => self.drop_node(clip, node, dx, cx), + // Each scrub is its own undo step, even from the same spot. + Some(PointerDrag::Scrub { .. }) => self.doc.end_coalescing(), + _ => {} + } + cx.notify(); + } + + fn pointer_listeners(&self, cx: &mut Context) -> impl IntoElement + use<> { + let this = cx.entity().downgrade(); + gpui_kit::canvas( + |_, _, _| (), + move |_, _, window, _| { + let on_move = this.clone(); + window.on_mouse_event(move |e: &gpui_kit::MouseMoveEvent, phase, _, cx| { + if phase == gpui_kit::DispatchPhase::Bubble { + on_move + .update(cx, |ws, cx| ws.pointer_move(e.position, e.modifiers, cx)) + .ok(); + } + }); + let on_up = this.clone(); + window.on_mouse_event(move |_: &gpui_kit::MouseUpEvent, phase, _, cx| { + if phase == gpui_kit::DispatchPhase::Bubble { + on_up.update(cx, |ws, cx| ws.pointer_up(cx)).ok(); + } + }); + }, + ) + .absolute() + .size_0() + } + + /* ---------- edit actions ---------- */ + + fn undo(&mut self, _: &Undo, _: &mut Window, cx: &mut Context) { + let before = self.doc.project.clone(); + match self.doc.undo() { + Some(label) => self.say(format!("Undid {label}")), + None => self.say("Nothing to undo"), + } + self.after_history_change(&before); + cx.notify(); + } + + fn redo(&mut self, _: &Redo, _: &mut Window, cx: &mut Context) { + let before = self.doc.project.clone(); + match self.doc.redo() { + Some(label) => self.say(format!("Redid {label}")), + None => self.say("Nothing to redo"), + } + self.after_history_change(&before); + cx.notify(); + } + + fn split(&mut self, _: &Split, _: &mut Window, cx: &mut Context) { + let t = self.playhead; + let p = &self.doc.project; + let targets: Vec = match self.selection.and_then(|id| p.clip(id)) { + Some(c) if t > c.start && t < c.end() => vec![c.id], + _ => p + .sequence + .clips + .iter() + .filter(|c| t > c.start && t < c.end()) + .filter(|c| p.track(c.track).is_some_and(|tr| !tr.locked)) + .map(|c| c.id) + .collect(), + }; + if targets.is_empty() { + self.say("No clip under the playhead to split"); + cx.notify(); + return; + } + let n = targets.len(); + let done = self.apply("split", cx, |p| { + targets + .iter() + .try_for_each(|id| p.split(*id, t).map(|_| ())) + }); + if done.is_some() { + self.flash_cut(t); + let what = if n == 1 { + "1 clip".to_string() + } else { + format!("{n} clips") + }; + self.say(format!( + "Split {what} at {} · {} to undo", + self.tc(t), + cmd_key("Z") + )); + } + } + + fn delete(&mut self, ripple: bool, cx: &mut Context) { + // With the peek open, Delete removes the focused node instead. + if !ripple + && self.peek.is_some() + && let Some((clip, node)) = self.focused_node() + && !self + .project() + .clip(clip) + .and_then(|c| c.node(node)) + .is_some_and(|n| n.kind.is_generator()) + { + self.remove_node(clip, node, cx); + return; + } + let Some(id) = self.selection else { + self.say("Select a clip to delete"); + cx.notify(); + return; + }; + let p = &self.doc.project; + let name = p.clip(id).map(|c| p.clip_name(c)).unwrap_or_default(); + let label = if ripple { "ripple delete" } else { "delete" }; + let done = self.apply(label, cx, |p| { + if ripple { + p.ripple_delete(id) + } else { + p.delete_clip(id) + } + }); + if done.is_some() { + self.select(None); + let verb = if ripple { "Ripple deleted" } else { "Deleted" }; + self.say(format!("{verb} {name} · {} to undo", cmd_key("Z"))); + } + } + + fn delete_clip(&mut self, _: &DeleteClip, _: &mut Window, cx: &mut Context) { + self.delete(false, cx); + } + + fn ripple_delete(&mut self, _: &RippleDelete, _: &mut Window, cx: &mut Context) { + self.delete(true, cx); + } + + fn deselect(&mut self, _: &Deselect, _: &mut Window, cx: &mut Context) { + if self.modal.is_some() { + self.modal = None; + } else if self.pdrag.take().is_some() { + self.doc.end_coalescing(); + } else if self.peek.is_some() { + self.peek = None; + } else if self.view == View::Graph { + self.close_graph(); + } else if self.inspect_output { + self.inspect_output = false; + } else if self.tl.drag.is_some() { + self.cancel_drag(); + } else if self.tool == Tool::Blade { + self.tool = Tool::Select; + } else { + self.select(None); + } + cx.notify(); + } + + fn select_tool(&mut self, _: &SelectTool, _: &mut Window, cx: &mut Context) { + self.set_tool(Tool::Select, cx); + } + + fn blade_tool(&mut self, _: &BladeTool, _: &mut Window, cx: &mut Context) { + self.set_tool(Tool::Blade, cx); + } + + pub(crate) fn set_tool(&mut self, tool: Tool, cx: &mut Context) { + self.tool = tool; + self.say(match tool { + Tool::Select => "Select tool", + Tool::Blade => "Blade · click a clip to cut it · V or Esc to go back", + }); + cx.notify(); + } + + pub(crate) fn toggle_snap(&mut self, _: &ToggleSnap, _: &mut Window, cx: &mut Context) { + self.snap = !self.snap; + self.say(if self.snap { + "Snapping on · 1 s grid, clip edges, playhead" + } else { + "Snapping off" + }); + cx.notify(); + } + + fn toggle_track(&mut self, _: &ToggleTrack, _: &mut Window, cx: &mut Context) { + let track = self + .selection + .and_then(|id| self.doc.project.clip(id)) + .map(|c| c.track); + match track { + Some(track) => self.toggle_track_enabled(track, cx), + None => { + self.say("Select a clip to mute or hide its track"); + cx.notify(); + } + } + } + + pub(crate) fn toggle_track_enabled(&mut self, track: TrackId, cx: &mut Context) { + let Some(t) = self.doc.project.track(track) else { + return; + }; + let (enabled, label) = (!t.enabled, t.label.clone()); + let edit = if enabled { + "enable track" + } else { + "disable track" + }; + if self + .apply(edit, cx, |p| p.set_track_enabled(track, enabled)) + .is_some() + { + self.say(format!("{label} {}", if enabled { "on" } else { "off" })); + } + } + + pub(crate) fn toggle_track_locked(&mut self, track: TrackId, cx: &mut Context) { + let Some(t) = self.doc.project.track(track) else { + return; + }; + let (locked, label) = (!t.locked, t.label.clone()); + let edit = if locked { "lock track" } else { "unlock track" }; + if self + .apply(edit, cx, |p| p.set_track_locked(track, locked)) + .is_some() + { + self.say(format!( + "{label} {}", + if locked { "locked" } else { "unlocked" } + )); + } + } + + /* ---------- view actions ---------- */ + + pub(crate) fn zoom_in(&mut self, _: &ZoomIn, _: &mut Window, cx: &mut Context) { + let step = settings::get(cx).zoom_step as f32; + self.zoom_around_playhead(step, settings::motion(cx)); + cx.notify(); + } + + pub(crate) fn zoom_out(&mut self, _: &ZoomOut, _: &mut Window, cx: &mut Context) { + let step = settings::get(cx).zoom_step as f32; + self.zoom_around_playhead(1. / step, settings::motion(cx)); + cx.notify(); + } + + pub(crate) fn zoom_fit(&mut self, _: &ZoomToFit, _: &mut Window, cx: &mut Context) { + self.fit(settings::motion(cx)); + cx.notify(); + } + + /* ---------- dialogs ---------- */ + + pub(crate) fn open_settings( + &mut self, + _: &OpenSettings, + _: &mut Window, + cx: &mut Context, + ) { + settings::refresh_system(cx); + self.modal = Some(Modal::Settings); + self.modal_opened = Instant::now(); + cx.notify(); + } + + pub(crate) fn about(&mut self, _: &About, _: &mut Window, cx: &mut Context) { + self.modal = Some(Modal::About); + self.modal_opened = Instant::now(); + cx.notify(); + } + + /* ---------- transport ---------- */ + + pub(crate) fn is_playing(&self) -> bool { + self.playback.is_some() + } + + fn start_playback(&mut self, speed: f64) { + let end = self.doc.project.end(); + if speed > 0. && self.playhead >= end { + self.playhead = 0; + } + self.playback = Some(Playback { + origin: self.playhead, + started: Instant::now(), + speed, + }); + } + + pub(crate) fn toggle_play(&mut self, _: &TogglePlay, _: &mut Window, cx: &mut Context) { + if self.playback.take().is_none() { + self.start_playback(1.); + } + cx.notify(); + } + + fn shuttle(&mut self, dir: f64) { + let speed = match &self.playback { + Some(pb) if pb.speed.signum() == dir => (pb.speed * 2.).clamp(-8., 8.), + _ => dir, + }; + self.start_playback(speed); + } + + fn shuttle_forward(&mut self, _: &ShuttleForward, _: &mut Window, cx: &mut Context) { + self.shuttle(1.); + cx.notify(); + } + + fn shuttle_backward(&mut self, _: &ShuttleBackward, _: &mut Window, cx: &mut Context) { + self.shuttle(-1.); + cx.notify(); + } + + fn shuttle_stop(&mut self, _: &ShuttleStop, _: &mut Window, cx: &mut Context) { + self.playback = None; + cx.notify(); + } + + fn nudge(&mut self, frames: Frame, cx: &mut Context) { + self.playback = None; + self.seek(self.playhead + frames); + self.follow_playhead(); + cx.notify(); + } + + pub(crate) fn step_back(&mut self, _: &StepBack, _: &mut Window, cx: &mut Context) { + self.nudge(-1, cx); + } + + pub(crate) fn step_forward(&mut self, _: &StepForward, _: &mut Window, cx: &mut Context) { + self.nudge(1, cx); + } + + fn second_back(&mut self, _: &SecondBack, _: &mut Window, cx: &mut Context) { + let n = self.fps().nominal(); + self.nudge(-n, cx); + } + + fn second_forward(&mut self, _: &SecondForward, _: &mut Window, cx: &mut Context) { + let n = self.fps().nominal(); + self.nudge(n, cx); + } + + fn prev_edit(&mut self, _: &PrevEdit, _: &mut Window, cx: &mut Context) { + let t = self.playhead; + let points = self.doc.project.edit_points(); + let to = points.into_iter().rev().find(|&f| f < t).unwrap_or(0); + self.nudge(to - t, cx); + } + + fn next_edit(&mut self, _: &NextEdit, _: &mut Window, cx: &mut Context) { + let t = self.playhead; + let end = self.doc.project.end(); + let points = self.doc.project.edit_points(); + let to = points.into_iter().find(|&f| f > t).unwrap_or(end); + self.nudge(to - t, cx); + } + + pub(crate) fn go_start(&mut self, _: &GoToStart, _: &mut Window, cx: &mut Context) { + let t = self.playhead; + self.nudge(-t, cx); + } + + pub(crate) fn go_end(&mut self, _: &GoToEnd, _: &mut Window, cx: &mut Context) { + let t = self.playhead; + let end = self.doc.project.end(); + self.nudge(end - t, cx); + } + + /// Advances the playhead from the wall clock while playing. + fn tick_playback(&mut self, window: &mut Window) { + let Some(pb) = &self.playback else { + return; + }; + let elapsed = pb.started.elapsed().as_secs_f64(); + let frame = pb.origin + (elapsed * self.fps().as_f64() * pb.speed).floor() as Frame; + let end = self.doc.project.end(); + if frame >= end && pb.speed > 0. { + self.playhead = end; + self.playback = None; + } else if frame <= 0 && pb.speed < 0. { + self.playhead = 0; + self.playback = None; + } else { + self.playhead = frame; + window.request_animation_frame(); + } + self.follow_playhead(); + } + + fn update_title(&mut self, window: &mut Window) { + let dirty = if self.doc.is_dirty() { " •" } else { "" }; + let title = format!("{}{dirty} — videode", self.doc.project.name); + if title != self.title { + window.set_window_title(&title); + self.title = title; + } + } +} + +fn capitalize(s: &str) -> String { + let mut chars = s.chars(); + match chars.next() { + Some(first) => first.to_uppercase().collect::() + chars.as_str(), + None => String::new(), + } +} + +impl Render for Workspace { + fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { + self.tick_playback(window); + self.sync_viewer_frame(window, cx); + self.update_title(window); + let editing = self.modal.is_none(); + + div() + .size_full() + .relative() + .flex() + .flex_col() + .bg(c(hex::PLUGE_SUB)) + .text_color(c(hex::INK)) + .font_family(theme::FONT) + .text_size(theme::TEXT) + .line_height(relative(1.45)) + .key_context(CONTEXT) + .track_focus(&self.focus) + .on_action(cx.listener(Self::new_project)) + .on_action(cx.listener(Self::open_project)) + .on_action(cx.listener(Self::open_demo)) + .on_action(cx.listener(Self::save)) + .on_action(cx.listener(Self::save_as)) + .on_action(cx.listener(Self::quit)) + .on_action(cx.listener(Self::export)) + .on_action(cx.listener(Self::deselect)) + .on_action(cx.listener(Self::open_settings)) + .on_action(cx.listener(Self::about)) + .on_action(cx.listener(Self::command_palette)) + .on_action(cx.listener(Self::open_output)) + .on_action(cx.listener(Self::import_media)) + // Files dropped anywhere on the window are imported. + .on_drop(cx.listener(|this, paths: &gpui_kit::ExternalPaths, _, cx| { + this.import_paths(paths.paths().to_vec(), cx); + })) + // Editing and transport are detached while a dialog is open. + .when(editing, |d| { + d.on_action(cx.listener(Self::toggle_peek)) + .on_action(cx.listener(Self::toggle_graph)) + .on_action(cx.listener(Self::add_node_menu)) + .on_action(cx.listener(Self::bypass_node)) + .on_action(cx.listener(Self::undo)) + .on_action(cx.listener(Self::redo)) + .on_action(cx.listener(Self::split)) + .on_action(cx.listener(Self::delete_clip)) + .on_action(cx.listener(Self::ripple_delete)) + .on_action(cx.listener(Self::select_tool)) + .on_action(cx.listener(Self::blade_tool)) + .on_action(cx.listener(Self::toggle_snap)) + .on_action(cx.listener(Self::toggle_track)) + .on_action(cx.listener(Self::zoom_in)) + .on_action(cx.listener(Self::zoom_out)) + .on_action(cx.listener(Self::zoom_fit)) + .on_action(cx.listener(Self::toggle_play)) + .on_action(cx.listener(Self::shuttle_forward)) + .on_action(cx.listener(Self::shuttle_backward)) + .on_action(cx.listener(Self::shuttle_stop)) + .on_action(cx.listener(Self::step_back)) + .on_action(cx.listener(Self::step_forward)) + .on_action(cx.listener(Self::second_back)) + .on_action(cx.listener(Self::second_forward)) + .on_action(cx.listener(Self::prev_edit)) + .on_action(cx.listener(Self::next_edit)) + .on_action(cx.listener(Self::go_start)) + .on_action(cx.listener(Self::go_end)) + }) + // Any key skips the splash without doing anything else. + .when(self.splash.is_some(), |d| { + d.capture_key_down(cx.listener(|this, _, _, cx| { + this.splash = None; + cx.stop_propagation(); + cx.notify(); + })) + }) + .child(self.render_top_bar(cx)) + .map(|d| match self.view { + View::Graph => d.child( + div() + .flex_1() + .min_h_0() + .flex() + .child(self.render_graph(window, cx)) + .child(self.render_inspector(cx)), + ), + View::Timeline => d + .child( + div() + .flex_1() + .min_h_0() + .flex() + .child(self.render_bin(cx)) + .child(self.render_viewer(cx)) + .child(self.render_inspector(cx)), + ) + .child( + div() + .h(px(5.)) + .flex_none() + .bg(c(hex::PLUGE_SUB)) + .border_t_1() + .border_color(c(hex::LINE)), + ) + .child(self.render_timeline(window, cx)), + }) + .child(self.render_status_bar()) + .children( + (self.view == View::Timeline) + .then(|| self.render_peek(window, cx)) + .flatten(), + ) + .when(self.pdrag.is_some(), |d| { + d.child(self.pointer_listeners(cx)) + }) + .children(self.render_palette(window, cx)) + .children(self.modal.map(|m| self.render_modal(m, cx))) + .children(self.render_splash(window, cx)) + } +} diff --git a/crates/videode-core/Cargo.toml b/crates/videode-core/Cargo.toml new file mode 100644 index 0000000..d9143d9 --- /dev/null +++ b/crates/videode-core/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "videode-core" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true + +[dependencies] +kdl = "6.7" +thiserror = "2" diff --git a/crates/videode-core/src/demo.rs b/crates/videode-core/src/demo.rs new file mode 100644 index 0000000..9b4edce --- /dev/null +++ b/crates/videode-core/src/demo.rs @@ -0,0 +1,84 @@ +//! "Signal Study", the demo project from the HTML mockup. Its media are +//! synthetic test patterns that the app generates on first open (see +//! `videode_media::demo`); `bars_tone.mov` is never made, to show offline +//! media. + +use crate::kdl_io::from_kdl; +use crate::project::Project; + +pub const DEMO_KDL: &str = r#" +videode version=1 +project "Signal Study" +media { + file id=1 path="media/dusk_gradient.mov" kind=video duration=384 codec=H.264 format="1280×720 · 24 fps" + file id=2 path="media/mandel_dive.mp4" kind=video duration=384 codec=H.264 format="1280×720 · 24 fps" + file id=3 path="media/colony_sim.mov" kind=video duration=384 codec=H.264 format="1280×720 · 24 fps" + file id=4 path="media/zoneplate_ref.mov" kind=video duration=384 codec=H.264 format="1280×720 · 24 fps" + file id=5 path="media/rule110.mov" kind=video duration=384 codec=H.264 format="1280×720 · 24 fps" + file id=6 path="media/bars_tone.mov" kind=video duration=384 codec="ProRes 422" format="1920×1080" status=offline + file id=7 path="media/voiceover_t3.wav" kind=audio duration=960 codec=PCM format="Mono · 48 kHz" + file id=8 path="media/pad_drone.wav" kind=audio duration=1440 codec=PCM format="Stereo · 48 kHz" +} +sequence "Main" fps=24 fps-den=1 width=1920 height=1080 { + track V2 kind=video name=Titles { + clip start=24 duration=108 { + text text="Signal Study" size=120 weight="600" + transform y=-40 + fade in=12 out=18 + } + clip start=600 duration=96 { + text text="part two — emergence" size=64 weight="500" + transform y=360 + fade in=8 out=8 + } + } + track V1 kind=video name=Picture { + clip start=0 duration=168 media=1 in=0 { + source + grade exposure=-0.2 temperature=5200 + fade in=12 out=0 + } + clip start=168 duration=192 media=2 in=48 { + source + transform scale=108 y=-42 + grade exposure=0.35 temperature=5600 saturation=112 + } + clip start=360 duration=240 media=3 in=0 { + source + grade saturation=80 contrast=112 + blur radius=1.5 + } + clip start=600 duration=144 media=4 in=24 { + source + crop top=6 bottom=6 + opacity opacity=85 + } + clip start=744 duration=168 media=5 in=0 { + source + grade exposure=0.1 temperature=7200 + } + clip start=912 duration=120 media=6 in=0 { + source + } + } + track A1 kind=audio name=Voice { + clip start=24 duration=840 media=7 in=0 { + source + gain gain=-3 + } + } + track A2 kind=audio name=Music { + clip start=0 duration=1032 media=8 in=96 { + source + gain gain=-6 + duck under=A1 amount=-12 + fade in=24 out=48 + } + } +} +output container=MP4 codec=H.264 resolution="1920×1080" quality=High path="signal_study.mp4" +"#; + +pub fn demo_project() -> Project { + from_kdl(DEMO_KDL).expect("the bundled demo project is valid") +} diff --git a/crates/videode-core/src/document.rs b/crates/videode-core/src/document.rs new file mode 100644 index 0000000..cc0dbb8 --- /dev/null +++ b/crates/videode-core/src/document.rs @@ -0,0 +1,362 @@ +//! A project being edited: undo/redo history, drag gestures and the saved +//! state used to show unsaved changes. +//! +//! History stores whole-project snapshots. Projects hold no media data, so a +//! snapshot is small; this keeps every edit trivially undoable. + +use std::path::PathBuf; + +use crate::edit::EditResult; +use crate::project::Project; + +const HISTORY_LIMIT: usize = 500; + +#[derive(Clone, Debug)] +struct Entry { + label: String, + project: Project, +} + +#[derive(Debug)] +pub struct Document { + pub project: Project, + pub path: Option, + saved: Project, + undo: Vec, + redo: Vec, + /// Consecutive edits with the same key merge into one undo step. + coalesce: Option, + gesture: Option, +} + +impl Document { + pub fn new(project: Project, path: Option) -> Self { + Self { + saved: project.clone(), + project, + path, + undo: Vec::new(), + redo: Vec::new(), + coalesce: None, + gesture: None, + } + } + + pub fn is_dirty(&self) -> bool { + self.project != self.saved + } + + /// Re-checks which media files are missing. Being offline is a fact + /// about the disk, not an edit, so this changes neither the undo history + /// nor whether the document counts as unsaved. + pub fn refresh_offline(&mut self, missing: impl Fn(&crate::project::Media) -> bool) -> usize { + let mut offline = 0; + for m in &mut self.project.media { + m.offline = missing(m); + offline += m.offline as usize; + } + let flags: Vec<_> = self + .project + .media + .iter() + .map(|m| (m.id, m.offline)) + .collect(); + for project in std::iter::once(&mut self.saved) + .chain(self.undo.iter_mut().map(|e| &mut e.project)) + .chain(self.redo.iter_mut().map(|e| &mut e.project)) + { + for m in &mut project.media { + if let Some((_, off)) = flags.iter().find(|(id, _)| *id == m.id) { + m.offline = *off; + } + } + } + offline + } + + /// Rewrites media paths everywhere they're kept, history included, so + /// undo never brings back a path that no longer resolves. Not an edit. + pub fn rebase_media(&mut self, mut f: impl FnMut(&mut crate::project::Media)) { + for project in std::iter::once(&mut self.project) + .chain(std::iter::once(&mut self.saved)) + .chain(self.undo.iter_mut().map(|e| &mut e.project)) + .chain(self.redo.iter_mut().map(|e| &mut e.project)) + { + project.media.iter_mut().for_each(&mut f); + } + } + + /// Ends the current run of coalesced edits, so the next one starts a new + /// undo step even if it has the same key (one per drag gesture). + pub fn end_coalescing(&mut self) { + self.coalesce = None; + } + + pub fn mark_saved(&mut self, path: PathBuf) { + self.coalesce = None; + self.saved = self.project.clone(); + self.path = Some(path); + } + + fn push(&mut self, label: &str, before: Project) { + self.undo.push(Entry { + label: label.into(), + project: before, + }); + if self.undo.len() > HISTORY_LIMIT { + self.undo.remove(0); + } + self.redo.clear(); + } + + /// Runs `f` as one undoable step. On error the project is left unchanged. + pub fn edit( + &mut self, + label: &str, + f: impl FnOnce(&mut Project) -> EditResult, + ) -> EditResult { + self.coalesce = None; + let before = self.project.clone(); + match f(&mut self.project) { + Ok(r) => { + if self.project != before { + self.push(label, before); + } + Ok(r) + } + Err(e) => { + self.project = before; + Err(e) + } + } + } + + /// Like [`Self::edit`], but repeated calls with the same `key` (for + /// example scrubbing one parameter) collapse into a single undo step. + pub fn edit_coalesced( + &mut self, + label: &str, + key: &str, + f: impl FnOnce(&mut Project) -> EditResult, + ) -> EditResult { + let merging = self.coalesce.as_deref() == Some(key); + let before = self.project.clone(); + match f(&mut self.project) { + Ok(r) => { + if self.project != before && !merging { + self.push(label, before); + } + self.coalesce = Some(key.into()); + Ok(r) + } + Err(e) => { + self.project = before; + Err(e) + } + } + } + + /// Starts a continuous edit such as a drag. Each [`Self::gesture`] call + /// replays from the starting state; [`Self::end_gesture`] records one + /// undo step if anything changed. + pub fn begin_gesture(&mut self) { + self.coalesce = None; + self.gesture = Some(self.project.clone()); + } + + pub fn in_gesture(&self) -> bool { + self.gesture.is_some() + } + + pub fn gesture(&mut self, f: impl FnOnce(&mut Project) -> EditResult) -> EditResult { + let base = self.gesture.clone().unwrap_or_else(|| self.project.clone()); + let mut next = base; + let r = f(&mut next)?; + self.project = next; + Ok(r) + } + + /// Returns whether the gesture changed the project. + pub fn end_gesture(&mut self, label: &str) -> bool { + match self.gesture.take() { + Some(before) if before != self.project => { + self.push(label, before); + true + } + _ => false, + } + } + + pub fn cancel_gesture(&mut self) { + if let Some(before) = self.gesture.take() { + self.project = before; + } + } + + pub fn undo_label(&self) -> Option<&str> { + self.undo.last().map(|e| e.label.as_str()) + } + + pub fn redo_label(&self) -> Option<&str> { + self.redo.last().map(|e| e.label.as_str()) + } + + /// Returns the label of the step undone. + pub fn undo(&mut self) -> Option { + self.coalesce = None; + let e = self.undo.pop()?; + let current = std::mem::replace(&mut self.project, e.project); + self.redo.push(Entry { + label: e.label.clone(), + project: current, + }); + Some(e.label) + } + + pub fn redo(&mut self) -> Option { + self.coalesce = None; + let e = self.redo.pop()?; + let current = std::mem::replace(&mut self.project, e.project); + self.undo.push(Entry { + label: e.label.clone(), + project: current, + }); + Some(e.label) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::edit::EditError; + use crate::node::{NodeKind, Value}; + use crate::project::MediaKind; + + fn doc() -> (Document, crate::project::ClipId) { + let mut p = Project::new("t"); + let m = p.add_media("a.mov", MediaKind::Video, Some(100), "", ""); + let c = p.add_media_clip(m, None, 0).unwrap(); + (Document::new(p, None), c) + } + + #[test] + fn undo_redo() { + let (mut d, c) = doc(); + assert!(!d.is_dirty()); + d.edit("split", |p| p.split(c, 50)).unwrap(); + assert_eq!(d.project.sequence.clips.len(), 2); + assert!(d.is_dirty()); + assert_eq!(d.undo().as_deref(), Some("split")); + assert_eq!(d.project.sequence.clips.len(), 1); + assert!(!d.is_dirty()); + assert_eq!(d.redo().as_deref(), Some("split")); + assert_eq!(d.project.sequence.clips.len(), 2); + assert_eq!(d.redo(), None); + } + + #[test] + fn failed_edit_leaves_no_trace() { + let (mut d, c) = doc(); + let r = d.edit("split", |p| p.split(c, 500)); + assert_eq!(r, Err(EditError::OutsideClip)); + assert_eq!(d.undo_label(), None); + } + + #[test] + fn coalesced_edits_merge() { + let (mut d, c) = doc(); + let g = d.edit("add", |p| p.add_node(c, NodeKind::Grade)).unwrap(); + for v in [0.1, 0.2, 0.3] { + d.edit_coalesced("exposure", "g.exposure", |p| { + p.set_param(c, g, "exposure", Value::Number(v)) + }) + .unwrap(); + } + assert_eq!(d.undo().as_deref(), Some("exposure")); + assert_eq!( + d.project + .clip(c) + .unwrap() + .node(g) + .unwrap() + .number("exposure"), + 0.0 + ); + assert_eq!(d.undo().as_deref(), Some("add")); + } + + #[test] + fn gestures_record_one_step() { + let (mut d, c) = doc(); + let v1 = d.project.clip(c).unwrap().track; + d.begin_gesture(); + for x in [10, 20, 30] { + d.gesture(|p| p.move_clip(c, v1, x)).unwrap(); + } + assert!(d.end_gesture("move")); + assert_eq!(d.project.clip(c).unwrap().start, 30); + d.undo(); + assert_eq!(d.project.clip(c).unwrap().start, 0); + + d.begin_gesture(); + d.gesture(|p| p.move_clip(c, v1, 0)).unwrap(); + assert!(!d.end_gesture("move")); + } + + #[test] + fn offline_refresh_is_not_an_edit() { + let (mut d, _) = doc(); + assert_eq!(d.refresh_offline(|_| true), 1); + assert!(d.project.media[0].offline); + assert!(!d.is_dirty()); + assert_eq!(d.undo_label(), None); + d.edit("split", |p| { + let c = p.sequence.clips[0].id; + p.split(c, 50) + }) + .unwrap(); + d.refresh_offline(|_| false); + d.undo(); + assert!( + !d.project.media[0].offline, + "undo doesn't bring back stale offline flags" + ); + } + + #[test] + fn rebased_paths_survive_undo() { + let (mut d, _) = doc(); + d.edit("split", |p| { + let c = p.sequence.clips[0].id; + p.split(c, 50) + }) + .unwrap(); + d.rebase_media(|m| m.path = PathBuf::from("/abs").join(&m.path)); + d.undo(); + assert!(d.project.media[0].path.starts_with("/abs")); + d.redo(); + assert!(d.project.media[0].path.starts_with("/abs")); + } + + #[test] + fn ending_coalescing_starts_a_new_step() { + let (mut d, c) = doc(); + let g = d.edit("add", |p| p.add_node(c, NodeKind::Grade)).unwrap(); + for v in [0.1, 0.2] { + d.edit_coalesced("exposure", "g.exposure", |p| { + p.set_param(c, g, "exposure", Value::Number(v)) + }) + .unwrap(); + d.end_coalescing(); + } + d.undo(); + let exposure = d + .project + .clip(c) + .unwrap() + .node(g) + .unwrap() + .number("exposure"); + assert_eq!(exposure, 0.1, "only the second gesture is undone"); + } +} diff --git a/crates/videode-core/src/edit.rs b/crates/videode-core/src/edit.rs new file mode 100644 index 0000000..c53eef0 --- /dev/null +++ b/crates/videode-core/src/edit.rs @@ -0,0 +1,653 @@ +//! Editing operations. Each validates against locks, track kinds, media +//! bounds and overlaps, and either applies fully or returns an error +//! without changing the project. + +use crate::node::{ClipKind, NodeId, NodeKind, ParamError, Value}; +use crate::project::{Clip, ClipId, MediaId, OutputField, Project, TrackId, container_extension}; +use crate::time::Frame; + +#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)] +pub enum EditError { + #[error("that clip no longer exists")] + NoSuchClip, + #[error("that track no longer exists")] + NoSuchTrack, + #[error("that node no longer exists")] + NoSuchNode, + #[error("that media no longer exists")] + NoSuchMedia, + #[error("{0} is locked")] + TrackLocked(String), + #[error("{0} can't hold this kind of clip")] + WrongTrackKind(String), + #[error("no room on {0} for this clip")] + NoRoom(String), + #[error("the frame isn't inside the clip")] + OutsideClip, + #[error("{node} doesn't work on {kind} clips")] + NotApplicable { + node: &'static str, + kind: &'static str, + }, + #[error("{0} is what the clip is made from; delete the clip instead")] + GeneratorFixed(&'static str), + #[error("{0} can't be {1}")] + InvalidOutput(&'static str, String), + #[error(transparent)] + Param(#[from] ParamError), +} + +pub type EditResult = Result; + +fn kind_name(kind: ClipKind) -> &'static str { + match kind { + ClipKind::Video => "video", + ClipKind::Audio => "audio", + ClipKind::Text => "text", + } +} + +/// Default length for clips of media without a duration (stills, text). +pub const DEFAULT_STILL_SECONDS: i64 = 5; + +impl Project { + fn editable_track(&self, id: TrackId) -> EditResult<&crate::project::Track> { + let t = self.track(id).ok_or(EditError::NoSuchTrack)?; + if t.locked { + return Err(EditError::TrackLocked(t.label.clone())); + } + Ok(t) + } + + fn editable_clip(&self, id: ClipId) -> EditResult<&Clip> { + let c = self.clip(id).ok_or(EditError::NoSuchClip)?; + self.editable_track(c.track)?; + Ok(c) + } + + /// Free intervals `[start, end)` on a track, ignoring `exclude`. The last + /// interval is open-ended (`Frame::MAX`). + pub fn free_gaps(&self, track: TrackId, exclude: Option) -> Vec<(Frame, Frame)> { + let mut gaps = Vec::new(); + let mut cursor = 0; + for c in self.clips_on(track) { + if Some(c.id) == exclude { + continue; + } + if c.start > cursor { + gaps.push((cursor, c.start)); + } + cursor = cursor.max(c.end()); + } + gaps.push((cursor, Frame::MAX)); + gaps + } + + /// The start closest to `desired` where `duration` frames fit on + /// `track` without overlapping anything except `exclude`. + pub fn place( + &self, + track: TrackId, + desired: Frame, + duration: Frame, + exclude: Option, + ) -> Option { + self.free_gaps(track, exclude) + .into_iter() + .filter(|(s, e)| e.saturating_sub(*s) >= duration) + .map(|(s, e)| desired.clamp(s, e.saturating_sub(duration))) + .min_by_key(|start| (start - desired).abs()) + } + + fn check_track_kind(&self, track: TrackId, kind: ClipKind) -> EditResult<()> { + let t = self.track(track).ok_or(EditError::NoSuchTrack)?; + if t.kind != kind.stream() { + return Err(EditError::WrongTrackKind(t.label.clone())); + } + Ok(()) + } + + /// Adds a clip for `media`. With no track given, picks the first + /// unlocked track of the right kind with room at `at`, then any with room. + pub fn add_media_clip( + &mut self, + media: MediaId, + track: Option, + at: Frame, + ) -> EditResult { + let m = self.media(media).ok_or(EditError::NoSuchMedia)?; + let kind = m.kind.clip_kind(); + let duration = m + .duration + .unwrap_or(DEFAULT_STILL_SECONDS * self.sequence.fps.nominal()); + let at = at.max(0); + let (track, start) = match track { + Some(t) => { + self.editable_track(t)?; + self.check_track_kind(t, kind)?; + let label = self.track(t).map(|t| t.label.clone()).unwrap_or_default(); + ( + t, + self.place(t, at, duration, None) + .ok_or(EditError::NoRoom(label))?, + ) + } + None => { + let candidates: Vec = self + .sequence + .tracks + .iter() + .filter(|t| t.kind == kind.stream() && !t.locked) + .map(|t| t.id) + .collect(); + let exact = candidates + .iter() + .find(|t| self.place(**t, at, duration, None) == Some(at)); + match exact.or(candidates.first()) { + Some(&t) => (t, self.place(t, at, duration, None).unwrap_or(at)), + None => return Err(EditError::WrongTrackKind("any unlocked track".into())), + } + } + }; + let source = self.new_node(NodeKind::Source); + let id = ClipId(self.alloc()); + self.sequence.clips.push(Clip { + id, + track, + kind, + start, + duration, + media: Some(media), + source_in: 0, + nodes: vec![source], + }); + Ok(id) + } + + pub fn add_text_clip( + &mut self, + track: TrackId, + at: Frame, + duration: Frame, + text: &str, + ) -> EditResult { + self.editable_track(track)?; + self.check_track_kind(track, ClipKind::Text)?; + let label = self + .track(track) + .map(|t| t.label.clone()) + .unwrap_or_default(); + let duration = duration.max(1); + let start = self + .place(track, at.max(0), duration, None) + .ok_or(EditError::NoRoom(label))?; + let mut generator = self.new_node(NodeKind::Text); + generator.set("text", Value::Text(text.into()))?; + let id = ClipId(self.alloc()); + self.sequence.clips.push(Clip { + id, + track, + kind: ClipKind::Text, + start, + duration, + media: None, + source_in: 0, + nodes: vec![generator], + }); + Ok(id) + } + + /// Moves a clip as close to `desired` on `track` as fits. Returns the + /// start actually used. + pub fn move_clip(&mut self, id: ClipId, track: TrackId, desired: Frame) -> EditResult { + let c = self.editable_clip(id)?; + let (kind, duration) = (c.kind, c.duration); + self.editable_track(track)?; + self.check_track_kind(track, kind)?; + let label = self + .track(track) + .map(|t| t.label.clone()) + .unwrap_or_default(); + let start = self + .place(track, desired.max(0), duration, Some(id)) + .ok_or(EditError::NoRoom(label))?; + let c = self.clip_mut(id).expect("checked above"); + c.track = track; + c.start = start; + Ok(start) + } + + /// Bounds a clip's edges may be trimmed to: neighbours on its track and, + /// for media with a length, the media itself. + fn trim_bounds(&self, c: &Clip) -> (Frame, Frame) { + let gaps = self.free_gaps(c.track, Some(c.id)); + let (gap_s, gap_e) = gaps + .into_iter() + .find(|(s, e)| *s <= c.start && *e >= c.end()) + .unwrap_or((c.start, c.end())); + let media_len = c.media.and_then(|m| self.media(m)).and_then(|m| m.duration); + match media_len { + Some(len) => ( + gap_s.max(c.start - c.source_in), + gap_e.min(c.start - c.source_in + len), + ), + None => (gap_s, gap_e), + } + } + + /// Moves the clip's in point, keeping its end fixed. Returns the new start. + pub fn trim_start(&mut self, id: ClipId, desired: Frame) -> EditResult { + let c = self.editable_clip(id)?; + let (lo, _) = self.trim_bounds(c); + let new_start = desired.clamp(lo, c.end() - 1); + let c = self.clip_mut(id).expect("checked above"); + let delta = new_start - c.start; + c.start = new_start; + c.duration -= delta; + if c.media.is_some() { + c.source_in += delta; + } + Ok(new_start) + } + + /// Moves the clip's out point, keeping its start fixed. Returns the new end. + pub fn trim_end(&mut self, id: ClipId, desired: Frame) -> EditResult { + let c = self.editable_clip(id)?; + let (_, hi) = self.trim_bounds(c); + let new_end = desired.clamp(c.start + 1, hi); + let c = self.clip_mut(id).expect("checked above"); + c.duration = new_end - c.start; + Ok(new_end) + } + + /// Cuts a clip in two at `at`. The right half gets fresh node ids; fades + /// are cleared on the cut side of each half. Returns the right half. + pub fn split(&mut self, id: ClipId, at: Frame) -> EditResult { + let c = self.editable_clip(id)?; + if at <= c.start || at >= c.end() { + return Err(EditError::OutsideClip); + } + let mut right = c.clone(); + right.id = ClipId(self.alloc()); + for n in &mut right.nodes { + n.id = NodeId(self.alloc()); + } + let offset = at - right.start; + right.start = at; + right.duration -= offset; + if right.media.is_some() { + right.source_in += offset; + } + clear_fade(&mut right, "in"); + let left = self.clip_mut(id).expect("checked above"); + left.duration = offset; + clear_fade(left, "out"); + let right_id = right.id; + self.sequence.clips.push(right); + Ok(right_id) + } + + pub fn delete_clip(&mut self, id: ClipId) -> EditResult<()> { + self.editable_clip(id)?; + self.sequence.clips.retain(|c| c.id != id); + Ok(()) + } + + /// Deletes a clip and closes the gap by pulling later clips on the same + /// track left. + pub fn ripple_delete(&mut self, id: ClipId) -> EditResult<()> { + let c = self.editable_clip(id)?; + let (track, end, duration) = (c.track, c.end(), c.duration); + self.sequence.clips.retain(|c| c.id != id); + for c in self.sequence.clips.iter_mut() { + if c.track == track && c.start >= end { + c.start -= duration; + } + } + Ok(()) + } + + pub fn add_node(&mut self, clip: ClipId, kind: NodeKind) -> EditResult { + let c = self.editable_clip(clip)?; + if !kind.applies_to(c.kind) { + return Err(EditError::NotApplicable { + node: kind.name(), + kind: kind_name(c.kind), + }); + } + let node = self.new_node(kind); + let id = node.id; + self.clip_mut(clip).expect("checked above").nodes.push(node); + Ok(id) + } + + fn processing_node_index(&self, clip: ClipId, node: NodeId) -> EditResult { + let c = self.editable_clip(clip)?; + let i = c.node_index(node).ok_or(EditError::NoSuchNode)?; + if c.nodes[i].kind.is_generator() { + return Err(EditError::GeneratorFixed(c.nodes[i].kind.name())); + } + Ok(i) + } + + pub fn remove_node(&mut self, clip: ClipId, node: NodeId) -> EditResult<()> { + let i = self.processing_node_index(clip, node)?; + self.clip_mut(clip).expect("checked above").nodes.remove(i); + Ok(()) + } + + /// Moves a node within the chain. Index 0 belongs to the generator, so + /// the target is clamped to `1..len`. + pub fn move_node(&mut self, clip: ClipId, node: NodeId, index: usize) -> EditResult { + let i = self.processing_node_index(clip, node)?; + let c = self.clip_mut(clip).expect("checked above"); + let index = index.clamp(1, c.nodes.len() - 1); + let n = c.nodes.remove(i); + c.nodes.insert(index, n); + Ok(index) + } + + pub fn set_bypass(&mut self, clip: ClipId, node: NodeId, bypass: bool) -> EditResult<()> { + let i = self.processing_node_index(clip, node)?; + self.clip_mut(clip).expect("checked above").nodes[i].bypass = bypass; + Ok(()) + } + + pub fn set_param( + &mut self, + clip: ClipId, + node: NodeId, + key: &str, + value: Value, + ) -> EditResult<()> { + let c = self.editable_clip(clip)?; + let i = c.node_index(node).ok_or(EditError::NoSuchNode)?; + self.clip_mut(clip).expect("checked above").nodes[i].set(key, value)?; + Ok(()) + } + + /// Changes one Output setting. Changing the container also fixes up a + /// known file extension on the output path. + pub fn set_output(&mut self, field: OutputField, value: &str) -> EditResult<()> { + let options = field.options(); + let value = value.trim(); + let ok = if options.is_empty() { + !value.is_empty() + } else { + options.contains(&value) + }; + if !ok { + return Err(EditError::InvalidOutput(field.label(), value.to_string())); + } + let o = &mut self.output; + match field { + OutputField::Container => { + if let (Some(ext), Some((stem, old))) = + (container_extension(value), o.path.rsplit_once('.')) + && ["mp4", "mov", "mkv", "webm"].contains(&old.to_ascii_lowercase().as_str()) + { + o.path = format!("{stem}.{ext}"); + } + o.container = value.into(); + } + OutputField::Codec => o.codec = value.into(), + OutputField::Resolution => o.resolution = value.into(), + OutputField::Quality => o.quality = value.into(), + OutputField::Path => o.path = value.into(), + } + Ok(()) + } + + pub fn set_track_enabled(&mut self, track: TrackId, enabled: bool) -> EditResult<()> { + let t = self + .sequence + .tracks + .iter_mut() + .find(|t| t.id == track) + .ok_or(EditError::NoSuchTrack)?; + t.enabled = enabled; + Ok(()) + } + + pub fn set_track_locked(&mut self, track: TrackId, locked: bool) -> EditResult<()> { + let t = self + .sequence + .tracks + .iter_mut() + .find(|t| t.id == track) + .ok_or(EditError::NoSuchTrack)?; + t.locked = locked; + Ok(()) + } + + /// Frames a dragged edge may snap to: sequence start, clip edges (except + /// `exclude`) and any `extra` points such as the playhead. + pub fn snap_points(&self, exclude: Option, extra: &[Frame]) -> Vec { + let mut v = vec![0]; + v.extend(extra); + for c in &self.sequence.clips { + if Some(c.id) != exclude { + v.push(c.start); + v.push(c.end()); + } + } + v.sort_unstable(); + v.dedup(); + v + } +} + +/// The nearest point within `tolerance` frames, if any. +pub fn snap(frame: Frame, points: &[Frame], tolerance: Frame) -> Option { + points + .iter() + .copied() + .filter(|p| (p - frame).abs() <= tolerance) + .min_by_key(|p| (p - frame).abs()) +} + +fn clear_fade(clip: &mut Clip, side: &str) { + for n in clip.nodes.iter_mut().filter(|n| n.kind == NodeKind::Fade) { + let _ = n.set(side, Value::Number(0.0)); + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::project::MediaKind; + + /// V1 holds a (0..100) and b (150..250) from 400-frame media; A1 is empty. + fn fixture() -> (Project, ClipId, ClipId, TrackId, TrackId, MediaId) { + let mut p = Project::new("t"); + let v1 = p.track_by_label("V1").unwrap().id; + let a1 = p.track_by_label("A1").unwrap().id; + let m = p.add_media("a.mov", MediaKind::Video, Some(400), "H.264", "1920×1080"); + let a = p.add_media_clip(m, Some(v1), 0).unwrap(); + p.trim_end(a, 100).unwrap(); + let b = p.add_media_clip(m, Some(v1), 150).unwrap(); + p.trim_end(b, 250).unwrap(); + (p, a, b, v1, a1, m) + } + + #[test] + fn add_picks_track_and_room() { + let (mut p, _, _, v1, _, m) = fixture(); + // At 50 V1 is occupied, so the clip goes to V2. + let c = p.add_media_clip(m, None, 50).unwrap(); + assert_eq!(p.track(p.clip(c).unwrap().track).unwrap().label, "V2"); + // Forcing V1 places it in the nearest gap that fits 400 frames. + let d = p.add_media_clip(m, Some(v1), 50).unwrap(); + assert_eq!(p.clip(d).unwrap().start, 250); + } + + #[test] + fn add_rejects_wrong_track_kind() { + let (mut p, _, _, _, a1, m) = fixture(); + assert_eq!( + p.add_media_clip(m, Some(a1), 0), + Err(EditError::WrongTrackKind("A1".into())) + ); + } + + #[test] + fn move_clamps_to_neighbours() { + let (mut p, a, _, v1, a1, _) = fixture(); + // b starts at 150; a is 100 long so it can go up to 50. + assert_eq!(p.move_clip(a, v1, 120).unwrap(), 50); + assert_eq!(p.move_clip(a, v1, -30).unwrap(), 0); + // Far right: jumps past b into the open gap. + assert_eq!(p.move_clip(a, v1, 400).unwrap(), 400); + assert!(matches!( + p.move_clip(a, a1, 0), + Err(EditError::WrongTrackKind(_)) + )); + } + + #[test] + fn trims_respect_media_and_neighbours() { + let (mut p, a, b, _, _, _) = fixture(); + // a's end can grow to b's start. + assert_eq!(p.trim_end(a, 500).unwrap(), 150); + // b's start can't pass a's end now. + assert_eq!(p.trim_start(b, 100).unwrap(), 150); + // Trimming b's start right moves its source in point too. + assert_eq!(p.trim_start(b, 170).unwrap(), 170); + let bc = p.clip(b).unwrap(); + assert_eq!((bc.source_in, bc.duration), (20, 80)); + // b's end is limited by the media length (400 - 20 source frames left). + assert_eq!(p.trim_end(b, 9_999).unwrap(), 170 - 20 + 400); + // Can't trim to zero length. + assert_eq!(p.trim_end(b, 0).unwrap(), 171); + } + + #[test] + fn split_and_fades() { + let (mut p, a, _, _, _, _) = fixture(); + p.add_node(a, NodeKind::Fade).unwrap(); + let r = p.split(a, 40).unwrap(); + let (l, rc) = (p.clip(a).unwrap(), p.clip(r).unwrap()); + assert_eq!((l.start, l.duration), (0, 40)); + assert_eq!((rc.start, rc.duration, rc.source_in), (40, 60, 40)); + assert_eq!(l.first(NodeKind::Fade).unwrap().number("out"), 0.0); + assert_eq!(rc.first(NodeKind::Fade).unwrap().number("in"), 0.0); + assert_ne!(l.nodes[0].id, rc.nodes[0].id); + assert_eq!(p.split(a, 0), Err(EditError::OutsideClip)); + assert_eq!(p.split(a, 40), Err(EditError::OutsideClip)); + } + + #[test] + fn ripple_delete_closes_gap() { + let (mut p, a, b, _, _, _) = fixture(); + p.ripple_delete(a).unwrap(); + assert_eq!(p.clip(b).unwrap().start, 50); + assert!(p.clip(a).is_none()); + } + + #[test] + fn locked_tracks_refuse_edits() { + let (mut p, a, _, v1, _, _) = fixture(); + p.set_track_locked(v1, true).unwrap(); + assert_eq!(p.delete_clip(a), Err(EditError::TrackLocked("V1".into()))); + assert!(p.split(a, 10).is_err()); + assert!(p.add_node(a, NodeKind::Grade).is_err()); + } + + #[test] + fn node_chain_ops() { + let (mut p, a, _, _, _, _) = fixture(); + let g = p.add_node(a, NodeKind::Grade).unwrap(); + let t = p.add_node(a, NodeKind::Transform).unwrap(); + assert_eq!(p.move_node(a, t, 0).unwrap(), 1); + let kinds: Vec<_> = p.clip(a).unwrap().nodes.iter().map(|n| n.kind).collect(); + assert_eq!( + kinds, + [NodeKind::Source, NodeKind::Transform, NodeKind::Grade] + ); + let src = p.clip(a).unwrap().nodes[0].id; + assert!(matches!( + p.remove_node(a, src), + Err(EditError::GeneratorFixed(_)) + )); + assert!(matches!( + p.add_node(a, NodeKind::Gain), + Err(EditError::NotApplicable { .. }) + )); + p.set_param(a, g, "exposure", Value::Number(1.0)).unwrap(); + p.set_bypass(a, g, true).unwrap(); + let gn = p.clip(a).unwrap().node(g).unwrap(); + assert!(gn.bypass && gn.number("exposure") == 1.0); + p.remove_node(a, g).unwrap(); + assert_eq!(p.clip(a).unwrap().nodes.len(), 2); + } + + #[test] + fn text_clips() { + let mut p = Project::new("t"); + let v2 = p.track_by_label("V2").unwrap().id; + let a2 = p.track_by_label("A2").unwrap().id; + let c = p.add_text_clip(v2, 10, 48, "Hello").unwrap(); + assert_eq!(p.clip_name(p.clip(c).unwrap()), "“Hello”"); + assert!(p.add_text_clip(a2, 0, 10, "x").is_err()); + assert!(p.add_node(c, NodeKind::Grade).is_err()); + assert!(p.add_node(c, NodeKind::Transform).is_ok()); + } + + #[test] + fn snapping() { + let (p, a, _, _, _, _) = fixture(); + let pts = p.snap_points(Some(a), &[77]); + assert_eq!(pts, vec![0, 77, 150, 250]); + assert_eq!(snap(153, &pts, 5), Some(150)); + assert_eq!(snap(160, &pts, 5), None); + } + + #[test] + fn output_settings_validate_and_fix_extension() { + let mut p = Project::new("t"); + p.set_output(OutputField::Container, "MOV").unwrap(); + assert_eq!(p.output.container, "MOV"); + assert_eq!(p.output.path, "export.mov"); + assert!(p.set_output(OutputField::Codec, "DivX").is_err()); + assert!(p.set_output(OutputField::Path, " ").is_err()); + p.set_output(OutputField::Path, "final cut.final").unwrap(); + p.set_output(OutputField::Container, "MKV").unwrap(); + // Unknown extensions are left alone. + assert_eq!(p.output.path, "final cut.final"); + } + + #[test] + fn node_chain_edits() { + let (mut p, a, ..) = fixture(); + let t = p.add_node(a, NodeKind::Transform).unwrap(); + let g = p.add_node(a, NodeKind::Grade).unwrap(); + assert_eq!( + p.move_node(a, g, 0).unwrap(), + 1, + "can't go before the generator" + ); + let kinds = |p: &Project| { + p.clip(a) + .unwrap() + .nodes + .iter() + .map(|n| n.kind) + .collect::>() + }; + assert_eq!( + kinds(&p), + [NodeKind::Source, NodeKind::Grade, NodeKind::Transform] + ); + p.set_bypass(a, t, true).unwrap(); + assert!(p.clip(a).unwrap().node(t).unwrap().bypass); + let source = p.clip(a).unwrap().nodes[0].id; + assert!(matches!( + p.remove_node(a, source), + Err(EditError::GeneratorFixed(_)) + )); + assert!(matches!( + p.add_node(a, NodeKind::Gain), + Err(EditError::NotApplicable { .. }) + )); + } +} diff --git a/crates/videode-core/src/fuzzy.rs b/crates/videode-core/src/fuzzy.rs new file mode 100644 index 0000000..19d018e --- /dev/null +++ b/crates/videode-core/src/fuzzy.rs @@ -0,0 +1,83 @@ +//! Fuzzy matching for the command palette: the query's characters must +//! appear in order; consecutive runs and word starts score higher. + +#[derive(Clone, Debug, PartialEq)] +pub struct Match { + pub score: i32, + /// Character (not byte) indices of matched characters in the candidate. + pub positions: Vec, +} + +pub fn fuzzy(query: &str, candidate: &str) -> Option { + let query: Vec = query + .chars() + .filter(|c| !c.is_whitespace()) + .flat_map(char::to_lowercase) + .collect(); + if query.is_empty() { + return Some(Match { + score: 0, + positions: Vec::new(), + }); + } + let chars: Vec = candidate.chars().collect(); + let lower: Vec = chars + .iter() + .map(|c| c.to_lowercase().next().unwrap_or(*c)) + .collect(); + let mut positions = Vec::with_capacity(query.len()); + let mut score = 0; + let mut qi = 0; + for (i, &c) in lower.iter().enumerate() { + if qi < query.len() && c == query[qi] { + let word_start = i == 0 + || !chars[i - 1].is_alphanumeric() + || (chars[i].is_uppercase() && chars[i - 1].is_lowercase()); + score += 1; + if word_start { + score += 8; + } + if positions.last() == Some(&(i.wrapping_sub(1))) { + score += 5; + } + positions.push(i); + qi += 1; + } + } + if qi < query.len() { + return None; + } + // Prefer matches that start early and candidates that are short. + score -= positions[0] as i32; + score -= (chars.len() as i32) / 8; + Some(Match { score, positions }) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn matches_in_order_only() { + assert!(fuzzy("spl", "Split at playhead").is_some()); + assert!(fuzzy("lps", "Split").is_none()); + assert_eq!(fuzzy("", "anything").unwrap().score, 0); + } + + #[test] + fn word_starts_and_runs_rank_higher() { + let a = fuzzy("rd", "Ripple delete").unwrap(); + let b = fuzzy("rd", "Redo").unwrap(); + assert!(a.score > b.score, "{a:?} vs {b:?}"); + let tight = fuzzy("grade", "Grade").unwrap(); + let loose = fuzzy("grade", "Go to start and end").map_or(i32::MIN, |m| m.score); + assert!(tight.score > loose); + assert_eq!(fuzzy("sp", "Split").unwrap().positions, vec![0, 1]); + } + + #[test] + fn case_and_unicode_safe() { + assert!(fuzzy("PART", "“part two — emergence”").is_some()); + assert_eq!(fuzzy("é", "Café").unwrap().positions, vec![3]); + } +} diff --git a/crates/videode-core/src/graph.rs b/crates/videode-core/src/graph.rs new file mode 100644 index 0000000..6b3141d --- /dev/null +++ b/crates/videode-core/src/graph.rs @@ -0,0 +1,358 @@ +//! The whole sequence as one node graph: every clip's chain feeds its track, +//! video tracks feed Composite, audio tracks feed Mix, both feed Sequence, +//! and Sequence feeds Output. This is the graph the "Shift+Tab" view shows +//! and the order the renderer evaluates. + +use crate::node::{Category, NodeId, StreamKind}; +use crate::project::{ClipId, Project, TrackId}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum GraphRef { + ClipNode { clip: ClipId, node: NodeId }, + Track(TrackId), + Composite, + Mix, + Sequence, + Output, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct GraphNode { + pub id: GraphRef, + pub label: String, + pub summary: String, + pub category: Category, + pub bypass: bool, +} + +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SequenceGraph { + pub nodes: Vec, + /// `(from, to)` indices into `nodes`. + pub edges: Vec<(usize, usize)>, +} + +impl SequenceGraph { + pub fn index_of(&self, id: GraphRef) -> Option { + self.nodes.iter().position(|n| n.id == id) + } + + /// Kahn's algorithm. Returns `None` if the graph has a cycle. + pub fn topo_order(&self) -> Option> { + let mut indegree = vec![0usize; self.nodes.len()]; + for &(_, to) in &self.edges { + indegree[to] += 1; + } + let mut ready: Vec = (0..self.nodes.len()) + .filter(|&i| indegree[i] == 0) + .collect(); + let mut order = Vec::with_capacity(self.nodes.len()); + while let Some(i) = ready.pop() { + order.push(i); + for &(from, to) in &self.edges { + if from == i { + indegree[to] -= 1; + if indegree[to] == 0 { + ready.push(to); + } + } + } + } + (order.len() == self.nodes.len()).then_some(order) + } +} + +pub fn sequence_graph(p: &Project) -> SequenceGraph { + let mut g = SequenceGraph::default(); + let add = |g: &mut SequenceGraph, id, label: String, summary: String, category, bypass| { + g.nodes.push(GraphNode { + id, + label, + summary, + category, + bypass, + }); + g.nodes.len() - 1 + }; + + let composite = add( + &mut g, + GraphRef::Composite, + "Composite".into(), + "stack video tracks".into(), + Category::Composite, + false, + ); + let mix = add( + &mut g, + GraphRef::Mix, + "Mix".into(), + "sum audio tracks".into(), + Category::Audio, + false, + ); + let seq = add( + &mut g, + GraphRef::Sequence, + "Sequence".into(), + p.sequence.name.clone(), + Category::Composite, + false, + ); + let out = add( + &mut g, + GraphRef::Output, + "Output".into(), + format!("{} · {}", p.output.container, p.output.codec), + Category::Output, + false, + ); + g.edges.push((composite, seq)); + g.edges.push((mix, seq)); + g.edges.push((seq, out)); + + for t in &p.sequence.tracks { + let (cat, bus) = match t.kind { + StreamKind::Video => (Category::Composite, composite), + StreamKind::Audio => (Category::Audio, mix), + }; + let ti = add( + &mut g, + GraphRef::Track(t.id), + format!("Track {}", t.label), + t.name.clone(), + cat, + !t.enabled, + ); + g.edges.push((ti, bus)); + for c in p.clips_on(t.id) { + let mut prev = None; + for n in &c.nodes { + let ni = add( + &mut g, + GraphRef::ClipNode { + clip: c.id, + node: n.id, + }, + n.kind.name().into(), + if n.kind == crate::node::NodeKind::Source { + p.clip_name(c) + } else { + n.summary() + }, + n.kind.category(), + n.bypass, + ); + if let Some(pi) = prev { + g.edges.push((pi, ni)); + } + prev = Some(ni); + } + if let Some(last) = prev { + g.edges.push((last, ti)); + } + } + } + g +} + +/// Node card size and spacing on the graph canvas, in logical pixels at 1×. +pub const NODE_W: f32 = 136.; +pub const NODE_H: f32 = 58.; +const STEP_X: f32 = 176.; +const GROUP_PAD: f32 = 12.; +const GROUP_LABEL: f32 = 18.; +const GROUP_GAP: f32 = 12.; +const TRACK_GAP: f32 = 18.; +const COLUMN_GAP: f32 = 40.; + +/// A clip's chain, drawn as a labelled box around its nodes. +#[derive(Clone, Debug, PartialEq)] +pub struct ClipGroup { + pub clip: ClipId, + pub x: f32, + pub y: f32, + pub w: f32, + pub h: f32, +} + +/// Where everything in the [`SequenceGraph`] sits: clips' chains in rows +/// grouped by track on the left, then tracks, buses, Sequence and Output. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct GraphLayout { + pub graph: SequenceGraph, + /// Top-left of each node, indexed like `graph.nodes`. + pub pos: Vec<(f32, f32)>, + pub groups: Vec, + pub width: f32, + pub height: f32, +} + +impl GraphLayout { + /// Wire endpoints: the source's right edge to the target's left edge, + /// both at mid-height, plus whether the target is bypassed. + pub fn wires(&self) -> impl Iterator + '_ { + self.graph.edges.iter().map(|&(a, b)| { + let (ax, ay) = self.pos[a]; + let (bx, by) = self.pos[b]; + ( + (ax + NODE_W, ay + NODE_H / 2.), + (bx, by + NODE_H / 2.), + self.graph.nodes[b].bypass, + ) + }) + } + + /// The topmost node under a point, in layout coordinates. + pub fn node_at(&self, x: f32, y: f32) -> Option { + self.pos + .iter() + .rposition(|&(nx, ny)| x >= nx && x <= nx + NODE_W && y >= ny && y <= ny + NODE_H) + } + + pub fn group_at(&self, x: f32, y: f32) -> Option<&ClipGroup> { + self.groups + .iter() + .find(|g| x >= g.x && x <= g.x + g.w && y >= g.y && y <= g.y + g.h) + } +} + +pub fn layout(p: &Project) -> GraphLayout { + let graph = sequence_graph(p); + let mut pos = vec![(0., 0.); graph.nodes.len()]; + let mut groups = Vec::new(); + let idx = |r: GraphRef| graph.index_of(r).expect("every ref is in the graph"); + + let longest = p + .sequence + .clips + .iter() + .map(|c| c.nodes.len()) + .max() + .unwrap_or(1) + .max(1); + let track_x = longest as f32 * STEP_X + COLUMN_GAP + GROUP_PAD; + let group_h = NODE_H + GROUP_PAD * 2. + GROUP_LABEL; + + let mut y = 0.; + let mut track_mid = Vec::new(); + for t in &p.sequence.tracks { + let top = y; + let clips = p.clips_on(t.id); + for c in &clips { + let w = c.nodes.len() as f32 * STEP_X - (STEP_X - NODE_W) + GROUP_PAD * 2.; + groups.push(ClipGroup { + clip: c.id, + x: 0., + y, + w, + h: group_h, + }); + for (i, n) in c.nodes.iter().enumerate() { + let at = idx(GraphRef::ClipNode { + clip: c.id, + node: n.id, + }); + pos[at] = (GROUP_PAD + i as f32 * STEP_X, y + GROUP_PAD + GROUP_LABEL); + } + y += group_h + GROUP_GAP; + } + if clips.is_empty() { + y += NODE_H + GROUP_GAP; + } + let mid = (top + y - GROUP_GAP) / 2.; + pos[idx(GraphRef::Track(t.id))] = (track_x, mid - NODE_H / 2.); + track_mid.push((t.kind, mid)); + y += TRACK_GAP; + } + + let average = |kind: StreamKind| { + let mids: Vec = track_mid + .iter() + .filter(|(k, _)| *k == kind) + .map(|(_, m)| *m) + .collect(); + if mids.is_empty() { + y / 2. + } else { + mids.iter().sum::() / mids.len() as f32 + } + }; + let (video, audio) = (average(StreamKind::Video), average(StreamKind::Audio)); + let bus_x = track_x + STEP_X + COLUMN_GAP; + let seq_x = bus_x + STEP_X + COLUMN_GAP; + let out_x = seq_x + STEP_X + COLUMN_GAP; + let seq_mid = (video + audio) / 2.; + pos[idx(GraphRef::Composite)] = (bus_x, video - NODE_H / 2.); + pos[idx(GraphRef::Mix)] = (bus_x, audio - NODE_H / 2.); + pos[idx(GraphRef::Sequence)] = (seq_x, seq_mid - NODE_H / 2.); + pos[idx(GraphRef::Output)] = (out_x, seq_mid - NODE_H / 2.); + + GraphLayout { + graph, + pos, + groups, + width: out_x + NODE_W, + height: (y - TRACK_GAP).max(NODE_H), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn demo_graph_shape() { + let p = crate::demo::demo_project(); + let g = sequence_graph(&p); + assert_eq!(g.nodes.len(), p.node_count()); + let order = g.topo_order().expect("acyclic"); + let pos = |r| { + order + .iter() + .position(|&i| i == g.index_of(r).unwrap()) + .unwrap() + }; + assert!(pos(GraphRef::Sequence) < pos(GraphRef::Output)); + assert!(pos(GraphRef::Composite) < pos(GraphRef::Sequence)); + // Every clip's generator comes before its track. + for c in &p.sequence.clips { + let generator = GraphRef::ClipNode { + clip: c.id, + node: c.nodes[0].id, + }; + assert!(pos(generator) < pos(GraphRef::Track(c.track))); + } + } + + #[test] + fn detects_cycles() { + let mut g = sequence_graph(&Project::new("t")); + g.edges.push(( + g.index_of(GraphRef::Output).unwrap(), + g.index_of(GraphRef::Composite).unwrap(), + )); + assert!(g.topo_order().is_none()); + } + + #[test] + fn layout_flows_left_to_right_without_overlap() { + let p = crate::demo::demo_project(); + let l = layout(&p); + assert_eq!(l.pos.len(), l.graph.nodes.len()); + for &(a, b) in &l.graph.edges { + assert!(l.pos[a].0 < l.pos[b].0, "edge {a}->{b} runs backwards"); + } + for (i, &(ax, ay)) in l.pos.iter().enumerate() { + for &(bx, by) in &l.pos[i + 1..] { + let apart = (ax - bx).abs() >= NODE_W || (ay - by).abs() >= NODE_H; + assert!(apart, "nodes overlap at ({ax},{ay})"); + } + } + assert_eq!(l.groups.len(), p.sequence.clips.len()); + let out = l.graph.index_of(GraphRef::Output).unwrap(); + let (ox, oy) = l.pos[out]; + assert_eq!(l.node_at(ox + 1., oy + 1.), Some(out)); + assert!(l.width >= ox + NODE_W); + } +} diff --git a/crates/videode-core/src/kdl_io.rs b/crates/videode-core/src/kdl_io.rs new file mode 100644 index 0000000..a5e98e4 --- /dev/null +++ b/crates/videode-core/src/kdl_io.rs @@ -0,0 +1,443 @@ +//! `.vde` project files, written as KDL v2. +//! +//! ```kdl +//! videode version=1 +//! project "Signal Study" +//! media { +//! file id=1 path="media/dusk.mov" kind=video duration=384 codec="ProRes 422 HQ" format="3840×2160" +//! } +//! sequence "Main" fps=24 fps-den=1 width=1920 height=1080 { +//! track V1 kind=video name=Picture { +//! clip start=0 duration=168 media=1 in=0 { +//! source +//! grade exposure=-0.2 temperature=5200 +//! } +//! } +//! } +//! output container=MP4 codec=H.264 resolution=1920×1080 quality=High path="export.mp4" +//! ``` +//! +//! Ids inside the program are regenerated on load; files refer to media by +//! the `id` written in the `media` block. + +use std::collections::HashMap; + +use kdl::{KdlDocument, KdlEntry, KdlNode, KdlValue}; + +use crate::node::{ClipKind, NodeKind, ParamKind, StreamKind, Value}; +use crate::project::{Clip, ClipId, MediaId, MediaKind, OutputSettings, Project}; +use crate::time::Fps; + +pub const FORMAT_VERSION: i64 = 1; + +#[derive(Debug, thiserror::Error, PartialEq, Eq)] +pub enum LoadError { + #[error("not a valid KDL document: {0}")] + Syntax(String), + #[error("not a videode project (missing `videode` header)")] + NotAProject, + #[error("project format version {0} is newer than this videode supports")] + TooNew(i64), + #[error("{0}")] + Invalid(String), +} + +fn invalid(msg: impl Into) -> Result { + Err(LoadError::Invalid(msg.into())) +} + +/* ---------------- writing ---------------- */ + +fn number(n: f64) -> KdlValue { + if n.fract() == 0.0 && n.abs() < 1e15 { + KdlValue::Integer(n as i128) + } else { + KdlValue::Float(n) + } +} + +fn prop(key: &str, value: impl Into) -> KdlEntry { + KdlEntry::new_prop(key, value.into()) +} + +pub fn to_kdl(p: &Project) -> String { + let mut doc = KdlDocument::new(); + + let mut header = KdlNode::new("videode"); + header.push(prop("version", FORMAT_VERSION as i128)); + doc.nodes_mut().push(header); + + let mut project = KdlNode::new("project"); + project.push(KdlEntry::new(p.name.as_str())); + doc.nodes_mut().push(project); + + let mut media = KdlNode::new("media"); + let media_children = media.ensure_children(); + for m in &p.media { + let mut f = KdlNode::new("file"); + f.push(prop("id", m.id.0 as i128)); + f.push(prop("path", m.path.to_string_lossy().as_ref())); + f.push(prop("kind", m.kind.ident())); + if let Some(d) = m.duration { + f.push(prop("duration", d as i128)); + } + if !m.codec.is_empty() { + f.push(prop("codec", m.codec.as_str())); + } + if !m.format.is_empty() { + f.push(prop("format", m.format.as_str())); + } + media_children.nodes_mut().push(f); + } + doc.nodes_mut().push(media); + + let s = &p.sequence; + let mut seq = KdlNode::new("sequence"); + seq.push(KdlEntry::new(s.name.as_str())); + seq.push(prop("fps", s.fps.num as i128)); + seq.push(prop("fps-den", s.fps.den as i128)); + seq.push(prop("width", s.width as i128)); + seq.push(prop("height", s.height as i128)); + let tracks = seq.ensure_children(); + for t in &s.tracks { + let mut tn = KdlNode::new("track"); + tn.push(KdlEntry::new(t.label.as_str())); + tn.push(prop( + "kind", + match t.kind { + StreamKind::Video => "video", + StreamKind::Audio => "audio", + }, + )); + tn.push(prop("name", t.name.as_str())); + if !t.enabled { + tn.push(prop("enabled", false)); + } + if t.locked { + tn.push(prop("locked", true)); + } + for c in p.clips_on(t.id) { + let mut cn = KdlNode::new("clip"); + cn.push(prop("start", c.start as i128)); + cn.push(prop("duration", c.duration as i128)); + if let Some(m) = c.media { + cn.push(prop("media", m.0 as i128)); + cn.push(prop("in", c.source_in as i128)); + } + let nodes = cn.ensure_children(); + for n in &c.nodes { + let mut nn = KdlNode::new(n.kind.ident()); + for spec in n.kind.params() { + match n.get(spec.key) { + Some(Value::Number(v)) => nn.push(prop(spec.key, number(*v))), + Some(Value::Text(v)) => nn.push(prop(spec.key, v.as_str())), + None => {} + } + } + if n.bypass { + nn.push(prop("bypass", true)); + } + nodes.nodes_mut().push(nn); + } + tn.ensure_children().nodes_mut().push(cn); + } + tracks.nodes_mut().push(tn); + } + doc.nodes_mut().push(seq); + + let o = &p.output; + let mut out = KdlNode::new("output"); + out.push(prop("container", o.container.as_str())); + out.push(prop("codec", o.codec.as_str())); + out.push(prop("resolution", o.resolution.as_str())); + out.push(prop("quality", o.quality.as_str())); + out.push(prop("path", o.path.as_str())); + doc.nodes_mut().push(out); + + doc.autoformat(); + doc.to_string() +} + +/* ---------------- reading ---------------- */ + +fn get_int(node: &KdlNode, key: &str) -> Result, LoadError> { + match node.get(key) { + None => Ok(None), + Some(KdlValue::Integer(i)) => i64::try_from(*i) + .map(Some) + .or_else(|_| invalid(format!("`{key}` is out of range"))), + Some(_) => invalid(format!( + "`{}`: `{key}` must be a whole number", + node.name().value() + )), + } +} + +fn req_int(node: &KdlNode, key: &str) -> Result { + get_int(node, key)? + .ok_or_else(|| LoadError::Invalid(format!("`{}` is missing `{key}`", node.name().value()))) +} + +fn get_str<'a>(node: &'a KdlNode, key: &str) -> Result, LoadError> { + match node.get(key) { + None => Ok(None), + Some(KdlValue::String(s)) => Ok(Some(s)), + Some(_) => invalid(format!( + "`{}`: `{key}` must be a string", + node.name().value() + )), + } +} + +fn get_bool(node: &KdlNode, key: &str, default: bool) -> Result { + match node.get(key) { + None => Ok(default), + Some(KdlValue::Bool(b)) => Ok(*b), + Some(_) => invalid(format!( + "`{}`: `{key}` must be #true or #false", + node.name().value() + )), + } +} + +fn arg_str(node: &KdlNode) -> Option<&str> { + node.entries() + .iter() + .find(|e| e.name().is_none()) + .and_then(|e| e.value().as_string()) +} + +fn children(node: &KdlNode) -> &[KdlNode] { + node.children().map(|d| d.nodes()).unwrap_or(&[]) +} + +pub fn from_kdl(text: &str) -> Result { + let doc: KdlDocument = text + .parse() + .map_err(|e: kdl::KdlError| LoadError::Syntax(e.to_string()))?; + let header = doc.get("videode").ok_or(LoadError::NotAProject)?; + let version = get_int(header, "version")?.unwrap_or(0); + if version > FORMAT_VERSION { + return Err(LoadError::TooNew(version)); + } + + let name = doc + .get("project") + .and_then(arg_str) + .unwrap_or("Untitled project"); + let mut p = Project::new(name); + p.sequence.tracks.clear(); + + let mut media_ids: HashMap = HashMap::new(); + if let Some(media) = doc.get("media") { + for f in children(media) + .iter() + .filter(|n| n.name().value() == "file") + { + let file_id = req_int(f, "id")?; + let path = get_str(f, "path")? + .ok_or_else(|| LoadError::Invalid("media file without `path`".into()))?; + let kind_s = get_str(f, "kind")?.unwrap_or("video"); + let kind = MediaKind::from_ident(kind_s) + .ok_or_else(|| LoadError::Invalid(format!("unknown media kind `{kind_s}`")))?; + let duration = get_int(f, "duration")?; + let id = p.add_media( + path, + kind, + duration, + get_str(f, "codec")?.unwrap_or(""), + get_str(f, "format")?.unwrap_or(""), + ); + if get_str(f, "status")? == Some("offline") { + p.media.last_mut().expect("just added").offline = true; + } + if media_ids.insert(file_id, id).is_some() { + return invalid(format!("media id {file_id} is used twice")); + } + } + } + + let seq = doc + .get("sequence") + .ok_or_else(|| LoadError::Invalid("missing `sequence`".into()))?; + p.sequence.name = arg_str(seq).unwrap_or("Main").into(); + let num = get_int(seq, "fps")?.unwrap_or(24); + let den = get_int(seq, "fps-den")?.unwrap_or(1); + if num <= 0 || den <= 0 { + return invalid("frame rate must be positive"); + } + p.sequence.fps = Fps::new(num as u32, den as u32); + p.sequence.width = get_int(seq, "width")?.unwrap_or(1920).max(1) as u32; + p.sequence.height = get_int(seq, "height")?.unwrap_or(1080).max(1) as u32; + + for tn in children(seq).iter().filter(|n| n.name().value() == "track") { + let label = + arg_str(tn).ok_or_else(|| LoadError::Invalid("track without a label".into()))?; + let kind = match get_str(tn, "kind")?.unwrap_or("video") { + "video" => StreamKind::Video, + "audio" => StreamKind::Audio, + other => return invalid(format!("unknown track kind `{other}`")), + }; + let track = p.push_track(label, get_str(tn, "name")?.unwrap_or(""), kind); + { + let t = p.sequence.tracks.last_mut().expect("just pushed"); + t.enabled = get_bool(tn, "enabled", true)?; + t.locked = get_bool(tn, "locked", false)?; + } + + for cn in children(tn).iter().filter(|n| n.name().value() == "clip") { + let start = req_int(cn, "start")?; + let duration = req_int(cn, "duration")?; + if start < 0 || duration < 1 { + return invalid(format!( + "clip on {label} has a negative start or empty duration" + )); + } + let media = match get_int(cn, "media")? { + Some(fid) => Some(*media_ids.get(&fid).ok_or_else(|| { + LoadError::Invalid(format!("clip refers to unknown media {fid}")) + })?), + None => None, + }; + let mut nodes = Vec::new(); + for nn in children(cn) { + let ident = nn.name().value(); + let kind = NodeKind::from_ident(ident) + .ok_or_else(|| LoadError::Invalid(format!("unknown node `{ident}`")))?; + let mut node = p.new_node(kind); + for spec in kind.params() { + let value = match (spec.kind, nn.get(spec.key)) { + (_, None) => continue, + (ParamKind::Number { .. }, Some(KdlValue::Integer(i))) => { + Value::Number(*i as f64) + } + (ParamKind::Number { .. }, Some(KdlValue::Float(f))) => Value::Number(*f), + (_, Some(KdlValue::String(s))) => Value::Text(s.clone()), + _ => return invalid(format!("`{ident}`: bad value for `{}`", spec.key)), + }; + node.set(spec.key, value) + .map_err(|e| LoadError::Invalid(format!("`{ident}`: {e}")))?; + } + node.bypass = get_bool(nn, "bypass", false)? && !kind.is_generator(); + nodes.push(node); + } + let kind = match (media, nodes.first().map(|n| n.kind)) { + (Some(m), Some(NodeKind::Source)) => { + p.media(m).expect("mapped above").kind.clip_kind() + } + (None, Some(NodeKind::Text)) => ClipKind::Text, + _ => { + return invalid(format!( + "clip on {label} must start with `source` (with media) or `text`" + )); + } + }; + if kind.stream() != kind_of_track(&p, track) { + return invalid(format!("{label} can't hold a {kind:?} clip")); + } + if nodes[1..].iter().any(|n| !n.kind.applies_to(kind)) { + return invalid(format!( + "clip on {label} has a node that doesn't apply to it" + )); + } + if p.place(track, start, duration, None) != Some(start) { + return invalid(format!("clips overlap on {label} at frame {start}")); + } + let id = ClipId(p.alloc()); + p.sequence.clips.push(Clip { + id, + track, + kind, + start, + duration, + media, + source_in: get_int(cn, "in")?.unwrap_or(0).max(0), + nodes, + }); + } + } + + if let Some(o) = doc.get("output") { + let d = OutputSettings::default(); + let s = |key: &str, default: &str| -> Result { + Ok(get_str(o, key)?.unwrap_or(default).to_string()) + }; + p.output = OutputSettings { + container: s("container", &d.container)?, + codec: s("codec", &d.codec)?, + resolution: s("resolution", &d.resolution)?, + quality: s("quality", &d.quality)?, + path: s("path", &d.path)?, + }; + } + Ok(p) +} + +fn kind_of_track(p: &Project, id: crate::project::TrackId) -> StreamKind { + p.track(id).expect("track exists").kind +} + +#[cfg(test)] +mod tests { + use super::*; + + /// Projects compare equal after a round trip, apart from regenerated ids. + fn normalized(p: &Project) -> String { + to_kdl(p) + } + + #[test] + fn demo_round_trips() { + let p = crate::demo::demo_project(); + let text = to_kdl(&p); + let back = from_kdl(&text).expect("re-parse"); + assert_eq!(normalized(&p), normalized(&back)); + assert_eq!(back.sequence.clips.len(), p.sequence.clips.len()); + assert!( + text.contains("grade exposure=-0.2 temperature=5200"), + "{text}" + ); + } + + #[test] + fn empty_project_round_trips() { + let p = Project::new("Empty"); + let back = from_kdl(&to_kdl(&p)).unwrap(); + assert_eq!(back.name, "Empty"); + assert_eq!(back.sequence.tracks.len(), 4); + } + + #[test] + fn rejects_bad_files() { + assert!(matches!(from_kdl("{{{"), Err(LoadError::Syntax(_)))); + assert_eq!(from_kdl("project \"x\""), Err(LoadError::NotAProject)); + assert_eq!(from_kdl("videode version=99"), Err(LoadError::TooNew(99))); + let overlap = r#" + videode version=1 + sequence "Main" { + track V2 kind=video { clip start=0 duration=10 { text }; clip start=5 duration=10 { text } } + }"#; + assert!(matches!(from_kdl(overlap), Err(LoadError::Invalid(m)) if m.contains("overlap"))); + let bad_node = r#" + videode version=1 + sequence "Main" { track A1 kind=audio { clip start=0 duration=10 { text } } }"#; + assert!(from_kdl(bad_node).is_err()); + let unknown_media = r#" + videode version=1 + sequence "Main" { track V1 kind=video { clip start=0 duration=10 media=7 { source } } }"#; + assert!( + matches!(from_kdl(unknown_media), Err(LoadError::Invalid(m)) if m.contains("unknown media")) + ); + } + + #[test] + fn clamps_params_on_load() { + let text = r#" + videode version=1 + sequence "Main" { track V2 kind=video { clip start=0 duration=10 { text size=9000; transform scale=50.5 } } }"#; + let p = from_kdl(text).unwrap(); + let c = &p.sequence.clips[0]; + assert_eq!(c.nodes[0].number("size"), 400.0); + assert_eq!(c.nodes[1].number("scale"), 51.0); + } +} diff --git a/crates/videode-core/src/lib.rs b/crates/videode-core/src/lib.rs new file mode 100644 index 0000000..f9bb922 --- /dev/null +++ b/crates/videode-core/src/lib.rs @@ -0,0 +1,25 @@ +//! videode core: the project model, node chains, editing operations with +//! undo, the sequence graph, and `.vde` (KDL) project files. No UI. + +pub mod demo; +pub mod document; +pub mod edit; +pub mod fuzzy; +pub mod graph; +pub mod kdl_io; +pub mod look; +pub mod node; +pub mod project; +pub mod settings; +pub mod time; + +pub use document::Document; +pub use edit::{EditError, EditResult, snap}; +pub use node::{ + Category, ClipKind, Node, NodeId, NodeKind, ParamKind, ParamSpec, StreamKind, Value, +}; +pub use project::{ + Clip, ClipId, Media, MediaId, MediaKind, OutputField, OutputSettings, Project, Track, TrackId, +}; +pub use settings::{Animations, Settings}; +pub use time::{Fps, Frame}; diff --git a/crates/videode-core/src/look.rs b/crates/videode-core/src/look.rs new file mode 100644 index 0000000..21be4d8 --- /dev/null +++ b/crates/videode-core/src/look.rs @@ -0,0 +1,125 @@ +//! What a clip looks like at one frame, from the nodes the viewer can apply +//! without a GPU effects pass: Transform (position, scale), Crop, Opacity and +//! Fade. Rotation, Grade and Blur are carried but not yet drawn. + +use crate::node::NodeKind; +use crate::project::Clip; +use crate::time::Frame; + +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Look { + /// 0–1, after Opacity and Fade. + pub opacity: f64, + /// 1.0 is the clip's natural size in the frame. + pub scale: f64, + /// Offset of the clip's centre from the frame's centre, in sequence pixels. + pub x: f64, + pub y: f64, + /// Fractions (0–0.5) cut from each edge: left, right, top, bottom. + pub crop: [f64; 4], +} + +impl Default for Look { + fn default() -> Self { + Self { + opacity: 1., + scale: 1., + x: 0., + y: 0., + crop: [0.; 4], + } + } +} + +/// The look of `clip` at sequence frame `at`, combining its enabled nodes in +/// chain order (two Transforms add their offsets and multiply their scales). +pub fn look_at(clip: &Clip, at: Frame) -> Look { + let mut l = Look::default(); + let local = (at - clip.start).clamp(0, clip.duration); + for n in clip.nodes.iter().filter(|n| !n.bypass) { + match n.kind { + NodeKind::Transform => { + l.x = l.x * n.number("scale") / 100. + n.number("x"); + l.y = l.y * n.number("scale") / 100. + n.number("y"); + l.scale *= n.number("scale") / 100.; + } + NodeKind::Crop => { + for (i, key) in ["left", "right", "top", "bottom"].into_iter().enumerate() { + l.crop[i] = (l.crop[i] + n.number(key) / 100.).min(0.5); + } + } + NodeKind::Opacity => l.opacity *= n.number("opacity") / 100., + NodeKind::Fade => { + let fade_in = n.number("in"); + let fade_out = n.number("out"); + let from_end = (clip.duration - local) as f64; + if fade_in > 0. { + l.opacity *= (local as f64 / fade_in).min(1.); + } + if fade_out > 0. { + l.opacity *= (from_end / fade_out).min(1.); + } + } + _ => {} + } + } + l.opacity = l.opacity.clamp(0., 1.); + l +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::node::Value; + use crate::project::{MediaKind, Project}; + + fn clip_with(kinds: &[(NodeKind, &[(&str, f64)])]) -> Clip { + let mut p = Project::new("t"); + let m = p.add_media("a.mov", MediaKind::Video, Some(100), "", ""); + let c = p.add_media_clip(m, None, 0).unwrap(); + for (kind, params) in kinds { + let n = p.add_node(c, *kind).unwrap(); + for (k, v) in *params { + p.set_param(c, n, k, Value::Number(*v)).unwrap(); + } + } + p.clip(c).unwrap().clone() + } + + #[test] + fn plain_clip_is_untouched() { + assert_eq!(look_at(&clip_with(&[]), 50), Look::default()); + } + + #[test] + fn fades_ramp_at_both_ends() { + let c = clip_with(&[(NodeKind::Fade, &[("in", 10.), ("out", 20.)])]); + assert_eq!(look_at(&c, 0).opacity, 0.); + assert_eq!(look_at(&c, 5).opacity, 0.5); + assert_eq!(look_at(&c, 50).opacity, 1.); + assert_eq!(look_at(&c, 90).opacity, 0.5); + assert_eq!(look_at(&c, 100).opacity, 0.); + } + + #[test] + fn opacity_transform_and_crop_combine() { + let c = clip_with(&[ + (NodeKind::Opacity, &[("opacity", 50.)]), + (NodeKind::Transform, &[("scale", 200.), ("x", 10.)]), + (NodeKind::Transform, &[("scale", 50.), ("y", -4.)]), + (NodeKind::Crop, &[("left", 10.), ("bottom", 60.)]), + ]); + let l = look_at(&c, 50); + assert_eq!(l.opacity, 0.5); + assert_eq!(l.scale, 1.); + assert_eq!((l.x, l.y), (5., -4.)); + assert_eq!(l.crop, [0.1, 0., 0., 0.5]); + } + + #[test] + fn bypassed_nodes_do_nothing() { + let mut c = clip_with(&[(NodeKind::Opacity, &[("opacity", 10.)])]); + c.nodes[1].bypass = true; + assert_eq!(look_at(&c, 50).opacity, 1.); + } +} diff --git a/crates/videode-core/src/node.rs b/crates/videode-core/src/node.rs new file mode 100644 index 0000000..bcda51b --- /dev/null +++ b/crates/videode-core/src/node.rs @@ -0,0 +1,614 @@ +//! Node kinds, their parameters, and node instances. +//! +//! A clip is a chain of nodes: a generator (Source or Text) followed by +//! processing nodes, feeding its track. Every node kind declares its +//! parameters so the inspector, the KDL format and validation all come +//! from one table. + +use std::collections::BTreeMap; + +/// Node categories. Each owns one bar colour in the UI. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum Category { + Source, + Transform, + Look, + Composite, + Audio, + Text, + Output, +} + +/// What a clip carries, which decides which nodes may be added to it. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum StreamKind { + Video, + Audio, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum ClipKind { + Video, + Audio, + Text, +} + +impl ClipKind { + pub fn stream(self) -> StreamKind { + match self { + ClipKind::Audio => StreamKind::Audio, + ClipKind::Video | ClipKind::Text => StreamKind::Video, + } + } +} + +#[derive(Clone, Debug, PartialEq)] +pub enum Value { + Number(f64), + Text(String), +} + +impl Value { + pub fn as_number(&self) -> Option { + match self { + Value::Number(n) => Some(*n), + Value::Text(_) => None, + } + } + + pub fn as_text(&self) -> Option<&str> { + match self { + Value::Text(s) => Some(s), + Value::Number(_) => None, + } + } +} + +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ParamKind { + Number { + min: f64, + max: f64, + step: f64, + default: f64, + /// Digits after the decimal point when displayed. + decimals: u8, + /// Show a leading `+` for positive values. + signed: bool, + }, + Text { + default: &'static str, + }, + Choice { + options: &'static [&'static str], + default: &'static str, + }, +} + +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct ParamSpec { + pub key: &'static str, + pub label: &'static str, + pub unit: &'static str, + pub kind: ParamKind, +} + +impl ParamSpec { + pub fn default_value(&self) -> Value { + match self.kind { + ParamKind::Number { default, .. } => Value::Number(default), + ParamKind::Text { default } => Value::Text(default.into()), + ParamKind::Choice { default, .. } => Value::Text(default.into()), + } + } + + /// Clamps numbers to range and step; rejects unknown choices and + /// mismatched value types. + pub fn validate(&self, value: Value) -> Result { + match (self.kind, value) { + (ParamKind::Number { min, max, step, .. }, Value::Number(n)) => { + if !n.is_finite() { + return Err(ParamError::Invalid(self.key)); + } + let snapped = if step > 0.0 { + (n / step).round() * step + } else { + n + }; + // Round away float noise from the step multiply. + let clean = (snapped.clamp(min, max) * 1e6).round() / 1e6; + Ok(Value::Number(clean)) + } + (ParamKind::Text { .. }, Value::Text(s)) => Ok(Value::Text(s)), + (ParamKind::Choice { options, .. }, Value::Text(s)) => { + if options.contains(&s.as_str()) { + Ok(Value::Text(s)) + } else { + Err(ParamError::Invalid(self.key)) + } + } + _ => Err(ParamError::WrongType(self.key)), + } + } + + /// Parses typed input. Numbers accept `−` or `-`, a leading `+` and a + /// trailing unit; choices match case-insensitively. The result still goes + /// through [`Self::validate`] when it is set. + pub fn parse(&self, text: &str) -> Option { + let t = text.trim(); + match self.kind { + ParamKind::Number { .. } => { + let t = t.replace('−', "-"); + let t = t + .trim_end_matches(|c: char| !(c.is_ascii_digit() || c == '.')) + .trim(); + let t = t.strip_prefix('+').unwrap_or(t); + t.parse::() + .ok() + .filter(|n| n.is_finite()) + .map(Value::Number) + } + ParamKind::Text { .. } => Some(Value::Text(text.to_string())), + ParamKind::Choice { options, .. } => options + .iter() + .find(|o| o.eq_ignore_ascii_case(t)) + .map(|o| Value::Text((*o).to_string())), + } + } + + /// A number moved by `steps` increments of its step, clamped to range. + pub fn nudge(&self, value: &Value, steps: f64) -> Option { + match (self.kind, value) { + (ParamKind::Number { step, .. }, Value::Number(n)) => { + self.validate(Value::Number(n + steps * step)).ok() + } + _ => None, + } + } + + pub fn is_default(&self, value: &Value) -> bool { + *value == self.default_value() + } + + /// Display string with units, e.g. `+0.35 EV`, `108 %`. + pub fn format(&self, value: &Value) -> String { + match (self.kind, value) { + ( + ParamKind::Number { + decimals, signed, .. + }, + Value::Number(n), + ) => { + let mut s = format!("{:.*}", decimals as usize, n); + if signed && *n > 0.0 { + s.insert(0, '+'); + } + let s = s.replace('-', "−"); + if self.unit.is_empty() { + s + } else { + format!("{s} {}", self.unit) + } + } + (_, Value::Text(s)) => s.clone(), + (_, Value::Number(n)) => n.to_string(), + } + } +} + +#[derive(Clone, Debug, PartialEq, Eq, thiserror::Error)] +pub enum ParamError { + #[error("{0} has no parameter `{1}`")] + Unknown(&'static str, String), + #[error("value for `{0}` has the wrong type")] + WrongType(&'static str), + #[error("value for `{0}` is not allowed")] + Invalid(&'static str), +} + +const fn num( + key: &'static str, + label: &'static str, + unit: &'static str, + (min, max, step, default): (f64, f64, f64, f64), + decimals: u8, + signed: bool, +) -> ParamSpec { + ParamSpec { + key, + label, + unit, + kind: ParamKind::Number { + min, + max, + step, + default, + decimals, + signed, + }, + } +} + +const BLENDS: &[&str] = &["Normal", "Screen", "Multiply", "Overlay", "Add"]; +const WEIGHTS: &[&str] = &["400", "500", "600"]; +const DUCK_UNDER: &[&str] = &["A1", "A2", "A3", "A4"]; + +const TEXT_PARAMS: &[ParamSpec] = &[ + ParamSpec { + key: "text", + label: "Text", + unit: "", + kind: ParamKind::Text { default: "Title" }, + }, + num("size", "Size", "px", (8., 400., 1., 96.), 0, false), + ParamSpec { + key: "weight", + label: "Weight", + unit: "", + kind: ParamKind::Choice { + options: WEIGHTS, + default: "600", + }, + }, +]; +const TRANSFORM_PARAMS: &[ParamSpec] = &[ + num("x", "Position X", "px", (-8192., 8192., 1., 0.), 0, true), + num("y", "Position Y", "px", (-8192., 8192., 1., 0.), 0, true), + num("scale", "Scale", "%", (1., 1000., 1., 100.), 0, false), + num("rotation", "Rotation", "°", (-360., 360., 0.5, 0.), 1, true), +]; +const CROP_PARAMS: &[ParamSpec] = &[ + num("left", "Left", "%", (0., 50., 0.5, 0.), 1, false), + num("right", "Right", "%", (0., 50., 0.5, 0.), 1, false), + num("top", "Top", "%", (0., 50., 0.5, 0.), 1, false), + num("bottom", "Bottom", "%", (0., 50., 0.5, 0.), 1, false), +]; +const GRADE_PARAMS: &[ParamSpec] = &[ + num("exposure", "Exposure", "EV", (-6., 6., 0.05, 0.), 2, true), + num( + "temperature", + "Temperature", + "K", + (2000., 12000., 50., 6500.), + 0, + false, + ), + num( + "saturation", + "Saturation", + "%", + (0., 200., 1., 100.), + 0, + false, + ), + num("contrast", "Contrast", "%", (0., 200., 1., 100.), 0, false), +]; +const BLUR_PARAMS: &[ParamSpec] = &[num("radius", "Radius", "px", (0., 200., 0.5, 4.), 1, false)]; +const OPACITY_PARAMS: &[ParamSpec] = &[ + num("opacity", "Opacity", "%", (0., 100., 1., 100.), 0, false), + ParamSpec { + key: "blend", + label: "Blend", + unit: "", + kind: ParamKind::Choice { + options: BLENDS, + default: "Normal", + }, + }, +]; +const FADE_PARAMS: &[ParamSpec] = &[ + num("in", "Fade in", "f", (0., 2400., 1., 12.), 0, false), + num("out", "Fade out", "f", (0., 2400., 1., 12.), 0, false), +]; +const GAIN_PARAMS: &[ParamSpec] = &[num("gain", "Gain", "dB", (-96., 24., 0.5, 0.), 1, true)]; +const DUCK_PARAMS: &[ParamSpec] = &[ + ParamSpec { + key: "under", + label: "Under track", + unit: "", + kind: ParamKind::Choice { + options: DUCK_UNDER, + default: "A1", + }, + }, + num("amount", "Amount", "dB", (-60., 0., 0.5, -12.), 1, true), +]; + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum NodeKind { + Source, + Text, + Transform, + Crop, + Grade, + Blur, + Opacity, + Fade, + Gain, + Duck, +} + +impl NodeKind { + pub const ALL: [NodeKind; 10] = [ + NodeKind::Source, + NodeKind::Text, + NodeKind::Transform, + NodeKind::Crop, + NodeKind::Grade, + NodeKind::Blur, + NodeKind::Opacity, + NodeKind::Fade, + NodeKind::Gain, + NodeKind::Duck, + ]; + + pub fn name(self) -> &'static str { + match self { + NodeKind::Source => "Source", + NodeKind::Text => "Text", + NodeKind::Transform => "Transform", + NodeKind::Crop => "Crop", + NodeKind::Grade => "Grade", + NodeKind::Blur => "Blur", + NodeKind::Opacity => "Opacity", + NodeKind::Fade => "Fade", + NodeKind::Gain => "Gain", + NodeKind::Duck => "Duck", + } + } + + /// The lowercase identifier used in project files. + pub fn ident(self) -> &'static str { + match self { + NodeKind::Source => "source", + NodeKind::Text => "text", + NodeKind::Transform => "transform", + NodeKind::Crop => "crop", + NodeKind::Grade => "grade", + NodeKind::Blur => "blur", + NodeKind::Opacity => "opacity", + NodeKind::Fade => "fade", + NodeKind::Gain => "gain", + NodeKind::Duck => "duck", + } + } + + pub fn from_ident(ident: &str) -> Option { + Self::ALL.into_iter().find(|k| k.ident() == ident) + } + + pub fn category(self) -> Category { + match self { + NodeKind::Source => Category::Source, + NodeKind::Text => Category::Text, + NodeKind::Transform | NodeKind::Crop => Category::Transform, + NodeKind::Grade | NodeKind::Blur => Category::Look, + NodeKind::Opacity | NodeKind::Fade => Category::Composite, + NodeKind::Gain | NodeKind::Duck => Category::Audio, + } + } + + pub fn description(self) -> &'static str { + match self { + NodeKind::Source => "Reads frames or samples from a file", + NodeKind::Text => "Sets a line of type", + NodeKind::Transform => "Position, scale, rotation", + NodeKind::Crop => "Trim the frame edges", + NodeKind::Grade => "Exposure, white balance, saturation", + NodeKind::Blur => "Gaussian blur", + NodeKind::Opacity => "Opacity and blend mode", + NodeKind::Fade => "Fade in and out over frames", + NodeKind::Gain => "Level in decibels", + NodeKind::Duck => "Lower this clip under another track", + } + } + + pub fn params(self) -> &'static [ParamSpec] { + match self { + NodeKind::Source => &[], + NodeKind::Text => TEXT_PARAMS, + NodeKind::Transform => TRANSFORM_PARAMS, + NodeKind::Crop => CROP_PARAMS, + NodeKind::Grade => GRADE_PARAMS, + NodeKind::Blur => BLUR_PARAMS, + NodeKind::Opacity => OPACITY_PARAMS, + NodeKind::Fade => FADE_PARAMS, + NodeKind::Gain => GAIN_PARAMS, + NodeKind::Duck => DUCK_PARAMS, + } + } + + pub fn param(self, key: &str) -> Option<&'static ParamSpec> { + self.params().iter().find(|p| p.key == key) + } + + /// Generators start a clip's chain; they have no input and are what the + /// clip *is*, so they can't be removed, moved or bypassed. + pub fn is_generator(self) -> bool { + matches!(self, NodeKind::Source | NodeKind::Text) + } + + /// Whether this processing node can be added to a clip of `kind`. + pub fn applies_to(self, kind: ClipKind) -> bool { + match self { + NodeKind::Source | NodeKind::Text => false, + NodeKind::Transform | NodeKind::Blur | NodeKind::Opacity => { + matches!(kind, ClipKind::Video | ClipKind::Text) + } + NodeKind::Crop | NodeKind::Grade => kind == ClipKind::Video, + NodeKind::Fade => true, + NodeKind::Gain | NodeKind::Duck => kind == ClipKind::Audio, + } + } +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct NodeId(pub u64); + +#[derive(Clone, Debug, PartialEq)] +pub struct Node { + pub id: NodeId, + pub kind: NodeKind, + pub params: BTreeMap<&'static str, Value>, + pub bypass: bool, +} + +impl Node { + pub fn new(id: NodeId, kind: NodeKind) -> Self { + let params = kind + .params() + .iter() + .map(|p| (p.key, p.default_value())) + .collect(); + Self { + id, + kind, + params, + bypass: false, + } + } + + pub fn get(&self, key: &str) -> Option<&Value> { + self.params.get(key) + } + + pub fn number(&self, key: &str) -> f64 { + self.get(key).and_then(Value::as_number).unwrap_or(0.0) + } + + pub fn text(&self, key: &str) -> &str { + self.get(key).and_then(Value::as_text).unwrap_or("") + } + + pub fn set(&mut self, key: &str, value: Value) -> Result<(), ParamError> { + let spec = self + .kind + .param(key) + .ok_or_else(|| ParamError::Unknown(self.kind.name(), key.to_string()))?; + let value = spec.validate(value)?; + self.params.insert(spec.key, value); + Ok(()) + } + + /// One-line summary for node cards, e.g. `108% · 0, −42`. + pub fn summary(&self) -> String { + let fmt = |key: &str| { + let spec = self.kind.param(key).expect("summary uses known params"); + spec.format(self.get(key).expect("params are always populated")) + }; + match self.kind { + NodeKind::Source => String::new(), + NodeKind::Text => format!("“{}”", self.text("text")), + NodeKind::Transform => format!( + "{}% · {}, {}", + self.number("scale"), + fmt("x").trim_end_matches(" px"), + fmt("y").trim_end_matches(" px") + ), + NodeKind::Crop => format!( + "T{} B{} L{} R{}", + self.number("top"), + self.number("bottom"), + self.number("left"), + self.number("right") + ), + NodeKind::Grade => format!("{} · {}", fmt("exposure"), fmt("temperature")), + NodeKind::Blur => fmt("radius"), + NodeKind::Opacity => format!("{} · {}", fmt("opacity"), self.text("blend")), + NodeKind::Fade => format!("in {}f · out {}f", self.number("in"), self.number("out")), + NodeKind::Gain => fmt("gain"), + NodeKind::Duck => format!("under {} · {}", self.text("under"), fmt("amount")), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn new_node_has_defaults() { + let n = Node::new(NodeId(1), NodeKind::Grade); + assert_eq!(n.number("temperature"), 6500.0); + assert_eq!(n.params.len(), 4); + } + + #[test] + fn set_clamps_and_snaps() { + let mut n = Node::new(NodeId(1), NodeKind::Grade); + n.set("exposure", Value::Number(0.337)).unwrap(); + assert_eq!(n.number("exposure"), 0.35); + n.set("exposure", Value::Number(99.0)).unwrap(); + assert_eq!(n.number("exposure"), 6.0); + assert!(matches!( + n.set("nope", Value::Number(1.0)), + Err(ParamError::Unknown(..)) + )); + assert!(matches!( + n.set("exposure", Value::Text("x".into())), + Err(ParamError::WrongType(_)) + )); + assert!(n.set("exposure", Value::Number(f64::NAN)).is_err()); + } + + #[test] + fn choices_are_validated() { + let mut n = Node::new(NodeId(1), NodeKind::Opacity); + n.set("blend", Value::Text("Screen".into())).unwrap(); + assert!(n.set("blend", Value::Text("Dissolve".into())).is_err()); + } + + #[test] + fn formats_values() { + let spec = NodeKind::Grade.param("exposure").unwrap(); + assert_eq!(spec.format(&Value::Number(0.35)), "+0.35 EV"); + assert_eq!(spec.format(&Value::Number(-1.0)), "−1.00 EV"); + let mut t = Node::new(NodeId(2), NodeKind::Transform); + t.set("scale", Value::Number(108.0)).unwrap(); + t.set("y", Value::Number(-42.0)).unwrap(); + assert_eq!(t.summary(), "108% · 0, −42"); + } + + #[test] + fn node_compatibility() { + assert!(NodeKind::Grade.applies_to(ClipKind::Video)); + assert!(!NodeKind::Grade.applies_to(ClipKind::Text)); + assert!(NodeKind::Gain.applies_to(ClipKind::Audio)); + assert!(!NodeKind::Gain.applies_to(ClipKind::Video)); + assert!(NodeKind::Fade.applies_to(ClipKind::Audio)); + assert!(!NodeKind::Source.applies_to(ClipKind::Video)); + } + + #[test] + fn idents_round_trip() { + for k in NodeKind::ALL { + assert_eq!(NodeKind::from_ident(k.ident()), Some(k)); + } + } + + #[test] + fn parses_typed_values() { + let exposure = NodeKind::Grade.param("exposure").unwrap(); + assert_eq!(exposure.parse("+0.35 EV"), Some(Value::Number(0.35))); + assert_eq!(exposure.parse("−1.5"), Some(Value::Number(-1.5))); + assert_eq!(exposure.parse(" 2ev "), Some(Value::Number(2.0))); + assert_eq!(exposure.parse("bright"), None); + let scale = NodeKind::Transform.param("scale").unwrap(); + assert_eq!(scale.parse("108 %"), Some(Value::Number(108.0))); + let blend = NodeKind::Opacity.param("blend").unwrap(); + assert_eq!(blend.parse("screen"), Some(Value::Text("Screen".into()))); + assert_eq!(blend.parse("glow"), None); + } + + #[test] + fn nudges_by_step_within_range() { + let exposure = NodeKind::Grade.param("exposure").unwrap(); + let v = exposure.nudge(&Value::Number(0.0), 3.0).unwrap(); + assert!(!exposure.is_default(&v)); + let huge = exposure.nudge(&Value::Number(0.0), 1e9).unwrap(); + let ParamKind::Number { max, .. } = exposure.kind else { + unreachable!() + }; + assert_eq!(huge, Value::Number(max)); + } +} diff --git a/crates/videode-core/src/project.rs b/crates/videode-core/src/project.rs new file mode 100644 index 0000000..0be4290 --- /dev/null +++ b/crates/videode-core/src/project.rs @@ -0,0 +1,391 @@ +//! The project model: media, one sequence of tracks and clips, and the +//! output settings. Clips are chains of nodes (see [`crate::node`]). + +use std::path::{Path, PathBuf}; + +use crate::node::{ClipKind, Node, NodeId, NodeKind, StreamKind}; +use crate::time::{Fps, Frame}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct MediaId(pub u64); + +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct ClipId(pub u64); + +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct TrackId(pub u64); + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum MediaKind { + Video, + Audio, + Image, +} + +impl MediaKind { + pub fn clip_kind(self) -> ClipKind { + match self { + MediaKind::Audio => ClipKind::Audio, + MediaKind::Video | MediaKind::Image => ClipKind::Video, + } + } + + pub fn ident(self) -> &'static str { + match self { + MediaKind::Video => "video", + MediaKind::Audio => "audio", + MediaKind::Image => "image", + } + } + + pub fn from_ident(s: &str) -> Option { + match s { + "video" => Some(MediaKind::Video), + "audio" => Some(MediaKind::Audio), + "image" => Some(MediaKind::Image), + _ => None, + } + } +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Media { + pub id: MediaId, + pub path: PathBuf, + pub kind: MediaKind, + /// Length in sequence frames; `None` for stills, which can be any length. + pub duration: Option, + pub codec: String, + /// Free-form format description, e.g. `1920×1080` or `Stereo`. + pub format: String, + /// The file could not be found when the project was opened. + pub offline: bool, +} + +impl Media { + pub fn file_name(&self) -> String { + file_name(&self.path) + } + + pub fn stem(&self) -> String { + self.path + .file_stem() + .map(|s| s.to_string_lossy().into_owned()) + .unwrap_or_else(|| self.file_name()) + } +} + +fn file_name(path: &Path) -> String { + path.file_name() + .map(|s| s.to_string_lossy().into_owned()) + .unwrap_or_else(|| path.display().to_string()) +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Track { + pub id: TrackId, + /// Short label such as `V1` or `A2`. + pub label: String, + pub name: String, + pub kind: StreamKind, + pub enabled: bool, + pub locked: bool, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Clip { + pub id: ClipId, + pub track: TrackId, + pub kind: ClipKind, + pub start: Frame, + pub duration: Frame, + pub media: Option, + /// First source frame used, for media clips. + pub source_in: Frame, + /// The clip's node chain; `nodes[0]` is always its generator. + pub nodes: Vec, +} + +impl Clip { + pub fn end(&self) -> Frame { + self.start + self.duration + } + + pub fn contains(&self, frame: Frame) -> bool { + frame >= self.start && frame < self.end() + } + + pub fn node(&self, id: NodeId) -> Option<&Node> { + self.nodes.iter().find(|n| n.id == id) + } + + pub fn node_index(&self, id: NodeId) -> Option { + self.nodes.iter().position(|n| n.id == id) + } + + pub fn first(&self, kind: NodeKind) -> Option<&Node> { + self.nodes.iter().find(|n| n.kind == kind) + } +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Sequence { + pub name: String, + pub fps: Fps, + pub width: u32, + pub height: u32, + pub tracks: Vec, + pub clips: Vec, +} + +/// One setting on the Output node. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum OutputField { + Container, + Codec, + Resolution, + Quality, + Path, +} + +impl OutputField { + pub const ALL: [OutputField; 5] = [ + OutputField::Container, + OutputField::Codec, + OutputField::Resolution, + OutputField::Quality, + OutputField::Path, + ]; + + pub fn label(self) -> &'static str { + match self { + OutputField::Container => "Container", + OutputField::Codec => "Codec", + OutputField::Resolution => "Resolution", + OutputField::Quality => "Quality", + OutputField::Path => "File", + } + } + + /// The allowed values; empty for free text. + pub fn options(self) -> &'static [&'static str] { + match self { + OutputField::Container => &["MP4", "MOV", "MKV", "WebM"], + OutputField::Codec => &["H.264", "H.265", "ProRes 422", "AV1", "VP9"], + OutputField::Resolution => &["1920×1080", "3840×2160", "1280×720"], + OutputField::Quality => &["Draft", "Standard", "High", "Lossless"], + OutputField::Path => &[], + } + } +} + +/// File extension for a container name. +pub fn container_extension(container: &str) -> Option<&'static str> { + match container { + "MP4" => Some("mp4"), + "MOV" => Some("mov"), + "MKV" => Some("mkv"), + "WebM" => Some("webm"), + _ => None, + } +} + +#[derive(Clone, Debug, PartialEq)] +pub struct OutputSettings { + pub container: String, + pub codec: String, + pub resolution: String, + pub quality: String, + pub path: String, +} + +impl OutputSettings { + pub fn get(&self, field: OutputField) -> &str { + match field { + OutputField::Container => &self.container, + OutputField::Codec => &self.codec, + OutputField::Resolution => &self.resolution, + OutputField::Quality => &self.quality, + OutputField::Path => &self.path, + } + } +} + +impl Default for OutputSettings { + fn default() -> Self { + Self { + container: "MP4".into(), + codec: "H.264".into(), + resolution: "1920×1080".into(), + quality: "High".into(), + path: "export.mp4".into(), + } + } +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Project { + pub name: String, + pub media: Vec, + pub sequence: Sequence, + pub output: OutputSettings, + pub(crate) next_id: u64, +} + +impl Default for Project { + fn default() -> Self { + Self::new("Untitled project") + } +} + +impl Project { + /// An empty project with the standard four tracks (V2, V1, A1, A2). + pub fn new(name: impl Into) -> Self { + let mut p = Project { + name: name.into(), + media: Vec::new(), + sequence: Sequence { + name: "Main".into(), + fps: Fps::FPS_24, + width: 1920, + height: 1080, + tracks: Vec::new(), + clips: Vec::new(), + }, + output: OutputSettings::default(), + next_id: 1, + }; + for (label, name, kind) in [ + ("V2", "Titles", StreamKind::Video), + ("V1", "Picture", StreamKind::Video), + ("A1", "Voice", StreamKind::Audio), + ("A2", "Music", StreamKind::Audio), + ] { + p.push_track(label, name, kind); + } + p + } + + pub(crate) fn alloc(&mut self) -> u64 { + let id = self.next_id; + self.next_id += 1; + id + } + + pub fn push_track(&mut self, label: &str, name: &str, kind: StreamKind) -> TrackId { + let id = TrackId(self.alloc()); + self.sequence.tracks.push(Track { + id, + label: label.into(), + name: name.into(), + kind, + enabled: true, + locked: false, + }); + id + } + + pub fn add_media( + &mut self, + path: impl Into, + kind: MediaKind, + duration: Option, + codec: impl Into, + format: impl Into, + ) -> MediaId { + let id = MediaId(self.alloc()); + self.media.push(Media { + id, + path: path.into(), + kind, + duration, + codec: codec.into(), + format: format.into(), + offline: false, + }); + id + } + + pub fn new_node(&mut self, kind: NodeKind) -> Node { + Node::new(NodeId(self.alloc()), kind) + } + + pub fn media(&self, id: MediaId) -> Option<&Media> { + self.media.iter().find(|m| m.id == id) + } + + pub fn track(&self, id: TrackId) -> Option<&Track> { + self.sequence.tracks.iter().find(|t| t.id == id) + } + + pub fn track_by_label(&self, label: &str) -> Option<&Track> { + self.sequence.tracks.iter().find(|t| t.label == label) + } + + pub fn clip(&self, id: ClipId) -> Option<&Clip> { + self.sequence.clips.iter().find(|c| c.id == id) + } + + pub(crate) fn clip_mut(&mut self, id: ClipId) -> Option<&mut Clip> { + self.sequence.clips.iter_mut().find(|c| c.id == id) + } + + /// Clips on a track, in time order. + pub fn clips_on(&self, track: TrackId) -> Vec<&Clip> { + let mut v: Vec<&Clip> = self + .sequence + .clips + .iter() + .filter(|c| c.track == track) + .collect(); + v.sort_by_key(|c| c.start); + v + } + + pub fn clip_at(&self, track: TrackId, frame: Frame) -> Option<&Clip> { + self.sequence + .clips + .iter() + .find(|c| c.track == track && c.contains(frame)) + } + + /// Display name: the media file stem, or the quoted text of a text clip. + pub fn clip_name(&self, clip: &Clip) -> String { + match clip.media.and_then(|m| self.media(m)) { + Some(m) => m.stem(), + None => match clip.first(NodeKind::Text) { + Some(t) => format!("“{}”", t.text("text")), + None => "Clip".into(), + }, + } + } + + /// The last frame covered by any clip. + pub fn end(&self) -> Frame { + self.sequence.clips.iter().map(Clip::end).max().unwrap_or(0) + } + + pub fn node_count(&self) -> usize { + // Clip nodes plus one per track and Composite, Mix, Sequence, Output. + self.sequence + .clips + .iter() + .map(|c| c.nodes.len()) + .sum::() + + self.sequence.tracks.len() + + 4 + } + + /// Every clip boundary, sorted and deduplicated. + pub fn edit_points(&self) -> Vec { + let mut v: Vec = self + .sequence + .clips + .iter() + .flat_map(|c| [c.start, c.end()]) + .collect(); + v.sort_unstable(); + v.dedup(); + v + } +} diff --git a/crates/videode-core/src/settings.rs b/crates/videode-core/src/settings.rs new file mode 100644 index 0000000..cde2d5a --- /dev/null +++ b/crates/videode-core/src/settings.rs @@ -0,0 +1,214 @@ +//! User settings, stored as KDL in the platform config folder. +//! +//! ```kdl +//! videode-settings version=1 +//! appearance { +//! animations system +//! splash #true +//! } +//! editing { +//! snap #true +//! zoom-step 1.4 +//! } +//! ``` +//! +//! Loading is forgiving: a missing or invalid value falls back to its default +//! and is reported, so a hand-edited file never stops the app from starting. + +use kdl::{KdlDocument, KdlEntry, KdlNode, KdlValue}; + +pub const SETTINGS_VERSION: i64 = 1; +pub const ZOOM_STEPS: [f64; 3] = [1.25, 1.4, 2.0]; + +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum Animations { + /// Follow the operating system's reduce-motion preference. + #[default] + System, + On, + Off, +} + +impl Animations { + pub const ALL: [Animations; 3] = [Animations::System, Animations::On, Animations::Off]; + + pub fn ident(self) -> &'static str { + match self { + Animations::System => "system", + Animations::On => "on", + Animations::Off => "off", + } + } + + pub fn from_ident(s: &str) -> Option { + Self::ALL.into_iter().find(|a| a.ident() == s) + } + + /// Whether motion should play, given the system preference. + pub fn enabled(self, system_reduces_motion: bool) -> bool { + match self { + Animations::System => !system_reduces_motion, + Animations::On => true, + Animations::Off => false, + } + } +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Settings { + pub animations: Animations, + /// Play the launch splash (only when animations are enabled). + pub splash: bool, + /// Snapping state for new windows. + pub snap: bool, + /// Zoom factor for one zoom-in or zoom-out step. + pub zoom_step: f64, +} + +impl Default for Settings { + fn default() -> Self { + Self { + animations: Animations::System, + splash: true, + snap: true, + zoom_step: 1.4, + } + } +} + +fn arg(name: &str, value: impl Into) -> KdlNode { + let mut n = KdlNode::new(name); + n.push(KdlEntry::new(value.into())); + n +} + +fn group(name: &str, nodes: Vec) -> KdlNode { + let mut g = KdlNode::new(name); + g.ensure_children().nodes_mut().extend(nodes); + g +} + +impl Settings { + pub fn to_kdl(&self) -> String { + let mut doc = KdlDocument::new(); + let mut header = KdlNode::new("videode-settings"); + header.push(KdlEntry::new_prop("version", SETTINGS_VERSION as i128)); + doc.nodes_mut().push(header); + doc.nodes_mut().push(group( + "appearance", + vec![ + arg("animations", self.animations.ident()), + arg("splash", self.splash), + ], + )); + doc.nodes_mut().push(group( + "editing", + vec![arg("snap", self.snap), arg("zoom-step", self.zoom_step)], + )); + doc.autoformat(); + doc.to_string() + } + + /// Parses settings, returning them along with a note for every value + /// that was ignored. Only a file that isn't KDL at all is an error. + pub fn from_kdl(text: &str) -> Result<(Settings, Vec), String> { + let doc: KdlDocument = text.parse().map_err(|e: kdl::KdlError| e.to_string())?; + let mut s = Settings::default(); + let mut notes = Vec::new(); + for g in doc.nodes() { + let section = g.name().value(); + if section == "videode-settings" { + continue; + } + let Some(children) = g.children() else { + notes.push(format!("ignored `{section}`")); + continue; + }; + for n in children.nodes() { + let key = n.name().value(); + let value = n + .entries() + .first() + .filter(|e| e.name().is_none()) + .map(KdlEntry::value); + let ok = match (section, key, value) { + ("appearance", "animations", Some(KdlValue::String(v))) => { + Animations::from_ident(v) + .map(|a| s.animations = a) + .is_some() + } + ("appearance", "splash", Some(KdlValue::Bool(b))) => { + s.splash = *b; + true + } + ("editing", "snap", Some(KdlValue::Bool(b))) => { + s.snap = *b; + true + } + ("editing", "zoom-step", Some(v)) => { + match v.as_float().or(v.as_integer().map(|i| i as f64)) { + Some(f) if (1.05..=4.0).contains(&f) => { + s.zoom_step = f; + true + } + _ => false, + } + } + _ => false, + }; + if !ok { + notes.push(format!("ignored `{section} {key}`")); + } + } + } + Ok((s, notes)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn round_trips() { + let s = Settings { + animations: Animations::Off, + splash: false, + snap: false, + zoom_step: 2.0, + }; + let text = s.to_kdl(); + assert!(text.contains("animations off"), "{text}"); + assert_eq!(Settings::from_kdl(&text).unwrap(), (s, vec![])); + } + + #[test] + fn defaults_round_trip() { + let text = Settings::default().to_kdl(); + assert_eq!(Settings::from_kdl(&text).unwrap().0, Settings::default()); + } + + #[test] + fn bad_values_fall_back_with_notes() { + let text = "appearance {\n animations sometimes\n splash #false\n}\nediting {\n zoom-step 99\n snap 3\n colour red\n}"; + let (s, notes) = Settings::from_kdl(text).unwrap(); + assert_eq!(s.animations, Animations::System); + assert!(!s.splash); + assert_eq!(s.zoom_step, 1.4); + assert!(s.snap); + assert_eq!(notes.len(), 4, "{notes:?}"); + } + + #[test] + fn not_kdl_is_an_error() { + assert!(Settings::from_kdl("appearance {").is_err()); + } + + #[test] + fn system_mode_follows_os() { + assert!(Animations::System.enabled(false)); + assert!(!Animations::System.enabled(true)); + assert!(Animations::On.enabled(true)); + assert!(!Animations::Off.enabled(false)); + } +} diff --git a/crates/videode-core/src/time.rs b/crates/videode-core/src/time.rs new file mode 100644 index 0000000..13529c4 --- /dev/null +++ b/crates/videode-core/src/time.rs @@ -0,0 +1,131 @@ +//! Frame-based time. Positions on a sequence are whole frames at the +//! sequence frame rate; frame rates are rationals so 29.97 stays exact. + +use std::fmt; + +/// A position or duration in frames at the sequence frame rate. +pub type Frame = i64; + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct Fps { + pub num: u32, + pub den: u32, +} + +impl Fps { + pub const FPS_24: Fps = Fps::new(24, 1); + + pub const fn new(num: u32, den: u32) -> Self { + Self { num, den } + } + + pub fn as_f64(self) -> f64 { + self.num as f64 / self.den as f64 + } + + /// Whole frames per timecode second (30 for 29.97, non-drop). + pub fn nominal(self) -> i64 { + (self.as_f64()).round().max(1.0) as i64 + } + + pub fn frames_to_seconds(self, frames: Frame) -> f64 { + frames as f64 * self.den as f64 / self.num as f64 + } + + pub fn seconds_to_frames(self, seconds: f64) -> Frame { + (seconds * self.as_f64()).round() as Frame + } +} + +impl fmt::Display for Fps { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.den == 1 { + write!(f, "{} fps", self.num) + } else { + write!(f, "{:.3} fps", self.as_f64()) + } + } +} + +/// `HH:MM:SS:FF` non-drop timecode. Negative frames clamp to zero. +pub fn timecode(frame: Frame, fps: Fps) -> String { + let n = fps.nominal(); + let f = frame.max(0); + let (ff, total_s) = (f % n, f / n); + format!( + "{:02}:{:02}:{:02}:{:02}", + total_s / 3600, + (total_s / 60) % 60, + total_s % 60, + ff + ) +} + +/// Compact `m:ss` (plus `:ff` when not on a whole second), for rulers. +pub fn timecode_short(frame: Frame, fps: Fps) -> String { + let n = fps.nominal(); + let f = frame.max(0); + let s = f / n; + let ff = f % n; + if ff == 0 { + format!("{}:{:02}", s / 60, s % 60) + } else { + format!("{}:{:02}:{:02}", s / 60, s % 60, ff) + } +} + +/// Parses `HH:MM:SS:FF`, any shorter suffix of it (`SS:FF`, `MM:SS:FF`), or +/// a bare frame count. `;` and `.` are accepted as separators. +pub fn parse_timecode(text: &str, fps: Fps) -> Option { + let text = text.trim(); + if text.is_empty() { + return None; + } + let parts: Vec = text + .split([':', ';', '.']) + .map(|p| p.trim().parse::().ok().filter(|v| *v >= 0)) + .collect::>()?; + if parts.len() == 1 { + return Some(parts[0]); + } + if parts.len() > 4 { + return None; + } + let mut p = [0i64; 4]; + p[4 - parts.len()..].copy_from_slice(&parts); + let [h, m, s, f] = p; + Some(((h * 60 + m) * 60 + s) * fps.nominal() + f) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn formats_timecode() { + assert_eq!(timecode(0, Fps::FPS_24), "00:00:00:00"); + assert_eq!(timecode(24 * 3661 + 5, Fps::FPS_24), "01:01:01:05"); + assert_eq!(timecode(-10, Fps::FPS_24), "00:00:00:00"); + assert_eq!(timecode(30, Fps::new(30000, 1001)), "00:00:01:00"); + } + + #[test] + fn formats_short() { + assert_eq!(timecode_short(24 * 65, Fps::FPS_24), "1:05"); + assert_eq!(timecode_short(24 * 5 + 3, Fps::FPS_24), "0:05:03"); + } + + #[test] + fn parses_timecode() { + let fps = Fps::FPS_24; + assert_eq!(parse_timecode("00:00:12:04", fps), Some(12 * 24 + 4)); + assert_eq!(parse_timecode("12:04", fps), Some(12 * 24 + 4)); + assert_eq!(parse_timecode("1:00:00", fps), Some(60 * 24)); + assert_eq!(parse_timecode("300", fps), Some(300)); + assert_eq!(parse_timecode("1;2.3", fps), Some(60 * 24 + 2 * 24 + 3)); + assert_eq!(parse_timecode("", fps), None); + assert_eq!(parse_timecode("ab:cd", fps), None); + assert_eq!(parse_timecode("1:2:3:4:5", fps), None); + assert_eq!(parse_timecode("-5", fps), None); + } +} diff --git a/crates/videode-media/Cargo.toml b/crates/videode-media/Cargo.toml new file mode 100644 index 0000000..b2ad346 --- /dev/null +++ b/crates/videode-media/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "videode-media" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true + +[dependencies] +# Dynamically linked against the system FFmpeg (9.x). +ffmpeg-next = "9" +thiserror = "2" +futures = { version = "0.3", default-features = false, features = ["std"] } diff --git a/crates/videode-media/src/demo.rs b/crates/videode-media/src/demo.rs new file mode 100644 index 0000000..5ccf44e --- /dev/null +++ b/crates/videode-media/src/demo.rs @@ -0,0 +1,164 @@ +//! Footage for the "Signal Study" demo project: synthetic test patterns made +//! with the `ffmpeg` command-line tool's built-in sources, matching the clips +//! in the HTML mockup. `bars_tone.mov` is deliberately never made, so the +//! demo shows what offline media looks like. + +use std::path::Path; +use std::process::Command; + +/// `(file name, ffmpeg arguments after the output-independent setup)`. +fn jobs() -> Vec<(&'static str, Vec)> { + let video = |filter: &str| -> Vec { + [ + "-f", "lavfi", "-i", filter, "-t", "16", "-c:v", "libx264", "-preset", "veryfast", + "-crf", "26", "-g", "24", "-pix_fmt", "yuv420p", + ] + .iter() + .map(|s| s.to_string()) + .collect() + }; + let audio = |expr: &str, seconds: &str| -> Vec { + [ + "-f", + "lavfi", + "-i", + expr, + "-t", + seconds, + "-c:a", + "pcm_s16le", + ] + .iter() + .map(|s| s.to_string()) + .collect() + }; + vec![ + ( + "dusk_gradient.mov", + video( + "gradients=s=1280x720:r=24:speed=0.01:c0=0x2b1a4a:c1=0xff7a3d:c2=0x1d3b6e:nb_colors=3", + ), + ), + ( + "mandel_dive.mp4", + video("mandelbrot=s=1280x720:r=24:maxiter=256:end_scale=0.002:end_pts=384"), + ), + ( + "colony_sim.mov", + video( + "life=s=320x180:r=24:mold=10:ratio=0.08:life_color=#5bc85b:death_color=#b02040,scale=1280:720:flags=neighbor", + ), + ), + ( + "zoneplate_ref.mov", + video("zoneplate=s=1280x720:r=24:kx2=256:ky2=256:kt2=8,hue=s=0"), + ), + ( + "rule110.mov", + video( + "cellauto=s=320x180:r=24:rule=110:scroll=1:random_fill_ratio=0.5,scale=1280:720:flags=neighbor", + ), + ), + ( + "voiceover_t3.wav", + audio( + "aevalsrc=0.4*sin(2*PI*(170+30*sin(2*PI*0.7*t))*t)*(0.5+0.5*sin(2*PI*2.3*t)):s=48000", + "40", + ), + ), + ( + "pad_drone.wav", + audio( + "aevalsrc=0.2*sin(2*PI*110*t)+0.15*sin(2*PI*165*t)|0.2*sin(2*PI*110.5*t)+0.15*sin(2*PI*220*t):s=48000", + "60", + ), + ), + ] +} + +/// Whether the `ffmpeg` command-line tool can be run. +pub fn ffmpeg_cli_available() -> bool { + Command::new("ffmpeg") + .arg("-version") + .output() + .is_ok_and(|o| o.status.success()) +} + +/// Files the demo needs that aren't in `dir` yet. +pub fn missing_demo_media(dir: &Path) -> Vec<&'static str> { + jobs() + .into_iter() + .map(|(name, _)| name) + .filter(|name| !dir.join(name).exists()) + .collect() +} + +/// Writes any missing demo files into `dir`, calling `progress(done, total)` +/// after each. Each file is written under a temporary name and renamed, so +/// an interrupted run never leaves a half-written clip behind. +pub fn generate_demo_media( + dir: &Path, + mut progress: impl FnMut(usize, usize), +) -> Result<(), String> { + std::fs::create_dir_all(dir).map_err(|e| format!("couldn't create {}: {e}", dir.display()))?; + let todo: Vec<_> = jobs() + .into_iter() + .filter(|(name, _)| !dir.join(name).exists()) + .collect(); + let total = todo.len(); + for (i, (name, args)) in todo.into_iter().enumerate() { + let out = dir.join(name); + let tmp = dir.join(format!(".partial-{name}")); + let status = Command::new("ffmpeg") + .args(["-v", "error", "-y", "-nostdin"]) + .args(&args) + .arg("-f") + .arg(if name.ends_with(".wav") { + "wav" + } else if name.ends_with(".mp4") { + "mp4" + } else { + "mov" + }) + .arg(&tmp) + .status() + .map_err(|e| format!("couldn't run ffmpeg: {e}"))?; + if !status.success() { + std::fs::remove_file(&tmp).ok(); + return Err(format!("ffmpeg failed making {name}")); + } + std::fs::rename(&tmp, &out) + .map_err(|e| format!("couldn't write {}: {e}", out.display()))?; + progress(i + 1, total); + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + /// Slow (about ten seconds): `cargo test -p videode-media -- --ignored`. + #[test] + #[ignore] + fn generates_every_demo_file() { + let dir = std::env::temp_dir().join("videode-demo-media-test"); + std::fs::remove_dir_all(&dir).ok(); + let mut calls = 0; + generate_demo_media(&dir, |_, _| calls += 1).unwrap(); + assert_eq!(calls, jobs().len()); + assert!(missing_demo_media(&dir).is_empty()); + for (name, _) in jobs() { + let p = crate::probe(&dir.join(name)).unwrap(); + let expected = match name { + "voiceover_t3.wav" => 40., + "pad_drone.wav" => 60., + _ => 16., + }; + assert!( + (p.duration.unwrap() - expected).abs() < 0.1, + "{name}: {p:?}" + ); + } + } +} diff --git a/crates/videode-media/src/lib.rs b/crates/videode-media/src/lib.rs new file mode 100644 index 0000000..42eb126 --- /dev/null +++ b/crates/videode-media/src/lib.rs @@ -0,0 +1,509 @@ +//! Media I/O on the system FFmpeg: probing files, decoding exact frames for +//! the viewer and thumbnails, and a small pool of decoder threads with a +//! frame cache. Pictures come out as BGRA, the order GPUI draws. + +pub mod demo; +mod pool; + +use std::path::Path; +use std::sync::Once; + +use ff::format::Pixel; +use ff::media::Type; +use ff::software::scaling; +use ffmpeg_next as ff; + +pub use pool::{FramePool, FrameRequest}; + +#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)] +pub enum MediaError { + #[error("couldn't open {0}")] + Open(String), + #[error("{0} has no picture")] + NoVideo(String), + #[error("{0} has no picture or sound")] + NoStreams(String), + #[error("decoding failed: {0}")] + Decode(String), + /// A newer request for the same slot replaced this one. + #[error("superseded by a newer request")] + Superseded, +} + +impl From for MediaError { + fn from(e: ff::Error) -> Self { + MediaError::Decode(e.to_string()) + } +} + +pub fn init() { + static ONCE: Once = Once::new(); + ONCE.call_once(|| { + ff::init().ok(); + ff::util::log::set_level(ff::util::log::Level::Error); + }); +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Kind { + Video, + Audio, + /// A single picture (PNG, JPEG, …) that can be any length. + Image, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct AudioInfo { + pub codec: String, + pub channels: u16, + pub sample_rate: u32, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct Probe { + pub kind: Kind, + /// Length in seconds; `None` for stills. + pub duration: Option, + /// Picture codec, or the audio codec for sound-only files. + pub codec: String, + pub width: Option, + pub height: Option, + pub fps: Option, + pub audio: Option, +} + +impl Probe { + /// One-line format text, e.g. `1920×1080 · 24 fps` or `Stereo · 48 kHz`. + pub fn format_text(&self) -> String { + match (self.width, self.height, &self.audio) { + (Some(w), Some(h), _) => match self.fps.filter(|_| self.kind == Kind::Video) { + Some(f) => format!("{w}×{h} · {} fps", trim_fps(f)), + None => format!("{w}×{h}"), + }, + (_, _, Some(a)) => format!( + "{} · {} kHz", + match a.channels { + 1 => "Mono".to_string(), + 2 => "Stereo".to_string(), + n => format!("{n} ch"), + }, + trim_fps(a.sample_rate as f64 / 1000.) + ), + _ => String::new(), + } + } +} + +fn trim_fps(f: f64) -> String { + if (f - f.round()).abs() < 0.005 { + format!("{}", f.round() as i64) + } else { + format!("{f:.2}") + } +} + +/// A human name for an FFmpeg codec id, e.g. `h264` → `H.264`. +pub fn codec_name(id: &str) -> String { + match id { + "h264" => "H.264".into(), + "hevc" => "H.265".into(), + "av1" => "AV1".into(), + "vp8" => "VP8".into(), + "vp9" => "VP9".into(), + "prores" => "ProRes".into(), + "dnxhd" => "DNxHD/HR".into(), + "mjpeg" => "JPEG".into(), + "png" => "PNG".into(), + "webp" => "WebP".into(), + "aac" => "AAC".into(), + "mp3" | "mp3float" => "MP3".into(), + "opus" => "Opus".into(), + "vorbis" => "Vorbis".into(), + "flac" => "FLAC".into(), + "alac" => "ALAC".into(), + id if id.starts_with("pcm_") => "PCM".into(), + other => other.to_uppercase(), + } +} + +fn path_text(path: &Path) -> String { + path.display().to_string() +} + +const STILL_CODECS: [&str; 8] = [ + "mjpeg", "png", "webp", "bmp", "tiff", "gif", "jpegxl", "avif", +]; + +pub fn probe(path: &Path) -> Result { + init(); + let input = ff::format::input(path).map_err(|_| MediaError::Open(path_text(path)))?; + let duration = + (input.duration() > 0).then(|| input.duration() as f64 / ff::ffi::AV_TIME_BASE as f64); + + let audio = input.streams().best(Type::Audio).and_then(|s| { + let ctx = ff::codec::Context::from_parameters(s.parameters()).ok()?; + let a = ctx.decoder().audio().ok()?; + Some(AudioInfo { + codec: codec_name(s.parameters().id().name()), + channels: a.channel_layout().channels() as u16, + sample_rate: a.rate(), + }) + }); + + if let Some(s) = input.streams().best(Type::Video) { + let id = s.parameters().id().name().to_string(); + let ctx = ff::codec::Context::from_parameters(s.parameters())?; + let v = ctx.decoder().video()?; + let rate = s.avg_frame_rate(); + let fps = (rate.denominator() != 0 && rate.numerator() > 0).then(|| f64::from(rate)); + let still = STILL_CODECS.contains(&id.as_str()) && s.frames() <= 1 && audio.is_none(); + return Ok(Probe { + kind: if still { Kind::Image } else { Kind::Video }, + duration: if still { None } else { duration }, + codec: codec_name(&id), + width: Some(v.width()), + height: Some(v.height()), + fps, + audio, + }); + } + match audio { + Some(a) => Ok(Probe { + kind: Kind::Audio, + duration, + codec: a.codec.clone(), + width: None, + height: None, + fps: None, + audio: Some(a), + }), + None => Err(MediaError::NoStreams(path_text(path))), + } +} + +/// A decoded picture in BGRA, rows packed with no padding. +#[derive(Clone, Debug, PartialEq)] +pub struct Picture { + pub width: u32, + pub height: u32, + pub bgra: Vec, + /// Presentation time of the frame, in seconds from the start. + pub time: f64, +} + +/// The largest size with the same aspect that fits in `max_w × max_h` +/// (never upscaled; even dimensions for the scaler). +pub fn fit(w: u32, h: u32, max_w: u32, max_h: u32) -> (u32, u32) { + let s = (max_w as f64 / w as f64) + .min(max_h as f64 / h as f64) + .min(1.); + let even = |v: f64| ((v.round() as u32).max(2) + 1) & !1; + (even(w as f64 * s), even(h as f64 * s)) +} + +/// Decodes exact frames from one file. Requests that move forward a little +/// keep decoding from where the last one stopped; anything else seeks to the +/// keyframe before the target and decodes forward. +pub struct VideoDecoder { + input: ff::format::context::Input, + stream: usize, + decoder: ff::decoder::Video, + time_base: f64, + start: f64, + frame_dur: f64, + /// The frame last returned, and its time. + last: Option<(f64, ff::frame::Video)>, + /// A frame decoded past the last target, kept for the next request. + ahead: Option<(f64, ff::frame::Video)>, + eof: bool, + scaler: Option<(u32, u32, Pixel, u32, u32, scaling::Context)>, +} + +/// How far ahead (seconds) a request may be and still decode forward +/// instead of seeking. +const FORWARD_WINDOW: f64 = 2.; + +impl VideoDecoder { + pub fn open(path: &Path) -> Result { + init(); + let input = ff::format::input(path).map_err(|_| MediaError::Open(path_text(path)))?; + let s = input + .streams() + .best(Type::Video) + .ok_or_else(|| MediaError::NoVideo(path_text(path)))?; + let stream = s.index(); + let tb = s.time_base(); + let time_base = f64::from(tb); + let start = if s.start_time() == ff::ffi::AV_NOPTS_VALUE { + 0. + } else { + s.start_time() as f64 * time_base + }; + let rate = s.avg_frame_rate(); + let fps = if rate.numerator() > 0 && rate.denominator() > 0 { + f64::from(rate) + } else { + 25. + }; + let mut ctx = ff::codec::Context::from_parameters(s.parameters())?; + // Use a few threads per decoder; the pool runs several decoders. + ctx.set_threading(ff::threading::Config { + kind: ff::threading::Type::Frame, + count: 2, + }); + let decoder = ctx.decoder().video()?; + Ok(Self { + input, + stream, + decoder, + time_base, + start, + frame_dur: 1. / fps, + last: None, + ahead: None, + eof: false, + scaler: None, + }) + } + + fn frame_time(&self, f: &ff::frame::Video) -> Option { + // Best-effort timestamps survive streams with missing pts. + f.timestamp() + .or(f.pts()) + .map(|ts| ts as f64 * self.time_base - self.start) + } + + fn seek(&mut self, t: f64) -> Result<(), MediaError> { + let ts = ((t + self.start).max(0.) * ff::ffi::AV_TIME_BASE as f64) as i64; + // The range end is the latest keyframe allowed (avformat max_ts). + self.input.seek(ts, ..ts)?; + self.decoder.flush(); + self.last = None; + self.ahead = None; + self.eof = false; + Ok(()) + } + + /// Decodes the next frame and its time, or `None` at the end. + fn next_frame(&mut self) -> Result, MediaError> { + if let Some(f) = self.ahead.take() { + return Ok(Some(f)); + } + let mut frame = ff::frame::Video::empty(); + loop { + if self.decoder.receive_frame(&mut frame).is_ok() { + let t = self.frame_time(&frame).unwrap_or(0.); + return Ok(Some((t, frame))); + } + if self.eof { + return Ok(None); + } + let mut sent = false; + for (s, packet) in self.input.packets() { + if s.index() == self.stream { + self.decoder.send_packet(&packet)?; + sent = true; + break; + } + } + if !sent { + self.eof = true; + self.decoder.send_eof().ok(); + } + } + } + + /// The frame showing at `t` seconds: the last frame starting at or before + /// `t`, with half a frame of slack to absorb rounding between rates. + /// Past the end, the last frame. + pub fn frame_at(&mut self, t: f64, max_w: u32, max_h: u32) -> Result { + let target = t.max(0.) + self.frame_dur / 2.; + let covers = |ft: f64, dur: f64| target >= ft && target < ft + dur; + let reuse = matches!(&self.last, Some((ft, _)) if covers(*ft, self.frame_dur)); + if !reuse { + let forward = + matches!(&self.last, Some((ft, _)) if target > *ft && target - ft < FORWARD_WINDOW); + if !forward { + self.seek(t.max(0.))?; + } + while let Some((ft, f)) = self.next_frame()? { + if ft > target && self.last.is_some() { + // Overshot: the previous frame is the one; keep this for later. + self.ahead = Some((ft, f)); + break; + } + self.last = Some((ft, f)); + if covers(ft, self.frame_dur) { + break; + } + } + } + let (time, frame) = self + .last + .take() + .ok_or_else(|| MediaError::Decode("no frames".into()))?; + let picture = self.scale(&frame, time, max_w, max_h); + self.last = Some((time, frame)); + picture + } + + fn scale( + &mut self, + f: &ff::frame::Video, + time: f64, + max_w: u32, + max_h: u32, + ) -> Result { + let (w, h) = fit(f.width(), f.height(), max_w, max_h); + let key = (f.width(), f.height(), f.format(), w, h); + let fresh = + !matches!(&self.scaler, Some((a, b, c, d, e, _)) if (*a, *b, *c, *d, *e) == key); + if fresh { + let ctx = scaling::Context::get( + f.format(), + f.width(), + f.height(), + Pixel::BGRA, + w, + h, + scaling::Flags::BILINEAR, + )?; + self.scaler = Some((key.0, key.1, key.2, key.3, key.4, ctx)); + } + let scaler = &mut self.scaler.as_mut().expect("set above").5; + let mut out = ff::frame::Video::empty(); + scaler.run(f, &mut out)?; + let stride = out.stride(0); + let row = w as usize * 4; + let data = out.data(0); + let mut bgra = Vec::with_capacity(row * h as usize); + for y in 0..h as usize { + bgra.extend_from_slice(&data[y * stride..y * stride + row]); + } + Ok(Picture { + width: w, + height: h, + bgra, + time, + }) + } +} + +/// A small picture for the bin: a tenth of the way in, or the only frame of +/// a still. +pub fn thumbnail(path: &Path, max_w: u32, max_h: u32) -> Result { + let p = probe(path)?; + if p.kind == Kind::Audio { + return Err(MediaError::NoVideo(path_text(path))); + } + let at = p.duration.map_or(0., |d| (d * 0.1).min(2.)); + VideoDecoder::open(path)?.frame_at(at, max_w, max_h) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::path::PathBuf; + use std::process::Command; + + /// 2 s at 24 fps, 64×48, each frame a flat grey that encodes its index, + /// with a keyframe every 12 frames so seeks land mid-GOP. + fn fixture() -> Option { + // Generated once; tests run in parallel and must not race on it. + static FIXTURE: std::sync::OnceLock> = std::sync::OnceLock::new(); + FIXTURE + .get_or_init(|| { + let dir = + std::env::temp_dir().join(format!("videode-media-test-{}", std::process::id())); + std::fs::create_dir_all(&dir).ok()?; + let path = dir.join("frames.mp4"); + let ok = Command::new("ffmpeg") + .args(["-v", "error", "-y", "-f", "lavfi", "-i"]) + .arg("nullsrc=s=64x48:r=24:d=2,format=gray,geq=lum='16+N*4'") + .args([ + "-c:v", "libx264", "-qp", "0", "-g", "12", "-pix_fmt", "yuv420p", + ]) + .arg(&path) + .status() + .ok()? + .success(); + ok.then_some(path) + }) + .clone() + } + + #[test] + fn probes_video() { + let Some(path) = fixture() else { + eprintln!("skipped: ffmpeg CLI not available"); + return; + }; + let p = probe(&path).unwrap(); + assert_eq!(p.kind, Kind::Video); + assert_eq!((p.width, p.height), (Some(64), Some(48))); + assert_eq!(p.codec, "H.264"); + assert!((p.fps.unwrap() - 24.).abs() < 0.01); + assert!((p.duration.unwrap() - 2.).abs() < 0.1); + assert_eq!(p.format_text(), "64×48 · 24 fps"); + } + + #[test] + fn decodes_exact_frames_in_any_order() { + let Some(path) = fixture() else { + eprintln!("skipped: ffmpeg CLI not available"); + return; + }; + // Ground truth: every frame, decoded front to back from a fresh open. + let mut d = VideoDecoder::open(&path).unwrap(); + let truth: Vec = (0..48) + .map(|n| d.frame_at(n as f64 / 24., 64, 48).unwrap()) + .collect(); + let greys: Vec = truth + .iter() + .map(|p| p.bgra[(24 * 64 + 32) * 4 + 1]) + .collect(); + assert!( + greys.windows(2).all(|w| w[1] > w[0]), + "each frame is distinct: {greys:?}" + ); + + // Random access, backwards, keyframes and mid-GOP, then a forward run. + let mut d = VideoDecoder::open(&path).unwrap(); + let order: Vec = [30, 5, 47, 13, 12, 0, 23, 24] + .into_iter() + .chain(31..40) + .collect(); + for n in order { + let pic = d.frame_at(n as f64 / 24., 64, 48).unwrap(); + assert_eq!( + pic.bgra, truth[n].bgra, + "frame {n} differs from sequential decode" + ); + assert!( + (pic.time - n as f64 / 24.).abs() < 1e-3, + "frame {n} has time {}", + pic.time + ); + } + // Past the end clamps to the last frame; between frames rounds down. + assert_eq!(d.frame_at(10., 64, 48).unwrap().bgra, truth[47].bgra); + assert_eq!(d.frame_at(10.4 / 24., 64, 48).unwrap().bgra, truth[10].bgra); + } + + #[test] + fn scales_to_fit_without_upscaling() { + assert_eq!(fit(1920, 1080, 160, 90), (160, 90)); + assert_eq!(fit(1920, 1080, 160, 160), (160, 90)); + assert_eq!(fit(64, 48, 640, 480), (64, 48)); + let (w, h) = fit(1001, 777, 300, 300); + assert!(w % 2 == 0 && h % 2 == 0 && w <= 300); + } + + #[test] + fn missing_files_fail_cleanly() { + assert!(matches!( + probe(Path::new("/nope/missing.mov")), + Err(MediaError::Open(_)) + )); + } +} diff --git a/crates/videode-media/src/pool.rs b/crates/videode-media/src/pool.rs new file mode 100644 index 0000000..4e6c079 --- /dev/null +++ b/crates/videode-media/src/pool.rs @@ -0,0 +1,235 @@ +//! Decoder threads and a frame cache. +//! +//! Each file is pinned to one worker so its decoder keeps its position for +//! forward playback. Requests carry a `slot` (the viewer, one thumbnail, …): +//! when a worker falls behind, only the newest request per slot is decoded, +//! so scrubbing never queues up stale frames. + +use std::collections::hash_map::DefaultHasher; +use std::collections::{HashMap, VecDeque}; +use std::hash::{Hash, Hasher}; +use std::path::{Path, PathBuf}; +use std::sync::mpsc::{Receiver, Sender, channel}; +use std::sync::{Arc, Mutex}; + +use futures::channel::oneshot; + +use crate::{MediaError, Picture, VideoDecoder}; + +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +struct CacheKey { + path: PathBuf, + /// Milliseconds, so near-identical times share an entry. + ms: i64, + max_w: u32, + max_h: u32, +} + +struct Cache { + map: HashMap>, + order: VecDeque, + bytes: usize, + limit: usize, +} + +impl Cache { + fn get(&mut self, key: &CacheKey) -> Option> { + let hit = self.map.get(key).cloned()?; + if let Some(i) = self.order.iter().position(|k| k == key) { + let k = self.order.remove(i).expect("index from position"); + self.order.push_back(k); + } + Some(hit) + } + + fn put(&mut self, key: CacheKey, picture: Arc) { + if self.map.contains_key(&key) { + return; + } + self.bytes += picture.bgra.len(); + self.order.push_back(key.clone()); + self.map.insert(key, picture); + while self.bytes > self.limit { + let Some(old) = self.order.pop_front() else { + break; + }; + if let Some(p) = self.map.remove(&old) { + self.bytes -= p.bgra.len(); + } + } + } +} + +pub struct FrameRequest { + pub path: PathBuf, + /// Seconds into the file. + pub time: f64, + pub max_w: u32, + pub max_h: u32, + /// Requests sharing a slot replace each other while queued. + pub slot: u64, +} + +struct Job { + req: FrameRequest, + key: CacheKey, + reply: oneshot::Sender, MediaError>>, +} + +pub struct FramePool { + workers: Vec>, + cache: Arc>, +} + +impl FramePool { + /// `workers` threads; `cache_mb` megabytes of decoded frames. + pub fn new(workers: usize, cache_mb: usize) -> Self { + crate::init(); + let cache = Arc::new(Mutex::new(Cache { + map: HashMap::new(), + order: VecDeque::new(), + bytes: 0, + limit: cache_mb << 20, + })); + let workers = (0..workers.max(1)) + .map(|i| { + let (tx, rx) = channel::(); + let cache = cache.clone(); + std::thread::Builder::new() + .name(format!("videode-decode-{i}")) + .spawn(move || worker(rx, cache)) + .expect("spawn decoder thread"); + tx + }) + .collect(); + Self { workers, cache } + } + + fn key(req: &FrameRequest) -> CacheKey { + CacheKey { + path: req.path.clone(), + ms: (req.time * 1000.).round() as i64, + max_w: req.max_w, + max_h: req.max_h, + } + } + + /// A cached frame, without decoding. + pub fn cached(&self, req: &FrameRequest) -> Option> { + self.cache.lock().ok()?.get(&Self::key(req)) + } + + /// Decodes a frame in the background. Resolves to an error if the + /// request was superseded by a newer one in the same slot. + pub fn request( + &self, + req: FrameRequest, + ) -> oneshot::Receiver, MediaError>> { + let (reply, rx) = oneshot::channel(); + let key = Self::key(&req); + if let Some(hit) = self.cache.lock().ok().and_then(|mut c| c.get(&key)) { + reply.send(Ok(hit)).ok(); + return rx; + } + let mut h = DefaultHasher::new(); + req.path.hash(&mut h); + let worker = &self.workers[h.finish() as usize % self.workers.len()]; + worker.send(Job { req, key, reply }).ok(); + rx + } +} + +fn worker(rx: Receiver, cache: Arc>) { + let mut decoders: HashMap = HashMap::new(); + while let Ok(first) = rx.recv() { + // Take everything queued and keep only the newest job per slot. + let mut jobs = vec![first]; + jobs.extend(rx.try_iter()); + let mut newest: Vec = Vec::with_capacity(jobs.len()); + for job in jobs { + if let Some(i) = newest.iter().position(|j| j.req.slot == job.req.slot) { + let old = std::mem::replace(&mut newest[i], job); + old.reply.send(Err(MediaError::Superseded)).ok(); + } else { + newest.push(job); + } + } + for job in newest { + if job.reply.is_canceled() { + continue; + } + let result = decode( + &mut decoders, + &job.req.path, + job.req.time, + job.req.max_w, + job.req.max_h, + ); + if decoders.len() > 8 { + // Keep the most recent few files open. + let keep = job.req.path.clone(); + decoders.retain(|p, _| *p == keep); + } + let result = result.map(Arc::new); + if let (Ok(p), Ok(mut c)) = (&result, cache.lock()) { + c.put(job.key.clone(), p.clone()); + } + job.reply.send(result).ok(); + } + } +} + +fn decode( + decoders: &mut HashMap, + path: &Path, + time: f64, + max_w: u32, + max_h: u32, +) -> Result { + if !decoders.contains_key(path) { + decoders.insert(path.to_path_buf(), VideoDecoder::open(path)?); + } + let d = decoders.get_mut(path).expect("inserted above"); + let result = d.frame_at(time, max_w, max_h); + if result.is_err() { + // A broken decoder is reopened next time. + decoders.remove(path); + } + result +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn cache_evicts_oldest_beyond_limit() { + let mut c = Cache { + map: HashMap::new(), + order: VecDeque::new(), + bytes: 0, + limit: 250, + }; + let pic = |n: u8| { + Arc::new(Picture { + width: 1, + height: 1, + bgra: vec![n; 100], + time: 0., + }) + }; + let key = |ms| CacheKey { + path: "a".into(), + ms, + max_w: 1, + max_h: 1, + }; + c.put(key(1), pic(1)); + c.put(key(2), pic(2)); + assert!(c.get(&key(1)).is_some(), "touch 1 so 2 is oldest"); + c.put(key(3), pic(3)); + assert!(c.get(&key(2)).is_none()); + assert!(c.get(&key(1)).is_some() && c.get(&key(3)).is_some()); + assert!(c.bytes <= 250); + } +} diff --git a/docs/PLAN.md b/docs/PLAN.md new file mode 100644 index 0000000..72f96d1 --- /dev/null +++ b/docs/PLAN.md @@ -0,0 +1,55 @@ +# videode plan + +Approved 2026-10-25, together with `mockup/videode.html` and `DESIGN.md`. + +## Stack + +| Concern | Choice | +|---|---| +| UI | GPUI via `gpui-kit` 0.8 (pins a matching GPUI snapshot; adds components, dock, menus) | +| Decode / encode | FFmpeg via `ffmpeg-next`, dynamically linked (LGPL) | +| Audio out | `cpal` | +| Compositing | CPU RGBA first, behind a `Compositor` trait; `wgpu` later for effects | +| Time | Rational: integer frames/ticks over a timebase | +| Project files | `.vde` in **KDL** (`kdl` crate), versioned schema. No JSON. | +| Concurrency | Decode, audio and export on worker threads; channels back to the UI | + +## Architecture: everything is a node + +`videode-core` is a node graph engine: typed nodes with typed ports, lazy pull-based +evaluation in topological order, and per-node caching. Source, Trim, Transform, Grade, +Blur, Opacity, Fade, Text, Gain, Duck, Track, Composite, Mix, Sequence and Output are all +node types. A clip is a chain of nodes feeding a track; a sequence is a node and can nest. + +The timeline, inspector, peek panel and graph view are different views of the same graph. +Every UI edit is a graph edit through one command stack (undo/redo). + +## Crates + +``` +videode-core graph engine, project model, commands/undo, KDL load/save +videode-media probe, decoder pool, seeking, frame cache, thumbnails, waveforms +videode-render evaluates the graph at time t into a frame (Compositor trait) +videode-audio mixer, cpal output, master clock +videode-export render to file through FFmpeg, progress, cancel +videode-app GPUI app: shell, timeline, inspector, peek, graph, palette +``` + +Crates are added in the milestone that needs them. + +## Milestones + +- **M0 Skeleton.** Workspace, GPUI window with the full shell layout, Test Card theme, + bundled fonts, headless snapshot tool, CI on Linux/macOS/Windows. +- **M1 Core + timeline.** Graph engine, project model, undo stack, KDL save/load. Timeline + rendering and editing: move, trim, split, delete, ripple delete, snapping, zoom. +- **M2 Node views.** Chain strips on clips, Tab peek panel (reorder, add, remove, bypass), + Shift+Tab sequence graph, inspector driven by node params, command palette. +- **M3 Media + preview.** Import, probe, bin with thumbnails, decoder pool, frame-accurate + scrubbing in the viewer. +- **M4 Playback + audio.** cpal output, audio-master clock, J/K/L, meters, waveforms. +- **M5 Export.** Output node renders H.264/AAC MP4 (plus H.265/ProRes when available). +- **M6 Polish + packaging.** Rebindable shortcuts, autosave and recovery, recent projects, + installers (MSI, DMG, AppImage/Flatpak) with FFmpeg bundled. + +Later: wgpu effects, transitions and keyframes, proxies, hardware decode, multiple sequences. diff --git a/docs/m0-shell.png b/docs/m0-shell.png new file mode 100644 index 0000000..0ab6d56 Binary files /dev/null and b/docs/m0-shell.png differ diff --git a/docs/m1-timeline.png b/docs/m1-timeline.png new file mode 100644 index 0000000..133fd6a Binary files /dev/null and b/docs/m1-timeline.png differ diff --git a/docs/m2-graph.png b/docs/m2-graph.png new file mode 100644 index 0000000..ca24efc Binary files /dev/null and b/docs/m2-graph.png differ diff --git a/docs/m2-peek.png b/docs/m2-peek.png new file mode 100644 index 0000000..a32135c Binary files /dev/null and b/docs/m2-peek.png differ diff --git a/docs/m3-media.png b/docs/m3-media.png new file mode 100644 index 0000000..5da107e Binary files /dev/null and b/docs/m3-media.png differ diff --git a/mockup/brand.html b/mockup/brand.html new file mode 100644 index 0000000..193c115 --- /dev/null +++ b/mockup/brand.html @@ -0,0 +1,362 @@ + + + + +videode · brand & motion + + + + + +
+

videode · brand & motion

+ + Animations +
+
+
+ +
+

Three directions for the mark

+

All three come from the Test Card system: PLUGE near-blacks, bone, and the seven bar colours, which already mean node categories inside the app. Each one is shown as a 1024 icon, at real small sizes, and as a wordmark lockup on dark and on bone. Click a card to try it in the previews below.

+
+
+ +
+

In context

+

The selected mark in the app's top bar, a macOS dock and a Windows taskbar. The wordmark is Geist SemiBold, lowercase, tracked −2.5%.

+
+
+
videodeFileEditClipViewPlayback
+
+
About videode0.1.0
+
videode
A video editor where everything is a node.
0.1.0 · GPUI · FFmpeg 7
+
+
+
+
+ +
+

Motion

+

Motion explains what changed. It never sits between you and the next keystroke: input is never delayed or blocked, and anything you drag follows the pointer 1:1. Use the switch at the top right to compare. Off makes everything instant. System follows the OS reduce-motion setting and is the default.

+
+
    +
  • Short. 90–180ms for UI feedback and 300ms for the peek. Only the splash runs longer (under 1s), and you can skip it with any key.
  • +
  • One curve. Ease-out cubic-bezier(.16,1,.3,1) for things arriving. Leaving is faster than arriving.
  • +
  • No motion on direct manipulation. Drag, trim, scrub and playback are never eased. Clips snap instantly; only the guide line flashes.
  • +
  • Off really means off. Every animation has an instant end state, so nothing is lost when motion is disabled. The playhead and meters still update; they are data, not decoration.
  • +
+
+ +
+

Settings window (Ctrl , / ⌘ ,)

+

Settings come first because animation needs a switch. They're saved as KDL in the platform config folder (~/.config/videode/settings.kdl, %APPDATA%\videode, ~/Library/Application Support/videode), are written whenever you change something, and take effect immediately.

+
+
+ +
+
AnimationsMenus, peek, flashes, splash
+
+
The system currently allows motion.
+
Splash on launchPlays the mark once; any key skips it
+
Snap by defaultSame as N
+
Timeline zoom stepFor = and -
1.40×
+
+
+

+  
+
+ +
+ What I need from you +
    +
  1. Which mark: A, B or C, or a combination (for example B's shape inside A's tile).
  2. +
  3. Which animations to keep: all eight below, or drop some.
  4. +
  5. Then I'll build it: +
      +
    • the brand: SVG masters, app icons (.ico for Windows, .icns for macOS, PNG sizes and a .desktop file for Linux), the in-app logo, an About box and the splash;
    • +
    • Settings: the window, the KDL settings file and a Ctrl/Cmd+, shortcut;
    • +
    • an animation layer in the app that checks the motion setting, and the animations themselves;
    • +
    • the motion rules, added to DESIGN.md.
    • +
    +
  6. +
+
+
+ + + + diff --git a/mockup/media/bars_01.jpg b/mockup/media/bars_01.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_01.jpg differ diff --git a/mockup/media/bars_02.jpg b/mockup/media/bars_02.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_02.jpg differ diff --git a/mockup/media/bars_03.jpg b/mockup/media/bars_03.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_03.jpg differ diff --git a/mockup/media/bars_04.jpg b/mockup/media/bars_04.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_04.jpg differ diff --git a/mockup/media/bars_05.jpg b/mockup/media/bars_05.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_05.jpg differ diff --git a/mockup/media/bars_06.jpg b/mockup/media/bars_06.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_06.jpg differ diff --git a/mockup/media/bars_07.jpg b/mockup/media/bars_07.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_07.jpg differ diff --git a/mockup/media/bars_08.jpg b/mockup/media/bars_08.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_08.jpg differ diff --git a/mockup/media/bars_09.jpg b/mockup/media/bars_09.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_09.jpg differ diff --git a/mockup/media/bars_10.jpg b/mockup/media/bars_10.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_10.jpg differ diff --git a/mockup/media/bars_11.jpg b/mockup/media/bars_11.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_11.jpg differ diff --git a/mockup/media/bars_12.jpg b/mockup/media/bars_12.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_12.jpg differ diff --git a/mockup/media/bars_13.jpg b/mockup/media/bars_13.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_13.jpg differ diff --git a/mockup/media/bars_14.jpg b/mockup/media/bars_14.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_14.jpg differ diff --git a/mockup/media/bars_15.jpg b/mockup/media/bars_15.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_15.jpg differ diff --git a/mockup/media/bars_16.jpg b/mockup/media/bars_16.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_16.jpg differ diff --git a/mockup/media/bars_17.jpg b/mockup/media/bars_17.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_17.jpg differ diff --git a/mockup/media/bars_18.jpg b/mockup/media/bars_18.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_18.jpg differ diff --git a/mockup/media/bars_19.jpg b/mockup/media/bars_19.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_19.jpg differ diff --git a/mockup/media/bars_20.jpg b/mockup/media/bars_20.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_20.jpg differ diff --git a/mockup/media/bars_21.jpg b/mockup/media/bars_21.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_21.jpg differ diff --git a/mockup/media/bars_22.jpg b/mockup/media/bars_22.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_22.jpg differ diff --git a/mockup/media/bars_23.jpg b/mockup/media/bars_23.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_23.jpg differ diff --git a/mockup/media/bars_24.jpg b/mockup/media/bars_24.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_24.jpg differ diff --git a/mockup/media/bars_25.jpg b/mockup/media/bars_25.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_25.jpg differ diff --git a/mockup/media/bars_26.jpg b/mockup/media/bars_26.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_26.jpg differ diff --git a/mockup/media/bars_27.jpg b/mockup/media/bars_27.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_27.jpg differ diff --git a/mockup/media/bars_28.jpg b/mockup/media/bars_28.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_28.jpg differ diff --git a/mockup/media/bars_29.jpg b/mockup/media/bars_29.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_29.jpg differ diff --git a/mockup/media/bars_30.jpg b/mockup/media/bars_30.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_30.jpg differ diff --git a/mockup/media/bars_31.jpg b/mockup/media/bars_31.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_31.jpg differ diff --git a/mockup/media/bars_32.jpg b/mockup/media/bars_32.jpg new file mode 100644 index 0000000..65bc614 Binary files /dev/null and b/mockup/media/bars_32.jpg differ diff --git a/mockup/media/colony_01.jpg b/mockup/media/colony_01.jpg new file mode 100644 index 0000000..10f1143 Binary files /dev/null and b/mockup/media/colony_01.jpg differ diff --git a/mockup/media/colony_02.jpg b/mockup/media/colony_02.jpg new file mode 100644 index 0000000..e64ca76 Binary files /dev/null and b/mockup/media/colony_02.jpg differ diff --git a/mockup/media/colony_03.jpg b/mockup/media/colony_03.jpg new file mode 100644 index 0000000..7ec58f4 Binary files /dev/null and b/mockup/media/colony_03.jpg differ diff --git a/mockup/media/colony_04.jpg b/mockup/media/colony_04.jpg new file mode 100644 index 0000000..201f015 Binary files /dev/null and b/mockup/media/colony_04.jpg differ diff --git a/mockup/media/colony_05.jpg b/mockup/media/colony_05.jpg new file mode 100644 index 0000000..ce4f153 Binary files /dev/null and b/mockup/media/colony_05.jpg differ diff --git a/mockup/media/colony_06.jpg b/mockup/media/colony_06.jpg new file mode 100644 index 0000000..21a67c1 Binary files /dev/null and b/mockup/media/colony_06.jpg differ diff --git a/mockup/media/colony_07.jpg b/mockup/media/colony_07.jpg new file mode 100644 index 0000000..37dcd7c Binary files /dev/null and b/mockup/media/colony_07.jpg differ diff --git a/mockup/media/colony_08.jpg b/mockup/media/colony_08.jpg new file mode 100644 index 0000000..05bddcd Binary files /dev/null and b/mockup/media/colony_08.jpg differ diff --git a/mockup/media/colony_09.jpg b/mockup/media/colony_09.jpg new file mode 100644 index 0000000..343c955 Binary files /dev/null and b/mockup/media/colony_09.jpg differ diff --git a/mockup/media/colony_10.jpg b/mockup/media/colony_10.jpg new file mode 100644 index 0000000..a62ce60 Binary files /dev/null and b/mockup/media/colony_10.jpg differ diff --git a/mockup/media/colony_11.jpg b/mockup/media/colony_11.jpg new file mode 100644 index 0000000..08067ab Binary files /dev/null and b/mockup/media/colony_11.jpg differ diff --git a/mockup/media/colony_12.jpg b/mockup/media/colony_12.jpg new file mode 100644 index 0000000..3f35cd6 Binary files /dev/null and b/mockup/media/colony_12.jpg differ diff --git a/mockup/media/colony_13.jpg b/mockup/media/colony_13.jpg new file mode 100644 index 0000000..221f8a5 Binary files /dev/null and b/mockup/media/colony_13.jpg differ diff --git a/mockup/media/colony_14.jpg b/mockup/media/colony_14.jpg new file mode 100644 index 0000000..ca74017 Binary files /dev/null and b/mockup/media/colony_14.jpg differ diff --git a/mockup/media/colony_15.jpg b/mockup/media/colony_15.jpg new file mode 100644 index 0000000..69686ba Binary files /dev/null and b/mockup/media/colony_15.jpg differ diff --git a/mockup/media/colony_16.jpg b/mockup/media/colony_16.jpg new file mode 100644 index 0000000..d0cac0c Binary files /dev/null and b/mockup/media/colony_16.jpg differ diff --git a/mockup/media/colony_17.jpg b/mockup/media/colony_17.jpg new file mode 100644 index 0000000..b66624d Binary files /dev/null and b/mockup/media/colony_17.jpg differ diff --git a/mockup/media/colony_18.jpg b/mockup/media/colony_18.jpg new file mode 100644 index 0000000..724e108 Binary files /dev/null and b/mockup/media/colony_18.jpg differ diff --git a/mockup/media/colony_19.jpg b/mockup/media/colony_19.jpg new file mode 100644 index 0000000..4140588 Binary files /dev/null and b/mockup/media/colony_19.jpg differ diff --git a/mockup/media/colony_20.jpg b/mockup/media/colony_20.jpg new file mode 100644 index 0000000..eb4fa26 Binary files /dev/null and b/mockup/media/colony_20.jpg differ diff --git a/mockup/media/colony_21.jpg b/mockup/media/colony_21.jpg new file mode 100644 index 0000000..7c50478 Binary files /dev/null and b/mockup/media/colony_21.jpg differ diff --git a/mockup/media/colony_22.jpg b/mockup/media/colony_22.jpg new file mode 100644 index 0000000..414b72a Binary files /dev/null and b/mockup/media/colony_22.jpg differ diff --git a/mockup/media/colony_23.jpg b/mockup/media/colony_23.jpg new file mode 100644 index 0000000..f7cd0e4 Binary files /dev/null and b/mockup/media/colony_23.jpg differ diff --git a/mockup/media/colony_24.jpg b/mockup/media/colony_24.jpg new file mode 100644 index 0000000..8bff4fd Binary files /dev/null and b/mockup/media/colony_24.jpg differ diff --git a/mockup/media/colony_25.jpg b/mockup/media/colony_25.jpg new file mode 100644 index 0000000..26cac46 Binary files /dev/null and b/mockup/media/colony_25.jpg differ diff --git a/mockup/media/colony_26.jpg b/mockup/media/colony_26.jpg new file mode 100644 index 0000000..da92e44 Binary files /dev/null and b/mockup/media/colony_26.jpg differ diff --git a/mockup/media/colony_27.jpg b/mockup/media/colony_27.jpg new file mode 100644 index 0000000..564bc4a Binary files /dev/null and b/mockup/media/colony_27.jpg differ diff --git a/mockup/media/colony_28.jpg b/mockup/media/colony_28.jpg new file mode 100644 index 0000000..087f1c9 Binary files /dev/null and b/mockup/media/colony_28.jpg differ diff --git a/mockup/media/colony_29.jpg b/mockup/media/colony_29.jpg new file mode 100644 index 0000000..0b4599e Binary files /dev/null and b/mockup/media/colony_29.jpg differ diff --git a/mockup/media/colony_30.jpg b/mockup/media/colony_30.jpg new file mode 100644 index 0000000..df314db Binary files /dev/null and b/mockup/media/colony_30.jpg differ diff --git a/mockup/media/colony_31.jpg b/mockup/media/colony_31.jpg new file mode 100644 index 0000000..d9ead02 Binary files /dev/null and b/mockup/media/colony_31.jpg differ diff --git a/mockup/media/colony_32.jpg b/mockup/media/colony_32.jpg new file mode 100644 index 0000000..24de030 Binary files /dev/null and b/mockup/media/colony_32.jpg differ diff --git a/mockup/media/dive_01.jpg b/mockup/media/dive_01.jpg new file mode 100644 index 0000000..110f33f Binary files /dev/null and b/mockup/media/dive_01.jpg differ diff --git a/mockup/media/dive_02.jpg b/mockup/media/dive_02.jpg new file mode 100644 index 0000000..4a97d25 Binary files /dev/null and b/mockup/media/dive_02.jpg differ diff --git a/mockup/media/dive_03.jpg b/mockup/media/dive_03.jpg new file mode 100644 index 0000000..fae223b Binary files /dev/null and b/mockup/media/dive_03.jpg differ diff --git a/mockup/media/dive_04.jpg b/mockup/media/dive_04.jpg new file mode 100644 index 0000000..9fb6b01 Binary files /dev/null and b/mockup/media/dive_04.jpg differ diff --git a/mockup/media/dive_05.jpg b/mockup/media/dive_05.jpg new file mode 100644 index 0000000..61abbec Binary files /dev/null and b/mockup/media/dive_05.jpg differ diff --git a/mockup/media/dive_06.jpg b/mockup/media/dive_06.jpg new file mode 100644 index 0000000..8b7689e Binary files /dev/null and b/mockup/media/dive_06.jpg differ diff --git a/mockup/media/dive_07.jpg b/mockup/media/dive_07.jpg new file mode 100644 index 0000000..63fdfae Binary files /dev/null and b/mockup/media/dive_07.jpg differ diff --git a/mockup/media/dive_08.jpg b/mockup/media/dive_08.jpg new file mode 100644 index 0000000..324dc38 Binary files /dev/null and b/mockup/media/dive_08.jpg differ diff --git a/mockup/media/dive_09.jpg b/mockup/media/dive_09.jpg new file mode 100644 index 0000000..ef22b89 Binary files /dev/null and b/mockup/media/dive_09.jpg differ diff --git a/mockup/media/dive_10.jpg b/mockup/media/dive_10.jpg new file mode 100644 index 0000000..fce1f15 Binary files /dev/null and b/mockup/media/dive_10.jpg differ diff --git a/mockup/media/dive_11.jpg b/mockup/media/dive_11.jpg new file mode 100644 index 0000000..49eb600 Binary files /dev/null and b/mockup/media/dive_11.jpg differ diff --git a/mockup/media/dive_12.jpg b/mockup/media/dive_12.jpg new file mode 100644 index 0000000..61e2c45 Binary files /dev/null and b/mockup/media/dive_12.jpg differ diff --git a/mockup/media/dive_13.jpg b/mockup/media/dive_13.jpg new file mode 100644 index 0000000..7ba05fc Binary files /dev/null and b/mockup/media/dive_13.jpg differ diff --git a/mockup/media/dive_14.jpg b/mockup/media/dive_14.jpg new file mode 100644 index 0000000..b858e26 Binary files /dev/null and b/mockup/media/dive_14.jpg differ diff --git a/mockup/media/dive_15.jpg b/mockup/media/dive_15.jpg new file mode 100644 index 0000000..2160059 Binary files /dev/null and b/mockup/media/dive_15.jpg differ diff --git a/mockup/media/dive_16.jpg b/mockup/media/dive_16.jpg new file mode 100644 index 0000000..be56734 Binary files /dev/null and b/mockup/media/dive_16.jpg differ diff --git a/mockup/media/dive_17.jpg b/mockup/media/dive_17.jpg new file mode 100644 index 0000000..3f8ed28 Binary files /dev/null and b/mockup/media/dive_17.jpg differ diff --git a/mockup/media/dive_18.jpg b/mockup/media/dive_18.jpg new file mode 100644 index 0000000..e70da59 Binary files /dev/null and b/mockup/media/dive_18.jpg differ diff --git a/mockup/media/dive_19.jpg b/mockup/media/dive_19.jpg new file mode 100644 index 0000000..aac6540 Binary files /dev/null and b/mockup/media/dive_19.jpg differ diff --git a/mockup/media/dive_20.jpg b/mockup/media/dive_20.jpg new file mode 100644 index 0000000..b562b13 Binary files /dev/null and b/mockup/media/dive_20.jpg differ diff --git a/mockup/media/dive_21.jpg b/mockup/media/dive_21.jpg new file mode 100644 index 0000000..5d6901c Binary files /dev/null and b/mockup/media/dive_21.jpg differ diff --git a/mockup/media/dive_22.jpg b/mockup/media/dive_22.jpg new file mode 100644 index 0000000..03d4ffd Binary files /dev/null and b/mockup/media/dive_22.jpg differ diff --git a/mockup/media/dive_23.jpg b/mockup/media/dive_23.jpg new file mode 100644 index 0000000..47f412e Binary files /dev/null and b/mockup/media/dive_23.jpg differ diff --git a/mockup/media/dive_24.jpg b/mockup/media/dive_24.jpg new file mode 100644 index 0000000..0f318c9 Binary files /dev/null and b/mockup/media/dive_24.jpg differ diff --git a/mockup/media/dive_25.jpg b/mockup/media/dive_25.jpg new file mode 100644 index 0000000..c02a3ec Binary files /dev/null and b/mockup/media/dive_25.jpg differ diff --git a/mockup/media/dive_26.jpg b/mockup/media/dive_26.jpg new file mode 100644 index 0000000..fd5f1b0 Binary files /dev/null and b/mockup/media/dive_26.jpg differ diff --git a/mockup/media/dive_27.jpg b/mockup/media/dive_27.jpg new file mode 100644 index 0000000..a03a59f Binary files /dev/null and b/mockup/media/dive_27.jpg differ diff --git a/mockup/media/dive_28.jpg b/mockup/media/dive_28.jpg new file mode 100644 index 0000000..5a1db3d Binary files /dev/null and b/mockup/media/dive_28.jpg differ diff --git a/mockup/media/dive_29.jpg b/mockup/media/dive_29.jpg new file mode 100644 index 0000000..1d101c1 Binary files /dev/null and b/mockup/media/dive_29.jpg differ diff --git a/mockup/media/dive_30.jpg b/mockup/media/dive_30.jpg new file mode 100644 index 0000000..d02f234 Binary files /dev/null and b/mockup/media/dive_30.jpg differ diff --git a/mockup/media/dive_31.jpg b/mockup/media/dive_31.jpg new file mode 100644 index 0000000..180161c Binary files /dev/null and b/mockup/media/dive_31.jpg differ diff --git a/mockup/media/dive_32.jpg b/mockup/media/dive_32.jpg new file mode 100644 index 0000000..1f84254 Binary files /dev/null and b/mockup/media/dive_32.jpg differ diff --git a/mockup/media/dusk_01.jpg b/mockup/media/dusk_01.jpg new file mode 100644 index 0000000..d411d10 Binary files /dev/null and b/mockup/media/dusk_01.jpg differ diff --git a/mockup/media/dusk_02.jpg b/mockup/media/dusk_02.jpg new file mode 100644 index 0000000..f8853e6 Binary files /dev/null and b/mockup/media/dusk_02.jpg differ diff --git a/mockup/media/dusk_03.jpg b/mockup/media/dusk_03.jpg new file mode 100644 index 0000000..2f57452 Binary files /dev/null and b/mockup/media/dusk_03.jpg differ diff --git a/mockup/media/dusk_04.jpg b/mockup/media/dusk_04.jpg new file mode 100644 index 0000000..b8ae89b Binary files /dev/null and b/mockup/media/dusk_04.jpg differ diff --git a/mockup/media/dusk_05.jpg b/mockup/media/dusk_05.jpg new file mode 100644 index 0000000..3ba0640 Binary files /dev/null and b/mockup/media/dusk_05.jpg differ diff --git a/mockup/media/dusk_06.jpg b/mockup/media/dusk_06.jpg new file mode 100644 index 0000000..c32fdf2 Binary files /dev/null and b/mockup/media/dusk_06.jpg differ diff --git a/mockup/media/dusk_07.jpg b/mockup/media/dusk_07.jpg new file mode 100644 index 0000000..84b649d Binary files /dev/null and b/mockup/media/dusk_07.jpg differ diff --git a/mockup/media/dusk_08.jpg b/mockup/media/dusk_08.jpg new file mode 100644 index 0000000..1b9ac56 Binary files /dev/null and b/mockup/media/dusk_08.jpg differ diff --git a/mockup/media/dusk_09.jpg b/mockup/media/dusk_09.jpg new file mode 100644 index 0000000..e69b261 Binary files /dev/null and b/mockup/media/dusk_09.jpg differ diff --git a/mockup/media/dusk_10.jpg b/mockup/media/dusk_10.jpg new file mode 100644 index 0000000..1242a72 Binary files /dev/null and b/mockup/media/dusk_10.jpg differ diff --git a/mockup/media/dusk_11.jpg b/mockup/media/dusk_11.jpg new file mode 100644 index 0000000..2e4c916 Binary files /dev/null and b/mockup/media/dusk_11.jpg differ diff --git a/mockup/media/dusk_12.jpg b/mockup/media/dusk_12.jpg new file mode 100644 index 0000000..6c5745d Binary files /dev/null and b/mockup/media/dusk_12.jpg differ diff --git a/mockup/media/dusk_13.jpg b/mockup/media/dusk_13.jpg new file mode 100644 index 0000000..8aaa078 Binary files /dev/null and b/mockup/media/dusk_13.jpg differ diff --git a/mockup/media/dusk_14.jpg b/mockup/media/dusk_14.jpg new file mode 100644 index 0000000..43eaaf0 Binary files /dev/null and b/mockup/media/dusk_14.jpg differ diff --git a/mockup/media/dusk_15.jpg b/mockup/media/dusk_15.jpg new file mode 100644 index 0000000..0633b80 Binary files /dev/null and b/mockup/media/dusk_15.jpg differ diff --git a/mockup/media/dusk_16.jpg b/mockup/media/dusk_16.jpg new file mode 100644 index 0000000..83fe519 Binary files /dev/null and b/mockup/media/dusk_16.jpg differ diff --git a/mockup/media/dusk_17.jpg b/mockup/media/dusk_17.jpg new file mode 100644 index 0000000..5ce7e30 Binary files /dev/null and b/mockup/media/dusk_17.jpg differ diff --git a/mockup/media/dusk_18.jpg b/mockup/media/dusk_18.jpg new file mode 100644 index 0000000..4f8917b Binary files /dev/null and b/mockup/media/dusk_18.jpg differ diff --git a/mockup/media/dusk_19.jpg b/mockup/media/dusk_19.jpg new file mode 100644 index 0000000..232bf95 Binary files /dev/null and b/mockup/media/dusk_19.jpg differ diff --git a/mockup/media/dusk_20.jpg b/mockup/media/dusk_20.jpg new file mode 100644 index 0000000..a15d6f3 Binary files /dev/null and b/mockup/media/dusk_20.jpg differ diff --git a/mockup/media/dusk_21.jpg b/mockup/media/dusk_21.jpg new file mode 100644 index 0000000..14774aa Binary files /dev/null and b/mockup/media/dusk_21.jpg differ diff --git a/mockup/media/dusk_22.jpg b/mockup/media/dusk_22.jpg new file mode 100644 index 0000000..c3e2c44 Binary files /dev/null and b/mockup/media/dusk_22.jpg differ diff --git a/mockup/media/dusk_23.jpg b/mockup/media/dusk_23.jpg new file mode 100644 index 0000000..f2fdf1d Binary files /dev/null and b/mockup/media/dusk_23.jpg differ diff --git a/mockup/media/dusk_24.jpg b/mockup/media/dusk_24.jpg new file mode 100644 index 0000000..a87fcd1 Binary files /dev/null and b/mockup/media/dusk_24.jpg differ diff --git a/mockup/media/dusk_25.jpg b/mockup/media/dusk_25.jpg new file mode 100644 index 0000000..6bfdacc Binary files /dev/null and b/mockup/media/dusk_25.jpg differ diff --git a/mockup/media/dusk_26.jpg b/mockup/media/dusk_26.jpg new file mode 100644 index 0000000..64655d7 Binary files /dev/null and b/mockup/media/dusk_26.jpg differ diff --git a/mockup/media/dusk_27.jpg b/mockup/media/dusk_27.jpg new file mode 100644 index 0000000..c23b551 Binary files /dev/null and b/mockup/media/dusk_27.jpg differ diff --git a/mockup/media/dusk_28.jpg b/mockup/media/dusk_28.jpg new file mode 100644 index 0000000..d02aaf2 Binary files /dev/null and b/mockup/media/dusk_28.jpg differ diff --git a/mockup/media/dusk_29.jpg b/mockup/media/dusk_29.jpg new file mode 100644 index 0000000..af2d639 Binary files /dev/null and b/mockup/media/dusk_29.jpg differ diff --git a/mockup/media/dusk_30.jpg b/mockup/media/dusk_30.jpg new file mode 100644 index 0000000..1f4ed38 Binary files /dev/null and b/mockup/media/dusk_30.jpg differ diff --git a/mockup/media/dusk_31.jpg b/mockup/media/dusk_31.jpg new file mode 100644 index 0000000..59b45fe Binary files /dev/null and b/mockup/media/dusk_31.jpg differ diff --git a/mockup/media/dusk_32.jpg b/mockup/media/dusk_32.jpg new file mode 100644 index 0000000..dd97450 Binary files /dev/null and b/mockup/media/dusk_32.jpg differ diff --git a/mockup/media/rule_01.jpg b/mockup/media/rule_01.jpg new file mode 100644 index 0000000..08a6701 Binary files /dev/null and b/mockup/media/rule_01.jpg differ diff --git a/mockup/media/rule_02.jpg b/mockup/media/rule_02.jpg new file mode 100644 index 0000000..32e8422 Binary files /dev/null and b/mockup/media/rule_02.jpg differ diff --git a/mockup/media/rule_03.jpg b/mockup/media/rule_03.jpg new file mode 100644 index 0000000..a784147 Binary files /dev/null and b/mockup/media/rule_03.jpg differ diff --git a/mockup/media/rule_04.jpg b/mockup/media/rule_04.jpg new file mode 100644 index 0000000..79e6882 Binary files /dev/null and b/mockup/media/rule_04.jpg differ diff --git a/mockup/media/rule_05.jpg b/mockup/media/rule_05.jpg new file mode 100644 index 0000000..b58af1e Binary files /dev/null and b/mockup/media/rule_05.jpg differ diff --git a/mockup/media/rule_06.jpg b/mockup/media/rule_06.jpg new file mode 100644 index 0000000..c2bb5f4 Binary files /dev/null and b/mockup/media/rule_06.jpg differ diff --git a/mockup/media/rule_07.jpg b/mockup/media/rule_07.jpg new file mode 100644 index 0000000..ede2546 Binary files /dev/null and b/mockup/media/rule_07.jpg differ diff --git a/mockup/media/rule_08.jpg b/mockup/media/rule_08.jpg new file mode 100644 index 0000000..be89fad Binary files /dev/null and b/mockup/media/rule_08.jpg differ diff --git a/mockup/media/rule_09.jpg b/mockup/media/rule_09.jpg new file mode 100644 index 0000000..cba679b Binary files /dev/null and b/mockup/media/rule_09.jpg differ diff --git a/mockup/media/rule_10.jpg b/mockup/media/rule_10.jpg new file mode 100644 index 0000000..f9cde6f Binary files /dev/null and b/mockup/media/rule_10.jpg differ diff --git a/mockup/media/rule_11.jpg b/mockup/media/rule_11.jpg new file mode 100644 index 0000000..f5c65f3 Binary files /dev/null and b/mockup/media/rule_11.jpg differ diff --git a/mockup/media/rule_12.jpg b/mockup/media/rule_12.jpg new file mode 100644 index 0000000..f3111ad Binary files /dev/null and b/mockup/media/rule_12.jpg differ diff --git a/mockup/media/rule_13.jpg b/mockup/media/rule_13.jpg new file mode 100644 index 0000000..a2c3d08 Binary files /dev/null and b/mockup/media/rule_13.jpg differ diff --git a/mockup/media/rule_14.jpg b/mockup/media/rule_14.jpg new file mode 100644 index 0000000..00ad1b7 Binary files /dev/null and b/mockup/media/rule_14.jpg differ diff --git a/mockup/media/rule_15.jpg b/mockup/media/rule_15.jpg new file mode 100644 index 0000000..64d0ced Binary files /dev/null and b/mockup/media/rule_15.jpg differ diff --git a/mockup/media/rule_16.jpg b/mockup/media/rule_16.jpg new file mode 100644 index 0000000..78af419 Binary files /dev/null and b/mockup/media/rule_16.jpg differ diff --git a/mockup/media/rule_17.jpg b/mockup/media/rule_17.jpg new file mode 100644 index 0000000..917a44f Binary files /dev/null and b/mockup/media/rule_17.jpg differ diff --git a/mockup/media/rule_18.jpg b/mockup/media/rule_18.jpg new file mode 100644 index 0000000..9b66d19 Binary files /dev/null and b/mockup/media/rule_18.jpg differ diff --git a/mockup/media/rule_19.jpg b/mockup/media/rule_19.jpg new file mode 100644 index 0000000..a79e0fb Binary files /dev/null and b/mockup/media/rule_19.jpg differ diff --git a/mockup/media/rule_20.jpg b/mockup/media/rule_20.jpg new file mode 100644 index 0000000..153379d Binary files /dev/null and b/mockup/media/rule_20.jpg differ diff --git a/mockup/media/rule_21.jpg b/mockup/media/rule_21.jpg new file mode 100644 index 0000000..523e4cf Binary files /dev/null and b/mockup/media/rule_21.jpg differ diff --git a/mockup/media/rule_22.jpg b/mockup/media/rule_22.jpg new file mode 100644 index 0000000..0263c7b Binary files /dev/null and b/mockup/media/rule_22.jpg differ diff --git a/mockup/media/rule_23.jpg b/mockup/media/rule_23.jpg new file mode 100644 index 0000000..5fb9d3b Binary files /dev/null and b/mockup/media/rule_23.jpg differ diff --git a/mockup/media/rule_24.jpg b/mockup/media/rule_24.jpg new file mode 100644 index 0000000..bd01a55 Binary files /dev/null and b/mockup/media/rule_24.jpg differ diff --git a/mockup/media/rule_25.jpg b/mockup/media/rule_25.jpg new file mode 100644 index 0000000..0f61a6f Binary files /dev/null and b/mockup/media/rule_25.jpg differ diff --git a/mockup/media/rule_26.jpg b/mockup/media/rule_26.jpg new file mode 100644 index 0000000..48706a5 Binary files /dev/null and b/mockup/media/rule_26.jpg differ diff --git a/mockup/media/rule_27.jpg b/mockup/media/rule_27.jpg new file mode 100644 index 0000000..756c292 Binary files /dev/null and b/mockup/media/rule_27.jpg differ diff --git a/mockup/media/rule_28.jpg b/mockup/media/rule_28.jpg new file mode 100644 index 0000000..3b74d59 Binary files /dev/null and b/mockup/media/rule_28.jpg differ diff --git a/mockup/media/rule_29.jpg b/mockup/media/rule_29.jpg new file mode 100644 index 0000000..4af210f Binary files /dev/null and b/mockup/media/rule_29.jpg differ diff --git a/mockup/media/rule_30.jpg b/mockup/media/rule_30.jpg new file mode 100644 index 0000000..29f4e2f Binary files /dev/null and b/mockup/media/rule_30.jpg differ diff --git a/mockup/media/rule_31.jpg b/mockup/media/rule_31.jpg new file mode 100644 index 0000000..04f6562 Binary files /dev/null and b/mockup/media/rule_31.jpg differ diff --git a/mockup/media/rule_32.jpg b/mockup/media/rule_32.jpg new file mode 100644 index 0000000..b794d57 Binary files /dev/null and b/mockup/media/rule_32.jpg differ diff --git a/mockup/media/zone_01.jpg b/mockup/media/zone_01.jpg new file mode 100644 index 0000000..8ec2cf6 Binary files /dev/null and b/mockup/media/zone_01.jpg differ diff --git a/mockup/media/zone_02.jpg b/mockup/media/zone_02.jpg new file mode 100644 index 0000000..8247a6f Binary files /dev/null and b/mockup/media/zone_02.jpg differ diff --git a/mockup/media/zone_03.jpg b/mockup/media/zone_03.jpg new file mode 100644 index 0000000..aeca320 Binary files /dev/null and b/mockup/media/zone_03.jpg differ diff --git a/mockup/media/zone_04.jpg b/mockup/media/zone_04.jpg new file mode 100644 index 0000000..f97d7e9 Binary files /dev/null and b/mockup/media/zone_04.jpg differ diff --git a/mockup/media/zone_05.jpg b/mockup/media/zone_05.jpg new file mode 100644 index 0000000..6e08670 Binary files /dev/null and b/mockup/media/zone_05.jpg differ diff --git a/mockup/media/zone_06.jpg b/mockup/media/zone_06.jpg new file mode 100644 index 0000000..083c4e6 Binary files /dev/null and b/mockup/media/zone_06.jpg differ diff --git a/mockup/media/zone_07.jpg b/mockup/media/zone_07.jpg new file mode 100644 index 0000000..963c7b3 Binary files /dev/null and b/mockup/media/zone_07.jpg differ diff --git a/mockup/media/zone_08.jpg b/mockup/media/zone_08.jpg new file mode 100644 index 0000000..4aa97ee Binary files /dev/null and b/mockup/media/zone_08.jpg differ diff --git a/mockup/media/zone_09.jpg b/mockup/media/zone_09.jpg new file mode 100644 index 0000000..45cfcd1 Binary files /dev/null and b/mockup/media/zone_09.jpg differ diff --git a/mockup/media/zone_10.jpg b/mockup/media/zone_10.jpg new file mode 100644 index 0000000..716bb1e Binary files /dev/null and b/mockup/media/zone_10.jpg differ diff --git a/mockup/media/zone_11.jpg b/mockup/media/zone_11.jpg new file mode 100644 index 0000000..4a89615 Binary files /dev/null and b/mockup/media/zone_11.jpg differ diff --git a/mockup/media/zone_12.jpg b/mockup/media/zone_12.jpg new file mode 100644 index 0000000..7addba4 Binary files /dev/null and b/mockup/media/zone_12.jpg differ diff --git a/mockup/media/zone_13.jpg b/mockup/media/zone_13.jpg new file mode 100644 index 0000000..a6f93dc Binary files /dev/null and b/mockup/media/zone_13.jpg differ diff --git a/mockup/media/zone_14.jpg b/mockup/media/zone_14.jpg new file mode 100644 index 0000000..fb92b62 Binary files /dev/null and b/mockup/media/zone_14.jpg differ diff --git a/mockup/media/zone_15.jpg b/mockup/media/zone_15.jpg new file mode 100644 index 0000000..6dd2413 Binary files /dev/null and b/mockup/media/zone_15.jpg differ diff --git a/mockup/media/zone_16.jpg b/mockup/media/zone_16.jpg new file mode 100644 index 0000000..2dba813 Binary files /dev/null and b/mockup/media/zone_16.jpg differ diff --git a/mockup/media/zone_17.jpg b/mockup/media/zone_17.jpg new file mode 100644 index 0000000..04e7015 Binary files /dev/null and b/mockup/media/zone_17.jpg differ diff --git a/mockup/media/zone_18.jpg b/mockup/media/zone_18.jpg new file mode 100644 index 0000000..287de2f Binary files /dev/null and b/mockup/media/zone_18.jpg differ diff --git a/mockup/media/zone_19.jpg b/mockup/media/zone_19.jpg new file mode 100644 index 0000000..c64a066 Binary files /dev/null and b/mockup/media/zone_19.jpg differ diff --git a/mockup/media/zone_20.jpg b/mockup/media/zone_20.jpg new file mode 100644 index 0000000..3c0a04e Binary files /dev/null and b/mockup/media/zone_20.jpg differ diff --git a/mockup/media/zone_21.jpg b/mockup/media/zone_21.jpg new file mode 100644 index 0000000..1313921 Binary files /dev/null and b/mockup/media/zone_21.jpg differ diff --git a/mockup/media/zone_22.jpg b/mockup/media/zone_22.jpg new file mode 100644 index 0000000..e56c22b Binary files /dev/null and b/mockup/media/zone_22.jpg differ diff --git a/mockup/media/zone_23.jpg b/mockup/media/zone_23.jpg new file mode 100644 index 0000000..c5143a8 Binary files /dev/null and b/mockup/media/zone_23.jpg differ diff --git a/mockup/media/zone_24.jpg b/mockup/media/zone_24.jpg new file mode 100644 index 0000000..82ebc02 Binary files /dev/null and b/mockup/media/zone_24.jpg differ diff --git a/mockup/media/zone_25.jpg b/mockup/media/zone_25.jpg new file mode 100644 index 0000000..52ffa39 Binary files /dev/null and b/mockup/media/zone_25.jpg differ diff --git a/mockup/media/zone_26.jpg b/mockup/media/zone_26.jpg new file mode 100644 index 0000000..ac25184 Binary files /dev/null and b/mockup/media/zone_26.jpg differ diff --git a/mockup/media/zone_27.jpg b/mockup/media/zone_27.jpg new file mode 100644 index 0000000..31251ea Binary files /dev/null and b/mockup/media/zone_27.jpg differ diff --git a/mockup/media/zone_28.jpg b/mockup/media/zone_28.jpg new file mode 100644 index 0000000..8057073 Binary files /dev/null and b/mockup/media/zone_28.jpg differ diff --git a/mockup/media/zone_29.jpg b/mockup/media/zone_29.jpg new file mode 100644 index 0000000..4dbc27e Binary files /dev/null and b/mockup/media/zone_29.jpg differ diff --git a/mockup/media/zone_30.jpg b/mockup/media/zone_30.jpg new file mode 100644 index 0000000..522242d Binary files /dev/null and b/mockup/media/zone_30.jpg differ diff --git a/mockup/media/zone_31.jpg b/mockup/media/zone_31.jpg new file mode 100644 index 0000000..63b83dd Binary files /dev/null and b/mockup/media/zone_31.jpg differ diff --git a/mockup/media/zone_32.jpg b/mockup/media/zone_32.jpg new file mode 100644 index 0000000..ebd7fa2 Binary files /dev/null and b/mockup/media/zone_32.jpg differ diff --git a/mockup/videode.html b/mockup/videode.html new file mode 100644 index 0000000..f7eb9b8 --- /dev/null +++ b/mockup/videode.html @@ -0,0 +1,1487 @@ + + + + + +videode — Signal Study + + + + + + + + +
+
+ + videode + +
+
+ + + + +
+
+ +
+
+
+ + + + +
+ +
+
+
+ +
+
+ Main Sequence + + 1920×1080 · 24 fps + +
+
+
+ +
+
+ +
+ + + + + +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ + + Drag to pan · scroll to zoom · double-click a clip to cut it in the timeline +
+

Viewer

+
+
+
+ + + +
+
+
+ + +
+ + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ + + Cache 72% + +
+
+ + +
+ + + + +
+
+ + + + diff --git a/packaging/linux/dev.videode.videode.desktop b/packaging/linux/dev.videode.videode.desktop new file mode 100644 index 0000000..827691d --- /dev/null +++ b/packaging/linux/dev.videode.videode.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +Name=videode +GenericName=Video Editor +Comment=A video editor where everything is a node +Exec=videode %F +Icon=dev.videode.videode +Terminal=false +Categories=AudioVideo;Video;AudioVideoEditing; +MimeType=application/x-videode-project; +StartupWMClass=dev.videode.videode +Keywords=video;editor;nle;node; diff --git a/packaging/linux/dev.videode.videode.xml b/packaging/linux/dev.videode.videode.xml new file mode 100644 index 0000000..7216067 --- /dev/null +++ b/packaging/linux/dev.videode.videode.xml @@ -0,0 +1,8 @@ + + + + videode project + + + + diff --git a/packaging/linux/install.sh b/packaging/linux/install.sh new file mode 100755 index 0000000..07bf287 --- /dev/null +++ b/packaging/linux/install.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Installs the videode binary, launcher, icons and .vde file type for the +# current user. Run after `cargo build --release`. +set -euo pipefail +cd "$(dirname "$0")/../.." +prefix=${PREFIX:-$HOME/.local} +id=dev.videode.videode +install -Dm755 target/release/videode "$prefix/bin/videode" +install -Dm644 packaging/linux/$id.desktop "$prefix/share/applications/$id.desktop" +install -Dm644 packaging/linux/$id.xml "$prefix/share/mime/packages/$id.xml" +install -Dm644 assets/brand/videode.svg "$prefix/share/icons/hicolor/scalable/apps/$id.svg" +for s in 16 24 32 48 64 128 256 512; do + install -Dm644 assets/brand/png/videode-$s.png "$prefix/share/icons/hicolor/${s}x${s}/apps/$id.png" +done +update-mime-database "$prefix/share/mime" 2>/dev/null || true +update-desktop-database "$prefix/share/applications" 2>/dev/null || true +gtk-update-icon-cache -f -t "$prefix/share/icons/hicolor" 2>/dev/null || true +echo "installed videode to $prefix" diff --git a/scripts/brand.sh b/scripts/brand.sh new file mode 100755 index 0000000..273fc24 --- /dev/null +++ b/scripts/brand.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# Regenerates every raster brand asset from the SVG masters in assets/brand. +# Needs rsvg-convert and Python 3 with Pillow. +set -euo pipefail +cd "$(dirname "$0")/.." +src=assets/brand +out=$src/png +mkdir -p "$out" + +# Let rsvg find the bundled Geist fonts for the lockups. +fc=$(mktemp -d) +trap 'rm -rf "$fc"' EXIT +cat > "$fc/fonts.conf" < +$PWD/assets/fonts/etc/fonts/fonts.conf$fc +CONF +export FONTCONFIG_FILE="$fc/fonts.conf" + +for s in 16 24 32; do rsvg-convert -w $s -h $s $src/videode-small.svg -o $out/videode-$s.png; done +for s in 48 64 128 256 512 1024; do rsvg-convert -w $s -h $s $src/videode.svg -o $out/videode-$s.png; done +for v in dark light; do rsvg-convert -w 1120 -h 320 $src/videode-lockup-$v.svg -o $out/videode-lockup-$v.png; done + +python3 -I - "$out" "$src" <<'PY' +import sys +from PIL import Image +out, src = sys.argv[1], sys.argv[2] +img = lambda s: Image.open(f"{out}/videode-{s}.png").convert("RGBA") +sizes = [16, 24, 32, 48, 64, 128, 256] +# Windows: one .ico holding every size, each drawn from its own master. +img(256).save(f"{src}/videode.ico", sizes=[(s, s) for s in sizes], + append_images=[img(s) for s in sizes[:-1]]) +# macOS placeholder until the Icon Composer (Liquid Glass) icon replaces it. +img(1024).save(f"{src}/videode.icns") +PY +echo "brand assets written to $src"