project_io
Project save and load system for DAW applications in Rust. Custom binary format with embedded JSON, autosave and undo/redo history.
Features
- Custom format —
.dawprojfile: fixed binary header + UTF-8 JSON + plugin blobs - Integrity check — FNV-1a 64-bit checksum over all content, verified on load
- Version detection — files from newer DAW versions return a clear error
- Autosave — background thread saves every N minutes, keeps last N files
- Undo/redo history — snapshot stack with memory limits and per-action labels
- Plugin blobs — opaque plugin state stored in binary section, indexed from JSON
- Pretty mode — human-readable JSON for debugging
File format
┌─────────────────────────────────────┐
│ MAGIC [8 bytes] "DAWPROJ\0" │
│ VERSION [4 bytes] u32 le │
│ FLAGS [4 bytes] u32 le │
│ JSON_LEN [8 bytes] u64 le │
│ BLOB_LEN [8 bytes] u64 le │
│ CHECKSUM [8 bytes] FNV-1a 64 │
├─────────────────────────────────────┤
│ JSON_BODY UTF-8 project state │
├─────────────────────────────────────┤
│ BLOB_BODY binary plugin states │
└─────────────────────────────────────┘
Usage
use ;
use ;
use ProjectHistory;
// Save
let schema = new;
let serializer = new;
serializer.save?;
// Load
let = load?;
// Autosave
let config = new.every_minutes;
let autosave = new;
autosave.update_snapshot;
autosave.start; // background thread
// Undo/redo
let mut history = new;
history.push?;
schema.bpm = 140.0;
let prev = history.undo?.unwrap; // back to 120 BPM
Part of the DAW crate ecosystem
audio_core_dsp
midi_clock_sync
audio_graph
event_queue
mixer
piano_roll
plugin_host
project_io ← you are here
License
MIT