P1b: SQLite project, content-addressed assets, autosave and undo

This commit is contained in:
Emil
2026-11-01 01:19:55 +03:00
parent 4f4ee05a3a
commit 0acf11ccb0
22 changed files with 1405 additions and 32 deletions
+2
View File
@@ -33,6 +33,8 @@ export function commandLabel(command: Command): string {
case 'strike_face': return `strike ${command.core} f${command.face + 1}`;
case 'set_pattern_step': return `step ${command.row + 1}:${command.step + 1} at ${command.velocity}`;
case 'set_pattern_face': return `${command.core} f${command.face + 1} on row ${command.row + 1}`;
case 'undo': return 'undo';
case 'redo': return 'redo';
case 'get_snapshot': return 'snapshot';
}
}
+8 -2
View File
@@ -61,6 +61,9 @@ export interface Pattern {
export interface State {
revision: number;
project_name: string;
can_undo: boolean;
can_redo: boolean;
transport: TransportState;
veins: VeinState[];
pattern: Pattern;
@@ -76,7 +79,8 @@ export type Event =
| { kind: 'struck'; vein: VeinId; velocity: number }
| { kind: 'pattern_step'; row: number; step: number; velocity: number }
| { kind: 'pattern_face'; row: number; core: string; face: number }
| { kind: 'face_struck'; core: string; face: number; velocity: number };
| { kind: 'face_struck'; core: string; face: number; velocity: number }
| { kind: 'history'; can_undo: boolean; can_redo: boolean };
export type Command =
| { type: 'get_snapshot' }
@@ -87,7 +91,9 @@ export type Command =
| { type: 'set_vein_gain'; vein: VeinId; gain: number }
| { type: 'strike_face'; core: string; face: number; velocity: number }
| { type: 'set_pattern_step'; row: number; step: number; velocity: number }
| { type: 'set_pattern_face'; row: number; core: string; face: number };
| { type: 'set_pattern_face'; row: number; core: string; face: number }
| { type: 'undo' }
| { type: 'redo' };
export type CommandResult =
| { kind: 'snapshot'; state: State }