feat(tracker): add support for a MIDI controller to the standalone tracker

Closes #132.
This commit is contained in:
Alexander Kraus
2024-10-14 13:08:20 +02:00
committed by 5684185+vsariola@users.noreply.github.com
parent 9779beee99
commit 577265b250
7 changed files with 165 additions and 15 deletions

View File

@ -1,6 +1,7 @@
package tracker
import (
"fmt"
"os"
"github.com/vsariola/sointu"
@ -444,6 +445,14 @@ func (m *Model) Cancel() Action { return Allow(func() { m.dialog = NoDialog
func (m *Model) Export() Action { return Allow(func() { m.dialog = Export }) }
func (m *Model) ExportFloat() Action { return Allow(func() { m.dialog = ExportFloatExplorer }) }
func (m *Model) ExportInt16() Action { return Allow(func() { m.dialog = ExportInt16Explorer }) }
func (m *Model) SelectMidiInput(item MIDIDevicer) Action {
return Allow(func() {
if !m.MIDI.OpenInputDevice(item) {
message := fmt.Sprintf("Could not open MIDI device %s\n", item)
m.Alerts().Add(message, Error)
}
})
}
func (m *Model) completeAction(checkSave bool) {
if checkSave && m.d.ChangedSinceSave {