feat: added a hotkey for loop button
This commit is contained in:
@@ -12,6 +12,7 @@ import { KGRegion } from '../core/region/KGRegion';
|
||||
import { AddTrackCommand, RemoveTrackCommand, ReorderTracksCommand, UpdateTrackCommand, type TrackUpdateProperties, PasteRegionsCommand, PasteNotesCommand, ChangeProjectPropertyCommand } from '../core/commands';
|
||||
import { ConfigManager } from '../core/config/ConfigManager';
|
||||
import { upgradeProjectToLatest } from '../core/project-upgrader/KGProjectUpgrader';
|
||||
import { toggleLoop } from '../util/loopUtil';
|
||||
|
||||
/**
|
||||
* Update CSS custom property for time signature numerator
|
||||
@@ -86,6 +87,7 @@ interface ProjectState {
|
||||
setPlayheadPosition: (position: number) => void;
|
||||
startPlaying: () => Promise<void>;
|
||||
stopPlaying: () => Promise<void>;
|
||||
toggleLoop: () => void;
|
||||
setBpm: (bpm: number) => void;
|
||||
setMaxBars: (maxBars: number) => void;
|
||||
setTimeSignature: (timeSignature: TimeSignature) => void;
|
||||
@@ -570,6 +572,11 @@ export const useProjectStore = create<ProjectState>((set, get) => {
|
||||
set({ isPlaying: false });
|
||||
},
|
||||
|
||||
toggleLoop: () => {
|
||||
const { isLooping, loopingRange, maxBars } = get();
|
||||
toggleLoop(isLooping, loopingRange, maxBars);
|
||||
},
|
||||
|
||||
setBpm: (bpm: number) => {
|
||||
try {
|
||||
// Create and execute the change project property command
|
||||
|
||||
Reference in New Issue
Block a user