Skip to content

Commit

Permalink
feat: chord backup import
Browse files Browse the repository at this point in the history
  • Loading branch information
Theaninova committed Nov 18, 2023
1 parent 2fd2dad commit 683561d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/lib/backup/backup.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type {
CharaBackupFile,
CharaChordFile,
CharaSettingsFile,
CharaLayoutFile,
CharaFile,
CharaLayoutFile,
CharaSettingsFile,
} from "$lib/share/chara-file.js"
import {changes, ChangeType, chords, layout, settings} from "$lib/undo-redo.js"
import type {Change} from "$lib/undo-redo.js"
import {changes, ChangeType, chords, layout, settings} from "$lib/undo-redo.js"
import {get} from "svelte/store"
import {serialPort} from "../serial/connection"
import {csvLayoutToJson, isCsvLayout} from "$lib/backup/compat/legacy-layout"
Expand Down Expand Up @@ -109,7 +109,14 @@ export function restoreFromFile(

export function getChangesFromChordFile(file: CharaChordFile) {
const changes: Change[] = []
// TODO...
for (const [input, output] of file.chords) {
changes.push({
type: ChangeType.Chord,
actions: input,
phrase: output,
id: input,
})
}
return changes
}

Expand Down

0 comments on commit 683561d

Please sign in to comment.