refactor(tracker): harmonize naming and use iterators in MIDI

using iterators requires go 1.23
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-10-14 15:00:55 +03:00
parent 577265b250
commit c07d8000c6
5 changed files with 95 additions and 87 deletions

View File

@ -445,11 +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 {
func (m *Model) SelectMidiInput(item MIDIDevice) Action {
return Allow(func() {
if !m.MIDI.OpenInputDevice(item) {
message := fmt.Sprintf("Could not open MIDI device %s\n", item)
if err := item.Open(); err != nil {
message := fmt.Sprintf("Could not open MIDI device: %s", item)
m.Alerts().Add(message, Error)
} else {
message := fmt.Sprintf("Opened MIDI device: %s", item)
m.Alerts().Add(message, Info)
}
})
}