feat: added shortcut N for sheet music view
This commit is contained in:
@@ -98,6 +98,8 @@ interface ProjectState {
|
||||
activeRegionId: string | null;
|
||||
pianoRollMode: 'midi-edit' | 'spectrogram' | 'hybrid';
|
||||
hybridAudioRegionId: string | null;
|
||||
requestedSheetMusicViewEnabled: boolean;
|
||||
pianoRollViewRequestVersion: number;
|
||||
automationRedrawVersion: number;
|
||||
activeTrackAutomationTrackId: string | null;
|
||||
activeTrackAutomationType: TrackAutomationType | null;
|
||||
@@ -194,6 +196,7 @@ interface ProjectState {
|
||||
setShowPianoRoll: (show: boolean) => void;
|
||||
setActiveRegionId: (regionId: string | null) => void;
|
||||
openMidiPianoRoll: (regionId: string) => void;
|
||||
openMidiPianoRollWithSheetMusicView: (regionId: string, sheetMusicViewEnabled: boolean) => void;
|
||||
openSpectrogramViewer: (regionId: string) => void;
|
||||
openHybridMode: (midiRegionId: string, audioRegionId: string) => void;
|
||||
bumpAutomationRedrawVersion: () => void;
|
||||
@@ -430,6 +433,8 @@ export const useProjectStore = create<ProjectState>((set, get) => {
|
||||
activeRegionId: null,
|
||||
pianoRollMode: 'midi-edit' as const,
|
||||
hybridAudioRegionId: null,
|
||||
requestedSheetMusicViewEnabled: false,
|
||||
pianoRollViewRequestVersion: 0,
|
||||
automationRedrawVersion: 0,
|
||||
activeTrackAutomationTrackId: null,
|
||||
activeTrackAutomationType: null,
|
||||
@@ -1560,15 +1565,47 @@ export const useProjectStore = create<ProjectState>((set, get) => {
|
||||
},
|
||||
|
||||
openMidiPianoRoll: (regionId: string) => {
|
||||
set({ showPianoRoll: true, activeRegionId: regionId, pianoRollMode: 'midi-edit', hybridAudioRegionId: null });
|
||||
KGPianoRollState.instance().setSheetMusicViewEnabled(false);
|
||||
set(state => ({
|
||||
showPianoRoll: true,
|
||||
activeRegionId: regionId,
|
||||
pianoRollMode: 'midi-edit',
|
||||
hybridAudioRegionId: null,
|
||||
requestedSheetMusicViewEnabled: false,
|
||||
pianoRollViewRequestVersion: state.pianoRollViewRequestVersion + 1,
|
||||
}));
|
||||
},
|
||||
|
||||
openMidiPianoRollWithSheetMusicView: (regionId: string, sheetMusicViewEnabled: boolean) => {
|
||||
KGPianoRollState.instance().setSheetMusicViewEnabled(sheetMusicViewEnabled);
|
||||
set(state => ({
|
||||
showPianoRoll: true,
|
||||
activeRegionId: regionId,
|
||||
pianoRollMode: 'midi-edit',
|
||||
hybridAudioRegionId: null,
|
||||
requestedSheetMusicViewEnabled: sheetMusicViewEnabled,
|
||||
pianoRollViewRequestVersion: state.pianoRollViewRequestVersion + 1,
|
||||
}));
|
||||
},
|
||||
|
||||
openSpectrogramViewer: (regionId: string) => {
|
||||
set({ showPianoRoll: true, activeRegionId: regionId, pianoRollMode: 'spectrogram', hybridAudioRegionId: null });
|
||||
set({
|
||||
showPianoRoll: true,
|
||||
activeRegionId: regionId,
|
||||
pianoRollMode: 'spectrogram',
|
||||
hybridAudioRegionId: null,
|
||||
requestedSheetMusicViewEnabled: false,
|
||||
});
|
||||
},
|
||||
|
||||
openHybridMode: (midiRegionId: string, audioRegionId: string) => {
|
||||
set({ showPianoRoll: true, activeRegionId: midiRegionId, hybridAudioRegionId: audioRegionId, pianoRollMode: 'hybrid' });
|
||||
set({
|
||||
showPianoRoll: true,
|
||||
activeRegionId: midiRegionId,
|
||||
hybridAudioRegionId: audioRegionId,
|
||||
pianoRollMode: 'hybrid',
|
||||
requestedSheetMusicViewEnabled: false,
|
||||
});
|
||||
},
|
||||
bumpAutomationRedrawVersion: () => {
|
||||
set(state => ({ automationRedrawVersion: state.automationRedrawVersion + 1 }));
|
||||
@@ -1587,6 +1624,8 @@ export const useProjectStore = create<ProjectState>((set, get) => {
|
||||
activeRegionId: null,
|
||||
hybridAudioRegionId: null,
|
||||
pianoRollMode: 'midi-edit',
|
||||
requestedSheetMusicViewEnabled: false,
|
||||
pianoRollViewRequestVersion: 0,
|
||||
activeTrackAutomationTrackId: null,
|
||||
activeTrackAutomationType: null,
|
||||
trackAutomationRedrawVersion: 0,
|
||||
|
||||
Reference in New Issue
Block a user