Skip to content

Commit

Permalink
Add toggle Edit/Add Timing keybinds
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Oct 14, 2024
1 parent 151ace8 commit 7e0e06f
Showing 1 changed file with 24 additions and 120 deletions.
144 changes: 24 additions & 120 deletions app/src/data/KeybindData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1058,126 +1058,6 @@ export const KEYBIND_DATA: { [key: string]: Keybind } = {
})
},
},
// quantize4th: {
// label: "4ths",
// bindLabel: "Quantize to 4ths",
// combos: [],
// disabled: app =>
// app.chartManager.selection.notes.length == 0 ||
// app.chartManager.getMode() != EditMode.Edit,
// callback: app => {
// app.chartManager.modifySelection(note => {
// note.beat = app.chartManager.getClosestTick(note.beat, 4)
// note.beat = Math.round(note.beat * 48) / 48
// return note
// })
// },
// },
// quantize8th: {
// label: "8ths",
// bindLabel: "Quantize to 8ths",
// combos: [],
// disabled: app =>
// app.chartManager.selection.notes.length == 0 ||
// app.chartManager.getMode() != EditMode.Edit,
// callback: app => {
// app.chartManager.modifySelection(note => {
// note.beat = app.chartManager.getClosestTick(note.beat, 8)
// note.beat = Math.round(note.beat * 48) / 48
// return note
// })
// },
// },
// quantize12th: {
// label: "12ths",
// bindLabel: "Quantize to 12ths",
// combos: [],
// disabled: app =>
// app.chartManager.selection.notes.length == 0 ||
// app.chartManager.getMode() != EditMode.Edit,
// callback: app => {
// app.chartManager.modifySelection(note => {
// note.beat = app.chartManager.getClosestTick(note.beat, 12)
// note.beat = Math.round(note.beat * 48) / 48
// return note
// })
// },
// },
// quantize16th: {
// label: "16ths",
// bindLabel: "Quantize to 16ths",
// combos: [],
// disabled: app =>
// app.chartManager.selection.notes.length == 0 ||
// app.chartManager.getMode() != EditMode.Edit,
// callback: app => {
// app.chartManager.modifySelection(note => {
// note.beat = app.chartManager.getClosestTick(note.beat, 16)
// note.beat = Math.round(note.beat * 48) / 48
// return note
// })
// },
// },
// quantize24th: {
// label: "24ths",
// bindLabel: "Quantize to 24ths",
// combos: [],
// disabled: app =>
// app.chartManager.selection.notes.length == 0 ||
// app.chartManager.getMode() != EditMode.Edit,
// callback: app => {
// app.chartManager.modifySelection(note => {
// note.beat = app.chartManager.getClosestTick(note.beat, 24)
// note.beat = Math.round(note.beat * 48) / 48
// return note
// })
// },
// },
// quantize32nd: {
// label: "32nds",
// bindLabel: "Quantize to 32nds",
// combos: [],
// disabled: app =>
// app.chartManager.selection.notes.length == 0 ||
// app.chartManager.getMode() != EditMode.Edit,
// callback: app => {
// app.chartManager.modifySelection(note => {
// note.beat = app.chartManager.getClosestTick(note.beat, 32)
// note.beat = Math.round(note.beat * 48) / 48
// return note
// })
// },
// },
// quantize48th: {
// label: "48ths",
// bindLabel: "Quantize to 48ths",
// combos: [],
// disabled: app =>
// app.chartManager.selection.notes.length == 0 ||
// app.chartManager.getMode() != EditMode.Edit,
// callback: app => {
// app.chartManager.modifySelection(note => {
// note.beat = app.chartManager.getClosestTick(note.beat, 48)
// note.beat = Math.round(note.beat * 48) / 48
// return note
// })
// },
// },
// quantize96th: {
// label: "96ths",
// bindLabel: "Quantize to 96ths",
// combos: [],
// disabled: app =>
// app.chartManager.selection.notes.length == 0 ||
// app.chartManager.getMode() != EditMode.Edit,
// callback: app => {
// app.chartManager.modifySelection(note => {
// note.beat = app.chartManager.getClosestTick(note.beat, 96)
// note.beat = Math.round(note.beat * 48) / 48
// return note
// })
// },
// },
delete: {
label: "Delete",
combos: [
Expand Down Expand Up @@ -1397,6 +1277,30 @@ export const KEYBIND_DATA: { [key: string]: Keybind } = {
}
},
},
toggleEditTiming: {
label: "Toggle Edit Timing",
combos: [{ key: "T", mods: [] }],
disabled: app => !app.chartManager.chartView,
callback: app => {
if (app.chartManager.editTimingMode != EditTimingMode.Off) {
app.chartManager.editTimingMode = EditTimingMode.Off
} else {
app.chartManager.editTimingMode = EditTimingMode.Edit
}
},
},
toggleAddTiming: {
label: "Toggle Add Timing",
combos: [{ key: "T", mods: [Modifier.ALT] }],
disabled: app => !app.chartManager.chartView,
callback: app => {
if (app.chartManager.editTimingMode != EditTimingMode.Add) {
app.chartManager.editTimingMode = EditTimingMode.Add
} else {
app.chartManager.editTimingMode = EditTimingMode.Edit
}
},
},
}

// Dynamically add keybinds
Expand Down

0 comments on commit 7e0e06f

Please sign in to comment.