refactor(tracker): use strings to identify MIDI ports

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2026-01-23 23:48:16 +02:00
parent 651ceb3cbb
commit 173648fbdb
5 changed files with 72 additions and 63 deletions

View File

@ -620,16 +620,16 @@ func (m *Model) ShowLicense() Action { return MakeAction((*showLicense)(m)) }
func (m *showLicense) Do() { m.dialog = License }
type selectMidiInput struct {
Item MIDIDevice
Item string
*Model
}
func (m *Model) SelectMidiInput(item MIDIDevice) Action {
func (m *Model) SelectMidiInput(item string) Action {
return MakeAction(selectMidiInput{Item: item, Model: m})
}
func (s selectMidiInput) Do() {
m := s.Model
if err := s.Item.Open(); err == nil {
if err := s.Model.MIDI.Open(s.Item); err == nil {
message := fmt.Sprintf("Opened MIDI device: %s", s.Item)
m.Alerts().Add(message, Info)
} else {