Skip to main content

songbird-state

Pure data layer for the Songbird DAW. Defines the project data model, entity types, channel-aligned state slices, and persistence. This crate has no business logic, no I/O beyond persistence, and no engine dependencies.

Architecture

Layer Hierarchy

Entities

Domain types with Serialize + Deserialize. No business logic beyond constructors and accessors.

Slices

Channel-aligned structs that group related entities. Each slice maps 1:1 to a sync engine channel and a persistence file.

StateManager

The root state container. One StateManager per open project.
Key property: because each field is a separate struct, Rust allows simultaneous &mut borrows of different slices — e.g., a mixer command can mutate state.mixer while a transport command reads state.transport.

StateStore

Wraps StateManager with:
  • Undo/redo — snapshots before each mutation
  • Change listeners — notify subscribers on mutation
  • Dirty tracking — which slices changed since last persist
  • Git persistence — commit state to git-backed project history

Persistence