feat: use factory default meta

feat: clear chords button
resolves #64
This commit is contained in:
2025-02-14 14:52:07 +01:00
parent 9d5b0e01d2
commit ac16cfd3bf
12 changed files with 173 additions and 87 deletions

View File

@@ -49,24 +49,28 @@
function deleteAction(at: number, count = 1) {
if (!(at in chord.phrase)) return;
changes.update((changes) => {
changes.push({
type: ChangeType.Chord,
id: chord.id,
actions: chord.actions,
phrase: chord.phrase.toSpliced(at, count),
});
changes.push([
{
type: ChangeType.Chord,
id: chord.id,
actions: chord.actions,
phrase: chord.phrase.toSpliced(at, count),
},
]);
return changes;
});
}
function insertAction(at: number, action: number) {
changes.update((changes) => {
changes.push({
type: ChangeType.Chord,
id: chord.id,
actions: chord.actions,
phrase: chord.phrase.toSpliced(at, 0, action),
});
changes.push([
{
type: ChangeType.Chord,
id: chord.id,
actions: chord.actions,
phrase: chord.phrase.toSpliced(at, 0, action),
},
]);
return changes;
});
}