# marshiyar/onetake architecture

> Architecture diagram of the GitHub repository marshiyar/onetake, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marshiyar/onetake
- Repository: https://github.com/marshiyar/onetake
- Video tour (about a minute): https://gitdiagram.com/marshiyar/onetake/video

## Overview

MpVFX is a cross-platform native video editor. The main workflow is to open or create a project, import media, arrange and edit clips on the timeline, preview the composition, then export a rendered file. The graph also preserves the documented grading, audio, scopes, keyframing, and library capabilities. Several domain links are based on README descriptions because their implementation files were not sampled; edges cite only those documented relationships.

Main entry points: [`mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift`](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift) (Editor session), [`mpvfx-swift/Sources/MpvfxPlayer/PreviewCompositor.swift`](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxPlayer/PreviewCompositor.swift) (Preview compositor), [`mpvfx-swift/Sources/MpvfxTimeline/TimelineController.swift`](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxTimeline/TimelineController.swift) (Timeline editing), [`mpvfx-swift/Sources/MpvfxRuntime/Export/ExportSession.swift`](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Export/ExportSession.swift) (Export session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["Editor experience"]
  node_desktop["Desktop shell<br/>[main.swift]"]
  node_session["Editor session"]
  node_panels["Editor panels"]
end

subgraph group_project["Projects and media"]
  node_projectdoc["Project document"]
  node_projectstore[("Project storage")]
  node_library[("Media library")]
  node_import["Media import<br/>[LocalImport.swift]"]
end

subgraph group_composition["Editing and preview"]
  node_timeline["Timeline editing"]
  node_keyframes["Keyframe engine"]
  node_player["Preview controls"]
  node_composition["Preview composition"]
  node_compositor["Preview compositor"]
end

subgraph group_render["Rendering and grading"]
  node_export["Export session"]
  node_renderer["Timeline renderer"]
  node_grade["Color grading"]
  node_gpu["GPU grade pipeline"]
end

subgraph group_support["Audio and analysis"]
  node_audio["Audio graph"]
  node_scopes["Scopes analysis<br/>[ScopeEngine.swift]"]
  node_mediaengine["Media engine<br/>[MediaEngine.swift]"]
end

node_user(("Editor"))

node_user -->|"uses"| node_desktop
node_desktop -->|"opens"| node_session
node_session -->|"loads"| node_projectdoc
node_session -->|"configures"| node_timeline
node_session -->|"configures"| node_player
node_session -->|"uses"| node_compositor
node_session -->|"uses"| node_keyframes
node_session -.->|"presents"| node_panels
node_projectdoc -.->|"persists through"| node_projectstore
node_user -->|"browses"| node_library
node_library -->|"imports"| node_import
node_import -.->|"decodes through"| node_mediaengine
node_timeline -.->|"edits"| node_projectdoc
node_timeline -.->|"uses"| node_keyframes
node_player -.->|"drives"| node_compositor
node_compositor -->|"draws"| node_composition
node_composition -.->|"applies"| node_grade
node_user -->|"requests"| node_export
node_export -.->|"renders"| node_renderer
node_renderer -.->|"applies"| node_grade
node_grade -.->|"dispatches"| node_gpu
node_renderer -.->|"mixes"| node_audio
node_export -.->|"encodes through"| node_mediaengine
node_compositor -.->|"analyzes frame"| node_scopes

click node_desktop "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxDesktop/main.swift"
click node_session "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift"
click node_panels "https://github.com/marshiyar/onetake/tree/main/mpvfx-swift/Sources/MpvfxPanels"
click node_projectdoc "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxShared/Project/NativeProjectDocument.swift"
click node_projectstore "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Projects/ProjectDocumentStore.swift"
click node_library "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Library/LibraryService.swift"
click node_import "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Media/LocalImport.swift"
click node_timeline "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxTimeline/TimelineController.swift"
click node_keyframes "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxShared/Engine/KeyframeRuntimeKeyframeEngine.swift"
click node_player "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxPlayer/PlayerController.swift"
click node_composition "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxPlayer/PreviewComposition.swift"
click node_compositor "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxPlayer/PreviewCompositor.swift"
click node_export "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Export/ExportSession.swift"
click node_renderer "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Media/TimelineRenderer.swift"
click node_grade "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxColor/ColorGradeRenderer.swift"
click node_gpu "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxMetal/MetalGradePipeline.swift"
click node_audio "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxAudio/GraphAudioSource.swift"
click node_scopes "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxScopes/ScopeEngine.swift"
click node_mediaengine "https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/OneTakeMedia/MediaEngine.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_desktop,node_session,node_panels toneBlue
class node_projectdoc,node_projectstore,node_library,node_import toneAmber
class node_timeline,node_keyframes,node_player,node_composition,node_compositor toneMint
class node_export,node_renderer,node_grade,node_gpu toneRose
class node_audio,node_scopes,node_mediaengine,node_user toneIndigo
```

## Components

### Editor experience

- [Desktop shell](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxDesktop/main.swift): `mpvfx-swift/Sources/MpvfxDesktop/main.swift`
- [Editor session](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift): `mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift`
- [Editor panels](https://github.com/marshiyar/onetake/tree/main/mpvfx-swift/Sources/MpvfxPanels): `mpvfx-swift/Sources/MpvfxPanels`

### Projects and media

- [Project document](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxShared/Project/NativeProjectDocument.swift): `mpvfx-swift/Sources/MpvfxShared/Project/NativeProjectDocument.swift`
- [Project storage](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Projects/ProjectDocumentStore.swift): `mpvfx-swift/Sources/MpvfxRuntime/Projects/ProjectDocumentStore.swift`
- [Media library](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Library/LibraryService.swift): `mpvfx-swift/Sources/MpvfxRuntime/Library/LibraryService.swift`
- [Media import](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Media/LocalImport.swift): `mpvfx-swift/Sources/MpvfxRuntime/Media/LocalImport.swift`

### Editing and preview

- [Timeline editing](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxTimeline/TimelineController.swift): `mpvfx-swift/Sources/MpvfxTimeline/TimelineController.swift`
- [Keyframe engine](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxShared/Engine/KeyframeRuntimeKeyframeEngine.swift): `mpvfx-swift/Sources/MpvfxShared/Engine/KeyframeRuntimeKeyframeEngine.swift`
- [Preview controls](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxPlayer/PlayerController.swift): `mpvfx-swift/Sources/MpvfxPlayer/PlayerController.swift`
- [Preview composition](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxPlayer/PreviewComposition.swift): `mpvfx-swift/Sources/MpvfxPlayer/PreviewComposition.swift`
- [Preview compositor](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxPlayer/PreviewCompositor.swift): `mpvfx-swift/Sources/MpvfxPlayer/PreviewCompositor.swift`

### Rendering and grading

- [Export session](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Export/ExportSession.swift): `mpvfx-swift/Sources/MpvfxRuntime/Export/ExportSession.swift`
- [Timeline renderer](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxRuntime/Media/TimelineRenderer.swift): `mpvfx-swift/Sources/MpvfxRuntime/Media/TimelineRenderer.swift`
- [Color grading](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxColor/ColorGradeRenderer.swift): `mpvfx-swift/Sources/MpvfxColor/ColorGradeRenderer.swift`
- [GPU grade pipeline](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxMetal/MetalGradePipeline.swift): `mpvfx-swift/Sources/MpvfxMetal/MetalGradePipeline.swift`

### Audio and analysis

- [Audio graph](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxAudio/GraphAudioSource.swift): `mpvfx-swift/Sources/MpvfxAudio/GraphAudioSource.swift`
- [Scopes analysis](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/MpvfxScopes/ScopeEngine.swift): `mpvfx-swift/Sources/MpvfxScopes/ScopeEngine.swift`
- [Media engine](https://github.com/marshiyar/onetake/blob/main/mpvfx-swift/Sources/OneTakeMedia/MediaEngine.swift): `mpvfx-swift/Sources/OneTakeMedia/MediaEngine.swift`

### Other components

- **Editor**

## Connections

- Editor → Desktop shell: uses (evidence: `README.md`)
- Desktop shell → Editor session: opens (evidence: `README.md`)
- Editor session → Project document: loads (evidence: `mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift`)
- Editor session → Timeline editing: configures (evidence: `mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift`)
- Editor session → Preview controls: configures (evidence: `mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift`)
- Editor session → Preview compositor: uses (evidence: `mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift`)
- Editor session → Keyframe engine: uses (evidence: `mpvfx-swift/Sources/MpvfxDesktop/EditorSession.swift`)
- Editor session → Editor panels: presents (evidence: `README.md`)
- Project document → Project storage: persists through (evidence: `README.md`)
- Editor → Media library: browses (evidence: `README.md`)
- Media library → Media import: imports (evidence: `mpvfx-swift/Sources/MpvfxRuntime/Library/LibraryService.swift`)
- Media import → Media engine: decodes through (evidence: `README.md`)
- Timeline editing → Project document: edits (evidence: `README.md`)
- Timeline editing → Keyframe engine: uses (evidence: `README.md`)
- Preview controls → Preview compositor: drives (evidence: `mpvfx-swift/Sources/MpvfxPlayer/PlayerController.swift`)
- Preview compositor → Preview composition: draws (evidence: `mpvfx-swift/tools/MpvfxPreviewBench/main.swift`)
- Preview composition → Color grading: applies (evidence: `README.md`)
- Editor → Export session: requests (evidence: `README.md`)
- Export session → Timeline renderer: renders (evidence: `README.md`)
- Timeline renderer → Color grading: applies (evidence: `README.md`)
- Color grading → GPU grade pipeline: dispatches (evidence: `README.md`)
- Timeline renderer → Audio graph: mixes (evidence: `README.md`)
- Export session → Media engine: encodes through (evidence: `README.md`)
- Preview compositor → Scopes analysis: analyzes frame (evidence: `README.md`)
