How toghroltp/pealayer works
Pealayer combines desktop video playback and a 4D cue editor with a background hardware-control engine; an HTTP/WebSocket service exposes playback and media browsing to a browser remote. The graph follows the documented playback-to-timeline-to-device workflow and the sampled calls from the app and editor into the engine. Sidecar pairing, recording, and some UI behavior are documented capabilities, but their precise internal wiring is not fully visible in the excerpts.
Main entry points: app.rs Player App · layout.rs Timeline Editor · mod.rs HTTP / WS Server · engine.rs Cue Scheduler
Components 22
Desktop Player
- Player App
src/app.rs - Player Panels
src/ui - mpv Renderer
src/mpv/render.rs
4D Timeline
- Timeline Editor
src/ui/layout.rs - Timeline Models
src/four_d/models.rs - Undo History
src/four_d/history.rs - Effect Patterns
src/four_d/patterns.rs - Analog Curves
src/four_d/curve.rs - Curve Recording
src/four_d/curve_record.rs
Hardware Engine
- Cue Scheduler
src/four_d/engine.rs - Serial Protocol
src/four_d/protocol.rs
Remote Control
- Browser Remote
web_ui/src/App.tsx - Remote Controls
web_ui/src/components/RemoteControlTab.tsx - HTTP / WS Server
src/server/mod.rs - Media Browsing
src/server/fs_api.rs - Thumbnail Service
src/server/thumbnails.rs
Platform Integration
- Command Bridge
src/platform/interop.rs
Other components
- Viewer / Editor
- libmpv
- Serial Controller
- Media Files / Streams
- 4D Sidecar Data
Connections 26
- Viewer / Editor → Player App: operates
- Player App → Player Panels: renders
- Player App → libmpv: controls playback
- Player App → mpv Renderer: renders frames
- mpv Renderer → libmpv: requests frames
- Media Files / Streams → Player App: opens
- Player App → Timeline Editor: hosts editor
- Timeline Editor → Timeline Models: edits cues
- Timeline Editor → Undo History: tracks edits
- Timeline Editor → Cue Scheduler: compiles and sends queue
- Player App → Cue Scheduler: sends playback updates
- Player App → Analog Curves: updates analog tracks
- Effect Patterns → Timeline Models: creates effects
- Curve Recording → Timeline Models: records curve data
- Cue Scheduler → Serial Protocol: encodes commands
- Cue Scheduler → Serial Controller: writes serial commands
- Viewer / Editor → Browser Remote: uses remote
- Browser Remote → Remote Controls: shows controls
- Browser Remote → HTTP / WS Server: sends commands and polls state
- HTTP / WS Server → Player App: dispatches commands and state
- Player App → Command Bridge: handles interop commands
- HTTP / WS Server → Media Browsing: browses and trashes media
- HTTP / WS Server → Thumbnail Service: requests thumbnails
- Media Browsing → Media Files / Streams: reads media folders
- Thumbnail Service → Media Files / Streams: reads media files
- Player App → 4D Sidecar Data: pairs timeline on open