feat(tracker): implement a numeric up down widget and use that for the numbers

This commit is contained in:
vsariola
2021-01-15 20:38:46 +02:00
parent f665a529e5
commit 80d87dea8c
5 changed files with 283 additions and 73 deletions

View File

@ -69,9 +69,9 @@ func (t *Tracker) KeyEvent(e key.Event) bool {
return true
case `\`:
if e.Modifiers.Contain(key.ModShift) {
return t.ChangeBPM(1)
return t.ChangeOctave(1)
}
return t.ChangeBPM(-1)
return t.ChangeOctave(-1)
case key.NameUpArrow:
delta := -1
if e.Modifiers.Contain(key.ModCtrl) {
@ -161,7 +161,7 @@ func (t *Tracker) getCurrent() byte {
// NotePressed handles incoming key presses while in the note column
func (t *Tracker) NotePressed(val int) {
t.SetCurrentNote(getNoteValue(int(t.CurrentOctave), val))
t.SetCurrentNote(getNoteValue(int(t.Octave.Value), val))
}
// NumberPressed handles incoming presses while in either of the hex number columns