mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 13:04:25 -04:00
fix(sointu-vsti): VST crashed due to Model.MIDI being nil
This commit is contained in:
parent
c07d8000c6
commit
f427eca1f4
@ -54,7 +54,8 @@ func main() {
|
||||
recoveryFile = filepath.Join(configDir, "Sointu", "sointu-track-recovery")
|
||||
}
|
||||
model, player := tracker.NewModelPlayer(cmd.MainSynther, recoveryFile)
|
||||
model.MIDI = gomidi.NewContext()
|
||||
midiContext := gomidi.NewContext()
|
||||
model.MIDI = midiContext
|
||||
defer model.MIDI.Close()
|
||||
if a := flag.Args(); len(a) > 0 {
|
||||
f, err := os.Open(a[0])
|
||||
@ -64,7 +65,7 @@ func main() {
|
||||
f.Close()
|
||||
}
|
||||
tracker := gioui.NewTracker(model)
|
||||
audioCloser := audioContext.Play(&PlayerAudioSource{player, model.MIDI})
|
||||
audioCloser := audioContext.Play(&PlayerAudioSource{player, midiContext})
|
||||
go func() {
|
||||
tracker.Main()
|
||||
audioCloser.Close()
|
||||
|
Reference in New Issue
Block a user