feat: added a read-only piano roll automation view

This commit is contained in:
Xiaohan-Tian
2026-05-07 22:55:19 -07:00
parent f3d26126fa
commit 917a1b0a21
12 changed files with 787 additions and 34 deletions
+6
View File
@@ -85,6 +85,7 @@ interface ProjectState {
activeRegionId: string | null;
pianoRollMode: 'midi-edit' | 'spectrogram' | 'hybrid';
hybridAudioRegionId: string | null;
automationRedrawVersion: number;
// ChatBox state
showChatBox: boolean;
@@ -168,6 +169,7 @@ interface ProjectState {
openMidiPianoRoll: (regionId: string) => void;
openSpectrogramViewer: (regionId: string) => void;
openHybridMode: (midiRegionId: string, audioRegionId: string) => void;
bumpAutomationRedrawVersion: () => void;
// Project state cleanup
cleanupProjectState: () => void;
@@ -374,6 +376,7 @@ export const useProjectStore = create<ProjectState>((set, get) => {
activeRegionId: null,
pianoRollMode: 'midi-edit' as const,
hybridAudioRegionId: null,
automationRedrawVersion: 0,
// Initial ChatBox state
showChatBox: initialChatBoxState,
@@ -1250,6 +1253,9 @@ export const useProjectStore = create<ProjectState>((set, get) => {
openHybridMode: (midiRegionId: string, audioRegionId: string) => {
set({ showPianoRoll: true, activeRegionId: midiRegionId, hybridAudioRegionId: audioRegionId, pianoRollMode: 'hybrid' });
},
bumpAutomationRedrawVersion: () => {
set(state => ({ automationRedrawVersion: state.automationRedrawVersion + 1 }));
},
// Project state cleanup - used when starting new/loading projects
cleanupProjectState: () => {